Skip to content

#5969 - Add PIR outcome to applications#6237

Open
tiago-graf wants to merge 9 commits into
mainfrom
feature/#5969-PIR-outcome
Open

#5969 - Add PIR outcome to applications#6237
tiago-graf wants to merge 9 commits into
mainfrom
feature/#5969-PIR-outcome

Conversation

@tiago-graf

Copy link
Copy Markdown
Collaborator

Summary

Adds PIR outcome to applications when it applies.

image

@tiago-graf tiago-graf self-assigned this Jun 12, 2026
@tiago-graf tiago-graf marked this pull request as ready for review June 12, 2026 17:36
Copilot AI review requested due to automatic review settings June 12, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.getApplicationById to 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.

Comment on lines +208 to +212
pirSummaryProgramName:
application.currentAssessment?.offering?.educationProgram.name,
pirSummaryOfferingName: getOfferingNameAndPeriod(
application.currentAssessment?.offering,
),
@tiago-graf tiago-graf added Form.io Form IO definitions changed. Backend Used by the dependabot pull requests to identify PRs related to the backend. labels Jun 12, 2026
@weskubo-cgi weskubo-cgi self-requested a review June 12, 2026 18:55
@andrewsignori-aot andrewsignori-aot self-requested a review June 12, 2026 20:35
* Injected for the read-only PIR outcome summary section in the application form.
* Only populated when pirStatus is completed.
*/
pirSummaryProgramName?: string;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to selectedProgramDesc, a new object can be added to group the pirSummary.

currentReadOnlyDataPromise,
previousReadOnlyDataPromise,
]);
this.applicationControllerService.addPIRSummaryToFormData(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason the generateApplicationFormData was not included as one aditonal step into the existing generateApplicationFormData?

Comment thread sources/packages/backend/apps/api/src/services/application/application.service.ts Outdated
loadDynamicData?: boolean;
studentId?: number;
entityManager?: EntityManager;
loadPIRSummaryData?: boolean;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is loadPIRSummaryData not an extension of the loadDynamicData?
Should loadPIRSummaryData ever be loaded if the loadDynamicData is false?

Comment on lines +316 to +317
programName: savedOffering!.educationProgram.name,
offeringName: getOfferingNameAndPeriod(savedOffering!),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the moment the type was ensured at line 300, these non-null-assertion operators can be removed.

Comment on lines +322 to +326
const offeringInitialValues = {
name: "Test PIR Offering Name",
studyStartDate: "2024-09-01",
studyEndDate: "2025-04-30",
yearOfStudy: 2,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a need to have these values explicitly defined?

*/
pirSummary?: {
/**
* Program name from the completed PIR's current assessment offering.

@andrewsignori-aot andrewsignori-aot Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "show = !!data.pirSummary not enough for the condition?

@andrewsignori-aot andrewsignori-aot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes. Please take a look at the comments.

@weskubo-cgi weskubo-cgi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment on lines +114 to +119
programName?: string;
/**
* Formatted offering name (including year of study and dates) from the
* completed PIR in the application's original assessment.
*/
offeringName?: string;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, those two must be present once the pirSummary is present.

*/
async generateApplicationFormData(
data: ApplicationData,
application: Application,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the parameter comments.

Comment on lines +1050 to +1054
currentAssessment: {
offering: options?.loadDynamicData
? { educationProgram: true }
: true,
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change still required?

@andrewsignori-aot andrewsignori-aot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes. Minor comments left. Feel free to merge once it is done.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.08% ( 4753 / 23671 )
Methods: 9.81% ( 282 / 2874 )
Lines: 24.41% ( 4061 / 16635 )
Branches: 9.85% ( 410 / 4162 )

@github-actions

Copy link
Copy Markdown

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 47.81% ( 2746 / 5744 )
Methods: 37.57% ( 287 / 764 )
Lines: 54.63% ( 2075 / 3798 )
Branches: 32.49% ( 384 / 1182 )

@github-actions

Copy link
Copy Markdown

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 81.49% ( 9627 / 11814 )
Methods: 81.12% ( 1250 / 1541 )
Lines: 84.75% ( 7205 / 8501 )
Branches: 66.14% ( 1172 / 1772 )

@github-actions

Copy link
Copy Markdown

E2E SIMS API Coverage Report

Totals Coverage
Statements: 68.9% ( 14202 / 20612 )
Methods: 66.42% ( 1689 / 2543 )
Lines: 72.07% ( 10171 / 14113 )
Branches: 59.2% ( 2342 / 3956 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend Used by the dependabot pull requests to identify PRs related to the backend. Form.io Form IO definitions changed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants