first commit

This commit is contained in:
Zeeshaun
2026-03-11 11:18:25 -05:00
commit f3cb730f3b
472 changed files with 53651 additions and 0 deletions
@@ -0,0 +1,32 @@
using FluentValidation;
using Landmark.OLA.Models.Individuals.Enums;
namespace Landmark.OLA.Models.HomeMortgageDisclosureAct.Validators
{
public class HmdaValidator : AbstractValidator<Hmda>
{
public HmdaValidator()
{
RuleFor(x => x.Races).NotEmpty()
.WithMessage($"No race information was provided. Set {Race.NotProvided} if none will be provided.");
RuleFor(x => x.Races).Must(races => races.Contains(Race.AmericanIndianAlaskaNative))
.When(x => !string.IsNullOrWhiteSpace(x.AmericanIndianAlaskaNativeTribe))
.WithMessage($"Include {Race.AmericanIndianAlaskaNative} in Races when a value is set in AmericanIndianAlaskaNativeTribe.");
RuleFor(x => x.Races).Must(races => races.Contains(Race.OtherAsian))
.When(x => !string.IsNullOrWhiteSpace(x.OtherAsianRace))
.WithMessage($"Include {Race.OtherAsian} in Races when a value is set in OtherAsianRace.");
RuleFor(x => x.Races).Must(races => races.Contains(Race.OtherPacificIslander))
.When(x => !string.IsNullOrWhiteSpace(x.OtherPacificIslanderRace))
.WithMessage($"Include {Race.OtherPacificIslander} in Races when a value is set in OtherPacificIslanderRace.");
RuleFor(x => x.Ethnicities).NotEmpty()
.WithMessage($"No ethnicity information was provided. Set {Ethnicity.NotProvided} if none will be provided.");
RuleFor(x => x.Ethnicities).Must(ethnicities => ethnicities.Contains(Ethnicity.OtherHispanicLatino))
.When(x => !string.IsNullOrWhiteSpace(x.OtherHispanicLatinoEthnicity))
.WithMessage($"Include {Ethnicity.OtherHispanicLatino} in Ethnicities when a value is set in OtherHispanicLatinoEthnicity.");
RuleFor(x => x.Sexes).NotEmpty()
.WithMessage($"No sex information was provided. Set {Sex.NotProvided} if none will be provided.");
}
}
}