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

Refactor V619_2 edits to use dynamic dates #4904

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2018._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{ S300, S301 }
import hmda.validation.rules.lar.validity.{_2018,_}
Expand Down Expand Up @@ -40,7 +41,7 @@ private[engine] object LarEngine2018 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2018.V619_2,
V619_2.withYear("2018"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2019._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{ S300, S301 }
import hmda.validation.rules.lar.validity.{_2019,_}
Expand Down Expand Up @@ -41,7 +42,7 @@ private[engine] object LarEngine2019 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2019.V619_2,
V619_2.withYear("2019"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2019._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.{common, _2020 => quality2020}
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
Expand Down Expand Up @@ -43,7 +44,7 @@ private[engine] object LarEngine2020 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2020.V619_2,
V619_2.withYear("2020"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import hmda.validation.rules.lar.validity._
import hmda.validation.rules.lar.validity._2020
import hmda.census.records.CensusRecords
import hmda.validation.rules.lar.validity._2020.V716
import hmda.validation.rules.lar.validity.common.V619_2

private[engine] object LarEngine2020Q extends ValidationEngine[LoanApplicationRegister] {

Expand Down Expand Up @@ -43,7 +44,7 @@ private[engine] object LarEngine2020Q extends ValidationEngine[LoanApplicationRe
V617,
V618,
V619_1,
_2020.V619_2,
V619_2.withYear("2020"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality.{_2020 => quality2020, _2021 => quality2021}
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
import hmda.validation.rules.lar.validity._
Expand Down Expand Up @@ -41,7 +42,7 @@ private[engine] object LarEngine2021 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2021.V619_2,
V619_2.withYear("2021"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import hmda.validation.rules.lar.syntactical.{S300, S301}
import hmda.validation.rules.lar.validity._
import hmda.validation.rules.lar.validity._2020
import hmda.census.records.CensusRecords
import hmda.validation.rules.lar.validity.common.V619_2

private[engine] object LarEngine2021Q extends ValidationEngine[LoanApplicationRegister] {

Expand Down Expand Up @@ -42,7 +43,7 @@ private[engine] object LarEngine2021Q extends ValidationEngine[LoanApplicationRe
V617,
V618,
V619_1,
_2021.V619_2,
V619_2.withYear("2021"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2019._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.{_2020 => quality2020, _2021 => quality2021, _2022 => quality2022}
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
Expand Down Expand Up @@ -42,7 +43,7 @@ private[engine] object LarEngine2022 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2022.V619_2,
V619_2.withYear("2022"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
import hmda.validation.rules.lar.validity.{_2020, _2022, _}
import hmda.census.records.CensusRecords
import hmda.validation.rules.lar.validity.common.V619_2

private[engine] object LarEngine2022Q extends ValidationEngine[LoanApplicationRegister] {

Expand Down Expand Up @@ -42,7 +43,7 @@ private[engine] object LarEngine2022Q extends ValidationEngine[LoanApplicationRe
V617,
V618,
V619_1,
_2022.V619_2,
V619_2.withYear("2022"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2019._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.{_2020 => quality2020, _2021 => quality2021, _2022 => quality2022}
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
import hmda.validation.rules.lar.validity.{_2020, _2022, _2023, _}
import hmda.validation.rules.lar.validity.{_2020, _2022, _}
import hmda.census.records.CensusRecords

private[engine] object LarEngine2023 extends ValidationEngine[LoanApplicationRegister] {
Expand Down Expand Up @@ -42,7 +43,7 @@ private[engine] object LarEngine2023 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2023.V619_2,
V619_2.withYear("2023"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
import hmda.validation.rules.lar.validity.{_2020, _2022, _}
import hmda.census.records.CensusRecords
import hmda.validation.rules.lar.validity.common.V619_2

private[engine] object LarEngine2023Q extends ValidationEngine[LoanApplicationRegister] {

Expand Down Expand Up @@ -42,7 +43,7 @@ private[engine] object LarEngine2023Q extends ValidationEngine[LoanApplicationRe
V617,
V618,
V619_1,
_2023.V619_2,
V619_2.withYear("2023"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2019._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.{_2020 => quality2020, _2021 => quality2021, _2022 => quality2022, _2025 => quality2025}
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
Expand Down Expand Up @@ -43,7 +44,7 @@ private[engine] object LarEngine2024 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2024.V619_2,
V619_2.withYear("2024"),
V619_3,
V620,
V621,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package hmda.validation.engine
import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.context.ValidationContext
import hmda.validation.rules.lar.quality._2019._
import hmda.validation.rules.lar.validity.common.V619_2
import hmda.validation.rules.lar.quality.{_2020 => quality2020, _2021 => quality2021, _2022 => quality2022, _2025 => quality2025}
import hmda.validation.rules.lar.quality.common._
import hmda.validation.rules.lar.syntactical.{S300, S301}
Expand Down Expand Up @@ -43,7 +44,7 @@ private[engine] object LarEngine2025 extends ValidationEngine[LoanApplicationReg
V617,
V618,
V619_1,
_2025.V619_2,
V619_2.withYear("2025"),
V619_3,
V620,
V621,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
package hmda.validation.rules.lar.validity._2023

package hmda.validation.rules.lar.validity.common

import hmda.model.filing.lar.LoanApplicationRegister
import hmda.validation.dsl.PredicateCommon._
import hmda.validation.dsl.PredicateSyntax._
import hmda.validation.dsl.ValidationResult
import hmda.validation.rules.EditCheck

object V619_2 extends EditCheck[LoanApplicationRegister] {
object V619_2 {
def withYear(year: String): EditCheck[LoanApplicationRegister] =
new V619_2(year)

}

class V619_2 private (year: String) extends EditCheck[LoanApplicationRegister] {
override def name: String = "V619-2"

override def parent: String = "V619"

override def apply(lar: LoanApplicationRegister): ValidationResult = {
val year = "2023"

lar.action.actionTakenDate.toString.slice(0, 4) is equalTo(year)
}

}
}

This file was deleted.

Loading
Loading