feat(credit-risk) - create reserves when COR is selected#760
feat(credit-risk) - create reserves when COR is selected#760gabrielseco wants to merge 40 commits intomainfrom
Conversation
…arrive at the step
…credit-risk-flow-for-cor
… pbyr-3518-build-credit-risk-flow-for-cor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (310 total)
✅ Bundle size check passed |
|
Deploy preview for remote-flows ready! ✅ Preview Built with commit f875626. |
|
Deploy preview for remote-flows-example-app ready! ✅ Preview Built with commit f875626. |
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| }) => void; | ||
| onSubmit?: () => void | Promise<void>; | ||
| render: (props: { employmentStatus: 'invited' }) => ReactNode; | ||
| render: (props: { status: 'invited' | 'create_reserve' }) => ReactNode; |
There was a problem hiding this comment.
Render prop property renamed, breaking consumer API
High Severity
The render prop callback property was renamed from employmentStatus to status in the ContractorOnboarding's OnboardingInvite. Existing consumers destructuring employmentStatus from the render callback will now silently receive undefined. The Onboarding version's OnboardingInvite still uses employmentStatus, creating an inconsistency between two parallel components. This is a breaking change to the public render prop API without a BREAKING CHANGE: commit annotation.
Additional Locations (1)
Triggered by project rule: Code Review Guidelines


I was able to create the reserve invoice in the sandbox environment but I have asked internally how to achieve employment.status created_reserve_paid
Note
Medium Risk
Adds a new submission path that calls the credit-risk reserve invoice endpoint for COR employments, changing the primary action taken from the review step and expanding possible success states. Risk is mainly around triggering the wrong mutation (invite vs reserve) and handling pending/disabled states during onboarding.
Overview
When a contractor employment is Contractor of Record and not read-only, the review-step action now creates a risk reserve invoice (via
useCreateReserveInvoice->/v1/risk-reserve) instead of sending an invite; success callbacks can now returncreated_awaiting_reserveand the button label switches to "Create Reserve".OnboardingInvitehas been moved/rewired to the contractor onboarding flow (types.tsimport change), itsrenderprop now receivesstatus: 'invite' | 'create_reserve', and the button disables while either invite or reserve mutations are pending. Contractor onboarding hook usage is tightened by fetching contract documents usinginternalEmploymentId.Tests are updated/expanded to cover the COR reserve path, new button labeling/disabled behavior, and to reduce flakiness by waiting for spinners and mocking missing schema endpoints.
Written by Cursor Bugbot for commit f875626. This will update automatically on new commits. Configure here.