Skip to content

NoteValidator

A FluentValidation AbstractValidator<Note> that enforces content and length rules for a Collections case note, including the append-text workflow used once a note is outside its editable window. It has no external collaborators, relying only on the Note instance being validated.

Purpose

  • Requires note text to be present, and (when not being appended to) between 4 and 4000 characters.
  • Requires append text once a note can no longer be directly edited (CanEdit == false).
  • Prevents the combined original-plus-appended note text from exceeding 4000 characters.

Context

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

Public members

Member Signature Purpose
NoteValidator() public NoteValidator() Registers the note-text presence/length rules and the conditional append-text presence/combined-length rules described above against a validated Note instance.

Behavioral notes

  • The 4–4000 character length rule for NoteText only applies when there is no append text in progress, allowing an existing over-length note to remain valid while it is being appended to rather than replaced.
  • IsNoteLengthValid checks the trimmed original NoteText length rather than the combined appended text, which may not fully validate the true post-append length*.

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/Collections/Validators/NoteValidator.cs