Skip to content

Fix steps order bug#1147

Merged
jordividaller merged 3 commits into
mainfrom
fix/pbyr-4243-invert-questionnaire-and-contract-options-steps
Jul 8, 2026
Merged

Fix steps order bug#1147
jordividaller merged 3 commits into
mainfrom
fix/pbyr-4243-invert-questionnaire-and-contract-options-steps

Conversation

@jordividaller

@jordividaller jordividaller commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Description

When selecting Contractor of record in pricing plan, eligibility questionnaire should be the next step and was after contract origin selection.

Other bug discovered when fixing that one
When selecting 'Contractor Management Plus' or 'Contractor of Record' pricing plans, the contract origin selection step is missing from the Remote platform (though it is present in the SDK). This creates a bug when attempting to complete the flow without an agreement on the 'Contractor of Record' plan, as the API requires contract details for this case.

What has been done

  • Now contract origin is considered after Eligibility Questionnaire (even if the two steps should never be displayed in the same flow).

  • Contract origin step is now displayed only if we are in 'contractor management' pricing plan.

How to test

With our example app in the SDK

  • Create contractor, with Contractor of record pricing plan -> Eligibility Questionnaire step should be displayed and not contract origin step.
  • At the last step, go back on pricing plan and select 'contractor management' -> Eligibility Questionnaire step should not be displayed and contract origin step should be.
  • Select without an agreement and go to the end of the flow.
  • Then go back until pricing plan step and select 'Contractor management plus' -> Contract details should be the next step, contract origin step should not be displayed, Eligibility questionnaire step should not be displayed.

Note

Medium Risk
Changes multi-step navigation and skip logic for pricing plans; incorrect gating could block or expose wrong steps in production onboarding.

Overview
Fixes contractor onboarding step order and which steps appear for each pricing plan.

Eligibility vs contract origin: In buildSteps, Contract Options (contract_origin) now comes after Eligibility Questionnaire, so Contractor of Record goes pricing → eligibility → contract details instead of hitting contract origin first.

Plan-specific contract origin: The contract origin step is shown only for Contractor Management (standard). includeContractOrigin is driven by selectedPricingPlan === contractorStandardProductIdentifier (and skipSteps), so Plus and COR skip it—matching platform behavior and avoiding broken “without agreement” flows on COR.

“Without an agreement”: Treating the flow as customer-provided contract now also requires the standard product, so Plus/COR aren’t classified that way from stale origin alone.

Tests and fillContractorSubscription helpers are updated for the new order and plan gating, including switching from CM to CM+ mid-flow.

Reviewed by Cursor Bugbot for commit c874153. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 226.59 kB 226.56 kB +29 B (+0.0%) 🔴
Total (raw) 612.56 kB 612.5 kB +57 B (+0.0%) 🔴
CSS (gzip) 21.45 kB 21.45 kB 0 B (0%) 🟢
CSS (raw) 110.5 kB 110.5 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 226.59 kB / 250 kB (90.6%)
  • ✅ Total raw: 612.56 kB / 650 kB (94.2%)
  • ✅ CSS gzipped: 21.45 kB / 25 kB (85.8%)

Largest Files (Top 5)

  1. chunk-Y3CJRZLA.js - 14 kB (0 B (0%))
  2. styles.css - 10.73 kB (0 B (0%))
  3. index.css - 10.73 kB (0 B (0%))
  4. chunk-Q5OFEWTH.js - 6.43 kB (0 B (0%))
  5. index.js - 6.34 kB (+2 B (+0.0%))
View All Files (345 total)
File Size (gzip) Change
chunk-Y3CJRZLA.js 14 kB 0 B (0%)
styles.css 10.73 kB 0 B (0%)
index.css 10.73 kB 0 B (0%)
chunk-Q5OFEWTH.js 6.43 kB 0 B (0%)
index.js 6.34 kB +2 B (+0.0%)
chunk-BYDNNJHZ.js 6.08 kB 0 B (0%)
chunk-G2LZFGZA.js 5.31 kB 0 B (0%)
chunk-NVLXQA7S.js 4.85 kB new
chunk-A5SRPVT2.js 4.76 kB 0 B (0%)
chunk-S4QKVG2B.js 3.89 kB 0 B (0%)

✅ Bundle size check passed

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-3k4b86z3l-remotecom.vercel.app
Latest Commit:c874153

Deployed with vercel-action

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-jiv78v9ej-remotecom.vercel.app
Latest Commit:c874153

Deployed with vercel-action

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1ee7a9d. Configure here.

Comment thread src/flows/ContractorOnboarding/hooks.tsx
@jordividaller jordividaller changed the title Fix steps orders bug Fix steps order bug Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 88.46% 88.45% 0%
Statements 87.87% 87.86% 0%
Functions 84.84% 84.83% +0.01% 🟢
Branches 79.86% 79.83% +0.03% 🟢

Detailed Breakdown

Lines Coverage
  • Covered: 3885 / 4392
  • Coverage: 88.46%
  • Change: 0% (3 lines)
Statements Coverage
  • Covered: 3947 / 4492
  • Coverage: 87.87%
  • Change: 0% (3 statements)
Functions Coverage
  • Covered: 1052 / 1240
  • Coverage: 84.84%
  • Change: +0.01% (1 functions)
Branches Coverage
  • Covered: 2442 / 3058
  • Coverage: 79.86%
  • Change: +0.03% (4 branches)

✅ Coverage check passed

@jordividaller jordividaller requested a review from cammellos July 7, 2026 15:29
@jordividaller jordividaller merged commit 98b7381 into main Jul 8, 2026
11 checks passed
@jordividaller jordividaller deleted the fix/pbyr-4243-invert-questionnaire-and-contract-options-steps branch July 8, 2026 15:07
@cursor cursor Bot mentioned this pull request Jul 8, 2026
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