using Data.SeaHavenIndustries; namespace SeaHaven.DataServices.Interfaces { public interface IForgetPasswordDataService { /// Deletes every pending code for the email, then stores the new one. Task ReplaceCodeAsync(string email, string userId, string codeHash, string codeSalt, DateTime expiresAtUtc, CancellationToken cancellationToken); /// Returns the pending code for exactly this email, or null. Task GetByEmailAsync(string email, CancellationToken cancellationToken); /// /// Atomically consumes one attempt when the code is unexpired and has fewer /// than consumed. Returns false otherwise. /// Task TryConsumeAttemptAsync(int id, int maxAttempts, DateTime nowUtc, CancellationToken cancellationToken); /// Gives back an attempt consumed by a check that matched. Task RefundAttemptAsync(int id, CancellationToken cancellationToken); Task RemoveByEmailAsync(string email, CancellationToken cancellationToken); /// /// Deletes the email's codes issued up to and including , /// leaving any code issued after it by a concurrent request. /// Task RemoveIssuedThroughAsync(string email, int throughId, CancellationToken cancellationToken); } }