feat(useContractorSignatureForm): add contractor W-9 signature form hook#2318
Open
serikjensen wants to merge 1 commit into
Open
feat(useContractorSignatureForm): add contractor W-9 signature form hook#2318serikjensen wants to merge 1 commit into
serikjensen wants to merge 1 commit into
Conversation
Headless hook for signing a contractor document (W-9). Declares the field surface statically with presence-based gating for API-variable fields, collapses the seven tax-classification checkboxes into a single radio group with conditional LLC-code/Other sub-fields, and maps the selection back to the W-9 wire format on submit. Adds SSN/EIN format validation with an "N/A" sentinel, consolidates the shared EIN_REGEX, and exposes a field-metadata placeholder for masked values. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 1, 2026
3 tasks
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 the headless
useContractorSignatureFormhook — the data/validation/field layer for signing a contractor document (W-9). This is the first of two PRs; theContractor.SignatureFormcomponent that consumes it follows in a stacked PR.form.Fields) with presence-based gating: core fields are always present, API-variable fields are exposed only when the API returns them (undefinedotherwise) — a defensive guard against API divergence.N/Asentinel; omits untouched redacted TINs on submit so the backend falls back to the real profile value.EIN_REGEX(helpers/validations.ts), now also consumed bycontractorDetailsSchema.placeholderfield-metadata property for masked-value display.onSubmitreturnsHookSubmitResult<DocumentSigned>, soDocumentSignedis re-exported through the public API models.Test plan
npm run test -- --run src/components/Contractor/Documents/SignatureForm/useContractorSignatureForm(43 passing)npx tsc --noEmitnpm run derive(API report + docs regenerated, 0 errors)Separated this into smaller PRs, but worked on both together and verified this hook with the UI as follows:
Screen.Recording.2026-06-30.at.4.52.45.PM.mov
Made with Cursor