SIMS icon indicating copy to clipboard operation
SIMS copied to clipboard

Institution Program Restrictions: Suspension (UI - add and display restriction)

Open astridSABC opened this issue 5 months ago • 8 comments

As a Ministry User I want to be able to add and resolve Suspension Restrictions to Institution Program So That I can temporarily suspend a program. Use case: PTIB suspends a program but not a Location or an Institution. In this case Ministry does not want to allow any new offerings. No new applications will be allowed. Already existing applications will require Ministry review. If money were disbursed, no action.

Scope of this ticket:

UI to add the restriction, UI for displaying restriction in Restrictions table

Things to consider:

We will be building

  • [program+location] restrictions known as "Program restriction" AND
  • restrictions that should be applied to location known as "Location restriction". Make sure we can accommodate both scenarios in the near future.

Acceptance Criteria

UI to apply [ program + location] restriction:

  • [ ] Create provincial [program+location] restriction SUS that Can be applied to a specific program within One Location or to the specific program across ALL Locations

  • [ ] When Ministry clicks "Add restriction" Button on Institution Restrictions Page, display the pop-up screen. This form will be dynamic in the future based on Reason, allowing to restrict Location and Institution.

image.png

Reason: SUS - program suspended Program - allow to search for a program within selected location. Allow to choose one program. Only display Active Programs. Location - drop-down list with all locations within an Institution. Allow to choose one to all locations.
Notes

  • [ ] All fields are mandatory fields. If User clicks "Add restriction" and the data in one of the mandatory fields is missing, display a standard warning message.
  • [ ] Once user clicks "Add restriction", display green Toast message Restriction was successfully added
  • [ ] Save Notes into Notes section
  • [ ] Keycloak: institution-add-restriction should be available to ServiceDelivery-Limited and ServiceDelivery-Full groups (i believe, group already exists, not DEV task)

Display restriction on Ministry portal

  • [ ] Display data about added restriction in the Restriction Table. Add Location and Program Columns, remove Category. Add View Button. Allow to sort on Location and Program
  • [ ] Reason: If SUS - display "Suspension"
  • [ ] Display the restricted program in Restrictions table
  • [ ] If restriction was applied to specific program for multiple locations, display each line separately image.png

Additional considerations for business: Suspension: in some cases IPDT restricts program across all locations at once (program does not meet requirements), in other cases IPDT restricts program only in one location (for example, instructor is not qualified).

QA NOTES:

  • Test different roles: Service Delivery-Limited and Service Delivery-Full group

astridSABC avatar Jul 22 '25 18:07 astridSABC

@AnnaPBashkatova, when comparing the type of data that we have for student restrictions, would it be fair to assume the data in the columns below would not be required for institutions?

image.png

Assuming the data is not required, can we have some default values for these columns to allow reusing the same structure?

The data that we would need for the institution's restrictions would likely be the below.

  • restriction_code
  • description
  • action_type

andrewsignori-aot avatar Nov 27 '25 01:11 andrewsignori-aot

Analysis

Plan A (preferred)

  • Reuse the existing table sims.restrictions.
  • NOT NULL columns not required for institution restrictions can receive some default values meaningful for institutions, for instance, restriction_category can be saved as "Institution".
  • Expand restriction_types (Federal, Provincial) to include Institution.
  • Share the same actions_types.
  • Adapt Ministry UI and any other UI consuming the categories.
  • Drop and create the table to allow better column organization, since the table can be dropped at this moment.

Suggested changes for existing tables

image.png

sims.institution_restrictions

DROP TABLE sims.institution_restrictions;
CREATE TABLE sims.institution_restrictions(
    id SERIAL PRIMARY KEY,
    institution_id INT NOT NULL REFERENCES sims.institutions(id),
    location_id INT NULL REFERENCES sims.institution_locations(id),
    program_id INT NULL REFERENCES sims.education_programs(id),
    restriction_id INT NOT NULL REFERENCES sims.restrictions(id),
    restriction_note_id INT NOT NULL REFERENCES sims.notes(id),
    resolution_note_id INT REFERENCES sims.notes(id),
    resolved_at TIMESTAMP WITH TIME ZONE NULL,
    resolved_by INT NULL DEFAULT NULL REFERENCES sims.users(id),
    is_active BOOLEAN NOT NULL,
    -- Audit columns
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    creator INT NOT NULL REFERENCES sims.users(id),
    modifier INT NULL DEFAULT NULL REFERENCES sims.users(id)
);

Plan B

Suggested changes for existing and new tables

image.png

sims.institution_restrictions

  • sims.institution_restrictions table is not used currently. It would be recreated to be adapted to the new requirement.
  • institution_id, location_id, program_id would allow the future restrictions to be configured at different scopes. institution_id should be mandatory since it will always be possible to have an association.
  • No delete functionality present in the requirement so far.
DROP TABLE sims.institution_restrictions;

CREATE TABLE sims.institution_restrictions(
    id SERIAL PRIMARY KEY,
    institution_id INT NOT NULL REFERENCES sims.institutions(id),
    location_id INT NULL REFERENCES sims.institution_locations(id),
    program_id INT NULL REFERENCES sims.education_programs_offerings(id),
    restriction_reason_id INT NOT NULL REFERENCES sims.institution_restriction_reasons(id),
    restriction_note_id INT NOT NULL REFERENCES sims.notes(id),
    resolution_note_id INT REFERENCES sims.notes(id),
    is_active BOOLEAN NOT NULL,
    -- Audit columns
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    creator INT NOT NULL REFERENCES sims.users(id),
    modifier INT NULL DEFAULT NULL REFERENCES sims.users(id)
);

sims.institution_restriction_reasons

  • Using the same table sims.restrictions does not seem a good approach due to the differences in the data required for the institutions.
  • Suggestion to call it "reasons" to differentiate from the students' related table sims.restrictions.
CREATE TABLE sims.institution_restriction_reasons(
    id SERIAL PRIMARY KEY,
    description VARCHAR(250) NOT NULL,
    action_type sims.restriction_reason_action_types [] NOT NULL,
    -- Audit columns
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);

sims.restriction_reason_action_types

  • New action types to be created to contain only institution-specific actions.
CREATE TYPE sims.restriction_reason_action_types AS ENUM (
  'No effect',
  'Stop part-time disbursement',
  'Stop full-time disbursement'
);

andrewsignori-aot avatar Nov 27 '25 02:11 andrewsignori-aot

@andrewsignori-aot Good morning, Andrew. We definitely don't need Restriction type and Restriction category, but possibly need to keep Notification type as for some restrictions (like suspension) institution will be notified about restriction: Banner, etc. And for others, like fraud, there will be no warning or indication for Institution. Not sure if the plan is to manage it via Notification type. Happy to chat further.

AnnaPBashkatova avatar Nov 27 '25 16:11 AnnaPBashkatova

@AnnaPBashkatova, I did not see any requirements about allowing institution restrictions to be deleted. Can we assume they will not have the deleted capability that the students' restrictions have?

andrewsignori-aot avatar Nov 27 '25 21:11 andrewsignori-aot

@andrewsignori-aot Hi Andrew, i think it is fare to assume we will not need to have ability to "Delete" Institution restrictions at the moment. Ministry can always resolve them, no concerns.

AnnaPBashkatova avatar Nov 27 '25 21:11 AnnaPBashkatova

@AnnaPBashkatova related to the programs to be displayed in the list, which status should we display? For instance, should we consider only approved and active programs? The possible program statuses are: Approved, Pending, and Declined.

Program - allow to search for a program within selected location. Allow to choose one program. Only display Active Programs.

andrewsignori-aot avatar Nov 28 '25 03:11 andrewsignori-aot

@andrewsignori-aot Good morning, Andrew. Yes please, let consider only Approved programs. Thank you,

AnnaPBashkatova avatar Nov 28 '25 15:11 AnnaPBashkatova

@andrewsignori-aot Good morning, Andrew. Yes please, let consider only Approved programs. Thank you,

@AnnaPBashkatova, can you please convert it to an AC? Right now, it is just below the image.

andrewsignori-aot avatar Nov 28 '25 17:11 andrewsignori-aot

@andrewsignori-aot Good morning, Andrew. Done. Please let me know if it works. image.png

Anna

AnnaPBashkatova avatar Dec 01 '25 16:12 AnnaPBashkatova

@andrewsignori-aot Good morning, Andrew. Done. Please let me know if it works. image.png

Anna

The idea was to have a listed AC. The ACs should start with something like:

  • [ ] Need to do something to accomplish a goal.

andrewsignori-aot avatar Dec 02 '25 03:12 andrewsignori-aot

@AnnaPBashkatova, I did not find a specific AC for restriction resolution. It is mentioned at the beginning of the ticket, then it is no longer mentioned in the ticket scope or the ACs (as far as I could check). Was it expected to have the restrictions resolutions working by the end of this ticket?

andrewsignori-aot avatar Dec 02 '25 03:12 andrewsignori-aot

@andrewsignori-aot Good morning, Andrew! Resolution is not in a scope of this ticket. There is separate ticket for resolution: https://app.zenhub.com/workspaces/student-information-management-system-5fce9df5aa1b45000e937014/issues/gh/bcgov/sims/5112 Also updated AC based on the feedback.

Anna

AnnaPBashkatova avatar Dec 02 '25 16:12 AnnaPBashkatova

@AnnaPBashkatova, when selecting multiple locations and creating multiple restrictions, is it correct to assume they will all be associated with the same "Institution Note"? Below is the AC about adding notes.

Save Notes into Notes section

andrewsignori-aot avatar Dec 02 '25 19:12 andrewsignori-aot

@andrewsignori-aot Hi Andrew, that is correct. I updated AC.

AnnaPBashkatova avatar Dec 02 '25 19:12 AnnaPBashkatova

@AnnaPBashkatova does the below work for multi selection?

image.png image.png

andrewsignori-aot avatar Dec 02 '25 20:12 andrewsignori-aot

@andrewsignori-aot Hi Andrew, looks good. Made me think that we should only show designated locations.

AnnaPBashkatova avatar Dec 02 '25 20:12 AnnaPBashkatova

@andrewsignori-aot Hi Andrew, looks good. Made me think that we should only show designated locations.

As far as I remember, we do not check for designation before generating the e-cert. If the idea is to stop any funds for a program, we should ensure that everything is blocked.

andrewsignori-aot avatar Dec 02 '25 22:12 andrewsignori-aot

@AnnaPBashkatova, if they try to select a mix of institutions that already have active restrictions, the user would get a message like the one below.

Image

@AnnaPBashkatova, updating the message to be generic as below, which still would work for this restriction and future possible configurations. If there is any other better sentence, please share.

At least one restriction is already active for the selected items.

Please add the below one to make it clear to QA.

  • [ ] While adding restrictions, the system should not allow a duplicated restriction to be added. A warning toast notification should be displayed if any of the restrictions to be added is already active, preventing all restrictions from being added.

andrewsignori-aot avatar Dec 02 '25 22:12 andrewsignori-aot

@andrewsignori-aot

As far as I remember, we do not check for designation before generating the e-cert. If the idea is to stop any funds for a program, we should ensure that everything is blocked.

Got it, good point. I agree. Like the Toast message. Thank you!

AnnaPBashkatova avatar Dec 02 '25 23:12 AnnaPBashkatova

@AnnaPBashkatova, is there a problem displaying the "Reason" as below, adding the code to it following the same from the student restrictions?

Image

andrewsignori-aot avatar Dec 03 '25 02:12 andrewsignori-aot

@CarlyCotton @ninosamson Now that PrimeVue will be gone, we can start taking advantage of other Vuetify features like multi-sorting. See below the example where the table would be initialized, already displaying its sorting orders and allowing it to be modified. @AnnaPBashkatova do you see any issue with having multiple sorting enabled for this one?

Image

andrewsignori-aot avatar Dec 03 '25 02:12 andrewsignori-aot

@andrewsignori-aot Good morning, Andrew.

is there a problem displaying the "Reason" as below, adding the code to it following the same from the student restrictions?

No problem, please follow the student restrictions logic.

Do you see any issue with having multiple sorting enabled for this one?

Go for it!

AnnaPBashkatova avatar Dec 03 '25 16:12 AnnaPBashkatova

@AnnaPBashkatova, after a technical decision, the table sorting will remain as planned initially. The ability for multiple sorting may be enabled in the future across the entire application.

andrewsignori-aot avatar Dec 03 '25 19:12 andrewsignori-aot

@AnnaPBashkatova, question from devs during PR review: should the "Location" be renamed to "Locations" or "Location(s)"?

image.png

andrewsignori-aot avatar Dec 03 '25 22:12 andrewsignori-aot

@andrewsignori-aot Hi Andrew, yes we can rename Location into Location(s), if you think it adds clarity. Thank you. Updated AC

AnnaPBashkatova avatar Dec 03 '25 22:12 AnnaPBashkatova

@AnnaPBashkatova I am ok either way. Since there was a dev question I did the follow up. I will adjust as per the AC.

andrewsignori-aot avatar Dec 03 '25 22:12 andrewsignori-aot

@andrewsignori-aot & @AnnaPBashkatova Moving back to In Progress from discussion on #5099 around the restriction category change.

CarlyCotton avatar Dec 11 '25 18:12 CarlyCotton

@andrewsignori-aot Hi Andrew, added AC regarding restriction category. Thank you.

AnnaPBashkatova avatar Dec 11 '25 18:12 AnnaPBashkatova