RequestValidator¶
A FluentValidation AbstractValidator<Request> that enforces the required fields and context validity for a new or edited Collections case request, delegating policy/claim-number existence checks to ICollectionsService.ValidateContext.
Purpose¶
- Requires a collection type, case status, county, credit representative, judgment-years selection, and annual interest rate.
- Requires a valid policy number for policy-coded requests, or a valid claim number for non-policy-coded requests, verified via
ICollectionsService. - Requires the received date to fall between 01/01/1980 and seven days in the future.
Context¶
- Namespace:
SAIF.Services.Collections.Validators - Assembly/package:
SAIF.Services(packaged inside theSAIF.SAIFCode.CoreNuGet package)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| RequestValidator(...) | public RequestValidator(ICollectionsService service) |
Wires in the Collections service used for policy/claim context validation and registers all field-required and context-validity rules described above against a validated Request instance. |
Behavioral notes¶
IsValidPolicyskips policy-number validation entirely for collection codes that do not contain"POL", and otherwise requires a non-zero policy number that resolves viaICollectionsService.ValidateContext.IsValidClaimmirrors this logic in reverse: it skips claim-number validation for"POL"-coded requests and otherwise requires a non-null claim number that resolves viaICollectionsService.ValidateContext.- Both context-validity checks discard the
outmessage returned byValidateContext, relying solely on its boolean result to drive the FluentValidation failure*.
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/Collections/Validators/RequestValidator.cs