Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix validator
Browse files Browse the repository at this point in the history
AntBush authored and ccbc-service-account committed Jan 31, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5177c87 commit 6342a4d
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/lib/helpers/ccbcSummaryGenerateFormData.ts
Original file line number Diff line number Diff line change
@@ -413,7 +413,7 @@ const getApplicationErrors = (
const template9Data =
applicationData?.applicationFormTemplate9DataByApplicationId?.nodes[0];
const formErrors = validate(
{ template9Data, allApplicationErs, allApplicationRds },
{ template9Data, applicationData, allApplicationErs, allApplicationRds },
review
);
return formErrors;
20 changes: 18 additions & 2 deletions app/utils/ccbcCustomValidator.ts
Original file line number Diff line number Diff line change
@@ -17,10 +17,26 @@ const CCBC_VALIDATIONS = {
rules: [template9Validation],
},
totalHouseholdsImpacted: {
rules: [template9Validation],
rules: [
{
condition: (data) =>
!Number.isNaN(data?.applicationData?.benefits?.numberOfHouseholds),
error:
'This value is informed from Template 1 which has not been received from the applicant.',
},
],
},
numberOfIndigenousHouseholds: {
rules: [template9Validation],
rules: [
{
condition: (data) =>
!Number.isNaN(
data?.applicationData?.benefits?.householdsImpactedIndigenous
),
error:
'This value is informed from Template 1 which has not been received from the applicant.',
},
],
},
},
locations: {

0 comments on commit 6342a4d

Please sign in to comment.