SendPendRequestValidator¶
Validates a SendPendRequest, which routes bills to a reviewer's mailbox pending further action: it requires a recipient mail id that resolves to a real employee (via IRepositoryFactory's Employee repository), bounds the pend date to a window from yesterday through 60 days out, and — when conflict-access validation is requested on the request (ValidateConflictAccess) — checks, for every bill in BillsToPend, that the recipient's claim security profile grants conflict access to that bill's claim. The conflict-access check reconstructs a Bill domain object per id using six injected dependencies and compares it against the recipient's ClaimUserSecurityAccess via ClaimSecurityService.
Purpose¶
- Requires
SendtoMailIdto be non-null and, when present, to match an existingEmployee.UserId(case-insensitive via.ToUpper()), viaIRepositoryFactory. - Requires
PendDateto be less than 60 days in the future and greater than yesterday (i.e., not in the past). - When
SendtoMailIdis present andrequest.ValidateConflictAccessis true, requires every bill id inBillsToPendto be one the recipient has conflict access to, determined by reconstructing eachBilland evaluatingClaimSecurityService.GetClaimSecurityagainst the recipient'sClaimUserSecurityAccess.
Context¶
- Namespace:
SAIF.Services.Claims.Bills.Validators - Assembly/package:
SAIF.Services(packaged inside theSAIF.SAIFCode.CoreNuGet package)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| SendPendRequestValidator | SendPendRequestValidator(IRepositoryFactory factory, IUserProfileService profileService, IBillQueryProvider billQueryProvider, IClaimQueryProvider claimQueryProvider, IAuditNoteQueryProvider auditNoteQueryProvider, IWorkerQueryProvider workerQueryProvider, ICCClaimApiService claimApiService, IClaimDataApiClient gwClaimDataApiClient) |
Wires required/existence rules for SendtoMailId, a date-window rule for PendDate, and a conditional per-bill conflict-access check across BillsToPend.* |
Behavioral notes¶
- Validation is enforced via FluentValidation's
AbstractValidator<T>base.* - The mail-id existence rule and the conflict-access rule are both gated by
When(request => request.SendtoMailId != null, ...).* - The conflict-access check short-circuits to valid (
return true) whenrequest.ValidateConflictAccessis false, so the security check is opt-in per request.* - For conflict-access validation, the rule reconstructs a
Billdomain object per id inBillsToPend(vianew Bill(...)) and evaluates it againstClaimSecurityService.GetClaimSecurity, so cost and outcome depend on live claim security data for each bill.*
Constraints and usage notes¶
- Requires all eight constructor dependencies to be supplied via injection; several are used only inside the conflict-access branch.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
- Services/SAIF.Services/Claims/Bills/Validators/SendPendRequestValidator.cs