using AMREZ.EOP.Domain.Entities.Authentications; using AMREZ.EOP.Domain.Shared._Users; namespace AMREZ.EOP.Abstractions.Infrastructures.Repositories; public interface IUserRepository { Task FindByIdAsync(Guid userId, CancellationToken ct = default); Task FindActiveByEmailAsync(string email, CancellationToken ct = default); Task EmailExistsAsync(string email, CancellationToken ct = default); Task AddAsync(User user, CancellationToken ct = default); // Identities Task AddIdentityAsync(Guid userId, IdentityType type, string identifier, bool isPrimary, CancellationToken ct = default); Task VerifyIdentityAsync(Guid userId, IdentityType type, string identifier, DateTimeOffset verifiedAt, CancellationToken ct = default); Task GetPrimaryIdentityAsync(Guid userId, IdentityType type, CancellationToken ct = default); // Password Task ChangePasswordAsync(Guid userId, string newPasswordHash, CancellationToken ct = default); Task AddPasswordHistoryAsync(Guid userId, string passwordHash, CancellationToken ct = default); // MFA Task AddTotpFactorAsync(Guid userId, string label, string secret, CancellationToken ct = default); Task DisableMfaFactorAsync(Guid factorId, CancellationToken ct = default); Task HasAnyMfaAsync(Guid userId, CancellationToken ct = default); // Sessions Task CreateSessionAsync(UserSession session, CancellationToken ct = default); Task RevokeSessionAsync(Guid userId, Guid sessionId, CancellationToken ct = default); Task RevokeAllSessionsAsync(Guid userId, CancellationToken ct = default); }