/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The current status of the state tax setup. * * @remarks * - `not_started`: No requirements have been filled * - `in_progress`: Some requirements have been filled, or default rates are applied * - `complete`: All requirements have been filled without default rates */ export const SetupStatus = { NotStarted: "not_started", InProgress: "in_progress", Complete: "complete", } as const; /** * The current status of the state tax setup. * * @remarks * - `not_started`: No requirements have been filled * - `in_progress`: Some requirements have been filled, or default rates are applied * - `complete`: All requirements have been filled without default rates */ export type SetupStatus = ClosedEnum; export type TaxRequirementStatesList = { /** * One of the two-letter state abbreviations for the fifty United States and the District of Columbia (DC) */ state?: string | undefined; /** * Whether all requirements for the state have been satisfied such that the company can complete onboarding. A company must be `setup_complete` in all relevant states to complete the `state_setup` company onboarding step. */ setupComplete?: boolean | undefined; /** * The current status of the state tax setup. * * @remarks * - `not_started`: No requirements have been filled * - `in_progress`: Some requirements have been filled, or default rates are applied * - `complete`: All requirements have been filled without default rates */ setupStatus?: SetupStatus | undefined; /** * Whether the state is using system-assigned default SUI rates rather than employer-specific rates. */ defaultRatesApplied?: boolean | undefined; /** * Whether the state tax setup is sufficiently complete for the company to run payroll. This will be `true` when `setup_complete` is `true`. */ readyToRunPayroll?: boolean | undefined; }; /** @internal */ export const SetupStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(SetupStatus); /** @internal */ export const TaxRequirementStatesList$inboundSchema: z.ZodType< TaxRequirementStatesList, z.ZodTypeDef, unknown > = z.object({ state: z.string().optional(), setup_complete: z.boolean().optional(), setup_status: SetupStatus$inboundSchema.optional(), default_rates_applied: z.boolean().optional(), ready_to_run_payroll: z.boolean().optional(), }).transform((v) => { return remap$(v, { "setup_complete": "setupComplete", "setup_status": "setupStatus", "default_rates_applied": "defaultRatesApplied", "ready_to_run_payroll": "readyToRunPayroll", }); }); export function taxRequirementStatesListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxRequirementStatesList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxRequirementStatesList' from JSON`, ); }