Skip to content

NoteEditValidator

A FluentValidation AbstractValidator<NoteEdit> used by SAIF.Services.Agencies.Notes.NoteService and MoreReadableNoteService (via IValidationService) to validate agency-note edits before they are persisted. It has no injected dependencies.

Purpose

  • Requires a category code on every agency-note edit.
  • Requires a type code on every agency-note edit.

Context

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

Public members

Member Signature Purpose
NoteEditValidator() public NoteEditValidator() Registers RuleFor(n => n.CategoryCode).NotNull() ("Error: Category is required.") and RuleFor(n => n.TypeCode).NotNull() ("Error: Type is required.").

Behavioral notes

  • Text-length/required-text rules are commented out in source, so note text content is not validated by this validator; text validation for agency notes is instead performed separately in NoteService.ValidateNoteText.

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/Agencies/Notes/Validators/NoteEditValidator.cs