Skip to content

LegalBillValidator

FluentValidation validator for the LegalBill contract, enforcing that billing and rendering providers are specified, a requesting attorney is present, the comment does not exceed 4000 characters, and the bill status passes the nested BillStatusValidator.

Purpose

  • Requires both a billing provider ID and a rendering provider ID before a bill can be saved.
  • Requires a requesting attorney/employee ID.
  • Limits the free-form comment field to 4000 characters.
  • Delegates bill-status validation to BillStatusValidator, requiring a non-empty status code.

Context

  • Namespace: SAIF.Services.Legal.Bills
  • Assembly/package: SAIF.Services (packaged inside the SAIF.SAIFCode.Core NuGet package).

Public members

Member Signature Purpose
LegalBillValidator (constructor) public LegalBillValidator() Configures the FluentValidation rules for ProviderData.BillingProviderId, ProviderData.RenderingProviderId, RequestedByEmployeeId, Comment length, and the nested BillStatus validator.

Behavioral notes

  • Provider IDs are validated through the nested ProviderData object rather than flat properties on LegalBill.
  • The BillStatus property is validated by composing a separate BillStatusValidator 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/LegalBillValidator.cs