/* * 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 { ClosedEnum } from "../../types/enums.js"; import { FlsaStatusType, FlsaStatusType$outboundSchema, } from "./flsastatustype.js"; /** * The unit accompanying the compensation rate. If the employee is an owner, rate should be 'Paycheck'. */ export const CompensationsRequestBodyPaymentUnit = { Hour: "Hour", Week: "Week", Month: "Month", Year: "Year", Paycheck: "Paycheck", } as const; /** * The unit accompanying the compensation rate. If the employee is an owner, rate should be 'Paycheck'. */ export type CompensationsRequestBodyPaymentUnit = ClosedEnum< typeof CompensationsRequestBodyPaymentUnit >; export type CompensationsRequestBodyMinimumWages = { /** * The UUID of the minimum wage. */ uuid?: string | undefined; }; /** * Request body for creating a compensation. */ export type CompensationsRequestBody = { /** * The dollar amount paid per payment unit. */ rate: string; /** * The unit accompanying the compensation rate. If the employee is an owner, rate should be 'Paycheck'. */ paymentUnit: CompensationsRequestBodyPaymentUnit; /** * The FLSA status for this compensation. Salaried ('Exempt') employees are paid a fixed salary every pay period. Salaried with overtime ('Salaried Nonexempt') employees are paid a fixed salary every pay period, and receive overtime pay when applicable. Hourly ('Nonexempt') employees are paid for the hours they work, and receive overtime pay when applicable. Commissioned employees ('Commission Only Exempt') earn wages based only on commission. Commissioned with overtime ('Commission Only Nonexempt') earn wages based on commission, and receive overtime pay when applicable. Owners ('Owner') are employees that own at least twenty percent of the company. */ flsaStatus: FlsaStatusType; /** * The effective date for this compensation. */ effectiveDate?: string | undefined; /** * The job title for this compensation. */ title?: string | undefined; /** * Whether the compensation should be adjusted to minimum wage during payroll calculation. */ adjustForMinimumWage?: boolean | undefined; minimumWages?: Array | undefined; }; /** @internal */ export const CompensationsRequestBodyPaymentUnit$outboundSchema: z.ZodNativeEnum = z.nativeEnum( CompensationsRequestBodyPaymentUnit, ); /** @internal */ export type CompensationsRequestBodyMinimumWages$Outbound = { uuid?: string | undefined; }; /** @internal */ export const CompensationsRequestBodyMinimumWages$outboundSchema: z.ZodType< CompensationsRequestBodyMinimumWages$Outbound, z.ZodTypeDef, CompensationsRequestBodyMinimumWages > = z.object({ uuid: z.string().optional(), }); export function compensationsRequestBodyMinimumWagesToJSON( compensationsRequestBodyMinimumWages: CompensationsRequestBodyMinimumWages, ): string { return JSON.stringify( CompensationsRequestBodyMinimumWages$outboundSchema.parse( compensationsRequestBodyMinimumWages, ), ); } /** @internal */ export type CompensationsRequestBody$Outbound = { rate: string; payment_unit: string; flsa_status: string; effective_date?: string | undefined; title?: string | undefined; adjust_for_minimum_wage?: boolean | undefined; minimum_wages?: | Array | undefined; }; /** @internal */ export const CompensationsRequestBody$outboundSchema: z.ZodType< CompensationsRequestBody$Outbound, z.ZodTypeDef, CompensationsRequestBody > = z.object({ rate: z.string(), paymentUnit: CompensationsRequestBodyPaymentUnit$outboundSchema, flsaStatus: FlsaStatusType$outboundSchema, effectiveDate: z.string().optional(), title: z.string().optional(), adjustForMinimumWage: z.boolean().optional(), minimumWages: z.array( z.lazy(() => CompensationsRequestBodyMinimumWages$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { paymentUnit: "payment_unit", flsaStatus: "flsa_status", effectiveDate: "effective_date", adjustForMinimumWage: "adjust_for_minimum_wage", minimumWages: "minimum_wages", }); }); export function compensationsRequestBodyToJSON( compensationsRequestBody: CompensationsRequestBody, ): string { return JSON.stringify( CompensationsRequestBody$outboundSchema.parse(compensationsRequestBody), ); }