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 theSAIF.SAIFCode.CoreNuGet 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
ProviderDataobject rather than flat properties onLegalBill. - The
BillStatusproperty is validated by composing a separateBillStatusValidatorinstance 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/LegalBillValidator.cs