Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 120 additions & 1 deletion .reports/embedded-react-sdk.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { Compensation } from '@gusto/embedded-api-v-2025-11-15/models/components
import { ComponentType } from 'react';
import { Contractor } from '@gusto/embedded-api-v-2025-11-15/models/components/contractor';
import { ContractorAddress } from '@gusto/embedded-api-v-2025-11-15/models/components/contractoraddress';
import { ContractorBankAccount } from '@gusto/embedded-api-v-2025-11-15/models/components/contractorbankaccount';
import { ContractorOnboardingStatus1 } from '@gusto/embedded-api-v-2025-11-15/models/components/contractor';
import { ContractorPaymentMethod } from '@gusto/embedded-api-v-2025-11-15/models/components/contractorpaymentmethod';
import { Control } from 'react-hook-form';
import { CustomTypeOptions } from 'i18next';
import { default as default_2 } from 'react';
Expand Down Expand Up @@ -1123,6 +1125,12 @@ interface ConfirmWireDetailsProps extends BaseComponentInterface<'Payroll.Confir
wireInId?: string;
}

// @public
export type ContractorAccountType = (typeof ContractorAccountTypes)[number];

// @public
export const ContractorAccountTypes: readonly ["Checking", "Savings"];

// @public
export function ContractorBusinessNameField(props: ContractorBusinessNameFieldProps): JSX;

Expand Down Expand Up @@ -1301,6 +1309,87 @@ export const ContractorOnboardingStatus: {
readonly ONBOARDING_COMPLETED: "onboarding_completed";
};

// @public
export function ContractorPaymentMethodAccountNumberField(props: ContractorPaymentMethodAccountNumberFieldProps): JSX;

// @public
export type ContractorPaymentMethodAccountNumberFieldProps = HookFieldProps<TextInputHookFieldProps<ContractorPaymentMethodAccountNumberValidation>>;

// @public
export type ContractorPaymentMethodAccountNumberValidation = (typeof ContractorPaymentMethodErrorCodes)[keyof Pick<typeof ContractorPaymentMethodErrorCodes, 'REQUIRED' | 'INVALID_ACCOUNT_NUMBER'>];

// @public
export function ContractorPaymentMethodAccountTypeField(props: ContractorPaymentMethodAccountTypeFieldProps): JSX;

// @public
export type ContractorPaymentMethodAccountTypeFieldProps = HookFieldProps<RadioGroupHookFieldProps<ContractorPaymentMethodRequiredValidation, ContractorAccountType>>;

// @public
export type ContractorPaymentMethodErrorCode = (typeof ContractorPaymentMethodErrorCodes)[keyof typeof ContractorPaymentMethodErrorCodes];

// @public
export const ContractorPaymentMethodErrorCodes: {
readonly REQUIRED: "REQUIRED";
readonly INVALID_ROUTING_NUMBER: "INVALID_ROUTING_NUMBER";
readonly INVALID_ACCOUNT_NUMBER: "INVALID_ACCOUNT_NUMBER";
};

// @public
export type ContractorPaymentMethodFieldsMetadata = UseContractorPaymentMethodFormReady['form']['fieldsMetadata'];

// @public
export type ContractorPaymentMethodFormData = { type: "Check" | "Direct Deposit"; name: string; routingNumber: string; accountNumber: string; accountType: "Checking" | "Savings"; };

// @public
export interface ContractorPaymentMethodFormFields {
AccountNumber: typeof ContractorPaymentMethodAccountNumberField | undefined;
AccountType: typeof ContractorPaymentMethodAccountTypeField | undefined;
Name: typeof ContractorPaymentMethodNameField | undefined;
RoutingNumber: typeof ContractorPaymentMethodRoutingNumberField | undefined;
Type: typeof ContractorPaymentMethodTypeField;
}

// @public
export type ContractorPaymentMethodFormOutputs = ContractorPaymentMethodFormData;

// @public
export type ContractorPaymentMethodFormType = (typeof ContractorPaymentMethodTypes)[number];

// @public
export function ContractorPaymentMethodNameField(props: ContractorPaymentMethodNameFieldProps): JSX;

// @public
export type ContractorPaymentMethodNameFieldProps = HookFieldProps<TextInputHookFieldProps<ContractorPaymentMethodRequiredValidation>>;

// @public
export type ContractorPaymentMethodOptionalFieldsToRequire = { create?: never[] | undefined; update?: never[] | undefined; };

// @public
export type ContractorPaymentMethodRequiredValidation = typeof ContractorPaymentMethodErrorCodes.REQUIRED;

// @public
export function ContractorPaymentMethodRoutingNumberField(props: ContractorPaymentMethodRoutingNumberFieldProps): JSX;

// @public
export type ContractorPaymentMethodRoutingNumberFieldProps = HookFieldProps<TextInputHookFieldProps<ContractorPaymentMethodRoutingNumberValidation>>;

// @public
export type ContractorPaymentMethodRoutingNumberValidation = (typeof ContractorPaymentMethodErrorCodes)[keyof Pick<typeof ContractorPaymentMethodErrorCodes, 'REQUIRED' | 'INVALID_ROUTING_NUMBER'>];

// @public
export interface ContractorPaymentMethodSubmitOptions {
onBankAccountCreated?: (bankAccount: ContractorBankAccount) => void;
}

// @public
export function ContractorPaymentMethodTypeField(props: ContractorPaymentMethodTypeFieldProps): JSX;

// @public
export type ContractorPaymentMethodTypeFieldProps = HookFieldProps<RadioGroupHookFieldProps<never, ContractorPaymentMethodFormType>>;

// @public
export const ContractorPaymentMethodTypes: readonly ["Direct Deposit", "Check"];

// @public
function ContractorProfile(props: ContractorProfileProps): JSX;

Expand Down Expand Up @@ -3509,7 +3598,7 @@ function PaymentMethod(input: PaymentMethodProps): JSX;
function PaymentMethod_2(input: PaymentMethodProps_2): JSX;

// @public
function PaymentMethod_3(props: PaymentMethodProps_3): JSX;
function PaymentMethod_3(input: PaymentMethodProps_3): JSX;

// @public
function PaymentMethodBankForm(input: PaymentMethodBankFormProps): JSX;
Expand Down Expand Up @@ -5154,6 +5243,36 @@ export type UseContractorDetailsFormSharedProps = {
shouldFocusError?: boolean;
};

// @public
export function useContractorPaymentMethodForm(input: UseContractorPaymentMethodFormProps): HookLoadingResult | UseContractorPaymentMethodFormReady;

// @public
export interface UseContractorPaymentMethodFormProps {
contractorId: string;
defaultValues?: Partial<ContractorPaymentMethodFormData>;
optionalFieldsToRequire?: ContractorPaymentMethodOptionalFieldsToRequire;
shouldFocusError?: boolean;
validationMode?: UseFormProps['mode'];
}

// @public
export interface UseContractorPaymentMethodFormReady extends BaseFormHookReady<FieldsMetadata, ContractorPaymentMethodFormData, ContractorPaymentMethodFormFields> {
actions: {
onSubmit: (options?: ContractorPaymentMethodSubmitOptions) => Promise<HookSubmitResult<ContractorPaymentMethod> | undefined>;
};
data: {
paymentMethod: ContractorPaymentMethod;
bankAccount: ContractorBankAccount | undefined;
};
status: {
isPending: boolean;
mode: 'update';
};
}

// @public
export type UseContractorPaymentMethodFormResult = HookLoadingResult | UseContractorPaymentMethodFormReady;

// @public
export function useCurrentHomeAddressForm(props: UseCurrentHomeAddressFormProps): UseHomeAddressFormResult;

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/contractor/hooks/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ custom_edit_url: null

# Hooks

<DocCardList items={[{"type":"link","href":"use-contractor-details-form","label":"✍️ useContractorDetailsForm","description":"Headless hook for creating or updating a contractor's profile details — individual vs. business type, wage type, names, SSN/EIN, work state, and the self-onboarding preference."}]} />
<DocCardList items={[{"type":"link","href":"use-contractor-details-form","label":"✍️ useContractorDetailsForm","description":"Headless hook for creating or updating a contractor's profile details — individual vs. business type, wage type, names, SSN/EIN, work state, and the self-onboarding preference."},{"type":"link","href":"use-contractor-payment-method-form","label":"✍️ useContractorPaymentMethodForm","description":"Headless React Hook Form hook for managing a contractor's payment method."}]} />
Loading
Loading