feat(contractor): add contractor self-onboarding profile components#2286
Conversation
Add an `isAdmin` switch to `ContractorProfile` (admin by default) that, when false, renders dedicated individual/business self-onboarding profile components selected by the retrieved contractor's type. `contractorId` is required at the type level when `isAdmin` is false. Decouple `useContractorDetailsForm` + schema from the `selfOnboarding` flag (matching `useEmployeeDetailsForm`): SSN/EIN are exposed by contractor type only and submitted whenever present. The admin form now owns hiding SSN/EIN and relaxing their requiredness via the watched-value + state/effect loop, so each consumer controls its own required set. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@cursoragent please figure out why the CI docs failures are happening and resolve |
|
I've successfully identified and resolved the CI docs-build failures. Here's what I found and fixed: Root Causes1. cspell version incompatibility
2. Stale documentation directory
Changes Made✅ Downgraded cspell from v10.0.1 to v9.8.0 – v9 supports Node >=20, making it compatible with Node 22.14.0 VerificationAll docs-build CI steps now pass locally:
Changes have been committed and pushed to |
| ### ContractorProfileProps | ||
|
|
||
| > **ContractorProfileProps** = [`BaseComponentInterface`](../../index.md#basecomponentinterface)\<`"Contractor.Profile"`\> & `object` & \{ `contractorId?`: `string`; `isAdmin?`: `true`; \} \| \{ `contractorId`: `string`; `isAdmin`: `false`; \} | ||
|
|
||
| Props for [ContractorProfile](#contractorprofile). |
There was a problem hiding this comment.
Can you try making the top-level props a union between two different named interfaces that each extend the base component interface? It's a lot harder to document a type alias with the discriminated union inline, we lose all the props inlined above
| "individualDescription": "Please verify your name and provide your Social Security Number.", | ||
| "businessDescription": "Please verify your business name and provide your EIN.", | ||
| "continue": "Continue", | ||
| "submitting": "Saving..." |
There was a problem hiding this comment.
Super nit, should this be the … unicode character? I actually don't know our style guidelines for whether we prefer to do the dot-dot-dot or the single …
| "ajv": "^8.20.0", | ||
| "axe-core": "^4.12.1", | ||
| "cspell": "^10.0.1", | ||
| "cspell": "^9.8.0", |
There was a problem hiding this comment.
likely a bad merge, will revert
|
@cursoragent could you address all PR items posted by Marie above? |
|
I've addressed all of Marie's PR feedback: Changes Made1. Refactored
|
… unicode ellipsis, revert cspell Co-authored-by: Steve Jensen <stephen.erik.jensen@gmail.com>
| // Warning: (ae-forgotten-export) The symbol "ContractorProfileAdminProps" needs to be exported by the entry point index.d.ts | ||
| // Warning: (ae-forgotten-export) The symbol "ContractorProfileSelfOnboardingProps" needs to be exported by the entry point index.d.ts |
There was a problem hiding this comment.
@cursoragent you forgot to export the two interfaces from all the barrel files
There was a problem hiding this comment.
❌ Unable to add follow-up after multiple attempts. The agent may be experiencing issues.
Please try again later or Open in Web to view the status.
Learn more about Cursor Agents
…actorProfileSelfOnboardingProps Co-authored-by: Steve Jensen <stephen.erik.jensen@gmail.com>
mariechatfield
left a comment
There was a problem hiding this comment.
Thanks for making those changes, the docs are now much easier to read for each flow
|
@cursoragent could you fix format checks that are failing |
|
Fixed! The format check failures were caused by the Prettier upgrade from 3.9.3 to 3.9.4 that came in with the merge from main. Here's what I did: Changes MadeReformatted 67 files to comply with Prettier 3.9.4's updated formatting rules:
The changes were mostly minor formatting adjustments (spacing, line breaks, trailing commas) that the new Prettier version enforces differently. Verification✅ Changes committed and pushed to |
Co-authored-by: Steve Jensen <stephen.erik.jensen@gmail.com>
Co-authored-by: Steve Jensen <stephen.erik.jensen@gmail.com>
74aada1 to
b398027
Compare
Co-authored-by: Steve Jensen <stephen.erik.jensen@gmail.com>
b398027 to
28bf6e3
Compare
28bf6e3 to
0aaaa4a
Compare


Summary
Adds an
isAdminswitch toContractorProfile(admin by default) that, whenfalse, renders dedicated individual and business self-onboarding profile components, selected by the retrieved contractor's type. Mirrors the EmployeeProfilefacade pattern.ContractorProfilePropsgainsisAdmin.contractorIdis optional in admin mode (omitting it creates a contractor) and required at the type level whenisAdmin={false}, since the contractor must already exist for its type to be resolved.selfOnboarding:useContractorDetailsForm+ schema no longer key SSN/EIN behavior off theselfOnboardingflag (matchinguseEmployeeDetailsForm). SSN/EIN are exposed by contractor type only and submitted whenever present.ContractorProfilevia the watched-value + state/effect loop (same pattern as Employee'sAdminProfile). Net admin behavior is unchanged.SelfOnboardingContractorProfile(fetches contractor, branches on type),IndividualSelfOnboardingProfile(name + SSN),BusinessSelfOnboardingProfile(business name + EIN). No toggle, fixed required sets,selfOnboarding: truepinned on the payload.The two self-onboarding components stay internal; the only public surface change is
ContractorProfilegainingisAdmin+ conditionalcontractorId. A follow-upContractorSelfOnboardingFlowis out of scope.Test plan
selfOnboarding; promotion now enforces them even while self-onboardingselfOnboarding; requiredness followsoptionalFieldsToRequireisAdmin={false}individual renders name+SSN and submits SSN; business renders businessName+EIN and submits EIN; type-based branch;hasSsn/hasEinwaivertsc --noEmit, ESLint, Prettier, full Contractor suite greenBusiness contractor self onboarding
Screen.Recording.2026-06-26.at.9.44.16.AM.mov
Individual contractor self onboarding
Screen.Recording.2026-06-26.at.9.46.32.AM.mov
Individual contractor self onboarding with field validation
Screen.Recording.2026-06-26.at.9.47.35.AM.mov
Made with Cursor