Skip to content

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 the SAIF.SAIFCode.Core NuGet 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

  • PaidAmount validation is two rules: it must be >= 0 and it must be <= BilledAmount, each with a distinct error message.
  • The BillService property is validated by composing a separate BillServiceValidator instance rather than inline rules.

Constraints and usage notes

  • Carries a CA1710:IdentifiersShouldHaveCorrectSuffix suppression, since FluentValidation's naming convention ("Validator") does not match the IValidator interface-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