using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; namespace TakeoutSaaS.Domain.Tenants.Repositories; /// /// 租户通知仓储。 /// public interface ITenantNotificationRepository { /// /// 查询通知列表,按等级、未读状态与时间范围筛选。 /// /// 租户 ID。 /// 通知等级。 /// 仅返回未读。 /// 开始时间(UTC)。 /// 结束时间(UTC)。 /// 取消标记。 /// 通知集合。 Task> SearchAsync( long tenantId, TenantNotificationSeverity? severity, bool? unreadOnly, DateTime? from, DateTime? to, CancellationToken cancellationToken = default); /// /// 按 ID 获取通知。 /// /// 租户 ID。 /// 通知 ID。 /// 取消标记。 /// 通知实体或 null。 Task FindByIdAsync(long tenantId, long notificationId, CancellationToken cancellationToken = default); /// /// 新增通知。 /// /// 通知实体。 /// 取消标记。 /// 异步任务。 Task AddAsync(TenantNotification notification, CancellationToken cancellationToken = default); /// /// 更新通知。 /// /// 通知实体。 /// 取消标记。 /// 异步任务。 Task UpdateAsync(TenantNotification notification, CancellationToken cancellationToken = default); /// /// 保存变更。 /// /// 取消标记。 /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); }