feat(contractor): add contractor self-onboarding profile components#2286
Open
serikjensen wants to merge 3 commits into
Open
feat(contractor): add contractor self-onboarding profile components#2286serikjensen wants to merge 3 commits into
serikjensen wants to merge 3 commits into
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>
Member
Author
|
@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 |
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.


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