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

Task 40 - added missing validations #45

Merged
merged 3 commits into from
Sep 13, 2023
Merged
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
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
Loading