Skip to content

Conversation

@dheepak-aot
Copy link
Collaborator

@dheepak-aot dheepak-aot commented Oct 23, 2025

Modified independent - Ministry update - Update modified independent status

Keycloak role

  • Added a new keycloak role student-update-modified-independent-status to allow ministry user to update the modified independent status of the student.

API

  • Added a new ministry API to update modified independent status of the student.
  • In addition to validating the student id, the API also ensures that it performs the status update only if the current modified independent status is different than the requested one.

E2E Tests

  • Added E2E tests for the new ministry API to update modified independent status.
image
  • Updated the get student profile E2E tests to return default modified independent status as Not requested.

DB Migrations update

  • Added a new value Not requested to the type sims.modified_independent_status to be the default value of sims.students.modified_independent_status instead of null.
    Note: The exisiting migration SQL files were update here instead of adding new migration. Hence before the PR is merged, DEV migrations pertinent to this change will be rolled back to allow the migrations to be re-executed.

Rollback evidences

image image image

UI

  • Added new modal to update the modified independent status.
image image image image image
  • Warning toast to the user, if they update the status which is same as current modified independent status.
image image
  • Disable the button if the ministry user does not have the required role.
image

@dheepak-aot dheepak-aot changed the title #5035 - Modified independent - Ministry update - Update status #5035 - Modified independent - Ministry update - Update modified independent status Oct 27, 2025
@dheepak-aot dheepak-aot added DB DB migration involved Web portal labels Oct 27, 2025
@dheepak-aot dheepak-aot marked this pull request as ready for review October 27, 2025 05:42
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 functionality to allow ministry users to update a student's modified independent status, replacing the previous nullable field with a new "Not requested" default status. The implementation includes a new Keycloak role, API endpoints, UI components, and database migration updates.

Key Changes:

  • Added new NotRequested status to ModifiedIndependentStatus enum, changing field from nullable to required with default value
  • Created new ministry API endpoint and UI modal for updating modified independent status with validation and role-based permissions
  • Updated database migrations to include "Not requested" in the enum type and set it as default value

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sources/packages/web/src/types/contracts/aest/roles.ts Added new role for updating modified independent status
sources/packages/web/src/types/contracts/StudentContract.ts Added NotRequested enum value with documentation
sources/packages/web/src/services/http/dto/Student.dto.ts Changed modifiedIndependentStatus to required and added update DTO
sources/packages/web/src/services/http/StudentApi.ts Added API method for updating modified independent status
sources/packages/web/src/services/StudentService.ts Added service method for updating modified independent status
sources/packages/web/src/constants/error-code.constants.ts Added error constant for status not updated scenario
sources/packages/web/src/composables/useFormatters.ts Refactored status display logic to use switch statement
sources/packages/web/src/components/common/students/StudentProfile.vue Added event listener for status updates
sources/packages/web/src/components/aest/students/modals/UpdateModifiedIndependentStatusModal.vue New modal component for updating status
sources/packages/web/src/components/aest/students/ModifiedIndependentStatusTitleValue.vue Added update functionality with role-based permissions
sources/packages/web/src/components/aest/students/DisabilityStatusUpdateTileValue.vue Fixed attribute naming convention
sources/packages/backend/libs/sims-db/src/entities/student.model.ts Changed field to required (non-nullable)
sources/packages/backend/libs/sims-db/src/entities/student-modified-independent-status.type.ts Added NotRequested enum value
sources/packages/backend/apps/db-migrations/src/sql/Types/Create-modified-independent-status.sql Added "Not requested" to enum type
sources/packages/backend/apps/db-migrations/src/sql/Student/Add-cols-modified-independent.sql Set default value and NOT NULL constraint
sources/packages/backend/apps/api/src/services/student/student.service.ts Added service method to update status with transaction
sources/packages/backend/apps/api/src/route-controllers/student/student.controller.service.ts Added return type annotation
sources/packages/backend/apps/api/src/route-controllers/student/student.aest.controller.ts Added endpoint with validation logic
sources/packages/backend/apps/api/src/route-controllers/student/models/student.dto.ts Changed field to required and added update DTO
sources/packages/backend/apps/api/src/route-controllers/student/tests/e2e/*.e2e-spec.ts Updated tests to expect NotRequested as default value
sources/packages/backend/apps/api/src/constants/error-code.constants.ts Added error constant for backend
sources/packages/backend/apps/api/src/auth/roles.enum.ts Added new role enum value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot 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, please take a look at the comments.

@sonarqubecloud
Copy link

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.69% ( 4263 / 20609 )
Methods: 9.91% ( 250 / 2523 )
Lines: 24.85% ( 3649 / 14682 )
Branches: 10.69% ( 364 / 3404 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 74.77% ( 1043 / 1395 )
Methods: 77.93% ( 113 / 145 )
Lines: 78.29% ( 761 / 972 )
Branches: 60.79% ( 169 / 278 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 85.47% ( 1559 / 1824 )
Methods: 84.76% ( 178 / 210 )
Lines: 88.39% ( 1241 / 1404 )
Branches: 66.67% ( 140 / 210 )

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes, looks good 👍

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 74.03% ( 8234 / 11123 )
Methods: 73.3% ( 972 / 1326 )
Lines: 78.33% ( 6029 / 7697 )
Branches: 58.71% ( 1233 / 2100 )

@dheepak-aot dheepak-aot added this pull request to the merge queue Oct 27, 2025
Merged via the queue into main with commit 8158da2 Oct 27, 2025
26 of 27 checks passed
@dheepak-aot dheepak-aot deleted the feature/#5035-modified-independant-ministry-approval-update branch October 27, 2025 19:57
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 SIMS-Api SIMS-Api Web portal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants