Skip to content

feat(Contractor.Documents): document list, W-9 signing, and signer flow#2292

Draft
serikjensen wants to merge 2 commits into
mainfrom
feat/contractor-documents-signing
Draft

feat(Contractor.Documents): document list, W-9 signing, and signer flow#2292
serikjensen wants to merge 2 commits into
mainfrom
feat/contractor-documents-signing

Conversation

@serikjensen

Copy link
Copy Markdown
Member

Summary

Adds standalone contractor document review + signing (W-9), developed together so it can be split into focused PRs later.

  • useContractorDocumentsList + DocumentsList — lists a contractor's documents; Continue gates on all required docs being signed; emits contractor/documents/view / contractor/documents/done.
  • useContractorSignatureForm + SignatureForm — dynamic W-9 form driven by the document's fields[] (state-taxes-style). Synthesizes the 7 classification checkboxes into a single radio group with conditional LLC-code / "Other" sub-fields, maps the selection back to the 0/1 wire format on submit, and reuses the shared DocumentViewer.
  • ContractorDocumentSigner — thin robot3 orchestrator composing the two (standalone; not wired into ContractorOnboardingFlow yet, per the dedicated-flow plan).
  • Redacted SSN/EIN handling — masked values from the API are no longer seeded as the input value (which round-tripped the mask back on submit). They now seed an empty input, surface the mask as a placeholder, are exempt from required validation, and are omitted from the sign payload unless the contractor types a replacement. (Mirrors the employee hasRedactedValue pattern; adds an optional placeholder to FieldMetadata.)
  • Dedicated i18n namespaces (Contractor.DocumentsList, Contractor.SignatureForm), scoped events, MSW W-9 mocks, hook/component/orchestrator tests, and stories.
  • sdk-app registry regenerated so the dev app injects contractorId (and prompts for documentUuid on the standalone SignatureForm).

Status / TODO before review

  • Failing test: SignatureForm "shows the masked SSN as a placeholder" — getByLabelText('Social Security Number (SSN)') no longer resolves after the redacted-field change; needs the query/label association sorted out.
  • Split into focused PRs (list → sign hook → sign component → orchestrator).
  • Confirm the sign endpoint's expected behavior for omitted redacted fields against gws-flows.

Test plan

  • npm run test -- --run src/components/Contractor/Documents
  • Exercise list → sign → back / done in the SDK dev app against a real contractor.

Made with Cursor

serikjensen and others added 2 commits June 26, 2026 15:18
…r flow

Add standalone contractor document signing:
- useContractorDocumentsList data hook + DocumentsList component
- useContractorSignatureForm dynamic W-9 hook (get/getPdf/sign) with
  classification radio synthesis, conditional LLC/other fields, and 0/1
  wire mapping on submit
- SignatureForm component reusing the shared DocumentViewer
- ContractorDocumentSigner robot3 orchestrator composing the two
- masked SSN/EIN handled as redacted: empty input, mask shown as
  placeholder, omitted from the sign payload unless replaced
- dedicated i18n namespaces, events, MSW W-9 mocks, tests, and stories
- sdk-app registry regenerated so the dev app injects contractorId

WIP: SignatureForm masked-SSN placeholder test (getByLabelText) still
failing; to be resolved before review.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant