Skip to content

Conversation

@tiago-graf
Copy link
Collaborator

Changes Includes a new migration to update SQL of the report "Disbursement_Report" in the database. The new SQL includes a "Forecast Date" Column.

Rollback test:

image

@tiago-graf tiago-graf self-assigned this Jan 5, 2026
@tiago-graf tiago-graf added the DB DB migration involved label Jan 5, 2026
@tiago-graf tiago-graf marked this pull request as ready for review January 5, 2026 23:06
@tiago-graf tiago-graf requested a review from Copilot January 5, 2026 23:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Disbursement Report to include a new "Forecast Date" column, which displays the scheduled disbursement date alongside the actual disbursement date. The change is implemented through a database migration that updates the SQL query stored in the report configuration table.

  • Adds "Forecast Date" column (from ds.disbursement_date) as the first column in all three UNION queries
  • Provides both forward migration (to add the column) and rollback migration (to remove it)
  • Maintains existing report ordering and filtering logic

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
1767653404966-UpdateDisbursementReportForecastDate.ts TypeScript migration class that executes the SQL update and rollback scripts
Update-disbursements-report-forecast-date.sql SQL script that adds the "Forecast Date" column to all three UNION queries in the disbursement report
Rollback-update-disbursements-report-forecast-date.sql SQL script that removes the "Forecast Date" column to revert to the previous report version

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

@dheepak-aot dheepak-aot self-requested a review January 6, 2026 17:15
export class UpdateDisbursementReportForecastDate1767653404966 implements MigrationInterface {
/**
* Update the disbursement reports to include the "Forecast Date" column.
* @param queryRunner the query runner.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the additional space between the param and comment.

}
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we not include this file if this is not necessary?

@dheepak-aot
Copy link
Collaborator

PR looks good. Please add a E2E test.

Comment on lines 1407 to 1413
const student = application.student;
const sinValidation = createFakeSINValidation({
student,
});
student.sinValidation = sinValidation;
await db.student.save(student);
await db.sinValidation.save(sinValidation);
Copy link
Collaborator

Choose a reason for hiding this comment

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

saveFakeStudent can replace all the work done here. Please use a student created from saveFakeStudent in saveFakeApplicationDisbursements line 1387 and SIN validation will be automatically taken care.

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

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. Looks good.

Copy link
Collaborator

@weskubo-cgi weskubo-cgi left a comment

Choose a reason for hiding this comment

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

Changes look great. Tested report with migration and rollback. Just a few very minor comments.

@@ -73,6 +73,7 @@ SET
)
ORDER BY
"Date of Disbursement",
"Certificate Number" $$
"Certificate Number",
"Funding Code" $$
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Is this a new requirement? I don't see an AC for it.

Copy link
Collaborator Author

@tiago-graf tiago-graf Jan 6, 2026

Choose a reason for hiding this comment

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

This is not part of the AC
The current order by will cause the disbursement values to be returned in random order making it unpredictable in the tests.
The change however should not affect the reporting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@tiago-graf I believe the strict equal/equal(one among the 2) does not enforce the order. If that is added for tests I would ask to remove it as we can handle the assertion.

Copy link
Collaborator

@weskubo-cgi weskubo-cgi Jan 7, 2026

Choose a reason for hiding this comment

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

I think we can also shift the disbursementDate by a day on federal or provincial to get a consistent date sort.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
39.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.3% ( 4323 / 21298 )
Methods: 9.66% ( 252 / 2609 )
Lines: 24.45% ( 3705 / 15155 )
Branches: 10.36% ( 366 / 3534 )

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 75.41% ( 1055 / 1399 )
Methods: 79.31% ( 115 / 145 )
Lines: 78.79% ( 769 / 976 )
Branches: 61.51% ( 171 / 278 )

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 85.68% ( 1616 / 1886 )
Methods: 85% ( 187 / 220 )
Lines: 88.64% ( 1287 / 1452 )
Branches: 66.36% ( 142 / 214 )

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

E2E SIMS API Coverage Report

Totals Coverage
Statements: 75.57% ( 8582 / 11357 )
Methods: 75.59% ( 1028 / 1360 )
Lines: 79.64% ( 6235 / 7829 )
Branches: 60.84% ( 1319 / 2168 )

@tiago-graf tiago-graf added this pull request to the merge queue Jan 7, 2026
Merged via the queue into main with commit e0f35a5 Jan 7, 2026
21 of 22 checks passed
@tiago-graf tiago-graf deleted the feature/#5525-update-disbursement-report branch January 7, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DB DB migration involved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants