Skip to content

Commit

Permalink
Fix V628_1.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredb96 committed Jul 10, 2024
1 parent 03e17b6 commit 536b885
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ object V628_1 extends EditCheck[LoanApplicationRegister] {
OtherHispanicOrLatino,
NotHispanicOrLatino,
InformationNotProvided,
EthnicityNotApplicable,
EthnicityNoCoApplicant)
EthnicityNotApplicable)

override def apply(lar: LoanApplicationRegister): ValidationResult =
if(lar.applicant.ethnicity.otherHispanicOrLatino.isEmpty) {
lar.applicant.ethnicity.ethnicity1 is containedIn(validEthnicities) and (lar.applicant.ethnicity.ethnicity1.code not equalTo(0))
lar.applicant.ethnicity.ethnicity1 is containedIn(validEthnicities) and (lar.applicant.ethnicity.ethnicity1 not equalTo(EmptyEthnicityValue))
}
else {
lar.applicant.ethnicity.ethnicity1 is containedIn(validEthnicities) or (lar.applicant.ethnicity.ethnicity1.code is equalTo(0))
val x = lar.applicant.ethnicity.ethnicity1 is containedIn(validEthnicities)
val y = lar.applicant.ethnicity.ethnicity1 is equalTo(EmptyEthnicityValue)
lar.applicant.ethnicity.ethnicity1 is containedIn(validEthnicities) or (lar.applicant.ethnicity.ethnicity1 is equalTo(EmptyEthnicityValue))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class V628_1Spec extends LarEditCheckSpec {

val unapplicableLar = lar.copy(
applicant = lar.applicant.copy(ethnicity =
lar.applicant.ethnicity.copy(otherHispanicOrLatino = "test"))) //if free form is not blank and ethnicity is provided correctly
unapplicableLar.mustPass
lar.applicant.ethnicity.copy(otherHispanicOrLatino = "test")))

val ethnicityValid = applicableLar.applicant.ethnicity
.copy(ethnicity1 = HispanicOrLatino)

val ethnicityInvalid = applicableLar.applicant.ethnicity
.copy(ethnicity1 = new InvalidEthnicityCode)
lar
Expand Down

0 comments on commit 536b885

Please sign in to comment.