#5397 - Non-punitive Withdrawal Form and Accept Action#5965
#5397 - Non-punitive Withdrawal Form and Accept Action#5965sh16011993 wants to merge 29 commits intomainfrom
Conversation
This reverts commit 810d8de.
There was a problem hiding this comment.
Pull request overview
Adds support for a new Non-punitive Withdrawal student form and the related backend processing to mark a withdrawal as non-punitive, plus UI indicators to display the status in assessment history.
Changes:
- Introduces a new Form.io form definition (
nonpunitivewithdrawalform) that lets a student pick an eligible withdrawal and attest to qualifying circumstances. - Adds a new form-submission action + supplementary data loader to update
StudentScholasticStandingwith the approvingFormSubmissionItemreference. - Exposes and displays the new
nonPunitiveFormSubmissionItemIdflag through API DTOs and the web UI (chip tag + styling).
Reviewed changes
Copilot reviewed 60 out of 64 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| sources/packages/web/src/services/http/dto/Assessment.dto.ts | Adds nonPunitiveFormSubmissionItemId to assessment history DTO used by the web app. |
| sources/packages/web/src/components/common/students/assessment/AssessmentTags.vue | Shows a new “Non-Punitive” chip when the non-punitive form submission item ID is present. |
| sources/packages/web/src/assets/css/base.scss | Adds styling for the non-punitive chip tag. |
| sources/packages/forms/src/form-definitions/nonpunitivewithdrawalform.json | New student form definition that drives the non-punitive withdrawal request workflow. |
| sources/packages/backend/libs/sims-db/src/entities/student-scholastic-standing.model.ts | Adds DB-mapped field nonPunitiveFormSubmissionItemId to scholastic standings. |
| sources/packages/backend/libs/sims-db/src/entities/form-submission-item.model.ts | Adds new FormSubmissionActionType.UpdateNonPunitiveScholasticStandingWithdrawal. |
| sources/packages/backend/apps/db-migrations/src/sql/StudentScholasticStandings/Add-non-punitive-form-submission-item-id-col.sql | Adds the new DB column. |
| sources/packages/backend/apps/db-migrations/src/sql/StudentScholasticStandings/Rollback-add-non-punitive-form-submission-item-id-col.sql | Rolls back the new DB column. |
| sources/packages/backend/apps/db-migrations/src/migrations/1774023773932-AddNonPunitiveFormSubmissionItemIdCol.ts | Migration wiring for the SQL add/rollback scripts. |
| sources/packages/backend/apps/api/src/types/formSubmissionData.ts | Adds ApplicationWithdrawals type used for supplementary data to the form. |
| sources/packages/backend/apps/api/src/services/student-assessment/student-assessment.service.ts | Includes nonPunitiveFormSubmissionItemId in assessment history query selection. |
| sources/packages/backend/apps/api/src/services/index.ts | Re-exports the new form-submission action class. |
| sources/packages/backend/apps/api/src/services/form-submission/form-supplementary-data/index.ts | Re-exports the new supplementary data loader. |
| sources/packages/backend/apps/api/src/services/form-submission/form-supplementary-data/form-supplementary-data-scholastic-standing-withdrawals.ts | New loader that returns eligible withdrawals for the student to choose from. |
| sources/packages/backend/apps/api/src/services/form-submission/form-supplementary-data/form-supplementary-data-loader.ts | Registers the new supplementary data loader. |
| sources/packages/backend/apps/api/src/services/form-submission/form-submission.models.ts | Adds new known supplementary data key + typing. |
| sources/packages/backend/apps/api/src/services/form-submission/form-submission-approval.service.ts | Blocks form submission decisions if the related application is archived. |
| sources/packages/backend/apps/api/src/services/form-submission/form-submission-actions/form-submission-update-non-punitive-scholastic-standing-withdrawal.ts | New action that updates the target StudentScholasticStanding on approval. |
| sources/packages/backend/apps/api/src/services/form-submission/form-submission-actions/form-submission-action-processor.ts | Wires action processing to include submissionStatus/submittedData for the new action. |
| sources/packages/backend/apps/api/src/services/form-submission/form-submission-actions/form-submission-action-models.ts | Extends action model to include submittedData and submissionStatus. |
| sources/packages/backend/apps/api/src/route-controllers/form-submission/form-submission.aest.controller.ts | Updates Swagger descriptions for new failure modes. |
| sources/packages/backend/apps/api/src/route-controllers/assessment/models/assessment.dto.ts | Adds nonPunitiveFormSubmissionItemId to API output DTO. |
| sources/packages/backend/apps/api/src/route-controllers/assessment/assessment.controller.service.ts | Maps the new property into assessment history DTO output. |
| sources/packages/backend/apps/api/src/app.students.module.ts | Registers supplementary loader in Students module providers. |
| sources/packages/backend/apps/api/src/app.aest.module.ts | Registers supplementary loader + new action in AEST module providers. |
Files not reviewed (4)
- sources/packages/backend/package-lock.json: Language not supported
- sources/packages/forms/package-lock.json: Language not supported
- sources/packages/load-test/package-lock.json: Language not supported
- sources/packages/web/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
sources/packages/backend/apps/api/src/route-controllers/form-submission/form-submission.aest.controller.ts:216
- The
@ApiUnprocessableEntityResponsedescription string ends without a period and is inconsistent with the surrounding sentences in the same description. Add a trailing period to keep the API docs consistent/readable.
*/
...ubmission/form-supplementary-data/form-supplementary-data-scholastic-standing-withdrawals.ts
Outdated
Show resolved
Hide resolved
sources/packages/forms/src/form-definitions/nonpunitivewithdrawalform.json
Show resolved
Hide resolved
sources/packages/forms/src/form-definitions/nonpunitivewithdrawalform.json
Show resolved
Hide resolved
sources/packages/forms/src/form-definitions/nonpunitivewithdrawalform.json
Show resolved
Hide resolved
...mission-actions/form-submission-update-non-punitive-scholastic-standing-withdrawal-action.ts
Show resolved
Hide resolved
...orm-submission-actions/form-submission-update-non-punitive-scholastic-standing-withdrawal.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/libs/sims-db/src/entities/student-scholastic-standing.model.ts
Outdated
Show resolved
Hide resolved
- Resolved conflict with main branch
- Added non-punitive banner - Fixed failing e2e tests
- Fixed failing e2e test
- Added e2e tests
…/form-submission-actions/form-submission-update-non-punitive-scholastic-standing-withdrawal.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/form-supplementary-data/form-supplementary-data-scholastic-standing-withdrawals.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…on to FormSubmissionItem Agent-Logs-Url: https://github.com/bcgov/SIMS/sessions/2c557f89-5c21-468b-8e38-8810c3468ff3 Co-authored-by: sh16011993 <7859295+sh16011993@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…e relation to FormSubmissionItem" This reverts commit b9ca3d5. Co-authored-by: sh16011993 <7859295+sh16011993@users.noreply.github.com>
- Copilot Review Comments
- Fixed failing tests
- File name update
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 37 out of 37 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
sources/packages/backend/apps/api/src/route-controllers/form-submission/form-submission.aest.controller.ts:284
- The
completeendpoint behavior now includes non-punitive withdrawal processing, but there is no corresponding e2e test forFormSubmissionAESTController.completeFormSubmissionto cover success/failure paths (including thatnon_punitive_form_submission_item_idis set only when validations pass). Please add an e2e spec following the[feature-name].[client-type].controller.[method-name].e2e-spec.tsconvention.
@ApiUnprocessableEntityResponse({
description:
"Final decision cannot be made on a form submission with status different than pending or " +
"the provided form submission items do not match the form submission items currently saved for this submission or " +
"form submission item not found in the form submission or " +
"form submission item has been updated since it was last retrieved or " +
"final decision cannot be made when some decisions are still pending or " +
"the application associated with the form submission is not in completed status or is archived or " +
"failed to update the non-punitive scholastic standing withdrawal or " +
"form submission item is not in the approved status. Non-punitive scholastic standing withdrawal can only be updated for an approved form.",
})
@Roles(...FORM_SUBMISSION_UPDATE_ROLES)
@Patch(":formSubmissionId/complete")
async completeFormSubmission(
...mission-actions/form-submission-update-non-punitive-scholastic-standing-withdrawal-action.ts
Show resolved
Hide resolved
sources/packages/forms/src/form-definitions/nonpunitivewithdrawalform.json
Outdated
Show resolved
Hide resolved
sources/packages/backend/apps/api/src/types/formSubmissionData.ts
Outdated
Show resolved
Hide resolved
...es/backend/apps/api/src/route-controllers/form-submission/form-submission.aest.controller.ts
Outdated
Show resolved
Hide resolved
...mission-actions/form-submission-update-non-punitive-scholastic-standing-withdrawal-action.ts
Show resolved
Hide resolved
- reverted `isArchived`
…walform.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Added extra line in base.scss
|



As a part of this PR, the following were completed:
non_punitive_form_submission_item_idRollback Screenshot:
nonPunitiveFormSubmissionItemIdon form approval given it meets the required validations. Updated the errors thrown in case the required validations aren't metMinistry View:
Ministry View (application versions):
Institution View:
Student View:
Added the non-punitive banner to the View Request Scholastic Standing page for all clients (except institution as it does not have the ability to view the scholastic standing form):
Ministry View (with scholastic standing reversed):
Ministry View (without scholastic standing reversed):
Student View:
Supplementary data validations for scholasticStandingWithdrawals.
√ Should get supplementary data for scholasticStandingWithdrawals when there is a scholastic standing of change type Student withdrew from program that is not reversed and a non punitive withdrawal form has not been previously submitted for this application.
√ Should not return supplementary data for scholasticStandingWithdrawals when there is a scholastic standing of change type Student withdrew from program that is not reversed and a non punitive withdrawal form has not been previously submitted for this application but the application has been archived.
√ Should not return supplementary data for scholasticStandingWithdrawals when the Student withdrew from program scholastic standing is reversed.
√ Should not return supplementary data for scholasticStandingWithdrawals when the Student withdrew from program scholastic standing has a non punitive withdrawal form that is previously submitted for this application.