From 9de4f64a2a67d1e97a02e9043e60060f5349cc8e Mon Sep 17 00:00:00 2001 From: Andre Pestana <78114138+andrepestana-aot@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:06:56 -0800 Subject: [PATCH] #3691 - UX/UI for Ignore Restriction - Bypass Add/Remove - Added "Stop part time BC funding" action type (#3977) - Added StopPartTimeBCFunding restriction action type to the query that gets the available student restrictions to be bypassed. --- ...getAvailableRestricitionsToBypass.e2e-spec.ts | 16 ++++++++++++++++ .../application-restriction-bypass.service.ts | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/sources/packages/backend/apps/api/src/route-controllers/application-restriction-bypass/_tests_/e2e/application-restriction-bypass.aest.controller.getAvailableRestricitionsToBypass.e2e-spec.ts b/sources/packages/backend/apps/api/src/route-controllers/application-restriction-bypass/_tests_/e2e/application-restriction-bypass.aest.controller.getAvailableRestricitionsToBypass.e2e-spec.ts index a248906890..bc46fcb70e 100644 --- a/sources/packages/backend/apps/api/src/route-controllers/application-restriction-bypass/_tests_/e2e/application-restriction-bypass.aest.controller.getAvailableRestricitionsToBypass.e2e-spec.ts +++ b/sources/packages/backend/apps/api/src/route-controllers/application-restriction-bypass/_tests_/e2e/application-restriction-bypass.aest.controller.getAvailableRestricitionsToBypass.e2e-spec.ts @@ -78,6 +78,16 @@ describe("ApplicationRestrictionBypassAESTController(e2e)-getAvailableRestrictio }, ); + const b6aRestriction = await db.restriction.findOne({ + where: { restrictionCode: RestrictionCode.B6A }, + }); + // Add a student restriction that should be available to be bypassed because the restriction has an action type "Stop part time BC funding". + const stopPartTimeBCFundingStudentRestriction = + await saveFakeStudentRestriction(db.dataSource, { + student: application.student, + restriction: b6aRestriction, + }); + const b6bRestriction = await db.restriction.findOne({ where: { restrictionCode: RestrictionCode.B6B }, }); @@ -131,6 +141,12 @@ describe("ApplicationRestrictionBypassAESTController(e2e)-getAvailableRestrictio studentRestrictionCreatedAt: removedApplicationRestrictionsBypass.studentRestriction.createdAt.toISOString(), }, + { + studentRestrictionId: stopPartTimeBCFundingStudentRestriction.id, + restrictionCode: b6aRestriction.restrictionCode, + studentRestrictionCreatedAt: + stopPartTimeBCFundingStudentRestriction.createdAt.toISOString(), + }, { studentRestrictionId: stopPartTimeDisbursementStudentRestriction.id, restrictionCode: ecrsRestriction.restrictionCode, diff --git a/sources/packages/backend/apps/api/src/services/application-restriction-bypass/application-restriction-bypass.service.ts b/sources/packages/backend/apps/api/src/services/application-restriction-bypass/application-restriction-bypass.service.ts index 48585b4dad..f7bbebd8d1 100644 --- a/sources/packages/backend/apps/api/src/services/application-restriction-bypass/application-restriction-bypass.service.ts +++ b/sources/packages/backend/apps/api/src/services/application-restriction-bypass/application-restriction-bypass.service.ts @@ -181,6 +181,7 @@ export class ApplicationRestrictionBypassService { actionType: ArrayOverlap([ RestrictionActionType.StopFullTimeBCFunding, RestrictionActionType.StopFullTimeDisbursement, + RestrictionActionType.StopPartTimeBCFunding, RestrictionActionType.StopPartTimeDisbursement, ]), }, @@ -199,7 +200,10 @@ export class ApplicationRestrictionBypassService { RestrictionActionType.StopFullTimeBCFunding, RestrictionActionType.StopFullTimeDisbursement, ] - : [RestrictionActionType.StopPartTimeDisbursement]; + : [ + RestrictionActionType.StopPartTimeBCFunding, + RestrictionActionType.StopPartTimeDisbursement, + ]; const bypassedStudentRestrictionIds = application.student.studentRestrictions