Skip to content

#404 - Cherry pick hotfix 4.2.1 to main - #6761

Open
sh16011993 wants to merge 8 commits into
mainfrom
cherry-pick-hotfix-4-2-1-to-main
Open

sh16011993 wants to merge 8 commits into
mainfrom
cherry-pick-hotfix-4-2-1-to-main

Conversation

@sh16011993

@sh16011993 sh16011993 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator
  • Cherry pick commit: 4.2.1 to main
  • Updated the e2e tests for the eligible parent contribution e2e tests

**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.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 21:30
@sh16011993 sh16011993 self-assigned this Oct 15, 2026
@sh16011993 sh16011993 added E2E/Unit tests Branch Sync-up Branch features move between main/release/hotfix branches. labels Oct 15, 2026

This comment was marked as resolved.

@sh16011993
sh16011993 marked this pull request as draft October 16, 2026 15:49
@sh16011993 sh16011993 changed the title Cherry pick hotfix 4 2 1 to main #404 - Cherry pick hotfix 4.2.1 to main Oct 16, 2026
@sh16011993
sh16011993 marked this pull request as ready for review October 16, 2026 18:06
assessmentConsolidatedData.parent1Contributions = 0;
assessmentConsolidatedData.parent1DependentTable = [
createFakeStudentDependentEligibleForContribution({
...createFakeStudentDependentsEligibleForContribution({

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.

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 andrewsignori-aot left a comment

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.

Nice work, please take a look at the below comment and share your thoughts.
https://github.com/bcgov/SIMS/pull/6761/changes#r4298152262

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.31% ( 5120 / 25207 )
Methods: 9.87% ( 302 / 3060 )
Lines: 24.61% ( 4333 / 17607 )
Branches: 10.68% ( 485 / 4540 )

@github-actions

Copy link
Copy Markdown

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 48.51% ( 2987 / 6158 )
Methods: 38.5% ( 313 / 813 )
Lines: 55.29% ( 2254 / 4077 )
Branches: 33.12% ( 420 / 1268 )

@github-actions

Copy link
Copy Markdown

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 81.23% ( 10173 / 12523 )
Methods: 81% ( 1330 / 1642 )
Lines: 84.59% ( 7586 / 8968 )
Branches: 65.71% ( 1257 / 1913 )

@github-actions

Copy link
Copy Markdown

E2E SIMS API Coverage Report

Totals Coverage
Statements: 71.31% ( 15735 / 22067 )
Methods: 68.86% ( 1871 / 2717 )
Lines: 74.21% ( 11146 / 15019 )
Branches: 62.76% ( 2718 / 4331 )

This branch has not been deployed

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

Labels

Branch Sync-up Branch features move between main/release/hotfix branches. E2E/Unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants