UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

117 lines 5.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QuoteResponseSchema = exports.QuoteListResponseSchema = exports.QuoteListParamsSchema = exports.QuoteListItemSchema = exports.QuoteDocumentSchema = exports.QuoteLineSchema = void 0; const zod_1 = require("zod"); const schemas_1 = require("../../../core/schemas"); const orders_1 = require("./orders"); // Quote line schema - based on Quotes.json exports.QuoteLineSchema = zod_1.z.object({ invMastUid: zod_1.z.number(), cancelFlag: zod_1.z.enum(['Y', 'N']).nullable(), complete: zod_1.z.enum(['Y', 'N']).nullable(), deleteFlag: zod_1.z.enum(['Y', 'N']).nullable(), disposition: zod_1.z.string().nullable(), itemDesc: zod_1.z.string().nullable(), displayDesc: zod_1.z.string().nullable(), itemId: zod_1.z.string().nullable(), lineNo: zod_1.z.number().nullable(), orderNo: zod_1.z.string().nullable(), originalQtyOrdered: zod_1.z.number().nullable(), qtyAllocated: zod_1.z.number().nullable(), qtyCanceled: zod_1.z.number().nullable(), qtyInvoiced: zod_1.z.number().nullable(), qtyOnPickTickets: zod_1.z.number().nullable(), qtyOrdered: zod_1.z.number().nullable(), unitOfMeasure: zod_1.z.string().nullable(), unitQuantity: zod_1.z.number().nullable(), unitSize: zod_1.z.string().nullable(), unitPrice: zod_1.z.number().nullable(), extendedPrice: zod_1.z.number().nullable(), trinityItemId: zod_1.z.string().nullable(), trinityItemDesc: zod_1.z.string().nullable(), agentItemId: zod_1.z.string().nullable(), agentItemDesc: zod_1.z.string().nullable(), }); // Quote document schema - based on Quotes.json exports.QuoteDocumentSchema = zod_1.z.object({ orderNo: zod_1.z.string(), customerId: zod_1.z.number(), customerName: zod_1.z.string(), jobName: zod_1.z.string().nullable(), orderDate: zod_1.z.string().nullable(), // Y-m-d format requestedDate: zod_1.z.string().nullable(), // Y-m-d format completed: zod_1.z.enum(['Y', 'N']).nullable(), poNo: zod_1.z.string().nullable(), ship2Name: zod_1.z.string().nullable(), ship2Add1: zod_1.z.string().nullable(), ship2Add2: zod_1.z.string().nullable(), ship2Add3: zod_1.z.string().nullable(), ship2City: zod_1.z.string().nullable(), ship2State: zod_1.z.string().nullable(), ship2Zip: zod_1.z.string().nullable(), ship2Country: zod_1.z.string().nullable(), ship2EmailAddress: zod_1.z.string().nullable(), shipToPhone: zod_1.z.string().nullable(), deliveryInstructions: zod_1.z.string().nullable(), class1Id: zod_1.z.string().nullable(), class2Id: zod_1.z.string().nullable(), class3Id: zod_1.z.string().nullable(), class4Id: zod_1.z.string().nullable(), class5Id: zod_1.z.string().nullable(), contactId: zod_1.z.string().nullable(), webReferenceNo: zod_1.z.string().nullable(), orderStatus: zod_1.z.enum(['PENDING', 'SHIPPED', 'ON HOLD', 'IN PROCESS', 'SUBMITTED']), taker: zod_1.z.string().nullable(), contactFirstName: zod_1.z.string().nullable(), contactLastName: zod_1.z.string().nullable(), carrierId: zod_1.z.number().nullable(), carrierName: zod_1.z.string(), lines: zod_1.z.array(exports.QuoteLineSchema), pickTickets: zod_1.z.array(orders_1.PickTicketSchema), }); // Quote list item schema - based on Quotes.json exports.QuoteListItemSchema = zod_1.z.object({ orderNo: zod_1.z.string().max(8), customerId: zod_1.z.number(), customerName: zod_1.z.string().max(255).nullable(), jobName: zod_1.z.string().max(40).nullable(), orderDate: zod_1.z.string().nullable(), // Y-m-d format requestedDate: zod_1.z.string().nullable(), // Y-m-d format completed: zod_1.z.string().max(1).nullable(), poNo: zod_1.z.string().max(50).nullable(), orderStatus: zod_1.z.string(), taker: zod_1.z.string().max(30).nullable(), webReferenceNo: zod_1.z.string().max(255).nullable(), ship2Name: zod_1.z.string().max(50).nullable(), ship2Add1: zod_1.z.string().max(50).nullable(), ship2Add2: zod_1.z.string().max(50).nullable(), ship2Add3: zod_1.z.string().max(50).nullable(), ship2City: zod_1.z.string().max(50).nullable(), ship2State: zod_1.z.string().max(50).nullable(), ship2Zip: zod_1.z.string().max(10).nullable(), ship2Country: zod_1.z.string().max(50).nullable(), ship2EmailAddress: zod_1.z.string().max(255).nullable(), shipToPhone: zod_1.z.string().max(20).nullable(), deliveryInstructions: zod_1.z.string().max(255).nullable(), class1Id: zod_1.z.string().max(8).nullable(), class2Id: zod_1.z.string().max(8).nullable(), class3Id: zod_1.z.string().max(8).nullable(), class4Id: zod_1.z.string().max(8).nullable(), class5Id: zod_1.z.string().max(8).nullable(), contactId: zod_1.z.string().max(16).nullable(), contactFirstName: zod_1.z.string().nullable(), contactLastName: zod_1.z.string().nullable(), carrierId: zod_1.z.number().nullable(), carrierName: zod_1.z.string().nullable(), lines: zod_1.z.array(exports.QuoteLineSchema), pickTickets: zod_1.z.array(orders_1.PickTicketSchema), }); exports.QuoteListParamsSchema = schemas_1.BaseGetParamsSchema.extend({ limit: zod_1.z.coerce.number().optional(), offset: zod_1.z.coerce.number().optional(), orderBy: zod_1.z.string().optional(), }); // Response schemas using BaseResponseSchema (8-field format) exports.QuoteListResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(exports.QuoteListItemSchema)); exports.QuoteResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.QuoteDocumentSchema); //# sourceMappingURL=quotes.js.map