Interface ICardReplacementRequestRepository
- Namespace
- SEBT.Portal.Core.Repositories
- Assembly
- SEBT.Portal.Core.dll
Repository for tracking card replacement requests. Used to enforce the 14-day cooldown between replacement requests per case. All identifier values are pre-hashed by callers via IIdentifierHasher.
public interface ICardReplacementRequestRepository
Methods
CreateAsync(string, string, Guid, CancellationToken)
Records a new card replacement request.
Task CreateAsync(string householdIdentifierHash, string caseIdHash, Guid requestedByUserId, CancellationToken cancellationToken = default)
Parameters
householdIdentifierHashstringHMAC hash of the household identifier.
caseIdHashstringHMAC hash of the case ID.
requestedByUserIdGuidThe ID of the user making the request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
GetMostRecentRequestDateAsync(string, string, CancellationToken)
Returns the most recent request timestamp for a given household+case, or null if no request has ever been recorded. Used to hydrate CardRequestedAt so the frontend can enforce cooldown UI.
Task<DateTime?> GetMostRecentRequestDateAsync(string householdIdentifierHash, string caseIdHash, CancellationToken cancellationToken = default)
Parameters
householdIdentifierHashstringcaseIdHashstringcancellationTokenCancellationToken
Returns
- Task<DateTime?>
HasRecentRequestAsync(string, string, TimeSpan, CancellationToken)
Checks whether a card replacement request exists for the given household+case within the specified cooldown period.
Task<bool> HasRecentRequestAsync(string householdIdentifierHash, string caseIdHash, TimeSpan cooldownPeriod, CancellationToken cancellationToken = default)
Parameters
householdIdentifierHashstringHMAC hash of the household identifier.
caseIdHashstringHMAC hash of the case ID.
cooldownPeriodTimeSpanThe minimum time that must elapse between requests.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<bool>
True if a request exists within the cooldown window.