Repository navigation
feat(scripts): seed contractor employments with seed:onboarding --type=contractor - #1455
Open
gabrielseco wants to merge 3 commits into
Open
gabrielseco wants to merge 3 commits into
gabrielseco wants to merge 3 commits into
Conversation
…e=contractor Fills contractor_basic_information and creates a contractor employment, the same as ContractorOnboarding's basic_information step. GBR gets ir_35 and the Gulf countries get nationality on the contractor contract document, because those fields are added client-side and saved there, not in basic_information. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
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.
Reviewed by Cursor Bugbot for commit 6c7701f. Configure here.
Contributor
📊 Coverage Report⚪ Coverage unchanged
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
…ymentId= Mirrors the employee onboarding demo so the link printed by seed:onboarding --type=contractor loads the seeded employment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ntractor-onboarding
This branch has not been deployed
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
Lets the dev seed script create a contractor employment with its basic information already filled in, so you can start testing the contractor flow from the next step without typing it in by hand.
Why
npm run seed:onboardingonly creates EOR employments. Testing contractor onboarding past basic information meant filling that form by hand every time.Adding a
--typeflag to the existing script reuses its auth, API helper and #1423's schema filler and start-date picker, instead of copying them into a second script.What changed
Toggle details
--type=employee|contractorflag onscripts/seed-onboarding.ts. It defaults toemployee, so existing usage doesn't change.--type=contractorfetchescontractor_basic_information(default schema version 1, matchinggetBasicInformationSchemaVersioninContractorOnboarding/utils.ts) and callsPOST /v1/employmentswithtype: 'contractor'. It stops there: no eligibility, engagement agreement or later contractor steps.ir35(GBR) andnationality_status(SAU, KWT, OMN, QAT, BHR) aren't in the API schema.buildBasicInformationJsfModifyadds them client-side, anduseUpdateUKandSaudiFieldssaves them to the contractor contract document after the employment is created. The script does the same withPOST /v1/contractors/employments/{id}/contract-documents:ir_35: 'exempt'.inside/outsidewould require an SDS file upload.nationality: 'national', which skips the non-national path.NATIONALITY_COUNTRY_CODESinstead of imported, so the script doesn't pull in the flow's TSX.Screenshots
N/A
Related Resources
scripts/fill-schema.ts)Testing
example/app in a browser: N/A, script onlyRan
npm run seed:onboarding -- --country=<X> --type=contractor --env=sandbox, then fetched each employment:contract_details.ir_35 = "exempt".contract_details.nationality = "national".Not checked yet: continuing from that partial contract document to contract_details in the UI. The real flow leaves the employment in the same state, so it should work.
🤖 Generated with Claude Code
Note
Low Risk
Dev-only seed script and example demo URL prefilling; no production package or auth changes.
Overview
Adds
--type=contractortonpm run seed:onboarding(default staysemployee). The contractor path fillscontractor_basic_information, creates a contractor employment viaPOST /v1/employments, and for GBR / Gulf countries seeds the contract document withir_35: exemptornationality: nationalso dev testing can skip basic info and the client-only IR35/nationality fields. Output links use?demo=contract-onboarding&employmentId=.The example Contractor Onboarding demo now prefills Employment ID from the
employmentIdquery param (before the env var), matching the seed script links and the employee onboarding demo.Reviewed by Cursor Bugbot for commit 7640378. Bugbot is set up for automated code reviews on this repo. Configure here.