/* * 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 the originating transaction type. */ export const SourceType = { Other: "other", Invoice: "invoice", Bill: "bill", CreditNote: "credit_note", Payment: "payment", Refund: "refund", Expense: "expense", JournalEntry: "journal_entry", Payroll: "payroll", } as const; /** * Filter by the originating transaction type. */ export type SourceType = OpenEnum; export type GeneralLedgerTransactionsFilter = { /** * Filter by the originating transaction type. */ sourceType?: SourceType | undefined; /** * Return only transactions originated from the given source document id. */ sourceId?: string | undefined; /** * Return transactions updated on or after this timestamp. */ updatedSince?: Date | undefined; }; /** @internal */ export const SourceType$outboundSchema: z.ZodType< string, z.ZodTypeDef, SourceType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(SourceType)); /** @internal */ export type GeneralLedgerTransactionsFilter$Outbound = { source_type?: string | undefined; source_id?: string | undefined; updated_since?: string | undefined; }; /** @internal */ export const GeneralLedgerTransactionsFilter$outboundSchema: z.ZodType< GeneralLedgerTransactionsFilter$Outbound, z.ZodTypeDef, GeneralLedgerTransactionsFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ sourceType: SourceType$outboundSchema.optional(), sourceId: z.string().optional(), updatedSince: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { return remap$(v, { sourceType: "source_type", sourceId: "source_id", updatedSince: "updated_since", }); }) ); export function generalLedgerTransactionsFilterToJSON( generalLedgerTransactionsFilter: GeneralLedgerTransactionsFilter, ): string { return JSON.stringify( GeneralLedgerTransactionsFilter$outboundSchema.parse( generalLedgerTransactionsFilter, ), ); }