Skip to content

feat: warn admins when editing contractor profile/address after W-9 signing#2394

Merged
serikjensen merged 9 commits into
mainfrom
al/SDK-1029/contractor-profile-w9-alert
Jul 15, 2026
Merged

feat: warn admins when editing contractor profile/address after W-9 signing#2394
serikjensen merged 9 commits into
mainfrom
al/SDK-1029/contractor-profile-w9-alert

Conversation

@aaronlee777

@aaronlee777 aaronlee777 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an SDK Alert (warning variant) above the Contractor Profile (admin edit surface) and Contractor Address forms when the contractor already has a signed W-9 on file.
  • Alert copy signals to the admin that changing name/SSN/EIN or the mailing address will require re-collecting a new W-9.
  • Introduces a small useContractorHasSignedW9(contractorId) Suspense hook that reads the documents endpoint and returns true iff the contractor has a W-9 with a signedAt timestamp. The presence of a signed W-9 naturally covers both the self_onboarding_review and onboarding_completed cases without threading state through the flow machine.
  • Profile: alert only mounts in edit mode (mode === 'update' + resolved uuid), so create-mode never fetches documents.
  • Address: contractorId is always required, so no gating needed.
  • Self-onboarding contractor branch (SelfOnboardingContractorProfile) is intentionally left untouched.

Test plan

  • npm run test -- --run src/components/Contractor/Profile src/components/Contractor/Address (111 passing, including 5 new W-9 warning cases)
  • npx tsc --noEmit clean
  • Manual admin review path: pull SDK dev app, load a contractor in self_onboarding_review state with a signed W-9, verify warning renders above both edit surfaces

JIRA: SDK-1029

🤖 Generated with Claude Code

…igning

Adds an SDK Alert (warning) above the Contractor Profile and Address edit
forms when the contractor already has a signed W-9 on file. Signals to the
admin that any edit to name/SSN/EIN or address will require re-collecting a
new W-9. Alert is derived from the documents endpoint via a new
`useContractorHasSignedW9` Suspense hook — the presence of a signed W-9
naturally covers both the self_onboarding_review and onboarding_completed
cases without threading state through the flow machine.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aaronlee777 aaronlee777 requested a review from a team as a code owner July 13, 2026 21:01
github-actions Bot and others added 2 commits July 13, 2026 21:04
The contractor profile update button was renamed from "Update Contractor"
to "Continue" in Contractor.Profile.json; align the 03-onboarding-edit
spec so the button assertion matches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@serikjensen serikjensen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is looking good! blocking since we still need confirmation from legal that this is the correct way forward

aaronlee777 and others added 2 commits July 14, 2026 15:56
…ed Form W-9

Rewrites the Contractor.Profile and Contractor.Address w9EditWarning copy so
it makes clear that edits require the employer to retain an updated and
signed Form W-9 reflecting the corrected information — the operational
obligation, not just "sign a new W-9."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
aaronlee777 and others added 3 commits July 15, 2026 14:18
Rewords the body to reflect the retention obligation: the employer must
update and retain a new signed Form W-9 reflecting the corrected
information whenever the contractor's profile or address is corrected
after signing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@serikjensen serikjensen enabled auto-merge July 15, 2026 21:09
@serikjensen

Copy link
Copy Markdown
Member

@cursoragent could you take a look at test failures on this one and resolve?

@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

Perfect! I've fixed the test failures and pushed the changes. Here's what I did:

Fixed Issues

  1. Added missing contractor documents mock - The new W9 warning component uses useContractorHasSignedW9() which fetches contractor documents via a Suspense hook. The renderEditForPostSaveStatus test helper was missing the documents endpoint mock, causing the component to hang during rendering. I added handleGetContractorDocuments(() => HttpResponse.json(buildContractorDocumentsList())) to the test setup.

  2. Updated button text in test - The test was looking for a button labeled "Update Contractor", but the actual button text comes from the translation key buttons.update which is "Continue". I updated the test to use the correct button text.

Results

  • All 26 tests in ContractorProfile.test.tsx now pass ✅
  • All 33 tests in the Contractor Address component pass ✅
  • TypeScript type check passes with no errors ✅
  • Changes committed and pushed successfully

The CI should re-run with these fixes and the tests should pass.

Open in Web Open in Cursor 

@serikjensen serikjensen added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 3cb2e1e Jul 15, 2026
36 checks passed
@serikjensen serikjensen deleted the al/SDK-1029/contractor-profile-w9-alert branch July 15, 2026 21:36
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.

3 participants