/* * 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"; /** * Filter by bill status */ export const BillsFilterStatus = { Paid: "paid", Unpaid: "unpaid", PartiallyPaid: "partially_paid", } as const; /** * Filter by bill status */ export type BillsFilterStatus = OpenEnum; export type BillsFilter = { /** * Return records with a row ID greater than or equal to the given value */ idSince?: string | undefined; updatedSince?: Date | undefined; /** * Return bills whose `bill_number` equals the given value (exact match). Use this to verify whether a create that timed out (`outcome: uncertain`) was persisted before retrying. Bill numbers are not guaranteed unique on every connector, so more than one bill can be returned. */ billNumber?: string | undefined; /** * Return bills whose `reference` equals the given value (exact match). Use this to look up a bill by the reference you supplied on create, for example after a create that timed out (`outcome: uncertain`). */ reference?: string | undefined; /** * Return bills with a document date (`bill_date`) on or after the given date (YYYY-MM-DD). */ billedSince?: Date | undefined; /** * Return bills with a due date (`due_date`) on or after the given date (YYYY-MM-DD). */ dueSince?: Date | undefined; /** * Filter by bill status */ status?: BillsFilterStatus | undefined; /** * Filter by the subsidiary (legal entity) the record belongs to. Only honored on connectors that support multi-entity scoping (e.g. NetSuite OneWorld); ignored elsewhere. */ subsidiaryId?: string | undefined; }; /** @internal */ export const BillsFilterStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, BillsFilterStatus > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(BillsFilterStatus) ); /** @internal */ export type BillsFilter$Outbound = { id_since?: string | undefined; updated_since?: string | undefined; bill_number?: string | undefined; reference?: string | undefined; billed_since?: string | undefined; due_since?: string | undefined; status?: string | undefined; subsidiary_id?: string | undefined; }; /** @internal */ export const BillsFilter$outboundSchema: z.ZodType< BillsFilter$Outbound, z.ZodTypeDef, BillsFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ idSince: z.string().optional(), updatedSince: z.date().transform(v => v.toISOString()).optional(), billNumber: z.string().optional(), reference: z.string().optional(), billedSince: z.date().transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length) ).optional(), dueSince: z.date().transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length) ).optional(), status: BillsFilterStatus$outboundSchema.optional(), subsidiaryId: z.string().optional(), }).transform((v) => { return remap$(v, { idSince: "id_since", updatedSince: "updated_since", billNumber: "bill_number", billedSince: "billed_since", dueSince: "due_since", subsidiaryId: "subsidiary_id", }); }) ); export function billsFilterToJSON(billsFilter: BillsFilter): string { return JSON.stringify(BillsFilter$outboundSchema.parse(billsFilter)); }