using ColaFlow.Modules.Identity.Domain.Aggregates.Tenants;
using ColaFlow.Modules.Identity.Domain.Aggregates.Users;
namespace ColaFlow.Modules.Identity.Domain.Repositories;
///
/// Repository interface for User aggregate
///
public interface IUserRepository
{
///
/// Get user by ID
///
Task GetByIdAsync(UserId userId, CancellationToken cancellationToken = default);
///
/// Get user by Guid ID
///
Task GetByIdAsync(Guid userId, CancellationToken cancellationToken = default);
///
/// Get multiple users by their IDs
///
Task> GetByIdsAsync(
IEnumerable userIds,
CancellationToken cancellationToken = default);
///
/// Get user by email within a tenant
///
Task GetByEmailAsync(TenantId tenantId, Email email, CancellationToken cancellationToken = default);
///
/// Get user by external SSO ID within a tenant
///
Task GetByExternalIdAsync(
TenantId tenantId,
AuthenticationProvider provider,
string externalUserId,
CancellationToken cancellationToken = default);
///
/// Check if an email already exists within a tenant
///
Task ExistsByEmailAsync(TenantId tenantId, Email email, CancellationToken cancellationToken = default);
///
/// Get all users for a tenant
///
Task> GetAllByTenantAsync(TenantId tenantId, CancellationToken cancellationToken = default);
///
/// Get active users count for a tenant
///
Task GetActiveUsersCountAsync(TenantId tenantId, CancellationToken cancellationToken = default);
///
/// Add a new user
///
Task AddAsync(User user, CancellationToken cancellationToken = default);
///
/// Update an existing user
///
Task UpdateAsync(User user, CancellationToken cancellationToken = default);
///
/// Delete a user (hard delete)
///
Task DeleteAsync(User user, CancellationToken cancellationToken = default);
}