#5594 - Analysis: new unified data path for appeals and forms + non punitive (DB only)#5743
Open
andrewsignori-aot wants to merge 4 commits intomainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
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_submissionsandform_submission_itemstables (plus supporting enum types) and corresponding TypeORM entities. - Extended
dynamic_form_configurationswith form categorization and submission-scoping flags, and inserted configurations for existing appeal forms plus the non-punitive withdrawal form. - Updated test factory defaults for
DynamicFormConfigurationto 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. |
sources/packages/backend/libs/sims-db/src/entities/dynamic-form-configuration.model.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/libs/sims-db/src/entities/form-submission-item.model.ts
Outdated
Show resolved
Hide resolved
...ackend/apps/db-migrations/src/sql/FormSubmissionItems/Create-form-submission-items-table.sql
Outdated
Show resolved
Hide resolved
...backend/apps/db-migrations/src/sql/DynamicFormConfigurations/Add-form-submission-columns.sql
Show resolved
Hide resolved
sources/packages/backend/libs/test-utils/src/factories/dynamic-form-configuration.ts
Show resolved
Hide resolved
sources/packages/backend/libs/sims-db/src/entities/form-submission.model.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/libs/sims-db/src/entities/form-submission-item.model.ts
Outdated
Show resolved
Hide resolved
...ackend/apps/db-migrations/src/sql/FormSubmissionItems/Create-form-submission-items-table.sql
Show resolved
Hide resolved
...ackages/backend/apps/db-migrations/src/sql/FormSubmissions/Create-form-submissions-table.sql
Outdated
Show resolved
Hide resolved
...ackend/apps/db-migrations/src/sql/FormSubmissionItems/Create-form-submission-items-table.sql
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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
Rollback
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
Student Appeals/Forms Submission
Student Forms History (to be reused by Ministry)
Student Submission View
Ministry Form Submission Approval