Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023 support and 2024 edits #4705

Merged
merged 15 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
316 changes: 316 additions & 0 deletions common/src/main/resources/2024EditsDescriptions.txt

Large diffs are not rendered by default.

316 changes: 316 additions & 0 deletions common/src/main/resources/2024QuarterlyEditsDescriptions.txt

Large diffs are not rendered by default.

3,235 changes: 3,235 additions & 0 deletions common/src/main/resources/FullCountyLoanLimitList2024.txt

Large diffs are not rendered by default.

87,276 changes: 87,276 additions & 0 deletions common/src/main/resources/ffiec_census_2023.txt

Large diffs are not rendered by default.

98 changes: 98 additions & 0 deletions common/src/main/resources/parserFieldValidValues2024.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
LEI|String with only letters and numbers
ULI|String with only letters and numbers
LAR Record Identifier|Integer: 2
Application Date|Valid Date in format YYYYMMDD or NA
Loan Type|Integer: 1, 2, 3, 4
Loan Purpose|Integer: 1, 2, 31, 32, 4, 5
Preapproval|Integer: 1, 2
Construction Method|Integer: 1, 2
Occupancy Type|Integer: 1, 2, 3
Action Taken|Integer: 1, 2, 3, 4, 5, 6, 7, 8
Action Taken Date|Valid Date in format YYYYMMDD
Loan Amount|Numeric (Example: 110500 or 110500.00)
Loan Term|Integer, NA, or Exempt
Ethnicity of Applicant or Borrower: 1|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Applicant or Borrower: 2|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Applicant or Borrower: 3|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Applicant or Borrower: 4|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Applicant or Borrower: 5|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Applicant or Borrower Collected on the Basis of Visual Observation or Surname|Integer: 1, 2, 3, 4
Ethnicity of Co-Applicant or Co-Borrower: 1|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Co-Applicant or Co-Borrower: 2|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Co-Applicant or Co-Borrower: 3|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Co-Applicant or Co-Borrower: 4|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Co-Applicant or Co-Borrower: 5|Integer: 1, 11, 12, 13, 14, 2, 3, 4, 5 or Blank
Ethnicity of Co-Applicant or CoBorrower Collected on the Basis of Visual Observation or Surname|Integer: 1, 2, 3, 4
Race of Applicant or Borrower: 1|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Applicant or Borrower: 2|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Applicant or Borrower: 3|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Applicant or Borrower: 4|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Applicant or Borrower: 5|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Applicant or Borrower Collected on the Basis of Visual Observation or Surname|1, 2, 3, 4
Race of Co-Applicant or Co-Borrower: 1|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Co-Applicant or Co-Borrower: 2|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Co-Applicant or Co-Borrower: 3|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Co-Applicant or Co-Borrower: 4|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Co-Applicant or Co-Borrower: 5|Integer: 1, 2, 21, 22, 23, 24, 25, 26, 27, 3, 4, 41, 42, 43, 44, 5, 6, 7, 8 or Blank
Race of Co-Applicant or Co-Borrower Collected on the Basis of Visual Observation or Surname|1, 2, 3, 4
Sex of Applicant or Borrower|Integer: 1, 2, 3, 4, 5, 6
Sex of Applicant or Borrower Collected on the Basis of Visual Observation or Surname|Integer: 1, 2, 3, 4
Sex of Co-Applicant or Co-Borrower|Integer: 1, 2, 3, 4, 5, 6
Sex of Co-Applicant or Co-Borrower Collected on the Basis of Visual Observation or Surname|Integer: 1, 2, 3, 4
Age of Applicant or Borrower|Integer
Age of Co-Applicant or Co-Borrower|Integer
Credit Score of Applicant or Borrower|Integer
Applicant or Borrower, Name and Version of Credit Scoring Model|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1111
Credit Score of Co-Applicant or Co-Borrower|Integer
Co-Applicant or Co-Borrower, Name and Version of Credit Scoring Model|1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1111
Income|Integer or NA
Type of Purchaser|Integer: 1, 2, 3, 4, 5, 6, 71, 72, 8, 9
Rate Spread|Numeric (Example: 110500 or 110500.00), NA, or Exempt
HOEPA Status|Integer: 1, 2, 3
Lien Status|Integer: 1, 2
Reason for Denial: 1|Integer: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1111
Reason for Denial: 2|Integer: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1111 or Blank
Reason for Denial: 3|Integer: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1111 or Blank
Reason for Denial: 4|Integer: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1111 or Blank
Total Loan Costs|Numeric (Example: 110500 or 110500.00), NA, or Exempt
Total Points and Fees|Numeric (Example: 110500 or 110500.00), NA, or Exempt
Origination Charges|Numeric (Example: 110500 or 110500.00), NA, or Exempt
Discount Points|Numeric (Example: 0.2), NA, Exempt, or Blank
Lender Credits|Numeric (Example: 110500 or 110500.00), NA, Exempt, or Blank
Interest Rate|Numeric (Example: 0.0375), NA, or Exempt
Prepayment Penalty Term|Integer, NA, or Exempt
Debt-to-Income Ratio|Numeric (Example: 0.35), NA, or Exempt
Combined Loan-to-Value Ratio|Numeric (Example: 0.8), NA, or Exempt
Introductory Rate Period|Integer, NA or Exempt
Balloon Payments|Integer: 1, 2, 1111
Interest-Only Payments|Integer: 1, 2, 1111
Negative Amortization|Integer: 1, 2, 1111
Other Non-Amortizing Features|Integer: 1, 2, 1111
Property Value|Numeric (Example: 110500 or 110500.00), NA, or Exempt
Manufactured Home Secured Property Type|Integer: 1, 2, 3, 1111
Manufactured Home Land Property Interest|Integer: 1, 2, 3, 4, 5, 1111
Total Units|Integer
Multifamily Affordable Units|Integer, NA, or Exempt
Submission of Application|Integer
Initially Payable to Your Institution|Integer: 1, 2, 3, 1111
Mortgage Loan Originiator NMLSR Identifier|
Automated Underwriting System: 1|Integer: 1, 2, 3, 4, 5, 6, 7, 1111
Automated Underwriting System: 2|Integer: 1, 2, 3, 4, 5, 6, 7, 1111 or Blank
Automated Underwriting System: 3|Integer: 1, 2, 3, 4, 5, 6, 7, 1111 or Blank
Automated Underwriting System: 4|Integer: 1, 2, 3, 4, 5, 6, 7, 1111 or Blank
Automated Underwriting System: 5|Integer: 1, 2, 3, 4, 5, 6, 7, 1111 or Blank
Automated Underwriting System Result: 1|Integer: 1-24 or 1111 or Blank
Automated Underwriting System Result: 2|Integer: 1-24 or 1111 or Blank
Automated Underwriting System Result: 3|Integer: 1-24 or 1111 or Blank
Automated Underwriting System Result: 4|Integer: 1-24 or 1111 or Blank
Automated Underwriting System Result: 5|Integer: 1-24 or 1111 or Blank
Mortage|Integer: 1, 2, 1111
Open-End Line of Credit|Integer: 1, 2, 1111
Buisness or Commercial Purpose|Integer: 1, 2, 1111
Incorrect Number of LAR Fields|110 Fields
Incorrect Number of TS Fields|
Transmittal Sheet Record Identifier|Integer: 1
Calendar Year|Integer
Calendar Quarter|Integer
Total Number of Entries Contained in Submission|Integer
Federal Agency|Integer
34 changes: 29 additions & 5 deletions common/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ hmda {

rules {
yearly-filing {
years-allowed = "2018,2019,2020,2021,2022"
years-allowed = "2018,2019,2020,2021,2022,2023,2024"
years-allowed = ${?RULES_YEARLY_FILING_YEARS_ALLOWED}
}

quarterly-filing {
years-allowed = "2020,2021,2022"
years-allowed = "2020,2021,2022,2023,2024"
years-allowed = ${?RULES_QF_FILING_YEARS_ALLOWED}

q1 {
Expand Down Expand Up @@ -93,6 +93,8 @@ hmda {
current = ${?CURRENT_YEAR}

parser.validValues.filename = "parserFieldValidValues.txt"
parser.validValues.filename2024 = "parserFieldValidValues2024.txt"

2018 {
ts.length = 15
lar.length = 110
Expand Down Expand Up @@ -154,14 +156,28 @@ hmda {
lar.length = 110
edits.descriptions.filename = "2023QuarterlyEditsDescriptions.txt"
edits.descriptions.filename = ${?EDIT_DESCRIPTIONS_FILENAME_2023_Q}
year = 2022
year = 2023
}
2023 {
ts.length = 15
lar.length = 110
edits.descriptions.filename = "2023EditsDescriptions.txt"
edits.descriptions.filename = ${?EDIT_DESCRIPTIONS_FILENAME_2023}
year = 2022
year = 2023
}
2024Quarter {
ts.length = 15
lar.length = 110
edits.descriptions.filename = "2024QuarterlyEditsDescriptions.txt"
edits.descriptions.filename = ${?EDIT_DESCRIPTIONS_FILENAME_2024_Q}
year = 2024
}
2024 {
ts.length = 15
lar.length = 110
edits.descriptions.filename = "2024EditsDescriptions.txt"
edits.descriptions.filename = ${?EDIT_DESCRIPTIONS_FILENAME_2024}
year = 2024
}
}

Expand All @@ -188,7 +204,11 @@ hmda {
filename = ${?2022_CENSUS_FILENAME}
}
2023 {
filename = "ffiec_census_2022.txt"
filename = "ffiec_census_2023.txt"
filename = ${?2023_CENSUS_FILENAME}
}
2024 {
filename = "ffiec_census_2023.txt"
filename = ${?2023_CENSUS_FILENAME}
}
}
Expand Down Expand Up @@ -219,6 +239,10 @@ hmda {
fields.filename = "FullCountyLoanLimitList2023.txt"
fields.filename = ${?COUNTY_LOAN_LIMIT_FILENAME_2023}
}
2024 {
fields.filename = "FullCountyLoanLimitList2024.txt"
fields.filename = ${?COUNTY_LOAN_LIMIT_FILENAME_2024}
}
}

kafka {
Expand Down
18 changes: 15 additions & 3 deletions common/src/main/scala/hmda/census/records/CensusRecords.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ object CensusRecords {
private val censusFileName2020 = config.getString("hmda.census.fields.2020.filename")
private val censusFileName2021 = config.getString("hmda.census.fields.2021.filename")
private val censusFileName2022 = config.getString("hmda.census.fields.2022.filename")
private val censusFileName2023 = config.getString("hmda.census.fields.2023.filename")


val (
indexedTract2018: Map[String, Census],
Expand Down Expand Up @@ -72,6 +74,12 @@ object CensusRecords {
indexedSmallCounty2022: Map[String, Census]
) = getCensus(censusFileName2022)

val (
indexedTract2023: Map[String, Census],
indexedCounty2023: Map[String, Census],
indexedSmallCounty2023: Map[String, Census]
) = getCensus(censusFileName2023)

def yearTractMap(year: Int): Map[String, Census] = {
year match {
case 2018 =>
Expand All @@ -85,9 +93,11 @@ object CensusRecords {
case 2022 =>
indexedTract2022
case 2023 =>
indexedTract2022
indexedTract2023
case 2024 =>
indexedTract2023
case _ =>
indexedTract2021
indexedTract2023
}
}

Expand All @@ -105,8 +115,10 @@ object CensusRecords {
indexedCounty2022
case 2023 =>
indexedCounty2022
case 2024 =>
indexedCounty2023
case _ =>
indexedCounty2021
indexedCounty2023
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ object EditDescriptionLookup {
config.getString("hmda.filing.2023Quarter.edits.descriptions.filename")
val editDescriptionFileName2023 =
config.getString("hmda.filing.2023.edits.descriptions.filename")

val editDescriptionFileName2024Quarter =
config.getString("hmda.filing.2024Quarter.edits.descriptions.filename")
val editDescriptionFileName2024 =
config.getString("hmda.filing.2024.edits.descriptions.filename")
def editDescriptionList(file: Iterable[String]): Iterable[EditDescription] =
file
.drop(1)
Expand All @@ -54,6 +57,8 @@ object EditDescriptionLookup {
val editDescriptionLines2022 = fileLines(s"/$editDescriptionFileName2022")
val editDescriptionLines2023Quarter = fileLines(s"/$editDescriptionFileName2023Quarter")
val editDescriptionLines2023 = fileLines(s"/$editDescriptionFileName2023")
val editDescriptionLines2024Quarter = fileLines(s"/$editDescriptionFileName2024Quarter")
val editDescriptionLines2024 = fileLines(s"/$editDescriptionFileName2024")


val editDescriptionMap2018 = editDescriptionMap(editDescriptionLines2018)
Expand All @@ -66,7 +71,8 @@ object EditDescriptionLookup {
val editDescriptionMap2022 = editDescriptionMap(editDescriptionLines2022)
val editDescriptionMap2023Quarter = editDescriptionMap(editDescriptionLines2023Quarter)
val editDescriptionMap2023 = editDescriptionMap(editDescriptionLines2023)

val editDescriptionMap2024Quarter = editDescriptionMap(editDescriptionLines2024Quarter)
val editDescriptionMap2024 = editDescriptionMap(editDescriptionLines2024)


def mapForPeriod(period: Period): Map[String, EditDescription] =
Expand All @@ -81,6 +87,8 @@ object EditDescriptionLookup {
case Period(2022, None) => editDescriptionMap2022
case Period(2023, Some(_)) => editDescriptionMap2023Quarter
case Period(2023, None) => editDescriptionMap2023
case Period(2024, Some(_)) => editDescriptionMap2024Quarter
case Period(2024, None) => editDescriptionMap2024
case _ => editDescriptionMap2021
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ package hmda.model.filing

import com.typesafe.config.ConfigFactory
import hmda.model.ResourceUtils._
import hmda.utils.YearUtils.Period

object ParserValidValuesLookup {

val config = ConfigFactory.load()
val parserValidValuesFile =
config.getString("hmda.filing.parser.validValues.filename")

val parserValidValuesFile2024 =
config.getString("hmda.filing.parser.validValues.filename2024")

def parserValidValuesMapCreator(
file: Iterable[String]): Map[String, String] = {
file
Expand All @@ -24,8 +28,22 @@ object ParserValidValuesLookup {
val parserValidValuesLines = fileLines(s"/$parserValidValuesFile")
val parserValidValuesMap = parserValidValuesMapCreator(parserValidValuesLines)

def lookupParserValidValues(fieldName: String): String =
val parserValidValuesLines2024 = fileLines(s"/$parserValidValuesFile2024")
val parserValidValuesMap2024 = parserValidValuesMapCreator(parserValidValuesLines2024)

def lookupParserValidValues(fieldName: String): String = {

parserValidValuesMap
.getOrElse(fieldName, "")
}


def lookupParserValidValuesByYear(fieldName: String,period: Period): String =
period match {

case Period(2024, Some(_)) => parserValidValuesMap2024.getOrElse(fieldName, "")
case Period(2024, None) => parserValidValuesMap2024.getOrElse(fieldName, "")
PatrickGoRaft marked this conversation as resolved.
Show resolved Hide resolved
case _ => parserValidValuesMap.getOrElse(fieldName, "")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package hmda.model.filing.lar.enums
sealed trait CreditScoreEnum extends LarEnum

object CreditScoreEnum extends LarCodeEnum[CreditScoreEnum] {
override val values = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1111)
override val values = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,12,13,14,15, 1111)

override def valueOf(code: Int): CreditScoreEnum =
code match {
Expand All @@ -18,6 +18,10 @@ object CreditScoreEnum extends LarCodeEnum[CreditScoreEnum] {
case 9 => CreditScoreNotApplicable
case 10 => CreditScoreNoCoApplicant
case 11 => FICOScore9
case 12 => FICOScore8
case 13 => FICOScore10
case 14 => FICOScore10T
case 15 => VantageScore4
case 1111 => CreditScoreExempt
case other => new InvalidCreditScoreCode(other)
}
Expand Down Expand Up @@ -78,6 +82,25 @@ case object FICOScore9 extends CreditScoreEnum {
override def description: String = "FICO Score 9"
}

case object FICOScore8 extends CreditScoreEnum {
override def code: Int = 12
override def description: String = "FICO Score 8"
}

case object FICOScore10 extends CreditScoreEnum {
override def code: Int = 13
override def description: String = "FICO Score 10"
}

case object FICOScore10T extends CreditScoreEnum {
override def code: Int = 14
override def description: String = "FICO Score 10T"
}

case object VantageScore4 extends CreditScoreEnum {
override def code: Int = 15
override def description: String = "Vantage Score 4.0"
}
case object CreditScoreExempt extends CreditScoreEnum {
override def code: Int = 1111
override def description: String = "Exempt Credit Score"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class ModifiedLarRepository(databaseConfig: DatabaseConfig[JdbcProfile]) {
case 2020 => "modifiedlar2020"
case 2021 => "modifiedlar2021"
case 2022 => "modifiedlar2022"
case 2023 => "modifiedlar2023"

case _ => "modifiedlar2021"
}

Expand Down
Loading