@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
52 lines • 2.76 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ItemAttributeValueResponseSchema = exports.ItemAttributeValueListResponseSchema = exports.AttributeValueListResponseSchema = exports.AttributeListResponseSchema = exports.AttributeResponseSchema = exports.CreateItemAttributeValueRequestSchema = exports.ItemAttributeValueSchema = exports.AttributeValueSchema = exports.UpdateAttributeRequestSchema = exports.CreateAttributeRequestSchema = exports.AttributeSchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../../../core/schemas");
// Attribute schemas
exports.AttributeSchema = zod_1.z.object({
attributeUid: zod_1.z.number(),
attributeId: zod_1.z.string(),
attributeDesc: zod_1.z.string(),
dataType: zod_1.z.string(),
maxLength: zod_1.z.number().optional(),
sequenceNo: zod_1.z.number().optional(),
statusCd: zod_1.z.number(),
});
exports.CreateAttributeRequestSchema = zod_1.z.object({
attributeId: zod_1.z.string(),
attributeDesc: zod_1.z.string(),
dataType: zod_1.z.string(),
maxLength: zod_1.z.coerce.number().optional(),
sequenceNo: zod_1.z.coerce.number().optional(),
});
exports.UpdateAttributeRequestSchema = exports.CreateAttributeRequestSchema.partial();
// Attribute Value schemas
exports.AttributeValueSchema = zod_1.z.object({
attributeValueUid: zod_1.z.number(),
attributeUid: zod_1.z.number(),
attributeValue: zod_1.z.string(),
displayValue: zod_1.z.string().optional(),
sequenceNo: zod_1.z.number().optional(),
});
// Item Attribute Value schemas
exports.ItemAttributeValueSchema = zod_1.z.object({
itemAttributeValueUid: zod_1.z.number(),
invMastUid: zod_1.z.number(),
attributeUid: zod_1.z.number(),
attributeValue: zod_1.z.string(),
displayValue: zod_1.z.string().optional(),
});
exports.CreateItemAttributeValueRequestSchema = zod_1.z.object({
invMastUid: zod_1.z.coerce.number(),
attributeUid: zod_1.z.coerce.number(),
attributeValue: zod_1.z.string(),
displayValue: zod_1.z.string().optional(),
});
// Response schemas using BaseResponseSchema (8-field format)
exports.AttributeResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.AttributeSchema);
exports.AttributeListResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(exports.AttributeSchema));
exports.AttributeValueListResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(exports.AttributeValueSchema));
exports.ItemAttributeValueListResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(exports.ItemAttributeValueSchema));
exports.ItemAttributeValueResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.ItemAttributeValueSchema);
//# sourceMappingURL=attributes.js.map