LegalBillServiceValidator¶
FluentValidation validator for LegalBillService line items, enforcing that billed amount and billed units are positive, paid amount is non-negative and does not exceed the billed amount, and that the service's BillServiceCode passes the nested BillServiceValidator (non-empty code).
Purpose¶
- Rejects a bill service line with a zero or negative billed amount or billed units.
- Rejects a negative paid amount or a paid amount greater than the billed amount.
- Delegates bill-service-code validation to
BillServiceValidator, requiring a non-empty code.
Context¶
- Namespace:
SAIF.Services.Legal.Bills - Assembly/package:
SAIF.Services(packaged inside theSAIF.SAIFCode.CoreNuGet package).
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| LegalBillServiceValidator (constructor) | public LegalBillServiceValidator() |
Configures the FluentValidation rules for BilledAmount, BilledUnits, PaidAmount, and the nested BillService code validator. |
Behavioral notes¶
PaidAmountvalidation is two rules: it must be>= 0and it must be<=BilledAmount, each with a distinct error message.- The
BillServiceproperty is validated by composing a separateBillServiceValidatorinstance rather than inline rules.
Constraints and usage notes¶
- Carries a
CA1710:IdentifiersShouldHaveCorrectSuffixsuppression, since FluentValidation's naming convention ("Validator") does not match theIValidatorinterface-suffix rule.*
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/Bills/LegalBillServiceValidator.cs