Skip to content

Commit

Permalink
Merge pull request #1647 from bcgov/feature/EDX-2679
Browse files Browse the repository at this point in the history
SCH: Add funding warnings for refugees eligibility V91
  • Loading branch information
arcshiftsolutions authored Jun 20, 2024
2 parents 97b28a4 + dca9cc7 commit b8696d1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
4 changes: 3 additions & 1 deletion backend/src/components/sdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ function toTableRow(student) {
}

function fundingEligibleRefugee(student) {
const hasIssue = student?.sdcSchoolCollectionStudentValidationIssues?.some(issue => issue.validationIssueCode === 'REFUGEEINPREVCOL');
const hasIssue = student?.sdcSchoolCollectionStudentValidationIssues?.some(issue =>
issue.validationIssueCode === 'REFUGEEINPREVCOL' || issue.validationIssueCode === 'REFUGEEISADULT'
);
return hasIssue ? 'No' : 'Yes';
}

Expand Down
30 changes: 28 additions & 2 deletions backend/src/components/studentFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,35 @@ function createRefugeeFundingFilter(pValue) {
let refugeeFundingList = [];

if (pValue.toString() === 'true') {
refugeeFundingList.push({ key: 'sdcStudentValidationIssueEntities.validationIssueCode', value: 'REFUGEEINPREVCOL', operation: FILTER_OPERATION.NONE_IN, valueType: VALUE_TYPE.STRING, condition: CONDITION.OR });
refugeeFundingList.push({
key: 'sdcStudentValidationIssueEntities.validationIssueCode',
value: 'REFUGEEINPREVCOL',
operation: FILTER_OPERATION.NONE_IN,
valueType: VALUE_TYPE.STRING,
condition: CONDITION.AND
});
refugeeFundingList.push({
key: 'sdcStudentValidationIssueEntities.validationIssueCode',
value: 'REFUGEEISADULT',
operation: FILTER_OPERATION.NONE_IN,
valueType: VALUE_TYPE.STRING,
condition: CONDITION.AND
});
} else if (pValue.toString() === 'false') {
refugeeFundingList.push({ key: 'sdcStudentValidationIssueEntities.validationIssueCode', value: 'REFUGEEINPREVCOL', operation: FILTER_OPERATION.IN, valueType: VALUE_TYPE.STRING, condition: CONDITION.OR });
refugeeFundingList.push({
key: 'sdcStudentValidationIssueEntities.validationIssueCode',
value: 'REFUGEEINPREVCOL',
operation: FILTER_OPERATION.IN,
valueType: VALUE_TYPE.STRING,
condition: CONDITION.OR
});
refugeeFundingList.push({
key: 'sdcStudentValidationIssueEntities.validationIssueCode',
value: 'REFUGEEISADULT',
operation: FILTER_OPERATION.IN,
valueType: VALUE_TYPE.STRING,
condition: CONDITION.OR
});
}

return refugeeFundingList;
Expand Down

0 comments on commit b8696d1

Please sign in to comment.