Skip to content

fix: restore in_pay for Section 54 OPC/OPO/OPT eligibility path - #440

Merged
mdiapenabc merged 3 commits into
devfrom
feat/section54-not-eligible-in-pay
Aug 7, 2026
Merged

fix: restore in_pay for Section 54 OPC/OPO/OPT eligibility path#440
mdiapenabc merged 3 commits into
devfrom
feat/section54-not-eligible-in-pay

Conversation

@mdiapenabc

Copy link
Copy Markdown
Collaborator

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 PayEligible TBD and 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

  • Added step8_Section54Update with Section 54 transitions:
    • not_eligible_out_of_pay / null → eligible_tbd (unchanged)
    • not_eligible_in_pay / not_eligible_ip_tbdin_pay (new)
  • Step 2 routes OPC/OPO/OPT to step8_Section54Update instead of generic step8_UpdateEligibleTbd
  • Unit and Step 2 integration tests for in-pay restoration and guard that generic Step 8 does not restore in-pay

How to test

  • nvm use 24 && cd backend && npm test -- --run src/sync/eligibility/ passes
  • Record In Pay → legal end-dated → Not Eligible - In Pay → legal updated to OPC/OPO/OPT → run eligibility → status returns to In Pay
  • Same flow from Not Eligible IP-TBDIn Pay when legal auth is Section 54
  • Section 54 record at Not Eligible - Out of Pay still transitions to Eligible TBD
  • Non-Section 54 Step 8 path (enroll TBD, no placement) still leaves Not Eligible - In Pay unchanged

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.
@mdiapenabc
mdiapenabc merged commit 1affb38 into dev Aug 7, 2026
20 checks passed
@mdiapenabc
mdiapenabc deleted the feat/section54-not-eligible-in-pay branch August 7, 2026 01:13
mdiapenabc added a commit that referenced this pull request Aug 7, 2026
Restore batch CRA validation (#439), Section 54 eligibility (#440),
and Job Monitoring Alerts UI (#438) from dev after a bad merge
reintroduced pre-#439 code on this branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants