/* * 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; /** * Which payroll date `start_date` and `end_date` filter against. */ export const DateFilterType = { PeriodEndDate: "period_end_date", PeriodStartDate: "period_start_date", CheckDate: "check_date", } as const; /** * Which payroll date `start_date` and `end_date` filter against. */ export type DateFilterType = ClosedEnum; /** * Payment method to filter by. */ export const PaymentMethod = { Check: "check", DirectDeposit: "direct_deposit", } as const; /** * Payment method to filter by. */ export type PaymentMethod = ClosedEnum; /** * 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 EmploymentStatus = { 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 EmploymentStatus = ClosedEnum; /** * A custom report entry in a bulk batch. */ export type BulkReportCustomReportItem = { /** * UUID of the company to generate the report for. The partner must be mapped to this company. */ companyUuid: string; /** * Identifies this batch item as a custom report. */ reportType: "custom_report"; /** * Columns to include in the report. */ columns: Array; /** * How to group the report. If omitted, defaults are derived from the requested `columns`. */ groupings?: Array | undefined; /** * The type of file to generate. */ fileType: FileType; /** * Display name for the report. */ customName?: string | undefined; /** * Whether to include subtotals and grand totals. */ withTotals?: boolean | undefined; /** * Which payroll date `start_date` and `end_date` filter against. */ dateFilterType?: DateFilterType | undefined; /** * Start date of data to filter by. */ startDate?: RFCDate | undefined; /** * End date of data to filter by. */ endDate?: RFCDate | undefined; /** * Payment method to filter by. */ paymentMethod?: PaymentMethod | undefined; /** * Employee employment type to filter by. */ employmentType?: EmploymentType | undefined; /** * Employee employment status to filter by. */ employmentStatus?: EmploymentStatus | 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 DateFilterType$outboundSchema: z.ZodNativeEnum< typeof DateFilterType > = z.nativeEnum(DateFilterType); /** @internal */ export const PaymentMethod$outboundSchema: z.ZodNativeEnum< typeof PaymentMethod > = z.nativeEnum(PaymentMethod); /** @internal */ export const EmploymentType$outboundSchema: z.ZodNativeEnum< typeof EmploymentType > = z.nativeEnum(EmploymentType); /** @internal */ export const EmploymentStatus$outboundSchema: z.ZodNativeEnum< typeof EmploymentStatus > = z.nativeEnum(EmploymentStatus); /** @internal */ export type BulkReportCustomReportItem$Outbound = { company_uuid: string; report_type: "custom_report"; columns: Array; groupings?: Array | undefined; file_type: string; custom_name?: string | undefined; with_totals: boolean; date_filter_type: string; start_date?: string | undefined; 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 BulkReportCustomReportItem$outboundSchema: z.ZodType< BulkReportCustomReportItem$Outbound, z.ZodTypeDef, BulkReportCustomReportItem > = z.object({ companyUuid: z.string(), reportType: z.literal("custom_report"), columns: z.array(Columns$outboundSchema), groupings: z.array(Groupings$outboundSchema).optional(), fileType: FileType$outboundSchema, customName: z.string().optional(), withTotals: z.boolean().default(false), dateFilterType: DateFilterType$outboundSchema.default("period_end_date"), startDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), endDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(), paymentMethod: PaymentMethod$outboundSchema.optional(), employmentType: EmploymentType$outboundSchema.optional(), employmentStatus: EmploymentStatus$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, { companyUuid: "company_uuid", reportType: "report_type", fileType: "file_type", customName: "custom_name", withTotals: "with_totals", dateFilterType: "date_filter_type", startDate: "start_date", endDate: "end_date", paymentMethod: "payment_method", employmentType: "employment_type", employmentStatus: "employment_status", employeeUuids: "employee_uuids", departmentUuids: "department_uuids", workAddressUuids: "work_address_uuids", }); }); export function bulkReportCustomReportItemToJSON( bulkReportCustomReportItem: BulkReportCustomReportItem, ): string { return JSON.stringify( BulkReportCustomReportItem$outboundSchema.parse(bulkReportCustomReportItem), ); }