Skip to content
3 changes: 2 additions & 1 deletion sims.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
"Overaward",
"overawards",
"partnerinformationandincomeappeal",
"parttime",
"PDAP",
"PDPPD",
"PDRJ",
Expand All @@ -217,12 +218,12 @@
"PTSSR",
"PTWTHD",
"roomandboardcostsappeal",
"stepparentwaiverappeal",
"SABC",
"sbsd",
"SFAS",
"siteprotected",
"SSRN",
"stepparentwaiverappeal",
"studentadditionaltransportationappeal",
"studentdependantsappeal",
"studentdisabilityappeal",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ export enum YesNoOptions {
No = "no",
}

/**
* Dependant relationship with student.
*/
export enum DependantRelationship {
Child = "child",
Spouse = "spouse",
ElderlyRelative = "elderlyRelative",
Other = "other",
}

/**
* Offering delivery options.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0ihicdz" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.42.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0" camunda:diagramRelationId="7a75e87a-6774-4e60-9a94-5dbbe3be143a">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0ihicdz" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.43.1" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0" camunda:diagramRelationId="7a75e87a-6774-4e60-9a94-5dbbe3be143a">
<bpmn:message id="Message_3q4oc02" name="Message_3q4oc02" />
<bpmn:collaboration id="Collaboration_1cf99un">
<bpmn:participant id="Participant_1mct69m" name="fulltime-assessment-2026-2027" processRef="fulltime-assessment-2026-2027" />
Expand Down Expand Up @@ -2333,7 +2333,8 @@ Map the correct 1 or 2 values for each of the values used to calculate income, d
<bpmn:intermediateThrowEvent id="Event_0bdny14" name="Family Size">
<bpmn:extensionElements>
<zeebe:ioMapping>
<zeebe:output source="=if studentDataRelationshipStatus = &#34;married&#34;&#10; then calculatedDataTotalEligibleDependants + 2&#10;else calculatedDataTotalEligibleDependants + 1" target="calculatedDataFamilySize" />
<zeebe:output source="=count(calculatedDataEligibleDependants [relationship != &#34;spouse&#34;])" target="calculatedDataTotalEligibleDependantsExcludingPartner" />
<zeebe:output source="=if studentDataRelationshipStatus = &#34;married&#34; then&#10; calculatedDataTotalEligibleDependantsExcludingPartner + 2&#10;else calculatedDataTotalEligibleDependants + 1" target="calculatedDataFamilySize" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>Flow_10v9e2q</bpmn:incoming>
Expand Down Expand Up @@ -2363,8 +2364,9 @@ TotalChildcareDependants: 11yo and younger and 12+ on taxes</bpmn:documentation>
<zeebe:output source="=if studentDataDependants = null then 0 else&#10;count(&#10; studentDataDependants[&#10; // dependent children under 0 - 18 months old (i.e until they are 19 months old) and not declared on taxes due to disability.&#10; date(item.dateOfBirth) &#62; (date(offeringStudyStartDate) - duration(&#34;P19M&#34;))&#10; and item.declaredOnTaxes = &#34;no&#34;]&#10;)" target="calculatedDataDependantInfantQuantity" />
<zeebe:output source="=if studentDataDependants = null then 0 else&#10;count(&#10; studentDataDependants[&#10; // Dependants who are declared on taxes due to disability.&#10; item.declaredOnTaxes = &#34;yes&#34;&#10; ]&#10;)" target="calculatedDataDependantDeclaredOnTaxesQuantity" />
<zeebe:output source="=if studentDataDependants = null then 0 else&#10;count(&#10; studentDataDependants[&#10; // Dependants who are aged between 19-22 years (i.e until they are 23 years old) and not declared on taxes due to disability&#10; date(item.dateOfBirth) &#60;= (date(offeringStudyStartDate) - duration(&#34;P19Y&#34;))&#10; and date(item.dateOfBirth) &#62; (date(offeringStudyStartDate) - duration(&#34;P23Y&#34;))&#10; and item.attendingPostSecondarySchool = &#34;yes&#34;&#10; and item.declaredOnTaxes = &#34;no&#34; ]&#10;)" target="calculatedDataDependantPostSecondaryQuantity" />
<zeebe:output source="=if studentDataDependants = null then 0 else&#10; count(&#10;studentDataDependants[&#10;// 0-18 years of age: eligible.&#10;date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10;// 19-22 years of age: post-sec must be Yes or Tax is Yes.&#10;or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10; and date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and (item.attendingPostSecondarySchool = &#34;yes&#34; or item.declaredOnTaxes = &#34;yes&#34;)&#10;)&#10;// &#62; 22 years: eligible if Tax is Yes.&#10;or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and item.declaredOnTaxes = &#34;yes&#34;&#10;)])" target="calculatedDataTotalEligibleDependants" />
<zeebe:output source="=if studentDataDependants = null then 0 else&#10;count(studentDataDependants[&#10; // Dependant who is between 0 and 11 years on study start date.&#10; // i.e. until the day(study start date) before their 12th birthday the dependant &#10; // is considered to be in this category.&#10; (&#10; date(item.dateOfBirth) &#62; (date(offeringStudyStartDate) - duration(&#34;P12Y&#34;))&#10; and date(item.dateOfBirth) &#60;= date(offeringStudyEndDate)&#10; )&#10; // Dependants who are declared on taxes due to disability and are 12 or over.&#10; or&#10; (&#10; date(item.dateOfBirth) &#60;= (date(offeringStudyStartDate) - duration(&#34;P12Y&#34;))&#10; and item.declaredOnTaxes = &#34;yes&#34;&#10; ) &#10;])" target="calculatedDataTotalChildcareDependants" />
<zeebe:output source="=if studentDataDependants = null then [] else&#10;studentDataDependants[&#10;// 0-18 years of age: eligible.&#10;date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10;// 19-22 years of age: post-sec must be Yes or Tax is Yes.&#10;or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10; and date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and (item.attendingPostSecondarySchool = &#34;yes&#34; or item.declaredOnTaxes = &#34;yes&#34;)&#10;)&#10;// &#62; 22 years: eligible if Tax is Yes.&#10;or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and item.declaredOnTaxes = &#34;yes&#34;&#10;)]" target="calculatedDataEligibleDependants" />
<zeebe:output source="=count(calculatedDataEligibleDependants)" target="calculatedDataTotalEligibleDependants" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>Flow_045kdko</bpmn:incoming>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0yotgp9" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.41.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0yotgp9" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.43.1" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0">
<bpmn:process id="load-assessment-consolidated-data" name="Load Assessment Consolidated Data" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:extensionElements />
Expand Down Expand Up @@ -58,7 +58,7 @@
<zeebe:header key="studentDataIncomeAssistanceAmount" value="data.incomeAssistanceAmount" />
<zeebe:header key="studentDataLivingWithPartner" value="data.livingWithPartner" />
<zeebe:header key="studentDataCRAReportedIncome" value="student.craReportedIncome" />
<zeebe:header key="studentDataDependants" value="data.dependants[].{&#10; &#34;dateOfBirth&#34;: dateOfBirth,&#10; &#34;declaredOnTaxes&#34;: declaredOnTaxes,&#10; &#34;attendingPostSecondarySchool&#34;: attendingPostSecondarySchool&#10;}" />
<zeebe:header key="studentDataDependants" value="data.dependants[].{&#10; &#34;dateOfBirth&#34;: dateOfBirth,&#10; &#34;declaredOnTaxes&#34;: declaredOnTaxes,&#10; &#34;attendingPostSecondarySchool&#34;: attendingPostSecondarySchool,&#10; &#34;relationship&#34;: relationship&#10;}" />
<zeebe:header key="studentDataGovernmentFundingCosts" value="data.governmentFundingCosts" />
<zeebe:header key="studentDataNonGovernmentFundingCosts" value="data.nonGovernmentFundingCosts" />
<zeebe:header key="studentDataParentVoluntaryContributionsCosts" value="data.parentvoluntarycontributionsCosts" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0ihicdz" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.42.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0" camunda:diagramRelationId="7a75e87a-6774-4e60-9a94-5dbbe3be143a">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0ihicdz" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.43.1" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0" camunda:diagramRelationId="7a75e87a-6774-4e60-9a94-5dbbe3be143a">
<bpmn:message id="Message_3q4oc02" name="Message_3q4oc02" />
<bpmn:collaboration id="Collaboration_1cf99un">
<bpmn:participant id="Participant_1mct69m" name="parttime-assessment-2026-2027" processRef="parttime-assessment-2026-2027" />
Expand Down Expand Up @@ -638,7 +638,8 @@ dmnX (comes from dmn)</bpmn:text>
<bpmn:intermediateThrowEvent id="Event_1k4n9fq" name="calculatedDataFamilySize">
<bpmn:extensionElements>
<zeebe:ioMapping>
<zeebe:output source="=calculatedDataTotalEligibleDependants + 2" target="calculatedDataFamilySize" />
<zeebe:output source="=count(calculatedDataEligibleDependants [relationship != &#34;spouse&#34;])" target="calculatedDataTotalEligibleDependantsExcludingPartner" />
<zeebe:output source="=calculatedDataTotalEligibleDependantsExcludingPartner + 2" target="calculatedDataFamilySize" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1ekiozl</bpmn:incoming>
Expand Down Expand Up @@ -1094,7 +1095,8 @@ dmnX (comes from dmn)</bpmn:text>
<bpmn:intermediateThrowEvent id="Event_1du7pjb" name="Calculate Eligible Dependents">
<bpmn:extensionElements>
<zeebe:ioMapping>
<zeebe:output source="=count(&#10; calculatedDataDependants[&#10; // 0-18 years of age: eligible.&#10; date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10; // 19-22 years of age: post-sec must be Yes or Tax is Yes.&#10; or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10; and date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and (item.attendingPostSecondarySchool = &#34;yes&#34; or item.declaredOnTaxes = &#34;yes&#34;)&#10; )&#10; // &#62; 22 years: eligible if Tax is Yes.&#10; or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and item.declaredOnTaxes = &#34;yes&#34;&#10; )&#10; ]&#10; )" target="calculatedDataTotalEligibleDependants" />
<zeebe:output source="=calculatedDataDependants[&#10; // 0-18 years of age: eligible.&#10; date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10; // 19-22 years of age: post-sec must be Yes or Tax is Yes.&#10; or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P18Y&#34;))&#10; and date(item.dateOfBirth) &#62;= (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and (item.attendingPostSecondarySchool = &#34;yes&#34; or item.declaredOnTaxes = &#34;yes&#34;)&#10; )&#10; // &#62; 22 years: eligible if Tax is Yes.&#10; or (&#10; date(item.dateOfBirth) &#60; (date(offeringStudyStartDate) - duration(&#34;P22Y&#34;))&#10; and item.declaredOnTaxes = &#34;yes&#34;&#10; )&#10;]" target="calculatedDataEligibleDependants" />
<zeebe:output source="=count(calculatedDataEligibleDependants)" target="calculatedDataTotalEligibleDependants" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0c6lc7n</bpmn:incoming>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import { DependantRelationship } from "@sims/test-utils";
import { PROGRAM_YEAR } from "../../constants/program-year.constants";
import {
createFakeConsolidatedFulltimeData,
executeFullTimeAssessmentForProgramYear,
ZeebeMockedClient,
} from "../../../test-utils";
import {
createFakeStudentDependentEligible,
createFakeStudentDependentNotEligible,
DependentEligibility,
} from "../../../test-utils/factories";

describe(`E2E Test Workflow fulltime-assessment-${PROGRAM_YEAR}-family-size.`, () => {
it("Should correctly calculate the family size count when one or more dependants provided in the application has relationship type 'spouse'.", async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedFulltimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataRelationshipStatus = "married";
assessmentConsolidatedData.studentDataIsYourPartnerAbleToReport = true;
assessmentConsolidatedData.partner1CRAReportedIncome = 22999;
assessmentConsolidatedData.studentDataDependants = [
createFakeStudentDependentEligible(
DependentEligibility.Eligible18To22YearsOldDeclaredOnTaxes,
),
];
const [dependent] = assessmentConsolidatedData.studentDataDependants;
dependent.relationship = DependantRelationship.Spouse;
assessmentConsolidatedData.studentDataDependants = [dependent];
Comment on lines +27 to +29
Copy link
Collaborator

@dheepak-aot dheepak-aot Jan 31, 2026

Choose a reason for hiding this comment

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

This part of code can be removed now by using the factory options this way.

assessmentConsolidatedData.studentDataDependants = [
      createFakeStudentDependentEligible(
        DependentEligibility.Eligible18To22YearsOldDeclaredOnTaxes,
        { relationship: DependantRelationship.Spouse },
      ),
    ];


// Act
const calculatedAssessment = await executeFullTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataTotalEligibleDependants,
).toBe(1);
expect(calculatedAssessment.variables.calculatedDataFamilySize).toBe(2);
});

it(
"Should correctly calculate the family size count when student relationship status is married and one dependant is provided in the application with relationship type spouse " +
" and not declared on taxes for disability.",
Comment on lines +45 to +46
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a space on both the lines, please use the space on one of the lines only.

async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedFulltimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataRelationshipStatus = "married";
assessmentConsolidatedData.studentDataIsYourPartnerAbleToReport = true;
assessmentConsolidatedData.partner1CRAReportedIncome = 22999;
assessmentConsolidatedData.studentDataDependants = [
createFakeStudentDependentNotEligible(
DependentEligibility.Eligible18To22YearsOldDeclaredOnTaxes,
),
];
const [dependent] = assessmentConsolidatedData.studentDataDependants;
dependent.relationship = DependantRelationship.Spouse;
Comment on lines +58 to +60
Copy link
Collaborator

Choose a reason for hiding this comment

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

assessmentConsolidatedData.studentDataDependants = [dependent];

// Act
const calculatedAssessment =
await executeFullTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataTotalEligibleDependants,
).toBe(0);
expect(calculatedAssessment.variables.calculatedDataFamilySize).toBe(2);
},
);

it(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same double space here.

"Should correctly calculate the family size count when student relationship status is married and one dependant is provided in the application with relationship type child " +
" and declared on taxes for disability.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedFulltimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataRelationshipStatus = "married";
assessmentConsolidatedData.studentDataIsYourPartnerAbleToReport = true;
assessmentConsolidatedData.partner1CRAReportedIncome = 22999;
assessmentConsolidatedData.studentDataDependants = [
createFakeStudentDependentEligible(
DependentEligibility.EligibleOver22YearsOld,
),
];

// Act
const calculatedAssessment =
await executeFullTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataTotalEligibleDependants,
).toBe(1);
expect(calculatedAssessment.variables.calculatedDataFamilySize).toBe(3);
},
);

afterAll(async () => {
// Closes the singleton instance created during test executions.
await ZeebeMockedClient.getMockedZeebeInstance().close();
});
});
Loading