/* * 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 * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Currency, Currency$inboundSchema, Currency$outboundSchema, } from "./currency.js"; import { PaymentFrequency, PaymentFrequency$inboundSchema, PaymentFrequency$outboundSchema, } from "./paymentfrequency.js"; import { PaymentUnit, PaymentUnit$inboundSchema, PaymentUnit$outboundSchema, } from "./paymentunit.js"; /** * The FLSA status for this compensation. */ export const FlsaStatus = { Exempt: "exempt", SalariedNonexempt: "salaried-nonexempt", Nonexempt: "nonexempt", Owner: "owner", Other: "other", } as const; /** * The FLSA status for this compensation. */ export type FlsaStatus = OpenEnum; export type EmployeeCompensation = { /** * A unique identifier for an object. */ id?: string | null | undefined; /** * The ID of the job to which the compensation belongs. */ jobId?: string | null | undefined; /** * The amount paid per payment unit. */ rate?: number | null | undefined; /** * Unit of measurement for employee compensation. */ paymentUnit?: PaymentUnit | null | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * The FLSA status for this compensation. */ flsaStatus?: FlsaStatus | null | undefined; /** * The date on which a change to an employee's compensation takes effect. */ effectiveDate?: string | null | undefined; /** * Frequency of employee compensation. */ paymentFrequency?: PaymentFrequency | null | undefined; }; export type EmployeeCompensationInput = { /** * The amount paid per payment unit. */ rate?: number | null | undefined; /** * Unit of measurement for employee compensation. */ paymentUnit?: PaymentUnit | null | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * The FLSA status for this compensation. */ flsaStatus?: FlsaStatus | null | undefined; /** * The date on which a change to an employee's compensation takes effect. */ effectiveDate?: string | null | undefined; /** * Frequency of employee compensation. */ paymentFrequency?: PaymentFrequency | null | undefined; }; /** @internal */ export const FlsaStatus$inboundSchema: z.ZodType< FlsaStatus, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(FlsaStatus)); /** @internal */ export const FlsaStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, FlsaStatus > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(FlsaStatus)); /** @internal */ export const EmployeeCompensation$inboundSchema: z.ZodType< EmployeeCompensation, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(types.string()).optional(), job_id: z.nullable(types.string()).optional(), rate: z.nullable(types.number()).optional(), payment_unit: z.nullable(PaymentUnit$inboundSchema).optional(), currency: z.nullable(Currency$inboundSchema).optional(), flsa_status: z.nullable(FlsaStatus$inboundSchema).optional(), effective_date: z.nullable(types.string()).optional(), payment_frequency: z.nullable(PaymentFrequency$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "job_id": "jobId", "payment_unit": "paymentUnit", "flsa_status": "flsaStatus", "effective_date": "effectiveDate", "payment_frequency": "paymentFrequency", }); }) ); export function employeeCompensationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeCompensation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeCompensation' from JSON`, ); } /** @internal */ export type EmployeeCompensationInput$Outbound = { rate?: number | null | undefined; payment_unit?: string | null | undefined; currency?: string | null | undefined; flsa_status?: string | null | undefined; effective_date?: string | null | undefined; payment_frequency?: string | null | undefined; }; /** @internal */ export const EmployeeCompensationInput$outboundSchema: z.ZodType< EmployeeCompensationInput$Outbound, z.ZodTypeDef, EmployeeCompensationInput > = /* @__PURE__ */ lazySchema$(() => z.object({ rate: z.nullable(z.number()).optional(), paymentUnit: z.nullable(PaymentUnit$outboundSchema).optional(), currency: z.nullable(Currency$outboundSchema).optional(), flsaStatus: z.nullable(FlsaStatus$outboundSchema).optional(), effectiveDate: z.nullable(z.string()).optional(), paymentFrequency: z.nullable(PaymentFrequency$outboundSchema).optional(), }).transform((v) => { return remap$(v, { paymentUnit: "payment_unit", flsaStatus: "flsa_status", effectiveDate: "effective_date", paymentFrequency: "payment_frequency", }); }) ); export function employeeCompensationInputToJSON( employeeCompensationInput: EmployeeCompensationInput, ): string { return JSON.stringify( EmployeeCompensationInput$outboundSchema.parse(employeeCompensationInput), ); }