Repository navigation
#404 - Cherry pick hotfix 4.2.1 to main - #6761
sh16011993 wants to merge 8 commits into
Conversation
**Summary** - Corrected the 2026–2027 full-time assessment DMN weekly MSOL allowance values for single students away from home, single parents, married students and spouses, and each dependent.
| assessmentConsolidatedData.parent1Contributions = 0; | ||
| assessmentConsolidatedData.parent1DependentTable = [ | ||
| createFakeStudentDependentEligibleForContribution({ | ||
| ...createFakeStudentDependentsEligibleForContribution({ |
There was a problem hiding this comment.
I do not see an array as a default pattern for the factory methods for dependents. Since it is a hotfix, we can execute the minimal E2E to cover the fix. That said, can you please consider the adjustment below to the factory to allow the scenarios below, which seems to be more expressive and easier to read?
Note: not all E2E scenarios need to test all of these, but it would be good if these variations below are included.
assessmentConsolidatedData.parent1DependentTable = [
// 15 years old attending post-secondary school (eligible for contribution).
createFakeStudentDependentsForContribution({
referenceDate: assessmentConsolidatedData.offeringStudyStartDate,
age: 15,
attendingPostSecondarySchool: YesNoOptions.Yes,
}),
// 15 years old attending not post-secondary school (not eligible for contribution).
createFakeStudentDependentsForContribution({
referenceDate: assessmentConsolidatedData.offeringStudyStartDate,
age: 15,
attendingPostSecondarySchool: YesNoOptions.No,
}),
// On the day completing 23 years old (not eligible for contribution).
createFakeStudentDependentsForContribution({
referenceDate: assessmentConsolidatedData.offeringStudyStartDate,
age: 23,
attendingPostSecondarySchool: YesNoOptions.Yes,
}),
// One day before completing 23 years old (eligible for contribution).
createFakeStudentDependentsForContribution({
referenceDate: assessmentConsolidatedData.offeringStudyStartDate,
age: 23,
attendingPostSecondarySchool: YesNoOptions.Yes,
daysOffSet: -1,
}),
];New factory method
* Creates student dependents at contribution eligibility age boundaries.
* @param options Options for constructing the dependent.
* - `referenceDate` Reference date used to calculate the dependents' birthdays.
* - `age` Age of the dependent.
* - `attendingPostSecondarySchool` Whether the dependent is attending post-secondary school.
* - `daysOffSet` Optional number of days to offset the dependent's birthday.
* @returns Dependents eligible for contribution based on their age and school attendance.
*/
export function createFakeStudentDependentsForContribution(options: {
referenceDate: Date | string;
age: number;
attendingPostSecondarySchool: YesNoOptions;
daysOffSet?: number;
}): StudentDependent {
let dateOfBirth = addToDateOnlyString(
options.referenceDate,
-options.age,
"years",
);
if (options.daysOffSet) {
dateOfBirth = addToDateOnlyString(dateOfBirth, options.daysOffSet, "day");
}
return {
dateOfBirth,
attendingPostSecondarySchool: options.attendingPostSecondarySchool,
// Not relevant for the contribution eligibility calculation.
declaredOnTaxes: YesNoOptions.No,
// Not relevant for the contribution eligibility calculation.
relationship: DependantRelationship.Child,
};
}
andrewsignori-aot
left a comment
There was a problem hiding this comment.
Nice work, please take a look at the below comment and share your thoughts.
https://github.com/bcgov/SIMS/pull/6761/changes#r4298152262
|



Uh oh!
There was an error while loading. Please reload this page.