using TakeoutSaaS.Domain.Dictionary.Entities;

namespace TakeoutSaaS.Domain.Dictionary.Repositories;

/// <summary>
/// 缓存失效日志仓储。
/// </summary>
public interface ICacheInvalidationLogRepository
{
    /// <summary>
    /// 新增失效日志。
    /// </summary>
    Task AddAsync(CacheInvalidationLog log, CancellationToken cancellationToken = default);

    /// <summary>
    /// 分页查询失效日志。
    /// </summary>
    Task<(IReadOnlyList<CacheInvalidationLog> Items, int TotalCount)> GetPagedAsync(
        int page,
        int pageSize,
        DateTime? startDate,
        DateTime? endDate,
        CancellationToken cancellationToken = default);

    /// <summary>
    /// 保存变更。
    /// </summary>
    Task SaveChangesAsync(CancellationToken cancellationToken = default);
}
