Skip to content

#5722 - Parent current year income appeal#6029

Open
weskubo-cgi wants to merge 10 commits intomainfrom
feature/#5722-parent-current-year-income-appeal
Open

#5722 - Parent current year income appeal#6029
weskubo-cgi wants to merge 10 commits intomainfrom
feature/#5722-parent-current-year-income-appeal

Conversation

@weskubo-cgi
Copy link
Copy Markdown
Collaborator

@weskubo-cgi weskubo-cgi commented Apr 14, 2026

Summary

  • Remove parent curent year income exception from sfaa2026-27-ft.json
  • Added new form parentcurrentyearincomeappeal.json
  • Added DB migration
  • Updated the following workflows:
    • fulltime-assessment-2026-2027.bpmn: added logic to determine application eligibility. Switched to use appeals data
    • assessment-gateway-v2.bpmn: added new application eligibility flag
    • load-assessment-consolidated-data.bpmn: added mapping for parent income appeal data

Notes

Custom validation was done at the grid level because the component level validation isn't handling the dynamic data in the label when presenting the error summary. Custom error labels were an option but they aren't used in custom validations.
image

Screenshots

Student -> 2026-2027 Full Time Application

image

Student -> Forms

image

Student -> Parent Current Year Income Appeal

image

Ministry -> Approve/Deny Appeal

image

Camunda

image

E2E Tests

fulltime-assessment-appeal-eligibility-parent-current-year-income.e2e-spec.ts‎

image

fulltime-assessment-parent-current-year-income.e2e-spec.ts

image

fulltime-assessment-total-parent-income.e2e-spec.ts

image

DB Migrations

image

Copilot AI review requested due to automatic review settings April 14, 2026 00:03
@weskubo-cgi weskubo-cgi marked this pull request as draft April 14, 2026 00:03
@weskubo-cgi weskubo-cgi self-assigned this Apr 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Parent Current Year Income” appeal form and wires it into the full-time 2026-2027 assessment workflow so the assessment gateway can surface eligibility for the new appeal.

Changes:

  • Added a new dynamic form definition: parentcurrentyearincomeappeal.json.
  • Updated workflow eligibility outputs and assessment gateway eligibility list to include the parent current-year-income appeal.
  • Added DB migration + SQL scripts to register the new dynamic form configuration.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Introduces the new Form.io appeal form definition for parent current-year income.
sources/packages/backend/workflow/src/workflow-definitions/fulltime-assessment-2026-2027.bpmn Outputs a new workflow variable to indicate eligibility for the parent current-year-income appeal.
sources/packages/backend/workflow/src/workflow-definitions/assessment-gateway-v2.bpmn Adds the new appeal form into the gateway’s computed eligibility list.
sources/packages/backend/apps/db-migrations/src/sql/DynamicFormConfigurations/Add-parent-current-year-income.sql Inserts a new dynamic form configuration record for the appeal.
sources/packages/backend/apps/db-migrations/src/sql/DynamicFormConfigurations/Rollback-add-parent-current-year-income.sql Removes the inserted dynamic form configuration record on rollback.
sources/packages/backend/apps/db-migrations/src/migrations/1775854087027-AddParentCurrentYearIncomeAppeal.ts Runs the add/rollback SQL scripts as a TypeORM migration.

Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
@weskubo-cgi weskubo-cgi added Form.io Form IO definitions changed. E2E/Unit tests Camunda Worflow Involves camunda workflow changes labels Apr 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.

Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment thread sources/packages/backend/workflow/test/models/assessment.model.ts Outdated
Comment thread sources/packages/forms/src/form-definitions/parentcurrentyearincomeappeal.json Outdated
Comment on lines 1782 to 1784
<bpmn:sequenceFlow id="Flow_0163xsr" name="Yes" sourceRef="Gateway_0zn0cny" targetRef="Event_0q2arco">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=studentDataParents[1].currentYearParentIncome != null</bpmn:conditionExpression>
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=appealsParentCurrentYearIncomeAppealData[1].currentYearParentIncome != null</bpmn:conditionExpression>
</bpmn:sequenceFlow>
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gateway condition accesses appealsParentCurrentYearIncomeAppealData[1].currentYearParentIncome directly. If appealsParentCurrentYearIncomeAppealData is null/undefined (no appeal submitted) or shorter than expected (e.g., single parent), FEEL evaluation can fail depending on null/index semantics. Guard the condition (e.g., check the list is defined and has the index) before dereferencing.

