using ColaFlow.Modules.Identity.Domain.Aggregates.Tenants;

namespace ColaFlow.Modules.Identity.Domain.Repositories;

/// <summary>
/// Repository interface for Tenant aggregate
/// </summary>
public interface ITenantRepository
{
    /// <summary>
    /// Get tenant by ID
    /// </summary>
    Task<Tenant?> GetByIdAsync(TenantId tenantId, CancellationToken cancellationToken = default);

    /// <summary>
    /// Get tenant by slug (unique subdomain identifier)
    /// </summary>
    Task<Tenant?> GetBySlugAsync(TenantSlug slug, CancellationToken cancellationToken = default);

    /// <summary>
    /// Check if a slug already exists
    /// </summary>
    Task<bool> ExistsBySlugAsync(TenantSlug slug, CancellationToken cancellationToken = default);

    /// <summary>
    /// Get all tenants (admin operation)
    /// </summary>
    Task<IReadOnlyList<Tenant>> GetAllAsync(CancellationToken cancellationToken = default);

    /// <summary>
    /// Add a new tenant
    /// </summary>
    Task AddAsync(Tenant tenant, CancellationToken cancellationToken = default);

    /// <summary>
    /// Update an existing tenant
    /// </summary>
    Task UpdateAsync(Tenant tenant, CancellationToken cancellationToken = default);

    /// <summary>
    /// Delete a tenant (hard delete)
    /// </summary>
    Task DeleteAsync(Tenant tenant, CancellationToken cancellationToken = default);
}
