Skip to content

#4517 - Bypass partner declaration exception (DV) #4651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 1, 2025

Conversation

andrewsignori-aot
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot commented Apr 30, 2025

  • Create a new DB enum entry for the marriedUnable option.
  • Adjusted backend conversions for federal integrations to follow the same codes used for Married,
  • Adjusted the "independent" logic in the Student Application to ensure it will be considered independant.
  • Created a new set of styles to allow a panel (container) customization as a banner that accepts child components (see image below).
  • Change the uploader information to use a single component and a single new CSS class file-upload-info-container.

Full-time Student application

image

Some styles were adjusted to ensure the validation message followed the others.

image

Ministry New Exception

image

TODO

  • Add some E2E tests for integrations using the new marriedUnable option.
  • Execute the same changes on part-time.

Migration Revert

image

Removed Citizenship for permanent residency

"Citizenship for permanent residency" was removed as part of #4662

@andrewsignori-aot andrewsignori-aot added Student Student Features SIMS-Api SIMS-Api Form.io Form IO definitions changed. labels Apr 30, 2025
@andrewsignori-aot andrewsignori-aot self-assigned this Apr 30, 2025
Copy link
Contributor

@Copilot 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

This PR introduces a new relationship status ("marriedUnable") to support partner declaration exceptions and aligns backend logic to incorporate this change. Key updates include:

  • Expanding type definitions and enums to include "marriedUnable".
  • Updating conversion functions in the utility module to map both Married and MarriedUnable to the same codes.
  • Adding a new DB migration to insert the new status into the database.

Reviewed Changes

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

File Description
sources/packages/backend/workflow/test/models/assessment.model.ts Updated the RelationshipStatusType union to include "marriedUnable".
sources/packages/backend/libs/utilities/src/esdc-utils.ts Modified conversion functions (getMaritalStatusCode and getPartTimeMaritalStatusCode) to include a case for "MarriedUnable".
sources/packages/backend/libs/sims-db/src/entities/relationship-status.type.ts Added a new enum entry for MarriedUnable with proper documentation.
sources/packages/backend/apps/db-migrations/src/migrations/1745962287131-AddRelationshipStatusMarriedUnable.ts Introduced a migration for adding the new relationship status.
Files not reviewed (4)
  • sources/packages/backend/apps/db-migrations/src/sql/Types/Add-relationship-status-married-unable.sql: Language not supported
  • sources/packages/backend/apps/db-migrations/src/sql/Types/Rollback-add-relationship-status-married-unable.sql: Language not supported
  • sources/packages/forms/src/form-definitions/studentexceptions.json: Language not supported
  • sources/packages/web/src/assets/css/formio-shared.scss: Language not supported
Comments suppressed due to low confidence (2)

sources/packages/backend/libs/utilities/src/esdc-utils.ts:17

  • Consider adding tests to verify that both RelationshipStatus.Married and RelationshipStatus.MarriedUnable correctly map to the expected marital status code for the MSFAA request file.
