/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Compensation, Compensation$inboundSchema } from "./compensation.js"; import { PayrollTotals, PayrollTotals$inboundSchema } from "./payrolltotals.js"; export type EmployeePayroll = { /** * A unique identifier for an object. */ id: string | null; /** * ID of the employee */ employeeId?: string | null | undefined; /** * The unique identifier of the company. */ companyId?: string | null | undefined; /** * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. */ processed: boolean | null; /** * The date the payroll was processed. */ processedDate?: string | null | undefined; /** * The date on which employees will be paid for the payroll. */ checkDate: string | null; /** * The start date, inclusive, of the pay period. */ startDate: string | null; /** * The end date, inclusive, of the pay period. */ endDate: string | null; /** * The overview of the payroll totals. */ totals?: PayrollTotals | undefined; /** * An array of compensations for the payroll. */ compensations?: Array | undefined; }; /** @internal */ export const EmployeePayroll$inboundSchema: z.ZodType< EmployeePayroll, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.nullable(types.string()), employee_id: z.nullable(types.string()).optional(), company_id: z.nullable(types.string()).optional(), processed: types.nullable(types.boolean()), processed_date: z.nullable(types.string()).optional(), check_date: types.nullable(types.string()), start_date: types.nullable(types.string()), end_date: types.nullable(types.string()), totals: types.optional(PayrollTotals$inboundSchema), compensations: types.optional(z.array(Compensation$inboundSchema)), }).transform((v) => { return remap$(v, { "employee_id": "employeeId", "company_id": "companyId", "processed_date": "processedDate", "check_date": "checkDate", "start_date": "startDate", "end_date": "endDate", }); }) ); export function employeePayrollFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeePayroll$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeePayroll' from JSON`, ); }