@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
63 lines • 3.16 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InventoryAvailabilityResponseSchema = exports.UsageRequestSchema = exports.UsageItemSchema = exports.WarrantyInfoSchema = exports.TransferRequestSchema = exports.TransferItemSchema = exports.InventoryReceiveRequestSchema = exports.InventoryReceiptSchema = exports.InventoryAdjustRequestSchema = exports.InventoryAdjustmentSchema = exports.InventoryAvailabilityParamsSchema = exports.InventoryAvailabilitySchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../../../core/schemas");
const common_1 = require("./common");
// Inventory operation schemas
exports.InventoryAvailabilitySchema = zod_1.z.object({
inv_mast_uid: zod_1.z.number(),
item_id: zod_1.z.string(),
description: zod_1.z.string(),
qty_on_hand: zod_1.z.number(),
default_selling_unit: zod_1.z.string(),
type: zod_1.z.union([zod_1.z.literal('prophet21'), zod_1.z.literal('products')]),
});
exports.InventoryAvailabilityParamsSchema = zod_1.z.object({
q: zod_1.z.string().min(1, 'Search query is required'),
});
exports.InventoryAdjustmentSchema = zod_1.z.object({
inv_mast_uid: zod_1.z.coerce.number(),
qty_on_hand: zod_1.z.coerce.number(),
reason: zod_1.z.string().optional(),
});
exports.InventoryAdjustRequestSchema = zod_1.z.object({
adjustments: zod_1.z.array(exports.InventoryAdjustmentSchema).min(1, 'At least one adjustment is required'),
});
exports.InventoryReceiptSchema = zod_1.z.object({
inv_mast_uid: zod_1.z.coerce.number(),
qty_received: zod_1.z.coerce.number(),
po_number: zod_1.z.string().optional(),
lot_number: zod_1.z.string().optional(),
});
exports.InventoryReceiveRequestSchema = zod_1.z.object({
receipts: zod_1.z.array(exports.InventoryReceiptSchema).min(1, 'At least one receipt is required'),
});
exports.TransferItemSchema = zod_1.z.object({
inv_mast_uid: zod_1.z.coerce.number(),
qty_to_transfer: zod_1.z.coerce.number(),
reason: zod_1.z.string().optional(),
});
exports.TransferRequestSchema = zod_1.z.object({
to_warehouse_uid: zod_1.z.coerce.number(),
transfers: zod_1.z.array(exports.TransferItemSchema).min(1, 'At least one transfer item is required'),
});
exports.WarrantyInfoSchema = zod_1.z.object({
model_no: zod_1.z.string().optional(),
serial_no: zod_1.z.string().optional(),
warranty_type: zod_1.z.string().optional(),
notes: zod_1.z.string().optional(),
});
exports.UsageItemSchema = zod_1.z.object({
inv_mast_uid: zod_1.z.coerce.number(),
inv_profile_line_type: common_1.InvProfileLineTypeSchema,
qty_used: zod_1.z.coerce.number(),
warranty: exports.WarrantyInfoSchema.optional(),
});
exports.UsageRequestSchema = zod_1.z.object({
job_description: zod_1.z.string().min(1, 'Job description is required'),
department: zod_1.z.string().optional(),
usage_items: zod_1.z.array(exports.UsageItemSchema).min(1, 'At least one usage item is required'),
});
exports.InventoryAvailabilityResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(exports.InventoryAvailabilitySchema));
//# sourceMappingURL=inventory.js.map