using TakeoutSaaS.Domain.Tenants.Entities;

namespace TakeoutSaaS.Domain.Tenants.Repositories;

/// <summary>
/// 租户只读仓储（AdminApi 使用）。
/// </summary>
public interface ITenantRepository
{
    /// <summary>
    /// 依据 ID 获取租户。
    /// </summary>
    /// <param name="tenantId">租户 ID（雪花算法）。</param>
    /// <param name="cancellationToken">取消标记。</param>
    /// <returns>租户实体，未找到返回 null。</returns>
    Task<Tenant?> FindByIdAsync(long tenantId, CancellationToken cancellationToken = default);

    /// <summary>
    /// 批量获取租户。
    /// </summary>
    /// <param name="tenantIds">租户 ID 列表。</param>
    /// <param name="cancellationToken">取消标记。</param>
    /// <returns>租户列表（仅返回找到的租户）。</returns>
    Task<IReadOnlyList<Tenant>> FindByIdsAsync(IReadOnlyCollection<long> tenantIds, CancellationToken cancellationToken = default);
}
