ClaimNoteValidator¶
A FluentValidation AbstractValidator<NoteEdit> that enforces claim-note content constraints: note text is required and capped at 4000 characters, appended text must not push the combined note (including a generated append header) past 4000 characters, and the note's Category and Type must each individually pass their own dedicated validators (NoteCategoryValidator, NoteTypeValidator).
Purpose¶
- Requires
Textto be present. - Caps
Textat 4000 characters. - Ensures
AppendText, when supplied, does not cause the combined text (original text plus append header plus appended content) to exceed 4000 characters. - Delegates
CategoryandTypevalidation toNoteCategoryValidatorandNoteTypeValidatorrespectively.
Context¶
- Namespace:
SAIF.Services.Claims.Notes.Validators - Assembly/package:
SAIF.Services(packaged inside theSAIF.SAIFCode.CoreNuGet package)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| ClaimNoteValidator() | public ClaimNoteValidator() |
Registers rules requiring non-empty Text no longer than 4000 characters, a valid-length AppendText (checked via HasValidAppendTextLength), and nested validation of Category/Type via NoteCategoryValidator/NoteTypeValidator. |
Behavioral notes¶
HasValidAppendTextLengthcomputes an estimated append-header length from the update date's short date string length (or a 6-character default), the current user ID length (or a 6-character default), plus 18 fixed characters, then checks thatText.Length + AppendText.Length + headerLengthis within 4000 and thatAppendTextis non-empty; anullAppendTextis always considered valid.- A commented-out rule (
AppendTextrequired when!CanEdit) remains in the source but is not active.
Sources¶
- Services/SAIF.Services/Claims/Notes/Validators/ClaimNoteValidator.cs