#6220 - Block disbursement on withdraw/transfer#6332
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an additional e-Cert validation blocker to prevent disbursements from being sent when an application has an active withdrawal or school transfer scholastic standing event (i.e., not reversed), and extends queue-consumer e2e coverage for both full-time and part-time e-Cert generation.
Changes:
- Added a new e-Cert failed validation (
ActiveWithdrawOrTransfer) and validation step logic to block eligible disbursements. - Extended the eligible disbursement query to detect active withdraw/transfer scholastic standing events and surface that as a boolean on
EligibleECertDisbursement. - Added e2e scenarios (full-time + part-time) asserting blocking behavior, non-blocking change types, and reversed-event behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sources/packages/backend/libs/integrations/src/services/disbursement-schedule/e-cert-processing-steps/validate-disbursement-base.ts | Adds the new withdraw/transfer validation blocker and logs when triggered. |
| sources/packages/backend/libs/integrations/src/services/disbursement-schedule/e-cert-generation.service.ts | Joins scholastic standings to flag applications with active withdraw/transfer events during eligibility selection. |
| sources/packages/backend/libs/integrations/src/services/disbursement-schedule/e-cert-calculation/e-cert-pre-validation-service.ts | Minor DI style change (readonly dataSource). |
| sources/packages/backend/libs/integrations/src/services/disbursement-schedule/disbursement-schedule.models.ts | Extends EligibleECertDisbursement and ECertFailedValidation with the new blocker. |
| sources/packages/backend/apps/queue-consumers/src/processors/schedulers/esdc-integration/ecert-integration/tests/ecert-part-time-process-integration.scheduler.e2e-spec.ts | Adds part-time e2e coverage for withdraw/transfer blocking and non-blocking cases. |
| sources/packages/backend/apps/queue-consumers/src/processors/schedulers/esdc-integration/ecert-integration/tests/ecert-full-time-process-integration.scheduler.e2e-spec.ts | Adds full-time e2e coverage for withdraw/transfer blocking and non-blocking cases. |
| "institutionRestriction.location", | ||
| "institutionRestrictionLocation", | ||
| ) | ||
| .leftJoin( |
There was a problem hiding this comment.
I looked at using a subquery to return hasActiveWithdrawOrTransfer directly but between query complexity and having to use getRawAndEntities/mapFromRawAndEntities/custom result type, I felt the join was simpler.
|
Great work @weskubo-cgi. Please take a look at the comments. |
| // Assert log messages for the blocked disbursement. | ||
| expect( | ||
| mockedJob.containLogMessages([ | ||
| `Student has an active scholastic standing change with change type '${StudentScholasticStandingChangeType.SchoolTransfer}' or '${StudentScholasticStandingChangeType.StudentWithdrewFromProgram}'.`, |
There was a problem hiding this comment.
Student application? Missed to mention the application in my suggestion.
There was a problem hiding this comment.
Yes, it should be consistent.
dheepak-aot
left a comment
There was a problem hiding this comment.
Thanks for making the changes. Looks good 👍
|



Summary
Scenario
Withdraw scholastic standing event added to Application awaiting disbursement:

Execute full-time-e-cert-integration - Blocked:
Withdrawal reversed:

Execute full-time-e-cert-integration - Ready to send:
E2E Tests
Scheduler queue processor for full-time-e-cert-integration
Scheduler queue processor for part-time-e-cert-integration