/* * 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"; export const PaymentsFilterType = { AccountsReceivable: "accounts_receivable", AccountsPayable: "accounts_payable", AccountsReceivableCredit: "accounts_receivable_credit", AccountsPayableCredit: "accounts_payable_credit", AccountsReceivableOverpayment: "accounts_receivable_overpayment", AccountsPayableOverpayment: "accounts_payable_overpayment", AccountsReceivablePrepayment: "accounts_receivable_prepayment", AccountsPayablePrepayment: "accounts_payable_prepayment", } as const; export type PaymentsFilterType = OpenEnum; /** * Filter by payment status */ export const PaymentsFilterPaymentStatus = { Draft: "draft", Authorised: "authorised", Rejected: "rejected", Paid: "paid", Voided: "voided", Deleted: "deleted", } as const; /** * Filter by payment status */ export type PaymentsFilterPaymentStatus = OpenEnum< typeof PaymentsFilterPaymentStatus >; export type PaymentsFilter = { updatedSince?: Date | undefined; invoiceId?: string | undefined; billId?: string | undefined; supplierId?: string | undefined; /** * Filter by customer id */ customerId?: string | undefined; type?: PaymentsFilterType | undefined; /** * Filter by payment status */ status?: PaymentsFilterPaymentStatus | 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 PaymentsFilterType$outboundSchema: z.ZodType< string, z.ZodTypeDef, PaymentsFilterType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(PaymentsFilterType) ); /** @internal */ export const PaymentsFilterPaymentStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, PaymentsFilterPaymentStatus > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(PaymentsFilterPaymentStatus) ); /** @internal */ export type PaymentsFilter$Outbound = { updated_since?: string | undefined; invoice_id?: string | undefined; bill_id?: string | undefined; supplier_id?: string | undefined; customer_id?: string | undefined; type?: string | undefined; status?: string | undefined; subsidiary_id?: string | undefined; }; /** @internal */ export const PaymentsFilter$outboundSchema: z.ZodType< PaymentsFilter$Outbound, z.ZodTypeDef, PaymentsFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ updatedSince: z.date().transform(v => v.toISOString()).optional(), invoiceId: z.string().optional(), billId: z.string().optional(), supplierId: z.string().optional(), customerId: z.string().optional(), type: PaymentsFilterType$outboundSchema.optional(), status: PaymentsFilterPaymentStatus$outboundSchema.optional(), subsidiaryId: z.string().optional(), }).transform((v) => { return remap$(v, { updatedSince: "updated_since", invoiceId: "invoice_id", billId: "bill_id", supplierId: "supplier_id", customerId: "customer_id", subsidiaryId: "subsidiary_id", }); }) ); export function paymentsFilterToJSON(paymentsFilter: PaymentsFilter): string { return JSON.stringify(PaymentsFilter$outboundSchema.parse(paymentsFilter)); }