Skip to content

#5594 - Analysis: new unified data path for appeals and forms + non punitive (DB only)#5743

Open
andrewsignori-aot wants to merge 4 commits intomainfrom
feature/#5594-new-unified-data-path-for-appeals-and-forms
Open

#5594 - Analysis: new unified data path for appeals and forms + non punitive (DB only)#5743
andrewsignori-aot wants to merge 4 commits intomainfrom
feature/#5594-new-unified-data-path-for-appeals-and-forms

Conversation

@andrewsignori-aot
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot commented Feb 6, 2026

  • Created a similar structure to the existing appeals to allow similar functionality to be expanded for generic forms submissions.
  • Allow each submission to be individually reviewed while still allowing the grouped submissions to have a final status to indicate their completion.
  • Allow the Ministry to take individual notes for each decision (for each appeal/form).
  • Create a status at the grouped submissions levels to avoid checking the child submission to determine the overall status.
  • Allow the UI to offer to the student different forms categories (e.g., Appeals, Forms) where the same should allow single or multiple grouped submissions.
  • Allow the Ministry to review forms also based on different categories (e.g., Appeals, Forms).
    Note: the structure and changes to come will be introduced in a non-disruptive way, allowing the feature to advance without being active on PROD till the time comes to replace the current appeals structure, and also enabling the new form submission.

ER

image

Rollback

image image image image

UI Samples (not included in this PR)

The below UIs resulted from the POC executed so far to support the analisys. They are shared here with the sole intention of helping to understand and giving more context for the DB changes being introduced.

Student Appeals/Forms Selector

image

Student Appeals/Forms Submission

image

Student Forms History (to be reused by Ministry)

image

Student Submission View

image

Ministry Form Submission Approval

image

@andrewsignori-aot andrewsignori-aot self-assigned this Feb 6, 2026
@andrewsignori-aot andrewsignori-aot added the DB DB migration involved label Feb 6, 2026
@andrewsignori-aot andrewsignori-aot changed the title #5594 - Analysis: new unified data path for appeals and forms + non punitive #5594 - Analysis: new unified data path for appeals and forms + non punitive (DB only) Feb 6, 2026
Copy link
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

This PR introduces new DB structures and ORM entities to support a unified “form submissions” data path (covering appeals and other student/system forms), including DB-only support for the non-punitive withdrawal form.

Changes:

  • Added new form_submissions and form_submission_items tables (plus supporting enum types) and corresponding TypeORM entities.
  • Extended dynamic_form_configurations with form categorization and submission-scoping flags, and inserted configurations for existing appeal forms plus the non-punitive withdrawal form.
  • Updated test factory defaults for DynamicFormConfiguration to populate newly added fields (partially).

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
sources/packages/backend/libs/test-utils/src/factories/dynamic-form-configuration.ts Updates test factory to set new dynamic-form configuration fields.
sources/packages/backend/libs/sims-db/src/entities/index.ts Exports new form-submission entities and enums.
sources/packages/backend/libs/sims-db/src/entities/form-submission.model.ts Adds FormSubmission entity mapping the new submission header table.
sources/packages/backend/libs/sims-db/src/entities/form-submission-status.type.ts Adds enum for overall submission status.
sources/packages/backend/libs/sims-db/src/entities/form-submission-item.model.ts Adds FormSubmissionItem entity for per-form decisions within a submission.
sources/packages/backend/libs/sims-db/src/entities/form-submission-decision-status.type.ts Adds enum for per-item decision status.
sources/packages/backend/libs/sims-db/src/entities/form-category.type.ts Adds enum to categorize forms (appeal/student/system).
sources/packages/backend/libs/sims-db/src/entities/dynamic-form-configuration.model.ts Adds new columns for form category/description/scoping/bundling.
sources/packages/backend/libs/sims-db/src/data-source.ts Registers new entities in the DBEntities list.
sources/packages/backend/libs/sims-db/src/constant.ts Adds new table names for form submissions/items.
sources/packages/backend/apps/db-migrations/src/sql/Types/Rollback-create-form-submission-related-types.sql Rollback script for new enum types.
sources/packages/backend/apps/db-migrations/src/sql/Types/Create-form-submission-related-types.sql Creates new Postgres enum types for form submission domain.
sources/packages/backend/apps/db-migrations/src/sql/FormSubmissions/Rollback-create-form-submissions-table.sql Rollback script for form_submissions.
sources/packages/backend/apps/db-migrations/src/sql/FormSubmissions/Create-form-submissions-table.sql Creates form_submissions table and constraints/comments.
sources/packages/backend/apps/db-migrations/src/sql/FormSubmissionItems/Rollback-create-form-submission-items-table.sql Rollback script for form_submission_items.
sources/packages/backend/apps/db-migrations/src/sql/FormSubmissionItems/Create-form-submission-items-table.sql Creates form_submission_items table and constraints/comments.
sources/packages/backend/apps/db-migrations/src/sql/DynamicFormConfigurations/Rollback-add-form-submission-columns.sql Rollback script for new dynamic form configuration columns + inserted rows.
sources/packages/backend/apps/db-migrations/src/sql/DynamicFormConfigurations/Add-form-submission-columns.sql Adds new columns and inserts new/updated dynamic form configurations.
sources/packages/backend/apps/db-migrations/src/migrations/1770417899700-DynamicFormConfigurationsAddFormSubmissionColumns.ts Runs the dynamic-form-configurations SQL changes.
sources/packages/backend/apps/db-migrations/src/migrations/1770417892002-CreateFormSubmissionItemsTable.ts Runs the form-submission-items table creation SQL.
sources/packages/backend/apps/db-migrations/src/migrations/1770417883203-CreateFormSubmissionsTable.ts Runs the form-submissions table creation SQL.
sources/packages/backend/apps/db-migrations/src/migrations/1770417867043-CreateFormSubmissionRelatedTypes.ts Runs the enum type creation SQL.

@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review February 7, 2026 01:07
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.35% ( 4388 / 21561 )
Methods: 9.88% ( 260 / 2632 )
Lines: 24.49% ( 3756 / 15336 )
Branches: 10.35% ( 372 / 3593 )

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 75.41% ( 1055 / 1399 )
Methods: 79.31% ( 115 / 145 )
Lines: 78.79% ( 769 / 976 )
Branches: 61.51% ( 171 / 278 )

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 85.68% ( 1616 / 1886 )
Methods: 85% ( 187 / 220 )
Lines: 88.64% ( 1287 / 1452 )
Branches: 66.36% ( 142 / 214 )

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

E2E SIMS API Coverage Report

Totals Coverage
Statements: 77.55% ( 8917 / 11499 )
Methods: 77.05% ( 1054 / 1368 )
Lines: 81.62% ( 6473 / 7931 )
Branches: 63.18% ( 1390 / 2200 )

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

Labels

DB DB migration involved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant