export type CreateApiEmployeesArgs = {body: {companyID: string, new_employees: Array<{email: string, first_name: string, last_name: string, title: string, default_pay_schedule: string, default_wage: number, workLocationID: string, overtime_rate?: number | undefined, doubletime_rate?: number | undefined, start_date?: string | undefined, dob?: string | undefined, ssn?: string | undefined, phone_number?: string | undefined, address?: string | undefined, address_line2?: string | undefined, city?: string | undefined, state?: string | undefined, zip?: string | undefined, is_943?: boolean | undefined, is_scheduleH?: boolean | undefined, external_id?: string | undefined, metadata?: Record | undefined, work_week_start?: string | undefined, is_salary?: boolean | undefined, salary?: number | undefined, is_regular?: boolean | undefined, soc_code?: string | undefined}>}}; export type CreateApiEmployeesOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create Employee * * POST /employees */ export const createApiEmployees = async (args: CreateApiEmployeesArgs, options?: CreateApiEmployeesOptions) => { const {baseUrl = "https://api.zeal.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/employees${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };