Skip to content

SAIF.Framework.Validation business rules

This page captures business rules enforced by this library.

BR-001 Required policy identifiers must be present

Field Value
Statement A policy or claims record must carry a non-empty policy number and claim number before it can be accepted for persistence.
Trigger Evaluated on every call to ValidationEngine.Validate for records in the ClaimIntake and PremiumAudit rule sets.
Enforcement ValidationRule.Evaluate applies the RequiredField rule type to the PolicyNumber and ClaimNumber fields and records a blocking failure when either is empty or whitespace.
Outcome ValidationResult.IsValid is False and a failure carrying rule ID BR-001 is returned; SAIF.Claims.Intake blocks submission and SAIF.PremiumAudit.Batch skips the record.
Source src/SAIF.Framework.Validation/Rules/ValidationRule.vb

BR-002 Jurisdiction must be supplied for state-scoped rules

Field Value
Statement Rules that vary by state may only be evaluated when the calling application supplies a jurisdiction code; a missing jurisdiction is treated as a validation failure rather than a skipped rule.
Trigger Evaluated when a rule set contains at least one rule whose definition includes a jurisdiction attribute.
Enforcement ValidationEngine.Validate reads IValidationContext.JurisdictionCode before rule execution and records a blocking failure when the value is null or empty.
Outcome Evaluation stops before any state-scoped rule runs, and a failure carrying rule ID BR-002 is returned so the defect is visible instead of silently passing.
Source src/SAIF.Framework.Validation/ValidationEngine.vb

BR-003 Claim dates must fall within the policy period

Field Value
Statement A claim's date of injury must fall on or between the policy effective date and the policy expiration date.
Trigger Evaluated for records in the ClaimIntake rule set whenever a date of injury is present.
Enforcement ValidationRule.Evaluate applies the DateRange rule type, comparing the record's date of injury against the effective and expiration dates provided by IValidationContext.
Outcome A blocking failure carrying rule ID BR-003 is returned, identifying the date of injury field so the intake screen can highlight it.
Source src/SAIF.Framework.Validation/Rules/ValidationRule.vb

BR-004 Warnings do not block persistence

Field Value
Statement Rules declared with warning severity report a problem but must not prevent a record from being saved; only blocking failures stop persistence.
Trigger Evaluated on every rule set execution that produces at least one warning-severity result.
Enforcement ValidationEngine.Validate adds warning results to ValidationResult.Warnings and leaves IsValid set to True when no blocking failure occurred.
Outcome SAIF.Claims.Intake displays warnings as advisory text and allows submission; SAIF.PremiumAudit.Batch writes warnings to the batch log and continues processing the record.
Source src/SAIF.Framework.Validation/ValidationResult.vb

BR-005 All failures are reported in a single pass

Field Value
Statement Validation must report every rule failure a record produces, so an operator can correct all problems in one correction cycle rather than one per submission.*
Trigger Evaluated on every call to ValidationEngine.Validate where more than one rule fails.
Enforcement ValidationEngine.Validate iterates the full rule collection without short-circuiting and appends each failure to the result.
Outcome The returned ValidationResult contains the complete ordered failure collection, each entry carrying its own rule identifier.
Source src/SAIF.Framework.Validation/ValidationEngine.vb

Inherited business rules

Rules in this section originate from base classes or services provided by dependency framework libraries. They are enforced by inherited behavior, not by code in this library. The originating class and library are recorded in each rule's Origin field.

INH-001 Framework components must be initialized before use

Field Value
Statement A framework component may not perform work until framework startup configuration has completed, so that trace routing and environment settings are established before any business decision is made.†
Trigger Evaluated on the first operation invoked on any component deriving from ValidationComponentBase.
Enforcement ValidationComponentBase.EnsureInitialized checks IsInitialized and raises FrameworkNotInitializedException when startup configuration has not run.
Outcome The operation is abandoned and the caller receives an exception identifying the uninitialized component, rather than results produced under default settings.
Origin SAIF.Framework.Core — ValidationComponentBase
Source Retrieved from indexed documentation via Legends CLI

Notes

  • Rule severity is declared in the rule set XML, not in code, so changing a rule from warning to blocking is a configuration change rather than a code change.
  • BR-005 is marked inferred because the no-short-circuit behavior is evident from the evaluation loop but is not stated in any code comment or specification in the repository.
  • Statements marked with † were retrieved from dependency library documentation via the Legends CLI RAG service.

Sources

  • src/SAIF.Framework.Validation/ValidationEngine.vb
  • src/SAIF.Framework.Validation/Rules/ValidationRule.vb
  • src/SAIF.Framework.Validation/ValidationResult.vb
  • src/SAIF.Framework.Validation/RuleSets/ClaimIntake.rules.xml
  • src/SAIF.Framework.Validation/RuleSets/PremiumAudit.rules.xml