SubpoenaRecipientValidator¶
A FluentValidation AbstractValidator<SubpoenaRecipient> that enforces non-negative mileage figures and a minimum-paid-amount rule on an individual subpoena recipient's payment fields, used by the subpoena save/approval workflow to reject recipient data before it is persisted.
Purpose¶
- Rejects a negative
MileageCoston a subpoena recipient. - Rejects a negative
MileageUnitson a subpoena recipient. - Rejects a
PaidAmountthat is nonzero but less than the recipient's system-calculated payment amount (CalculatedPaidAmount), while still permitting an explicit0(unpaid) value.
Context¶
- Namespace:
SAIF.Services.Legal.Subpoenas - Assembly/package:
SAIF.Services(packaged inside theSAIF.SAIFCode.CoreNuGet package).
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| SubpoenaRecipientValidator (constructor) | public SubpoenaRecipientValidator() |
Registers the three FluentValidation rules for MileageCost, MileageUnits, and PaidAmount, each with a specific "Error: ..." message surfaced to callers when validation fails. |
Behavioral notes¶
PaidAmountvalidation uses a customMust(HasValidPaidAmount)predicate rather than a built-in comparator, since the valid threshold (CalculatedPaidAmount) is itself a property of the same recipient object.- Carries a
CA1710:IdentifiersShouldHaveCorrectSuffixsuppression, acknowledging the type name does not end in the conventional "Collection"/"Validator"-exempt suffix pattern the analyzer expects.*
Constraints and usage notes¶
- This validator only checks payment-related numeric fields on a recipient; it does not validate the recipient's name, address, or provider/location identifiers — those are enforced separately by
SubpoenaValidator'sContainsValidRecipientDatarule.*
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/Legal/Subpoenas/SubpoenaRecipientValidator.cs