namespace Health.Application.Notifications; public sealed record InAppNotificationDto( Guid Id, string Type, string Title, string Message, string Severity, string? ActionType, string? ActionTargetId, bool IsRead, DateTime CreatedAt); public sealed record NotificationMessage( string Type, string Title, string Message, string Severity, string? ActionType, string? ActionTargetId); public interface IInAppNotificationService { Task> GetPendingAsync(Guid userId, CancellationToken ct); Task> GetHistoryAsync(Guid userId, CancellationToken ct); Task AcknowledgeAsync(Guid userId, Guid notificationId, CancellationToken ct); Task MarkAllReadAsync(Guid userId, CancellationToken ct); Task DeleteAsync(Guid userId, Guid notificationId, CancellationToken ct); } public interface IInAppNotificationRepository { Task> GetPendingAsync(Guid userId, CancellationToken ct); Task> GetHistoryAsync(Guid userId, CancellationToken ct); Task AcknowledgeAsync(Guid userId, Guid notificationId, CancellationToken ct); Task MarkAllReadAsync(Guid userId, CancellationToken ct); Task DeleteAsync(Guid userId, Guid notificationId, CancellationToken ct); } public sealed record InAppNotificationRecord( Guid Id, string Type, string Title, string Message, string Severity, string? ActionType, string? ActionTargetId, bool IsRead, DateTime CreatedAt); public interface IUserNotificationProducer { Task EnqueueAsync(Guid userId, Guid sourceId, NotificationMessage message, CancellationToken ct); } public interface INotificationOutboxProcessor { Task RecoverStaleAsync(CancellationToken ct); Task ProcessNextAsync(CancellationToken ct); }