Skip to content

#5397 - Non-punitive Withdrawal Form and Accept Action#5965

Open
sh16011993 wants to merge 29 commits intomainfrom
feature/#5397-non-punitive-withdrawal-form
Open

#5397 - Non-punitive Withdrawal Form and Accept Action#5965
sh16011993 wants to merge 29 commits intomainfrom
feature/#5397-non-punitive-withdrawal-form

Conversation

@sh16011993
Copy link
Copy Markdown
Collaborator

@sh16011993 sh16011993 commented Mar 26, 2026

As a part of this PR, the following were completed:

  • Added the database migrations for the newly added column: non_punitive_form_submission_item_id

Rollback Screenshot:

image
  • Added the non-punitive withdrawal form
image
  • Red banner when None of the above is selected in the form
image
  • Validation check when some other option is selected along with None of the above
image
  • Added relevant logic to retrieve the supplementary data for the Non-punitive withdrawal
image
  • Added relevant logic to apply the action of storing the nonPunitiveFormSubmissionItemId on form approval given it meets the required validations. Updated the errors thrown in case the required validations aren't met

  • Added the Non-punitive chip for all clients:

Ministry View:

5397_8

Ministry View (application versions):

5397_7

Institution View:

5397_9

Student View:

5397_6

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):

5397_5

Ministry View (without scholastic standing reversed):

5397_4

Student View:

5397_3
  • Added the following e2e tests:

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.

image

Copilot AI review requested due to automatic review settings March 26, 2026 17:19
@sh16011993 sh16011993 marked this pull request as draft March 26, 2026 17:19
@sh16011993 sh16011993 self-assigned this Mar 26, 2026
@sh16011993 sh16011993 added Student Student Features Institution Institution Features Ministry Ministry Features SIMS-Api SIMS-Api DB DB migration involved Web portal Form.io Form IO definitions changed. E2E/Unit tests labels Mar 26, 2026
Copy link
Copy Markdown
Contributor

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

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 StudentScholasticStanding with the approving FormSubmissionItem reference.
  • Exposes and displays the new nonPunitiveFormSubmissionItemId flag 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 @ApiUnprocessableEntityResponse description 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.
   */

sh16011993 and others added 8 commits March 26, 2026 10:28
- 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>
Copy link
Copy Markdown

Copilot AI commented Mar 27, 2026

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:

  • scarf.sh
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./report.js ../deps/cpu_features/include/internal --64 rev-�� cpu_features/deps/cpu_features/src/impl_ppc_linux.o.d.raw | grep -v &#39;^$&#39; as (dns block)

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
Copilot AI and others added 2 commits March 27, 2026 21:43
…ne relation to FormSubmissionItem"

This reverts commit 61cfdc4.

Co-authored-by: sh16011993 <7859295+sh16011993@users.noreply.github.com>
…rawal-form' into feature/#5397-non-punitive-withdrawal-form
- Fixed failing tests
- File name update
Copy link
Copy Markdown
Contributor

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

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 complete endpoint behavior now includes non-punitive withdrawal processing, but there is no corresponding e2e test for FormSubmissionAESTController.completeFormSubmission to cover success/failure paths (including that non_punitive_form_submission_item_id is set only when validations pass). Please add an e2e spec following the [feature-name].[client-type].controller.[method-name].e2e-spec.ts convention.
  @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(

sh16011993 and others added 6 commits March 27, 2026 16:06
- 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
@github-actions
Copy link
Copy Markdown

E2E SIMS API Coverage Report

Totals Coverage
Statements: 66.87% ( 13314 / 19909 )
Methods: 64% ( 1575 / 2461 )
Lines: 70.29% ( 9623 / 13690 )
Branches: 56.31% ( 2116 / 3758 )

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 48.28% ( 2714 / 5621 )
Methods: 38.26% ( 285 / 745 )
Lines: 55.15% ( 2051 / 3719 )
Branches: 32.67% ( 378 / 1157 )

@github-actions
Copy link
Copy Markdown

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.12% ( 4594 / 22833 )
Methods: 9.43% ( 262 / 2778 )
Lines: 24.52% ( 3946 / 16096 )
Branches: 9.75% ( 386 / 3959 )

@github-actions
Copy link
Copy Markdown

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 79.33% ( 9157 / 11543 )
Methods: 78.47% ( 1181 / 1505 )
Lines: 82.66% ( 6883 / 8327 )
Branches: 63.88% ( 1093 / 1711 )

@sh16011993 sh16011993 marked this pull request as ready for review March 27, 2026 23:57
@andrewsignori-aot andrewsignori-aot self-requested a review March 28, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DB DB migration involved E2E/Unit tests Form.io Form IO definitions changed. Institution Institution Features Ministry Ministry Features SIMS-Api SIMS-Api Student Student Features Web portal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants