UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

45 lines 2.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetStockResponseSchema = exports.GetStockParamsSchema = exports.StockDetailsDataSchema = exports.StockLocationDataSchema = void 0; const zod_1 = require("zod"); const schemas_1 = require("../../../core/schemas"); // Stock/Location schemas based on InvLoc.json exports.StockLocationDataSchema = zod_1.z.object({ locationId: zod_1.z.number(), companyId: zod_1.z.string(), qtyOnHand: zod_1.z.number(), qtyAllocated: zod_1.z.number(), stockable: zod_1.z.string().nullable().optional(), unallocated: zod_1.z.number(), nextDueInPoDate: zod_1.z.string().nullable().optional(), qtyBackordered: zod_1.z.number().nullable().optional(), primaryBin: zod_1.z.string().nullable().optional(), discontinued: zod_1.z.string().nullable().optional(), qtyFrozen: zod_1.z.number().nullable().optional(), qtyQuarantined: zod_1.z.number().nullable().optional(), qtyAvailable: zod_1.z.number(), orderQuantity: zod_1.z.number().nullable().optional(), productGroupId: zod_1.z.string().nullable().optional(), baseUnit: zod_1.z.string(), baseUnitSize: zod_1.z.number(), defaultSellingUnit: zod_1.z.string(), defaultSellingUnitSize: zod_1.z.number(), divisor: zod_1.z.number(), calcQtyOnHand: zod_1.z.number(), calcQtyAllocated: zod_1.z.number(), calcQtyAvailable: zod_1.z.number(), locationName: zod_1.z.string(), }); exports.StockDetailsDataSchema = zod_1.z.object({ stockData: zod_1.z.array(exports.StockLocationDataSchema), companySummary: zod_1.z.record(zod_1.z.string(), zod_1.z.number()), }); exports.GetStockParamsSchema = zod_1.z.object({ includeCompanySummary: zod_1.z.boolean().optional(), includeCalculatedValues: zod_1.z.boolean().optional(), locationIds: zod_1.z.array(zod_1.z.number()).optional(), companyIds: zod_1.z.array(zod_1.z.string()).optional(), }); // Response schemas using BaseResponseSchema (8-field format) exports.GetStockResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.StockDetailsDataSchema); //# sourceMappingURL=invLoc.js.map