Skip to content

Commit

Permalink
Fix V631 validator.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredb96 committed Jun 27, 2024
1 parent 2e2e28b commit 522807d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions hmda/src/main/scala/hmda/validation/dsl/PredicateCommon.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package hmda.validation.dsl

import hmda.model.filing.lar.enums.EthnicityEnum

import scala.util.Try

object PredicateCommon {
Expand Down Expand Up @@ -64,6 +66,7 @@ object PredicateCommon {

def empty[A]: Predicate[A] = (_: A) match {
case s: String => s.isEmpty
case s: EthnicityEnum => s.code == 0
case _ =>
throw new NotImplementedError("'empty doesn't handle non-string values yet'")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object V631_1 extends EditCheck[LoanApplicationRegister] {
)

override def apply(lar: LoanApplicationRegister): ValidationResult =
if(lar.coApplicant.ethnicity.otherHispanicOrLatino == "") {
if(lar.coApplicant.ethnicity.otherHispanicOrLatino.isEmpty) {
lar.coApplicant.ethnicity.ethnicity1 is containedIn(validEthnicities) and (lar.coApplicant.ethnicity.ethnicity1 not empty)
}
else {
Expand Down

0 comments on commit 522807d

Please sign in to comment.