fix: restore in_pay for Section 54 OPC/OPO/OPT eligibility path - #440
Merged
Conversation
Section 54 legal auth codes short-circuit to Step 8, bypassing Step 7 in-pay restoration. Add a dedicated Step 8 transition so Not Eligible - In Pay and Not Eligible IP-TBD records return to In Pay when legal status is OPC, OPO, or OPT.
Move not_eligible_in_pay and not_eligible_ip_tbd → in_pay transitions into step8_UpdateEligibleTbd and remove the separate Section 54 Step 8 function so all Step 8 callers share one outcome path.
Pass section54 to step8_UpdateEligibleTbd from Step 2 only so Not Eligible - In Pay and Not Eligible IP-TBD return to In Pay for Section 54 legal auth without affecting enroll TBD or no-placement Step 8 paths.
plakkara-bc
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Section 54 legal auth codes short-circuit to Step 8, bypassing Step 7 in-pay restoration. Add a dedicated Step 8 transition so Not Eligible - In Pay and Not Eligible IP-TBD records return to In Pay when legal status is OPC, OPO, or OPT.
Description
records that were In Pay moved to Not Eligible - In Pay when legal status was temporarily end-dated (CRA cancellation). When legal status later changed to a Section 54 code (OPC, OPO, OPT), eligibility did not restore In Pay.
Section 54 codes short-circuit Step 2 → Step 8, bypassing Step 7 where in-pay restoration normally happens. Generic Step 8 only transitions
Not Eligible - Out of Pay→Eligible TBDand leaves all other statuses unchanged.This PR adds a Section 54–specific Step 8 path so Not Eligible - In Pay and Not Eligible IP-TBD return to In Pay when legal auth is OPC, OPO, or OPT. Other Step 8 callers (enroll TBD, placement/no-placement) are unchanged.
What changed
step8_Section54Updatewith Section 54 transitions:not_eligible_out_of_pay/ null →eligible_tbd(unchanged)not_eligible_in_pay/not_eligible_ip_tbd→in_pay(new)step8_Section54Updateinstead of genericstep8_UpdateEligibleTbdHow to test
nvm use 24 && cd backend && npm test -- --run src/sync/eligibility/passes