#5969 - Add PIR outcome to applications#6237
Conversation
There was a problem hiding this comment.
Pull request overview
Adds PIR (Program Information Request) outcome summary details into application form data so that the SFAA form can display a read-only “Program information request summary” section when PIR is completed.
Changes:
- Added a new read-only PIR summary panel (program name + offering name) to SFAA form definitions across multiple program years/intensities.
- Enhanced
ApplicationService.getApplicationByIdto optionally load original assessment offering/program details needed for the PIR summary. - Injected PIR summary fields into application form data for Students/Institutions/AEST application detail endpoints, with e2e coverage added/updated.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sources/packages/forms/src/form-definitions/sfaa2026-27-pt.json | Adds PIR summary panel/fields to the 2026-27 PT form. |
| sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json | Adds PIR summary panel/fields to the 2026-27 FT form. |
| sources/packages/forms/src/form-definitions/sfaa2025-26-pt.json | Adds PIR summary panel/fields to the 2025-26 PT form. |
| sources/packages/forms/src/form-definitions/sfaa2025-26-ft.json | Adds PIR summary panel/fields to the 2025-26 FT form. |
| sources/packages/forms/src/form-definitions/sfaa2024-25.json | Adds PIR summary panel/fields to the 2024-25 form. |
| sources/packages/forms/src/form-definitions/sfaa2023-24.json | Adds PIR summary panel/fields to the 2023-24 form. |
| sources/packages/forms/src/form-definitions/sfaa2022-23.json | Adds PIR summary panel/fields to the 2022-23 form. |
| sources/packages/backend/apps/api/src/services/application/application.service.ts | Adds loadPIRSummaryData option to fetch assessment/offering/program details for PIR summary. |
| sources/packages/backend/apps/api/src/route-controllers/application/models/application.dto.ts | Extends ApplicationFormData with PIR summary fields. |
| sources/packages/backend/apps/api/src/route-controllers/application/application.students.controller.ts | Enables PIR summary loading and injects summary into student application form data. |
| sources/packages/backend/apps/api/src/route-controllers/application/application.institutions.controller.ts | Enables PIR summary loading and injects summary into institution application form data when dynamic data is loaded. |
| sources/packages/backend/apps/api/src/route-controllers/application/application.controller.service.ts | Adds addPIRSummaryToFormData helper to enrich form data when PIR is completed. |
| sources/packages/backend/apps/api/src/route-controllers/application/application.aest.controller.ts | Enables PIR summary loading and injects summary into AEST application form data when dynamic data is loaded. |
| sources/packages/backend/apps/api/src/route-controllers/application/tests/e2e/application.students.controller.getApplication.e2e-spec.ts | Updates/extends student getApplication e2e coverage for PIR summary. |
| sources/packages/backend/apps/api/src/route-controllers/application/tests/e2e/application.institutions.controller.getApplicationDetails.e2e-spec.ts | Adds institution getApplicationDetails e2e coverage for PIR summary. |
| sources/packages/backend/apps/api/src/route-controllers/application/tests/e2e/application.aest.controller.getApplicationDetails.e2e-spec.ts | Adds AEST getApplicationDetails e2e coverage for PIR summary. |
| pirSummaryProgramName: | ||
| application.currentAssessment?.offering?.educationProgram.name, | ||
| pirSummaryOfferingName: getOfferingNameAndPeriod( | ||
| application.currentAssessment?.offering, | ||
| ), |
| * Injected for the read-only PIR outcome summary section in the application form. | ||
| * Only populated when pirStatus is completed. | ||
| */ | ||
| pirSummaryProgramName?: string; |
There was a problem hiding this comment.
Similar to selectedProgramDesc, a new object can be added to group the pirSummary.
| currentReadOnlyDataPromise, | ||
| previousReadOnlyDataPromise, | ||
| ]); | ||
| this.applicationControllerService.addPIRSummaryToFormData( |
There was a problem hiding this comment.
Is there any particular reason the generateApplicationFormData was not included as one aditonal step into the existing generateApplicationFormData?
| loadDynamicData?: boolean; | ||
| studentId?: number; | ||
| entityManager?: EntityManager; | ||
| loadPIRSummaryData?: boolean; |
There was a problem hiding this comment.
Is loadPIRSummaryData not an extension of the loadDynamicData?
Should loadPIRSummaryData ever be loaded if the loadDynamicData is false?
| programName: savedOffering!.educationProgram.name, | ||
| offeringName: getOfferingNameAndPeriod(savedOffering!), |
There was a problem hiding this comment.
From the moment the type was ensured at line 300, these non-null-assertion operators can be removed.
| const offeringInitialValues = { | ||
| name: "Test PIR Offering Name", | ||
| studyStartDate: "2024-09-01", | ||
| studyEndDate: "2025-04-30", | ||
| yearOfStudy: 2, |
There was a problem hiding this comment.
Was there a need to have these values explicitly defined?
| */ | ||
| pirSummary?: { | ||
| /** | ||
| * Program name from the completed PIR's current assessment offering. |
There was a problem hiding this comment.
current assessment offering seems misleading in this context (same for the offeringName property). Please use something like this.
Program name from the completed PIR in the application's original assessment.
| data: { | ||
| pirSummary: { | ||
| programName: savedOffering.educationProgram.name, | ||
| offeringName: getOfferingNameAndPeriod(savedOffering), |
There was a problem hiding this comment.
Just noticed it now; the idea is to try to avoid using this type of production utility to ensure the test will fail if an issue is introduced at that level.
The recommendation is either to control the input data and test a constant or recreate in a raw way the utility output.
| "key": "pirSummaryPanel", | ||
| "label": "Program information request summary", | ||
| "input": false, | ||
| "customConditional": "show = !!(data.pirSummary && data.pirSummary.programName);", |
There was a problem hiding this comment.
Is "show = !!data.pirSummary not enough for the condition?
andrewsignori-aot
left a comment
There was a problem hiding this comment.
Thanks for making the changes. Please take a look at the comments.
| programName?: string; | ||
| /** | ||
| * Formatted offering name (including year of study and dates) from the | ||
| * completed PIR in the application's original assessment. | ||
| */ | ||
| offeringName?: string; |
There was a problem hiding this comment.
Minor, those two must be present once the pirSummary is present.
| */ | ||
| async generateApplicationFormData( | ||
| data: ApplicationData, | ||
| application: Application, |
There was a problem hiding this comment.
Please update the parameter comments.
| currentAssessment: { | ||
| offering: options?.loadDynamicData | ||
| ? { educationProgram: true } | ||
| : true, | ||
| }, |
There was a problem hiding this comment.
Is this change still required?
andrewsignori-aot
left a comment
There was a problem hiding this comment.
Thanks for making the changes. Minor comments left. Feel free to merge once it is done.
|



Summary
Adds PIR outcome to applications when it applies.