@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
35 lines • 1.09 kB
JavaScript
import { z } from 'zod';
import { BaseResponseSchema } from '../../../core/schemas';
// Tax Engine schemas
export const TaxEngineAddressSchema = z.object({
street: z.string(),
city: z.string(),
state: z.string(),
postal_code: z.string(),
});
export const TaxEngineItemSchema = z.object({
item_id: z.string(),
quantity: z.number(),
unit_price: z.number(),
extended_amount: z.number(),
});
export const TaxEngineRequestSchema = z.object({
customer_id: z.number(),
postal_code: z.string(),
items: z.array(TaxEngineItemSchema),
ship_to_address: TaxEngineAddressSchema,
});
export const TaxJurisdictionSchema = z.object({
jurisdiction_name: z.string(),
tax_rate: z.number(),
tax_amount: z.number(),
});
export const TaxEngineDataSchema = z.object({
total_tax: z.number(),
tax_rate: z.number(),
jurisdictions: z.array(TaxJurisdictionSchema),
taxable_amount: z.number(),
exempt_amount: z.number(),
});
export const TaxEngineResponseSchema = BaseResponseSchema(TaxEngineDataSchema);
//# sourceMappingURL=tax.js.map