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 with account details and initial credential. /// Uses stored procedure: USP_RegisterUser /// Task RegisterUserAsync( UserRegistrationDto userRegistrationDto ); /// /// Retrieves a user account by email address (typically used for login). /// Uses stored procedure: usp_GetUserAccountByEmail /// /// Email address to search for /// UserAccount if found, null otherwise Task GetUserByEmailAsync(string email); /// /// Retrieves a user account by username (typically used for login). /// Uses stored procedure: usp_GetUserAccountByUsername /// /// Username to search for /// UserAccount if found, null otherwise Task GetUserByUsernameAsync(string username); /// /// Retrieves the active (non-revoked) credential for a user account. /// Uses stored procedure: USP_GetActiveUserCredentialByUserAccountId /// /// ID of the user account /// Active UserCredential if found, null otherwise Task GetActiveCredentialByUserAccountIdAsync(Guid userAccountId); /// /// Rotates a user's credential by invalidating all existing credentials and creating a new one. /// Uses stored procedure: USP_RotateUserCredential /// /// ID of the user account /// New hashed password Task RotateCredentialAsync(Guid userAccountId, string newPasswordHash); /// /// Marks a user account as confirmed. /// /// ID of the user account to confirm /// The confirmed UserAccount entity, or null if the user account does not exist Task ConfirmUserAccountAsync(Guid userAccountId); /// /// Retrieves a user account by ID. /// /// ID of the user account /// UserAccount if found, null otherwise Task GetUserByIdAsync(Guid userAccountId); /// /// Checks whether a user account has been verified. /// /// ID of the user account /// True if the user has a verification record, false otherwise Task IsUserVerifiedAsync(Guid userAccountId); }