Skip to content

ActivityValidator

A FluentValidation AbstractValidator<Activity> that enforces the business rules for a Collections case Activity entry: a plausible activity date, a required activity type code, and a bounded activity amount. It is registered with FluentValidation's validator discovery and invoked indirectly through IValidationService.Validate wherever Activity instances are validated (for example, CollectionsService.SaveRequest).

Purpose

  • Rejects activity dates outside the range 01/01/1982 through seven days in the future.
  • Requires a non-empty activity type code.
  • Requires the activity amount to be strictly between zero and one million.

Context

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

Public members

Member Signature Purpose
ActivityValidator() public ActivityValidator() Registers the activity-date, activity-code, and activity-amount rules described above against a validated Activity instance.

Behavioral notes

  • The lower date bound (01/01/1982) is fixed at construction time via a private _fromDate field rather than being configurable*.
  • All three rules use ExclusiveBetween/NotEmpty with fixed, hardcoded thresholds rather than externally configured limits*.

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/ActivityValidator.cs