/* * 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 { Currency, Currency$outboundSchema } from "./currency.js"; import { LinkedCustomerInput, LinkedCustomerInput$Outbound, LinkedCustomerInput$outboundSchema, } from "./linkedcustomerinput.js"; import { LinkedDepartmentInput, LinkedDepartmentInput$Outbound, LinkedDepartmentInput$outboundSchema, } from "./linkeddepartmentinput.js"; import { LinkedExpenseCategory, LinkedExpenseCategory$Outbound, LinkedExpenseCategory$outboundSchema, } from "./linkedexpensecategory.js"; import { LinkedLedgerAccount, LinkedLedgerAccount$Outbound, LinkedLedgerAccount$outboundSchema, } from "./linkedledgeraccount.js"; import { LinkedLocationInput, LinkedLocationInput$Outbound, LinkedLocationInput$outboundSchema, } from "./linkedlocationinput.js"; import { LinkedTaxRateInput, LinkedTaxRateInput$Outbound, LinkedTaxRateInput$outboundSchema, } from "./linkedtaxrateinput.js"; import { LinkedTrackingCategory, LinkedTrackingCategory$Outbound, LinkedTrackingCategory$outboundSchema, } from "./linkedtrackingcategory.js"; export type ExpenseReportLineItemInput = { /** * Line number of the resource */ lineNumber?: number | null | undefined; /** * The expense category this entity is linked to. */ expenseCategory?: LinkedExpenseCategory | undefined; account?: LinkedLedgerAccount | null | undefined; /** * The description of the expense line item. */ description?: string | null | undefined; quantity?: number | null | undefined; unitPrice?: number | null | undefined; /** * The amount of the expense line item. */ amount: number; taxRate?: LinkedTaxRateInput | undefined; /** * Tax amount */ taxAmount?: number | null | undefined; /** * The total amount of the expense line item including tax. */ totalAmount?: number | null | undefined; /** * The date of the individual expense. */ transactionDate?: Date | null | undefined; /** * Whether the expense is billable to a customer. */ billable?: boolean | null | undefined; /** * Whether the expense is reimbursable to the employee. */ reimbursable?: boolean | null | undefined; /** * The customer this entity is linked to. */ customer?: LinkedCustomerInput | null | undefined; department?: LinkedDepartmentInput | null | undefined; location?: LinkedLocationInput | null | undefined; /** * A list of linked tracking categories. */ trackingCategories?: Array | null | undefined; /** * URL to the receipt or attachment for this expense line. */ receiptUrl?: string | null | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; }; /** @internal */ export type ExpenseReportLineItemInput$Outbound = { line_number?: number | null | undefined; expense_category?: LinkedExpenseCategory$Outbound | undefined; account?: LinkedLedgerAccount$Outbound | null | undefined; description?: string | null | undefined; quantity?: number | null | undefined; unit_price?: number | null | undefined; amount: number; tax_rate?: LinkedTaxRateInput$Outbound | undefined; tax_amount?: number | null | undefined; total_amount?: number | null | undefined; transaction_date?: string | null | undefined; billable?: boolean | null | undefined; reimbursable?: boolean | null | undefined; customer?: LinkedCustomerInput$Outbound | null | undefined; department?: LinkedDepartmentInput$Outbound | null | undefined; location?: LinkedLocationInput$Outbound | null | undefined; tracking_categories?: | Array | null | undefined; receipt_url?: string | null | undefined; currency?: string | null | undefined; }; /** @internal */ export const ExpenseReportLineItemInput$outboundSchema: z.ZodType< ExpenseReportLineItemInput$Outbound, z.ZodTypeDef, ExpenseReportLineItemInput > = /* @__PURE__ */ lazySchema$(() => z.object({ lineNumber: z.nullable(z.number().int()).optional(), expenseCategory: LinkedExpenseCategory$outboundSchema.optional(), account: z.nullable(LinkedLedgerAccount$outboundSchema).optional(), description: z.nullable(z.string()).optional(), quantity: z.nullable(z.number()).optional(), unitPrice: z.nullable(z.number()).optional(), amount: z.number(), taxRate: LinkedTaxRateInput$outboundSchema.optional(), taxAmount: z.nullable(z.number()).optional(), totalAmount: z.nullable(z.number()).optional(), transactionDate: z.nullable( z.date().transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)), ).optional(), billable: z.nullable(z.boolean()).optional(), reimbursable: z.nullable(z.boolean()).optional(), customer: z.nullable(LinkedCustomerInput$outboundSchema).optional(), department: z.nullable(LinkedDepartmentInput$outboundSchema).optional(), location: z.nullable(LinkedLocationInput$outboundSchema).optional(), trackingCategories: z.nullable( z.array(z.nullable(LinkedTrackingCategory$outboundSchema)), ).optional(), receiptUrl: z.nullable(z.string()).optional(), currency: z.nullable(Currency$outboundSchema).optional(), }).transform((v) => { return remap$(v, { lineNumber: "line_number", expenseCategory: "expense_category", unitPrice: "unit_price", taxRate: "tax_rate", taxAmount: "tax_amount", totalAmount: "total_amount", transactionDate: "transaction_date", trackingCategories: "tracking_categories", receiptUrl: "receipt_url", }); }) ); export function expenseReportLineItemInputToJSON( expenseReportLineItemInput: ExpenseReportLineItemInput, ): string { return JSON.stringify( ExpenseReportLineItemInput$outboundSchema.parse(expenseReportLineItemInput), ); }