using Domain.Entities; using Features.Auth.Dtos; namespace Features.Auth.Repository; /// /// Repository for authentication-related database operations including user registration and credential management. /// public interface IAuthRepository { /// /// Registers a new user account and its initial credential as a single atomic operation, then /// returns the created account. /// /// Thrown when the newly registered user cannot be retrieved after registration. Task RegisterUserAsync(UserAccount ua); /// Retrieves a user account by email, or if none exists. Task GetUserByEmailAsync(string email); /// Retrieves a user account by username, or if none exists. Task GetUserByUsernameAsync(string username); /// Retrieves the active (non-revoked) credential for a user account, or if none exists. Task GetActiveCredentialByUserAccountIdAsync(Guid userAccountId); /// Rotates a user's credential by invalidating all existing credentials and creating a new one. /// Thrown when no account with exists. Task RotateCredentialAsync(Guid userAccountId, string newPasswordHash); /// Marks a user account as confirmed. Idempotent if the account is already verified. Task ConfirmUserAccountAsync(Guid userAccountId); /// Retrieves a user account by ID, or if none exists. Task GetUserByIdAsync(Guid userAccountId); /// Determines whether a user account has been verified. Task IsUserVerifiedAsync(Guid userAccountId); }