Skip to content

NoteDeleteRequestValidator

Validates a NoteDeleteRequest by requiring a non-empty Id that resolves to an existing audit note, checked via IBillQueryProvider.AuditQueries.NoteQueries.GetAuditNote. This prevents delete operations from targeting a note id that does not exist in the audit note store.

Purpose

  • Requires Id to be non-null and non-empty.
  • Requires Id to resolve to an existing audit note by verifying that provider.AuditQueries.NoteQueries.GetAuditNote(x) does not return a null result.

Context

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

Public members

Member Signature Purpose
NoteDeleteRequestValidator NoteDeleteRequestValidator(IBillQueryProvider provider) Wires a required-value rule plus a Must check confirming Id resolves to an existing audit note via provider.AuditQueries.NoteQueries.GetAuditNote.*

Behavioral notes

  • Validation is enforced via FluentValidation's AbstractValidator<T> base.*
  • The existence check is a live lookup against IBillQueryProvider's audit note queries, so the rule's outcome depends on external data at validation time rather than the request's own field alone.*

Constraints and usage notes

  • Requires an IBillQueryProvider implementation to be supplied via constructor injection.

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/Claims/Bills/Validators/NoteDeleteRequestValidator.cs