Skip to content

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 Text to be present.
  • Caps Text at 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 Category and Type validation to NoteCategoryValidator and NoteTypeValidator respectively.

Context

  • Namespace: SAIF.Services.Claims.Notes.Validators
  • Assembly/package: SAIF.Services (packaged inside the SAIF.SAIFCode.Core NuGet 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

  • HasValidAppendTextLength computes 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 that Text.Length + AppendText.Length + headerLength is within 4000 and that AppendText is non-empty; a null AppendText is always considered valid.
  • A commented-out rule (AppendText required when !CanEdit) remains in the source but is not active.

Sources

  • Services/SAIF.Services/Claims/Notes/Validators/ClaimNoteValidator.cs