Skip to content

Commit

Permalink
Merge pull request #4786 from jaredb96/4785-hmda-analytics-quarterly-…
Browse files Browse the repository at this point in the history
…filing-lar-error

Add 2024 to LarConverter and tests
  • Loading branch information
rkovalik-raft authored Mar 29, 2024
2 parents b3dc227 + b2c5f62 commit 4acc5b8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ object LarConverter {
val censusFileName2023 =
config.getString("hmda.census.fields.2023.filename")

val censusFileName2024 =
config.getString("hmda.census.fields.2024.filename")

val countyLoanLimitFileName2018 =
config.getString("hmda.countyLoanLimit.2018.fields.filename")
val countyLoanLimitFileName2019 =
Expand All @@ -42,6 +45,9 @@ object LarConverter {

val countyLoanLimitFileName2023 =
config.getString("hmda.countyLoanLimit.2023.fields.filename")

val countyLoanLimitFileName2024 =
config.getString("hmda.countyLoanLimit.2024.fields.filename")

val countyLoanLimits2018: Seq[CountyLoanLimit] =
parseCountyLoanLimitFile(countyLoanLimitFileName2018)
Expand All @@ -55,13 +61,16 @@ object LarConverter {
parseCountyLoanLimitFile(countyLoanLimitFileName2022)
val countyLoanLimits2023: Seq[CountyLoanLimit] =
parseCountyLoanLimitFile(countyLoanLimitFileName2023)
val countyLoanLimits2024: Seq[CountyLoanLimit] =
parseCountyLoanLimitFile(countyLoanLimitFileName2024)

val overallLoanLimit2018 = overallLoanLimits(countyLoanLimits2018)
val overallLoanLimit2019 = overallLoanLimits(countyLoanLimits2019)
val overallLoanLimit2020 = overallLoanLimits(countyLoanLimits2020)
val overallLoanLimit2021 = overallLoanLimits(countyLoanLimits2021)
val overallLoanLimit2022 = overallLoanLimits(countyLoanLimits2022)
val overallLoanLimit2023 = overallLoanLimits(countyLoanLimits2023)
val overallLoanLimit2024 = overallLoanLimits(countyLoanLimits2024)



Expand All @@ -71,6 +80,7 @@ object LarConverter {
val countyLoanLimitsByCounty2021 = countyLoansLimitByCounty(countyLoanLimits2021)
val countyLoanLimitsByCounty2022 = countyLoansLimitByCounty(countyLoanLimits2022)
val countyLoanLimitsByCounty2023 = countyLoansLimitByCounty(countyLoanLimits2023)
val countyLoanLimitsByCounty2024 = countyLoansLimitByCounty(countyLoanLimits2024)


val countyLoanLimitsByState2018 = countyLoansLimitByState(countyLoanLimits2018)
Expand All @@ -79,6 +89,7 @@ object LarConverter {
val countyLoanLimitsByState2021 = countyLoansLimitByState(countyLoanLimits2021)
val countyLoanLimitsByState2022 = countyLoansLimitByState(countyLoanLimits2022)
val countyLoanLimitsByState2023 = countyLoansLimitByState(countyLoanLimits2023)
val countyLoanLimitsByState2024 = countyLoansLimitByState(countyLoanLimits2024)


def apply(
Expand Down Expand Up @@ -236,6 +247,7 @@ object LarConverter {
case 2021 => countyLoanLimitsByCounty2021
case 2022 => countyLoanLimitsByCounty2022
case 2023 => countyLoanLimitsByCounty2023
case 2024 => countyLoanLimitsByCounty2024

}
}
Expand All @@ -248,6 +260,7 @@ object LarConverter {
case 2021 => countyLoanLimitsByState2021
case 2022 => countyLoanLimitsByState2022
case 2023 => countyLoanLimitsByState2023
case 2024 => countyLoanLimitsByState2024

}
}
Expand All @@ -260,6 +273,7 @@ object LarConverter {
case 2021 => overallLoanLimit2021
case 2022 => overallLoanLimit2022
case 2023 => overallLoanLimit2023
case 2024 => overallLoanLimit2024

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ class LarConverterSpec extends PropSpec with ScalaCheckPropertyChecks with MustM
val finalLar = unitsLar.copy(loan = unitsLar.loan.copy(amount = 721151.00))
LarConverter(finalLar, 2018).conformingLoanLimit mustBe "NC"
LarConverter(finalLar, 2019).conformingLoanLimit mustBe "U"
LarConverter(finalLar, 2020).conformingLoanLimit mustBe "U"
LarConverter(finalLar, 2021).conformingLoanLimit mustBe "U"
LarConverter(finalLar, 2022).conformingLoanLimit mustBe "U"
LarConverter(finalLar, 2023).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2024).conformingLoanLimit mustBe "C"
}
}

Expand All @@ -26,6 +31,12 @@ class LarConverterSpec extends PropSpec with ScalaCheckPropertyChecks with MustM
val finalLar = unitsLar.copy(loan = unitsLar.loan.copy(amount = 552001.00))
LarConverter(finalLar, 2019).conformingLoanLimit mustBe "NC"
LarConverter(finalLar, 2020).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2021).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2022).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2023).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2024).conformingLoanLimit mustBe "C"


}
}

Expand All @@ -38,6 +49,10 @@ class LarConverterSpec extends PropSpec with ScalaCheckPropertyChecks with MustM
LarConverter(finalLar, 2019).conformingLoanLimit mustBe "U"
LarConverter(finalLar, 2019).isEmpty mustBe lar.larIdentifier.LEI.isEmpty
LarConverter(finalLar, 2020).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2021).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2022).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2023).conformingLoanLimit mustBe "C"
LarConverter(finalLar, 2024).conformingLoanLimit mustBe "C"
}
}

Expand Down

0 comments on commit 4acc5b8

Please sign in to comment.