Skip to content

Commit

Permalink
#3831 - SINF restriction bridge mapping and rename to SINR (#3846)
Browse files Browse the repository at this point in the history
- Changed restriction code `SINF` to `SINR`
- Updated the activity page accordion code to `SINR`
- Created a DB migration to change the code of the `SINF` to `SINR`.
- Renamed `SINF` to `SINR` in the existing `RestrictionCode` enum.
- Changed an existing E2E to ensure `SINF` will be mapped to `LGCY`. 
- Replaced "TREE" with "SINF" in file
"SFAS-TO-SIMS-2024MAR07-LEGACY-RESTRICTIONS.txt" to ensure `SINF`
mapping to `LGCY` for this PR.

### Rollback evidence screenshot

![image](https://github.com/user-attachments/assets/2002ad83-4af3-4ab5-9b9c-3226e02b28e8)

Screenshot of the SINR code on the activity page accordion

![image](https://github.com/user-attachments/assets/c1b4028c-c92b-447a-b417-a10fc8c75f04)

Screenshot of the `sfas_student` table having two records after
restrictions are imported

![image](https://github.com/user-attachments/assets/1b0d2812-3944-4a15-9641-fabe894cbcf4)

Screenshot of the `student_restrictions` table having only one record
with restriction_id = 72 (LGCY)

![image](https://github.com/user-attachments/assets/20e3396d-96db-4190-941a-9e597f945ba8)

Screenshot of the completed job for processing the SINR record on Bull
Dashboard

![image](https://github.com/user-attachments/assets/50db6edd-3070-4e25-80c3-db1ff1a60be0)
  • Loading branch information
lewischen-aot authored Oct 30, 2024
1 parent 81df5b5 commit 3ed8c2e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export class StudentRestrictionService extends RecordDataModelService<StudentRes

const hasSINRestriction = await this.studentHasRestriction(
studentId,
RestrictionCode.SINF,
RestrictionCode.SINR,
);
if (hasSINRestriction) {
// The student already has an active SIN restriction, avoid adding it again.
Expand All @@ -351,7 +351,7 @@ export class StudentRestrictionService extends RecordDataModelService<StudentRes
const restriction =
await this.studentRestrictionSharedService.createRestrictionToSave(
studentId,
RestrictionCode.SINF,
RestrictionCode.SINR,
auditUserId,
applicationId,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { getSQLFileData } from "../utilities/sqlLoader";

export class UpdateSINRestriction1730141787641 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData("Update-sin-restriction.sql", "Restrictions"),
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData("Rollback-update-sin-restriction.sql", "Restrictions"),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Revert the updates for the restriction SINR
UPDATE
sims.restrictions
SET
restriction_code = 'SINF'
WHERE
restriction_code = 'SINR';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Update restriction_code for the restriction code SINF
UPDATE
sims.restrictions
SET
restriction_code = 'SINR'
WHERE
restriction_code = 'SINF';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
100AESTSFAS TO SIMS BRIDGE 20211119142437
2001010101010JOHN FOUR 19980324900041310 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
40010101010100964351111TREE20180927
40010101010100964351111SINF20180927
40010101010100964351115CROW20180928
999000011431002573803010624
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export enum RestrictionCode {
* When a student has a temporary SIN and applies for a full-time/part-time application
* this restriction is applied case the SIN expiry date is before the offering end date.
*/
SINF = "SINF",
SINR = "SINR",
/**
* BCSL Lifetime Maximum is the student's cumulative full-time BCSL awards received over
* a lifetime. This restriction is added to a student when they reach BC lifetime maximum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3084,7 +3084,7 @@
"id": "eaaszn"
},
{
"title": "Code SINF - Temporary Social Insurance Number (SIN) expiration",
"title": "Code SINR - Temporary Social Insurance Number (SIN) expiration",
"labelWidth": "",
"labelMargin": "",
"theme": "default",
Expand Down

0 comments on commit 3ed8c2e

Please sign in to comment.