switch (maritalStatus) {

sources/packages/backend/libs/utilities/src/esdc-utils.ts:62

  • Consider adding tests to ensure getPartTimeMaritalStatusCode handles RelationshipStatus.MarriedUnable in the same way as RelationshipStatus.Married, returning the correct status code.
switch (maritalStatus) {

@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review April 30, 2025 23:52
@dheepak-aot dheepak-aot self-requested a review May 1, 2025 20:28
'married',
'single',
'other',
'marriedUnable'
Copy link
Collaborator

@dheepak-aot dheepak-aot May 1, 2025

Choose a reason for hiding this comment

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

The AC specifies the value as married unable with a space.
image

Is the business ok with the given value?

Copy link
Collaborator Author

@andrewsignori-aot andrewsignori-aot May 1, 2025

Choose a reason for hiding this comment

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

In general, we do not use dropdown values with white spaces, doing this for these seems against what we did for others.
Business can have an opinion about how it can potentially be displayed to the user, but how we persist will be a technical decision.
My understanding on the "provided AC value" was a suggestion on how to shorten the pretty long option.

Copy link
Collaborator

@dheepak-aot dheepak-aot May 1, 2025

Choose a reason for hiding this comment

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

I asked the same as this information goes raw to SDPR response as well.

Also there is an IER flag hasPartner which is based on marital status. Does it need to be taken care later? or should we follow the same path like other integrations here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does not seem to be in the scope or planned for this ticket, but it would be worth asking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Business updated the AC to state: marriedUnable.

@sh16011993 sh16011993 self-requested a review May 1, 2025 21:06
@@ -12465,7 +13177,7 @@
},
"properties": {},
"calculateServer": true,
"calculateValue": "// If the intensity is Part-time, student is always considered 'independant'.\r\nif (data.howWillYouBeAttendingTheProgram === \"Part Time\") {\r\n instance.setValue(\"independant\");\r\n}\r\n// If the intensity is Full-time, dependant status is calculated based on personal information answers.\r\nelse if (data.howWillYouBeAttendingTheProgram === \"Full Time\") {\r\n const isStudentIndependant =\r\n data.hasDependents === \"yes\" ||\r\n [\"married\", \"other\"].includes(data.relationshipStatus) ||\r\n data.outOfHighSchoolFor4Years === \"yes\" ||\r\n data.fulltimelabourForce === \"yes\" ||\r\n data.parentsDeceased === \"yes\" ||\r\n data.estranged === \"yes\" ||\r\n data.custodyOfChildWelfare === \"yes\";\r\n // If the student is not independant, dependant status is calculated based on personal information answer inputs.\r\n if (!isStudentIndependant) {\r\n const isPersonalInfoAnswered =\r\n !!data.hasDependents &&\r\n !!data.relationshipStatus &&\r\n !!data.outOfHighSchoolFor4Years &&\r\n !!data.fulltimelabourForce &&\r\n !!data.parentsDeceased &&\r\n !!data.estranged &&\r\n !!data.youthInCare &&\r\n (data.youthInCare === \"no\" || !!data.custodyOfChildWelfare);\r\n // If the answers to required personal information inputs are not provided, set the dependant status to null.\r\n // Otherwise, dependant status is calculated based on personal information answers.\r\n const calculatedStatusFromPersonalInfo = isPersonalInfoAnswered\r\n ? \"dependant\"\r\n : null;\r\n instance.setValue(calculatedStatusFromPersonalInfo);\r\n } else {\r\n instance.setValue(\"independant\");\r\n }\r\n}\r\n// If the intensity is not provided, set the value to null.\r\nelse {\r\n instance.setValue(null);\r\n}\r\n ",
"calculateValue": "// If the intensity is Part-time, student is always considered 'independant'.\r\nif (data.howWillYouBeAttendingTheProgram === \"Part Time\") {\r\n instance.setValue(\"independant\");\r\n}\r\n// If the intensity is Full-time, dependant status is calculated based on personal information answers.\r\nelse if (data.howWillYouBeAttendingTheProgram === \"Full Time\") {\r\n const isStudentIndependant =\r\n data.hasDependents === \"yes\" ||\r\n [\"married\", \"other\", \"marriedUnable\"].includes(data.relationshipStatus) ||\r\n data.outOfHighSchoolFor4Years === \"yes\" ||\r\n data.fulltimelabourForce === \"yes\" ||\r\n data.parentsDeceased === \"yes\" ||\r\n data.estranged === \"yes\" ||\r\n data.custodyOfChildWelfare === \"yes\";\r\n // If the student is not independant, dependant status is calculated based on personal information answer inputs.\r\n if (!isStudentIndependant) {\r\n const isPersonalInfoAnswered =\r\n !!data.hasDependents &&\r\n !!data.relationshipStatus &&\r\n !!data.outOfHighSchoolFor4Years &&\r\n !!data.fulltimelabourForce &&\r\n !!data.parentsDeceased &&\r\n !!data.estranged &&\r\n !!data.youthInCare &&\r\n (data.youthInCare === \"no\" || !!data.custodyOfChildWelfare);\r\n // If the answers to required personal information inputs are not provided, set the dependant status to null.\r\n // Otherwise, dependant status is calculated based on personal information answers.\r\n const calculatedStatusFromPersonalInfo = isPersonalInfoAnswered\r\n ? \"dependant\"\r\n : null;\r\n instance.setValue(calculatedStatusFromPersonalInfo);\r\n } else {\r\n instance.setValue(\"independant\");\r\n }\r\n}\r\n// If the intensity is not provided, set the value to null.\r\nelse {\r\n instance.setValue(null);\r\n}\r\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Comment on lines +856 to +858
.formio-component-weight-bold > div:first-child {
font-weight: $font-weight-bold;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of this particular css?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Apply a bold text to a component without interfering with other component items, for instance, error validators.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will add a comment.

@@ -457,6 +499,7 @@

.form-check-input {
position: inherit;
vertical-align: top;
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@dheepak-aot
Copy link
Collaborator

Great Job! One minor comment and a clarification.

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the clarifications. 👍

@andrewsignori-aot andrewsignori-aot requested a review from Copilot May 1, 2025 22:59
Copy link
Contributor

@Copilot 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

This PR implements the bypass partner declaration exception by introducing a new enum value "marriedUnable". Changes include updating the related type definitions, conversion logic in the backend utility functions, and adding a new database migration for the enum update.

  • Updated RelationshipStatusType and RelationshipStatus enum to include "marriedUnable".
  • Modified the marital status conversion functions in esdc-utils to support the new option.
  • Added a new migration for updating the database with the "marriedUnable" option.

Reviewed Changes

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

File Description
sources/packages/backend/workflow/test/models/assessment.model.ts Extended the RelationshipStatusType to include "marriedUnable".
sources/packages/backend/libs/utilities/src/esdc-utils.ts Updated conversion functions (MSFAA and Part-Time) to group Married and MarriedUnable statuses.
sources/packages/backend/libs/sims-db/src/entities/relationship-status.type.ts Added the MarriedUnable enum with accompanying documentation.
sources/packages/backend/apps/db-migrations/src/migrations/1745962287131-AddRelationshipStatusMarriedUnable.ts Created a migration for the new MarriedUnable enum value.
Files not reviewed (4)
  • sources/packages/backend/apps/db-migrations/src/sql/Types/Add-relationship-status-married-unable.sql: Language not supported
  • sources/packages/backend/apps/db-migrations/src/sql/Types/Rollback-add-relationship-status-married-unable.sql: Language not supported
  • sources/packages/forms/src/form-definitions/studentexceptions.json: Language not supported
  • sources/packages/web/src/assets/css/formio-shared.scss: Language not supported
Comments suppressed due to low confidence (1)

sources/packages/backend/workflow/test/models/assessment.model.ts:51

  • Ensure that the new 'marriedUnable' enum value is consistently handled in all partner information and income logic across the codebase.
  | "marriedUnable";

Copy link

sonarqubecloud bot commented May 1, 2025

Copy link

github-actions bot commented May 1, 2025

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 21.83% ( 4015 / 18390 )
Methods: 9.91% ( 233 / 2352 )
Lines: 25.2% ( 3470 / 13771 )
Branches: 13.76% ( 312 / 2267 )

Copy link

github-actions bot commented May 1, 2025

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 72.47% ( 679 / 937 )
Methods: 73.45% ( 83 / 113 )
Lines: 74.58% ( 531 / 712 )
Branches: 58.04% ( 65 / 112 )

Copy link
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.

Great work @andrewsignori-aot 👍

@andrewsignori-aot andrewsignori-aot added this pull request to the merge queue May 1, 2025
Merged via the queue into main with commit 45f2e2d May 1, 2025
20 checks passed
@andrewsignori-aot andrewsignori-aot deleted the feature/#4517-full-time-form-updates branch May 1, 2025 23:35
Copy link

github-actions bot commented May 1, 2025

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 85.75% ( 1511 / 1762 )
Methods: 83.41% ( 171 / 205 )
Lines: 88.12% ( 1246 / 1414 )
Branches: 65.73% ( 94 / 143 )

Copy link

github-actions bot commented May 1, 2025

E2E SIMS API Coverage Report

Totals Coverage
Statements: 71.28% ( 6772 / 9500 )
Methods: 69.45% ( 839 / 1208 )
Lines: 74.75% ( 5252 / 7026 )
Branches: 53.79% ( 681 / 1266 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Form.io Form IO definitions changed. SIMS-Api SIMS-Api Student Student Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants