Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy Restriction Mapping #4013

Closed
28 tasks done
CarlyCotton opened this issue Nov 29, 2024 · 2 comments
Closed
28 tasks done

Legacy Restriction Mapping #4013

CarlyCotton opened this issue Nov 29, 2024 · 2 comments
Assignees
Labels
Hotfix PR created for hotfix Ministry Ministry Features

Comments

@CarlyCotton
Copy link
Collaborator

CarlyCotton commented Nov 29, 2024

User Story
As a ministry user, I want to know about some restrictions imported from the legacy bridge but others are not going to be needed. Right now we directly map a few restrictions into unique restrictions in SIMS and the rest are mapped into a "LGCY" restriction to be reviewed by ministry users as required.

Acceptance Criteria

  • Change which legacy restrictions map to LGCY and ONLY map these ones to a unique version of the LGCY restriction. Each one would be mapped directly to its own version of the LGCY restriction.

  • All will need to display to the student as LGCY

    • TD - LGCY_TD
    • B5 - LGCY_B5
    • B5A - LGCY_B5A
    • B7 - LGCY_B7
    • SSD - LGCY_SSD
    • Z2 - LGCY_Z2
    • M1 - LGCY_M1
    • SSRN - LGCY_SSRN
    • B4 - LGCY_B4
    • Z1 - LGCY_Z1
  • These new LGCY restrictions will all replicate the effect of the current LGCY restriction

  • make this mapping to LGCY whitelist configurable, so that we can make any LGCY restrictions on demand possibly within db

  • Current LGCY restriction and behaviour of collecting all un mapped restrictions can be removed. All restrictions that are not mapped in this way or mapped to other restrictions will just not attach to the student.

  • These new legacy restrictions will be shown to the student as a single Legacy restriction in Account Activity/Banners as the highest level of warning to the student. Example: 4 legacy restrictions. 1 error, 2 warning, 1 no effect. Only error level messaging would be shown.

Additional Context
We are not concerned with any restrictions that have already mapped to students before this ticket is completed. These will be resolved with business process.
image.png

Technical

  • Create a new is_legacy column on sims.restrictions to be set as true only for the restrictions listed on the business ACs.
  • Create a new table sims.sfas_restrictions_maps to contain the possible restrictions mappings, including the existing ones A12, AF1, and B2D.
    • legacy_code: varchar(4)
    • code: varchar(4)
    • created_at: default to now().
  • Before executing the inserts on the student's restrictions, ensure the legacy restrictions present in the table sims.sfas_restrictions_maps are all present on sims.restrictions, if not, create the missing ones using the current LGCY restriction.
  • Adjust the student activity page to keep displaying the LGCY content if any restriction with is_legacy is active.
  • No changes are required to the restrictions bypass.
  • Update the SQL mapping used for the import of legacy restrictions in the bulk insert to use the new table sims.sfas_restrictions_maps.
  • Stop mapping any unknown restriction received from SFAS into the LGCY existing restriction. The LGCY will be kept on DB for now, do not remove it.
    • Remove the SQL responsible by adding current LGCY restriction and associated code needed to stop processing the current LGCY restriction.
  • E2E tests

Note: A new ticket will be created to prevent Ministry to add these restrictions to the student account (also block the API).

@CarlyCotton CarlyCotton added the Business Items under Business Consideration label Nov 29, 2024
@CarlyCotton CarlyCotton changed the title Legacy Restriction Mapping Legacy Restriction Mapping [[TWO APPROACHES PENDING REVIEW]] Nov 29, 2024
@CarlyCotton CarlyCotton added the Ministry Ministry Features label Nov 29, 2024
@CarlyCotton CarlyCotton changed the title Legacy Restriction Mapping [[TWO APPROACHES PENDING REVIEW]] Legacy Restriction Mapping Nov 29, 2024
@ninosamson ninosamson changed the title Legacy Restriction Mapping [WAITING FOR JER}: Legacy Restriction Mapping Dec 3, 2024
@ninosamson ninosamson changed the title [WAITING FOR JER}: Legacy Restriction Mapping [WAITING FOR JER]: Legacy Restriction Mapping Dec 4, 2024
@JerPearson JerPearson changed the title [WAITING FOR JER]: Legacy Restriction Mapping Legacy Restriction Mapping Dec 5, 2024
@CarlyCotton CarlyCotton added Dev & Architecture Development and Architecture and removed Business Items under Business Consideration labels Dec 5, 2024
andrewsignori-aot added a commit that referenced this issue Dec 7, 2024
- Created a new table to map SFAS code to SIMS legacy restriction codes.
- New records added to the table map will be automatically added to the
`sims.restrcitions` if not present yet.
- The column `is_legacy_only` creates a distinction between the
SFAS-SIMS mapped restriction and the restrictions that should be added
to SIMS but not managed (only resolved).
- Kept generating a notification for each student that had a new legacy
restriction added.
- The creation date is controlled and the query to get students looks
for any new student restriction created by the import process.

### Rollback


![image](https://github.com/user-attachments/assets/ab008da3-af0a-4664-bbb9-12ff4753b60f)


![image](https://github.com/user-attachments/assets/57a5f728-688d-4d0c-a8e4-48c3da58a39b)
@CarlyCotton
Copy link
Collaborator Author

Based on discussion from Friday/Today - added a new AC:

  • These new legacy restrictions will be shown to the student as a single Legacy restriction in Account Activity/Banners as the highest level of warning to the student. Example: 4 legacy restrictions. 1 error, 2 warning, 1 no effect. Only error level messaging would be shown.

FYI @andrewsignori-aot

@andrewsignori-aot andrewsignori-aot added the Hotfix PR created for hotfix label Dec 9, 2024
andrewsignori-aot added a commit that referenced this issue Dec 9, 2024
- Prevent API from retuning 'No effect' notifications since they are not
supposed to be notified to the student.
- Consolidated `LGCY_*` restrictions into a single `LGCY` restriction
code to be returned to the student. The error code returned will be the
highest one present in the list of the `LGCY_*` being returned.
- Create few `LGCY_*` in the DB seed to allow the E2E to use them.
- Fixed the `db:seed:test:clean` that was not removing the
`create_history_entry` function leading to an error when the DB was
populated again.
- Close Nestjs app (`app.close()`) to avoid the `db:seed:test:clean` and
`db:seed:test` to be hanging and waiting.
 
### Ministry visualization for the new legacy map


![image](https://github.com/user-attachments/assets/e50659f4-4cc1-4b9a-b6a6-de27e99c79b9)

### SQL to be manually added during release

```sql
INSERT INTO
    sims.sfas_restriction_maps (legacy_code, code, is_legacy_only)
VALUES
    ('TD', 'LGCY_TD', TRUE),
    ('B5', 'LGCY_B5', TRUE),
    ('B5A', 'LGCY_B5A', TRUE),
    ('B7', 'LGCY_B7', TRUE),
    ('SSD', 'LGCY_SSD', TRUE),
    ('Z2', 'LGCY_Z2', TRUE),
    ('M1', 'LGCY_M1', TRUE),
    ('SSRN', 'LGCY_SSRN', TRUE),
    ('B4', 'LGCY_B4', TRUE),
    ('Z1', 'LGCY_Z1', TRUE)
```
@andrewsignori-aot andrewsignori-aot removed the Dev & Architecture Development and Architecture label Dec 10, 2024
@CarlyCotton
Copy link
Collaborator Author

Looks good. Processed non-legacy mapping, legacy mapping with existing, added a new legacy map.

github-merge-queue bot pushed a commit that referenced this issue Dec 11, 2024
Merge Hotfix V2.1.1 to Main

## What's Changed
* #4013 - Legacy Restriction Mapping - Migrations and SQL Changes by
@andrewsignori-aot in #4037
* #4041 - Ignore Cancelled Legacy Applications on SIMS Validations and
Calculations by @dheepak-aot in #4042
* #4013 - Legacy Restriction Mapping - Student Changes by
@andrewsignori-aot in #4049
* #4052 - Fix the legacy program year totals for program year limits by
@dheepak-aot in #4058

---------

Co-authored-by: Andrew Boni Signori <[email protected]>
Co-authored-by: Dheepak Ramanathan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hotfix PR created for hotfix Ministry Ministry Features
Projects
None yet
Development

No branches or pull requests

3 participants