/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PayrollReversal = { /** * The UUID for the payroll run being reversed. */ reversedPayrollUuid?: string | undefined; /** * The UUID of the payroll where the reversal was applied. */ reversalPayrollUuid?: string | null | undefined; /** * A reason provided by the admin who created the reversal. */ reason?: string | undefined; /** * Timestamp of when the reversal was approved. */ approvedAt?: string | null | undefined; /** * Category chosen by the admin who requested the reversal. */ category?: string | null | undefined; /** * Array of affected employee UUIDs. */ reversedEmployeeUuids?: Array | undefined; }; /** @internal */ export const PayrollReversal$inboundSchema: z.ZodType< PayrollReversal, z.ZodTypeDef, unknown > = z.object({ reversed_payroll_uuid: z.string().optional(), reversal_payroll_uuid: z.nullable(z.string()).optional(), reason: z.string().optional(), approved_at: z.nullable(z.string()).optional(), category: z.nullable(z.string()).optional(), reversed_employee_uuids: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "reversed_payroll_uuid": "reversedPayrollUuid", "reversal_payroll_uuid": "reversalPayrollUuid", "approved_at": "approvedAt", "reversed_employee_uuids": "reversedEmployeeUuids", }); }); export function payrollReversalFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PayrollReversal$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PayrollReversal' from JSON`, ); }