@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
58 lines • 4.77 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckoutProphet21LineResponseSchema = exports.CheckoutProphet21LineItemSchema = exports.CheckoutProphet21LineAddRequestSchema = exports.CheckoutProphet21HdrResponseSchema = exports.CheckoutProphet21HdrDataSchema = exports.CheckoutProphet21HdrCreateRequestSchema = exports.CheckoutDocResponseSchema = exports.CheckoutDocDataSchema = exports.CheckoutActivateResponseSchema = exports.CheckoutActivateDataSchema = exports.CheckoutValidateResponseSchema = exports.CheckoutValidateDataSchema = exports.CheckoutDocParamsSchema = exports.CheckoutGetResponseSchema = exports.CheckoutCreateResponseSchema = exports.CheckoutCreateDataSchema = exports.CheckoutSchema = exports.CheckoutCreateParamsSchema = exports.CheckoutCreateRequestSchema = exports.CheckoutLineItemSchema = exports.CheckoutShippingSchema = exports.CheckoutPaymentSchema = exports.WebInfoSchema = exports.NotesSchema = exports.PaymentSchema = exports.OrderLineSchema = exports.CheckoutCustomerSchema = exports.OrderHeaderSchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../../../core/schemas");
// Checkout schemas - key fields only, passthrough for API flexibility
/** Order header - passthrough for multi-format field names */
exports.OrderHeaderSchema = zod_1.z.object({}).passthrough();
/** Checkout customer - key field only */
exports.CheckoutCustomerSchema = zod_1.z.object({ customerId: zod_1.z.number() }).passthrough();
/** Order line - key field only */
exports.OrderLineSchema = zod_1.z.object({ lineNo: zod_1.z.number().optional() }).passthrough();
/** Payment - passthrough for multi-format field names */
exports.PaymentSchema = zod_1.z.object({}).passthrough();
/** Notes - passthrough */
exports.NotesSchema = zod_1.z.object({}).passthrough();
/** Web info - passthrough */
exports.WebInfoSchema = zod_1.z.object({}).passthrough();
/** Legacy payment - passthrough */
exports.CheckoutPaymentSchema = zod_1.z.object({}).passthrough();
/** Legacy shipping - passthrough */
exports.CheckoutShippingSchema = zod_1.z.object({}).passthrough();
/** Line item - key field only */
exports.CheckoutLineItemSchema = zod_1.z.object({ invMastUid: zod_1.z.number() }).passthrough();
/** Checkout create request - passthrough for flexible input */
exports.CheckoutCreateRequestSchema = zod_1.z.object({}).passthrough();
exports.CheckoutCreateParamsSchema = zod_1.z.object({
cartHdrUid: zod_1.z.coerce.number().optional(),
});
/** Checkout - key field only */
exports.CheckoutSchema = zod_1.z.object({ checkoutUid: zod_1.z.number() }).passthrough();
/** Checkout create data - key field only */
exports.CheckoutCreateDataSchema = zod_1.z.object({ checkoutUid: zod_1.z.number() }).passthrough();
exports.CheckoutCreateResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.CheckoutCreateDataSchema);
exports.CheckoutGetResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.CheckoutSchema);
exports.CheckoutDocParamsSchema = schemas_1.BaseGetParamsSchema.extend({
cartHdrUid: zod_1.z.coerce.number().optional(),
});
/** Checkout validate data - key field only */
exports.CheckoutValidateDataSchema = zod_1.z.object({ checkoutUid: zod_1.z.number() }).passthrough();
exports.CheckoutValidateResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.CheckoutValidateDataSchema);
/** Checkout activate data - key field only */
exports.CheckoutActivateDataSchema = zod_1.z.object({ checkoutUid: zod_1.z.number() }).passthrough();
exports.CheckoutActivateResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.CheckoutActivateDataSchema);
/** Checkout doc data - key field only */
exports.CheckoutDocDataSchema = zod_1.z.object({ checkoutUid: zod_1.z.number() }).passthrough();
exports.CheckoutDocResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.CheckoutDocDataSchema);
/** P21 header create request - passthrough */
exports.CheckoutProphet21HdrCreateRequestSchema = zod_1.z.object({}).passthrough();
/** P21 header data - key field only */
exports.CheckoutProphet21HdrDataSchema = zod_1.z.object({ checkoutUid: zod_1.z.number() }).passthrough();
exports.CheckoutProphet21HdrResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.CheckoutProphet21HdrDataSchema);
/** P21 line add request - minimal validation for required fields */
exports.CheckoutProphet21LineAddRequestSchema = zod_1.z.array(zod_1.z.object({ invMastUid: zod_1.z.number() }).passthrough());
/** P21 line item - key field only */
exports.CheckoutProphet21LineItemSchema = zod_1.z.object({ lineNo: zod_1.z.number() }).passthrough();
exports.CheckoutProphet21LineResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(exports.CheckoutProphet21LineItemSchema));
//# sourceMappingURL=checkout.js.map