@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
38 lines • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaxEngineResponseSchema = exports.TaxEngineDataSchema = exports.TaxJurisdictionSchema = exports.TaxEngineRequestSchema = exports.TaxEngineItemSchema = exports.TaxEngineAddressSchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../../../core/schemas");
// Tax Engine schemas
exports.TaxEngineAddressSchema = zod_1.z.object({
street: zod_1.z.string(),
city: zod_1.z.string(),
state: zod_1.z.string(),
postal_code: zod_1.z.string(),
});
exports.TaxEngineItemSchema = zod_1.z.object({
item_id: zod_1.z.string(),
quantity: zod_1.z.number(),
unit_price: zod_1.z.number(),
extended_amount: zod_1.z.number(),
});
exports.TaxEngineRequestSchema = zod_1.z.object({
customer_id: zod_1.z.number(),
postal_code: zod_1.z.string(),
items: zod_1.z.array(exports.TaxEngineItemSchema),
ship_to_address: exports.TaxEngineAddressSchema,
});
exports.TaxJurisdictionSchema = zod_1.z.object({
jurisdiction_name: zod_1.z.string(),
tax_rate: zod_1.z.number(),
tax_amount: zod_1.z.number(),
});
exports.TaxEngineDataSchema = zod_1.z.object({
total_tax: zod_1.z.number(),
tax_rate: zod_1.z.number(),
jurisdictions: zod_1.z.array(exports.TaxJurisdictionSchema),
taxable_amount: zod_1.z.number(),
exempt_amount: zod_1.z.number(),
});
exports.TaxEngineResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.TaxEngineDataSchema);
//# sourceMappingURL=tax.js.map