/* * 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 { RFCDate } from "../../types/rfcdate.js"; export const Columns = { BankAccountAccountNumber: "bank_account_account_number", BankAccountRoutingNumber: "bank_account_routing_number", BankAccountType: "bank_account_type", BankAccount: "bank_account", Bonus: "bonus", CashTips: "cash_tips", CheckAmount: "check_amount", CheckDate: "check_date", Commission: "commission", DateOfBirth: "date_of_birth", DoubleOvertimeEarnings: "double_overtime_earnings", DoubleOvertimeHours: "double_overtime_hours", DoubleOvertimeRate: "double_overtime_rate", EmployeeAdditionalTaxes: "employee_additional_taxes", EmployeeBenefitContributions: "employee_benefit_contributions", EmployeeCompensationTimePeriod: "employee_compensation_time_period", EmployeeCompensation: "employee_compensation", EmployeeDeductions: "employee_deductions", EmployeeDepartment: "employee_department", EmployeeEmail: "employee_email", EmployeeDonations: "employee_donations", EmployeeFederalIncomeTax: "employee_federal_income_tax", EmployeeFirstName: "employee_first_name", EmployeeLastName: "employee_last_name", EmployeeMiddleInitial: "employee_middle_initial", EmployeeMedicareAdditionalTax: "employee_medicare_additional_tax", EmployeeMedicareTax: "employee_medicare_tax", EmployeePhoneNumber: "employee_phone_number", EmployeeSocialSecurityTax: "employee_social_security_tax", EmployeeTaxes: "employee_taxes", EmployeeUuid: "employee_uuid", EmployeeWorkEmail: "employee_work_email", EmployerAdditionalTaxes: "employer_additional_taxes", EmployerBenefitContributions: "employer_benefit_contributions", EmployerCost: "employer_cost", EmployerFutaTax: "employer_futa_tax", EmployerMedicareTax: "employer_medicare_tax", EmployerSocialSecurityTax: "employer_social_security_tax", EmployerSutaTax: "employer_suta_tax", EmployerTaxes: "employer_taxes", EmploymentType: "employment_type", Employment: "employment", EndDate: "end_date", Garnishments: "garnishments", GrossEarnings: "gross_earnings", HolidayEarnings: "holiday_earnings", HolidayHours: "holiday_hours", HomeAddressCity: "home_address_city", HomeAddressState: "home_address_state", HomeAddressStreet: "home_address_street", HomeAddressZip: "home_address_zip", HomeAddress: "home_address", JobTitle: "job_title", NetPay: "net_pay", OneTimeReimbursements: "one_time_reimbursements", OvertimeEarnings: "overtime_earnings", OvertimeHours: "overtime_hours", OvertimeRate: "overtime_rate", PaidTimeOffEarnings: "paid_time_off_earnings", PaidTimeOffHours: "paid_time_off_hours", PaidTimeOffRate: "paid_time_off_rate", PayPeriodEnd: "pay_period_end", PayPeriodStart: "pay_period_start", PaycheckTips: "paycheck_tips", PaymentMethod: "payment_method", PayrollType: "payroll_type", PayrollUuid: "payroll_uuid", PreferredFirstName: "preferred_first_name", RecurringReimbursements: "recurring_reimbursements", RegularEarnings: "regular_earnings", RegularHours: "regular_hours", RegularRate: "regular_rate", Reimbursements: "reimbursements", RiskClassCode: "risk_class_code", SickRate: "sick_rate", SickTimeOffEarnings: "sick_time_off_earnings", SickTimeOffHours: "sick_time_off_hours", StartDate: "start_date", TotalEmployerBenefitContributions: "total_employer_benefit_contributions", TotalTimeOffEarnings: "total_time_off_earnings", TotalTimeOffHours: "total_time_off_hours", WorkAddressCity: "work_address_city", WorkAddressStreet: "work_address_street", WorkAddressZip: "work_address_zip", } as const; export type Columns = ClosedEnum; export const Groupings = { Payroll: "payroll", Employee: "employee", WorkAddress: "work_address", WorkAddressState: "work_address_state", } as const; export type Groupings = ClosedEnum; /** * The type of file to generate */ export const FileType = { Csv: "csv", Json: "json", Pdf: "pdf", } as const; /** * The type of file to generate */ export type FileType = ClosedEnum; /** * Payment method to filter by */ export const CreateReportBodyPaymentMethod = { Check: "check", DirectDeposit: "direct_deposit", } as const; /** * Payment method to filter by */ export type CreateReportBodyPaymentMethod = ClosedEnum< typeof CreateReportBodyPaymentMethod >; /** * Employee employment type to filter by */ export const EmploymentType = { Exempt: "exempt", SalariedNonexempt: "salaried_nonexempt", Nonexempt: "nonexempt", CommissionOnlyExempt: "commission_only_exempt", CommissionOnlyNonexempt: "commission_only_nonexempt", } as const; /** * Employee employment type to filter by */ export type EmploymentType = ClosedEnum; /** * Employee employment status to filter by */ export const CreateReportBodyEmploymentStatus = { ActiveFullTime: "active_full_time", ActivePartTime: "active_part_time", ActivePartTimeEligible: "active_part_time_eligible", ActiveVariable: "active_variable", ActiveSeasonal: "active_seasonal", Active: "active", Dismissed: "dismissed", } as const; /** * Employee employment status to filter by */ export type CreateReportBodyEmploymentStatus = ClosedEnum< typeof CreateReportBodyEmploymentStatus >; /** * Request body for creating a custom report. */ export type CreateReportBody = { /** * Columns to include in the report */ columns: Array; /** * How to group the report */ groupings: Array; /** * The title of the report */ customName?: string | undefined; /** * The type of file to generate */ fileType: FileType; /** * Whether to include subtotals and grand totals in the report */ withTotals?: boolean | undefined; /** * Start date of data to filter by */ startDate?: RFCDate | undefined; /** * End date of data to filter by */ endDate?: RFCDate | undefined; /** * Dismissed start date of employees to filter by */ dismissedStartDate?: RFCDate | undefined; /** * Dismissed end date of employees to filter by */ dismissedEndDate?: RFCDate | undefined; /** * Payment method to filter by */ paymentMethod?: CreateReportBodyPaymentMethod | undefined; /** * Employee employment type to filter by */ employmentType?: EmploymentType | undefined; /** * Employee employment status to filter by */ employmentStatus?: CreateReportBodyEmploymentStatus | undefined; /** * Employees to filter by */ employeeUuids?: Array | null | undefined; /** * Departments to filter by */ departmentUuids?: Array | undefined; /** * Work addresses to filter by */ workAddressUuids?: Array | undefined; }; /** @internal */ export const Columns$outboundSchema: z.ZodNativeEnum = z .nativeEnum(Columns); /** @internal */ export const Groupings$outboundSchema: z.ZodNativeEnum = z .nativeEnum(Groupings); /** @internal */ export const FileType$outboundSchema: z.ZodNativeEnum = z .nativeEnum(FileType); /** @internal */ export const CreateReportBodyPaymentMethod$outboundSchema: z.ZodNativeEnum< typeof CreateReportBodyPaymentMethod > = z.nativeEnum(CreateReportBodyPaymentMethod); /** @internal */ export const EmploymentType$outboundSchema: z.ZodNativeEnum< typeof EmploymentType > = z.nativeEnum(EmploymentType); /** @internal */ export const CreateReportBodyEmploymentStatus$outboundSchema: z.ZodNativeEnum< typeof CreateReportBodyEmploymentStatus > = z.nativeEnum(CreateReportBodyEmploymentStatus); /** @internal */ export type CreateReportBody$Outbound = { columns: Array; groupings: Array; custom_name?: string | undefined; file_type: string; with_totals: boolean; start_date?: string | undefined; end_date?: string | undefined; dismissed_start_date?: string | undefined; dismissed_end_date?: string | undefined; payment_method?: string | undefined; employment_type?: string | undefined; employment_status?: string | undefined; employee_uuids?: Array | null | undefined; department_uuids?: Array | undefined; work_address_uuids?: Array | undefined; }; /** @internal */ export const CreateReportBody$outboundSchema: z.ZodType< CreateReportBody$Outbound, z.ZodTypeDef, CreateReportBody > = z.object({ columns: z.array(Columns$outboundSchema), groupings: z.array(Groupings$outboundSchema), customName: z.string().optional(), fileType: FileType$outboundSchema, withTotals: z.boolean().default(false), startDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), endDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), dismissedStartDate: z.instanceof(RFCDate).transform(v => v.toString()) .optional(), dismissedEndDate: z.instanceof(RFCDate).transform(v => v.toString()) .optional(), paymentMethod: CreateReportBodyPaymentMethod$outboundSchema.optional(), employmentType: EmploymentType$outboundSchema.optional(), employmentStatus: CreateReportBodyEmploymentStatus$outboundSchema.optional(), employeeUuids: z.nullable(z.array(z.string())).optional(), departmentUuids: z.array(z.string()).optional(), workAddressUuids: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { customName: "custom_name", fileType: "file_type", withTotals: "with_totals", startDate: "start_date", endDate: "end_date", dismissedStartDate: "dismissed_start_date", dismissedEndDate: "dismissed_end_date", paymentMethod: "payment_method", employmentType: "employment_type", employmentStatus: "employment_status", employeeUuids: "employee_uuids", departmentUuids: "department_uuids", workAddressUuids: "work_address_uuids", }); }); export function createReportBodyToJSON( createReportBody: CreateReportBody, ): string { return JSON.stringify( CreateReportBody$outboundSchema.parse(createReportBody), ); }