Copilot uses AI. Check for mistakes.
@weskubo-cgi weskubo-cgi marked this pull request as ready for review April 16, 2026 00:44
@sh16011993 sh16011993 self-requested a review April 16, 2026 14:11
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData(
"Add-parent-current-year-income.sql",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Just like the filename, this can also be suffixed with the word appeal indicating that this form is a student appeal.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.3% ( 4651 / 22906 )
Methods: 9.8% ( 274 / 2795 )
Lines: 24.65% ( 3979 / 16140 )
Branches: 10.02% ( 398 / 3971 )

@github-actions
Copy link
Copy Markdown

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 48.07% ( 2720 / 5658 )
Methods: 37.9% ( 285 / 752 )
Lines: 54.93% ( 2057 / 3745 )
Branches: 32.56% ( 378 / 1161 )

@github-actions
Copy link
Copy Markdown

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 80.98% ( 9398 / 11606 )
Methods: 80.75% ( 1225 / 1517 )
Lines: 84.34% ( 7054 / 8364 )
Branches: 64.87% ( 1119 / 1725 )

@github-actions
Copy link
Copy Markdown

E2E SIMS API Coverage Report

Totals Coverage
Statements: 68.14% ( 13627 / 19998 )
Methods: 65.51% ( 1626 / 2482 )
Lines: 71.33% ( 9804 / 13744 )
Branches: 58.24% ( 2197 / 3772 )

<bpmn:sequenceFlow id="Flow_0163xsr" name="Yes" sourceRef="Gateway_0zn0cny" targetRef="Event_0q2arco">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=studentDataParents[1].currentYearParentIncome != null</bpmn:conditionExpression>
<bpmn:sequenceFlow id="Flow_0163xsr" name="Appeal" sourceRef="Gateway_0zn0cny" targetRef="Event_0q2arco">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=appealsParentCurrentYearIncomeAppealData[1].currentYearParentIncome != null</bpmn:conditionExpression>
Copy link
Copy Markdown
Collaborator Author

@weskubo-cgi weskubo-cgi Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming a couple assumptions on this code:

  • Accessing by an index that isn't valid (e.g. empty array) will gracefully evaluate to null and not throw an error
  • The order of parents is consistent across the consolidated data and appeals data (which originates from the parent supplementary-data) since they are both sorted by id asc

@weskubo-cgi weskubo-cgi changed the title Feature #5722 - Parent current year income appeal #5722 - Parent current year income appeal Apr 16, 2026
@@ -0,0 +1,19 @@
-- Insert configuration for the parent current year income appeal form into the dynamic_form_configurations table.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if "Add-" or "Insert-" was preferred as there is a mix across the scripts. Happy to switch if wanted.

Copy link
Copy Markdown
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @weskubo-cgi 👍

<bpmn:sequenceFlow id="Flow_1pj43zf" name="No" sourceRef="Gateway_09wstv9" targetRef="Event_0sjmtg8">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=studentDataParents[2].currentYearParentIncome = null </bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_0f0wu98" name="Application or CRA" sourceRef="Gateway_0zn0cny" targetRef="Event_0yefgn7" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the paths below; it seems the labels are misplaced.

Image

I would recommend having both paths with the same flow organization instead of having them "mirrored".

assessmentConsolidatedData.studentDataDependantstatus =
dependantStatus as DependantStatusType;
// Need for dependant students
if (dependantStatus === "dependant") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but this type of check and data setup defeats a bit the idea of the for loop, IMO.

Still maybe not the case, but when some data setup is required, an approach like the below can be used.

const appealEligibilityScenarios = [
{
  dependantStatus: "dependant",
  expectedEligibility: true,
  inputData: {
    parent1TotalIncome: 99999,
    parent1CppEmployment: 500,
    parent1CppSelfemploymentOther: 200,
    parent1Ei: 600,
    parent1Tax: 700,
    parent1Contributions: 0,
    studentDataVoluntaryContributions: 0,
    studentDataParents: [
      {
        parentIsAbleToReport: YesNoOptions.Yes,
      },
    ],
  },
},
{
  dependantStatus: "independant",
  expectedEligibility: false,
},
];
// Arrange
const assessmentConsolidatedData = {
  ...createFakeConsolidatedFulltimeData(PROGRAM_YEAR),
  ...inputData,
}

).toBe(55000);
});

it("Should use the appeal current year income values when there is a parent current year income appeal for parent 1 and CRA reported income for parent 2 .", async () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the extra white space at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Camunda Worflow Involves camunda workflow changes E2E/Unit tests Form.io Form IO definitions changed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants