/* * 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$ } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; /** * The accounting method used for the report: cash or accrual. */ export const ProfitAndLossFilterAccountingMethod = { Cash: "cash", Accrual: "accrual", } as const; /** * The accounting method used for the report: cash or accrual. */ export type ProfitAndLossFilterAccountingMethod = OpenEnum< typeof ProfitAndLossFilterAccountingMethod >; export type ProfitAndLossFilter = { /** * Filter by customer id */ customerId?: string | undefined; /** * Filter by start date. If start date is given, end date is required. */ startDate?: string | undefined; /** * Filter by end date. If end date is given, start date is required. */ endDate?: string | undefined; /** * Filter by location id */ locationId?: string | undefined; /** * The accounting method used for the report: cash or accrual. */ accountingMethod?: ProfitAndLossFilterAccountingMethod | undefined; }; /** @internal */ export const ProfitAndLossFilterAccountingMethod$outboundSchema: z.ZodType< string, z.ZodTypeDef, ProfitAndLossFilterAccountingMethod > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(ProfitAndLossFilterAccountingMethod) ); /** @internal */ export type ProfitAndLossFilter$Outbound = { customer_id?: string | undefined; start_date?: string | undefined; end_date?: string | undefined; location_id?: string | undefined; accounting_method?: string | undefined; }; /** @internal */ export const ProfitAndLossFilter$outboundSchema: z.ZodType< ProfitAndLossFilter$Outbound, z.ZodTypeDef, ProfitAndLossFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ customerId: z.string().optional(), startDate: z.string().optional(), endDate: z.string().optional(), locationId: z.string().optional(), accountingMethod: ProfitAndLossFilterAccountingMethod$outboundSchema .optional(), }).transform((v) => { return remap$(v, { customerId: "customer_id", startDate: "start_date", endDate: "end_date", locationId: "location_id", accountingMethod: "accounting_method", }); }) ); export function profitAndLossFilterToJSON( profitAndLossFilter: ProfitAndLossFilter, ): string { return JSON.stringify( ProfitAndLossFilter$outboundSchema.parse(profitAndLossFilter), ); }