Skip to content

feat(contractor): add useContractorPaymentMethodForm hook#2302

Merged
serikjensen merged 6 commits into
mainfrom
feat/use-contractor-payment-method-form
Jun 30, 2026
Merged

feat(contractor): add useContractorPaymentMethodForm hook#2302
serikjensen merged 6 commits into
mainfrom
feat/use-contractor-payment-method-form

Conversation

@serikjensen

Copy link
Copy Markdown
Member

Summary

  • Adds useContractorPaymentMethodForm, a headless React Hook Form hook for a contractor's payment method type (Direct Deposit vs Check).
  • On submit it PUTs the payment method. The Direct Deposit path defers actual bank-account creation to useContractorBankAccountForm, so this hook owns only the type selection and the Check write.
  • Exposes the TypeField subcomponent and types via the public surface.

Notes

Test plan

  • useContractorPaymentMethodForm unit + schema tests pass (6/6)
  • npm run derive regenerates API report + docs

Made with Cursor

@serikjensen

Copy link
Copy Markdown
Member Author

@cursoragent fix the format issues that are failing CI

@cursor

cursor Bot commented Jun 29, 2026

Copy link
Copy Markdown

Perfect! I've fixed the formatting issue that was causing the CI failure.

What I did:

  • Ran npm run format which applied Prettier formatting to useContractorPaymentMethodForm.tsx
  • Verified the fix with npm run format:check (now passes)
  • Committed the formatting fix with message fix: apply prettier formatting
  • Pushed to the feat/use-contractor-payment-method-form branch

The formatting CI check should now pass on the next run.

Open in Web Open in Cursor 

export type ContractorPaymentMethodFieldsMetadata = UseContractorPaymentMethodFormReady['form']['fieldsMetadata'];

// @public
export type ContractorPaymentMethodFormData = { type: "Check" | "Direct Deposit"; };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I love it when the derived types are easy to read

Comment thread src/index.ts Outdated
export {
useContractorPaymentMethodForm,
ContractorPaymentMethodErrorCodes,
PAYMENT_METHOD_TYPES as ContractorPaymentMethodTypes,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why rename the export from a screaming case const to a pascal case? (actually a question)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

who am i to ask why claude does the things claude does?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

more seriously good catch! will fix

@mariechatfield mariechatfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome this looks beautiful

@serikjensen

Copy link
Copy Markdown
Member Author

@cursoragent fix the above export unneeded casing change and bring up to date/resolve conflicts

@cursor

cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown

Perfect! I've successfully completed both tasks:

What I Fixed

1. Export Casing Issue

  • Changed the export from PAYMENT_METHOD_TYPES as ContractorPaymentMethodTypes (pascal case) to PAYMENT_METHOD_TYPES as CONTRACTOR_PAYMENT_METHOD_TYPES (screaming case)
  • This maintains the screaming case constant naming convention while avoiding the duplicate identifier collision with the employee payment method types

2. Merged with Main

  • Merged origin/main into the feature branch to bring it up to date
  • Resolved merge conflict in .reports/embedded-react-sdk.api.md by combining both import sections
  • Regenerated the API report with npm run derive to reflect the new export name

Commits Pushed

  • fix: use screaming case for contractor payment method types export
  • Merge remote-tracking branch 'origin/main' into feat/use-contractor-payment-method-form
  • chore: regenerate API report with CONTRACTOR_PAYMENT_METHOD_TYPES

The branch is now up to date with main and the export follows proper naming conventions!

Open in Web Open in Cursor 

serikjensen and others added 4 commits June 30, 2026 22:22
Headless React Hook Form hook for a contractor's payment method type
(Direct Deposit vs Check). On submit it PUTs the payment method; the
Direct Deposit path defers bank-account creation to the bank account form,
so this hook owns only the type selection and the Check write.

Co-authored-by: Cursor <cursoragent@cursor.com>
The constant is an internal implementation detail. Partners have:
- The hook which provides Fields.Type with options baked in
- ContractorPaymentMethodFormType for TypeScript typing

No need to expose the raw constant array.
@cursor cursor Bot force-pushed the feat/use-contractor-payment-method-form branch from 847bcf5 to 4a24ba4 Compare June 30, 2026 22:24
@serikjensen serikjensen enabled auto-merge June 30, 2026 22:26
@serikjensen serikjensen added this pull request to the merge queue Jun 30, 2026
Merged via the queue into main with commit 450b129 Jun 30, 2026
31 checks passed
@serikjensen serikjensen deleted the feat/use-contractor-payment-method-form branch June 30, 2026 22:47
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