Skip to content

Commit

Permalink
Task 40 - added missing validations (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: Nargis Sultani <[email protected]>
  • Loading branch information
nargis-sultani and Nargis Sultani authored Sep 13, 2023
1 parent 1c75d8e commit 5a9a1cf
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions src/validator/phase_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,20 @@ def get_phase_1_and_2_validations_for_lei(lei: str = None):
condition_values={"977"},
),
SBLCheck(
has_valid_value_count,
has_valid_multi_field_value_count,
id="W2006",
name="credit_purpose_ff.invalid_number_of_values",
description="'Other Credit purpose' must not contain more than one other credit purpose.",
element_wise=True,
min_length=0,
max_length=1,
warning=True,
name="credit_purpose_ff.multi_invalid_number_of_values",
description=(
"'Credit purpose' and 'free-form text field for other credit "
"purpose' combined should not contain more than three values. "
"Code 977 (other), within 'credit purpose', does not count "
"toward the maximum number of values for the purpose of "
"this validation check."
),
groupby="credit_purpose",
ignored_values={"977"},
max_length=3,
),
],
},
Expand Down Expand Up @@ -823,6 +830,22 @@ def get_phase_1_and_2_validations_for_lei(lei: str = None):
groupby="denial_reasons",
condition_values={"977"},
),
SBLCheck(
has_valid_multi_field_value_count,
id="W2013",
warning=True,
name="denial_reasons_ff.multi_invalid_number_of_values",
description=(
"'Denial reason(s)' and 'free-form text field for other "
"denial reason(s)' combined should not contain more than "
"four values. Code 977 (other), within 'Denial reason(s)', "
"does not count toward the maximum number of values for "
"the purpose of this validation check."
),
groupby="denial_reasons",
ignored_values={"977"},
max_length=4,
),
],
},
"pricing_interest_rate_type": {
Expand Down

0 comments on commit 5a9a1cf

Please sign in to comment.