wiil-core-js 0.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/core/account/index.d.ts +7 -0
- package/dist/core/account/index.js +23 -0
- package/dist/core/account/organization.schema.d.ts +118 -0
- package/dist/core/account/organization.schema.js +91 -0
- package/dist/core/account/project.schema.d.ts +121 -0
- package/dist/core/account/project.schema.js +102 -0
- package/dist/core/account/supported-business-verticals.d.ts +8 -0
- package/dist/core/account/supported-business-verticals.js +23 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.d.ts +115 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.js +17 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.d.ts +61 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.js +29 -0
- package/dist/core/assistant-setups/index.d.ts +4 -0
- package/dist/core/assistant-setups/index.js +21 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.d.ts +63 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.js +14 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.d.ts +56 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.js +17 -0
- package/dist/core/base.schema.d.ts +34 -0
- package/dist/core/base.schema.js +36 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.d.ts +63 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.js +53 -0
- package/dist/core/business-mgt/appointment-field-config.schema.d.ts +251 -0
- package/dist/core/business-mgt/appointment-field-config.schema.js +49 -0
- package/dist/core/business-mgt/bookings.shared.schema.d.ts +47 -0
- package/dist/core/business-mgt/bookings.shared.schema.js +60 -0
- package/dist/core/business-mgt/business-location.schema.d.ts +327 -0
- package/dist/core/business-mgt/business-location.schema.js +176 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.d.ts +87 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.js +53 -0
- package/dist/core/business-mgt/customer-management/customer.schema.d.ts +156 -0
- package/dist/core/business-mgt/customer-management/customer.schema.js +93 -0
- package/dist/core/business-mgt/customer-management/index.d.ts +7 -0
- package/dist/core/business-mgt/customer-management/index.js +23 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.d.ts +112 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.js +79 -0
- package/dist/core/business-mgt/customer.schema.d.ts +111 -0
- package/dist/core/business-mgt/customer.schema.js +73 -0
- package/dist/core/business-mgt/discount-rule.schema.d.ts +183 -0
- package/dist/core/business-mgt/discount-rule.schema.js +108 -0
- package/dist/core/business-mgt/index.d.ts +16 -0
- package/dist/core/business-mgt/index.js +38 -0
- package/dist/core/business-mgt/menu-config.schema.d.ts +165 -0
- package/dist/core/business-mgt/menu-config.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/index.d.ts +11 -0
- package/dist/core/business-mgt/menu-management/index.js +27 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.d.ts +386 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.js +58 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.d.ts +301 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.js +169 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.d.ts +143 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.d.ts +239 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.js +117 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.d.ts +420 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.js +283 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.d.ts +654 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.js +204 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.d.ts +585 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.js +341 -0
- package/dist/core/business-mgt/menu.order.schema.d.ts +335 -0
- package/dist/core/business-mgt/menu.order.schema.js +149 -0
- package/dist/core/business-mgt/order.schema.d.ts +222 -0
- package/dist/core/business-mgt/order.schema.js +205 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.d.ts +56 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.js +68 -0
- package/dist/core/business-mgt/product-config.schema.d.ts +177 -0
- package/dist/core/business-mgt/product-config.schema.js +106 -0
- package/dist/core/business-mgt/product-management/index.d.ts +12 -0
- package/dist/core/business-mgt/product-management/index.js +28 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.d.ts +54 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.js +54 -0
- package/dist/core/business-mgt/product-management/product-config.schema.d.ts +1042 -0
- package/dist/core/business-mgt/product-management/product-config.schema.js +392 -0
- package/dist/core/business-mgt/product-management/product-display.schema.d.ts +548 -0
- package/dist/core/business-mgt/product-management/product-display.schema.js +80 -0
- package/dist/core/business-mgt/product-management/product-order.schema.d.ts +493 -0
- package/dist/core/business-mgt/product-management/product-order.schema.js +158 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.d.ts +167 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.js +68 -0
- package/dist/core/business-mgt/product-management/product-set.schema.d.ts +488 -0
- package/dist/core/business-mgt/product-management/product-set.schema.js +273 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.d.ts +156 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.js +98 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.d.ts +219 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.js +130 -0
- package/dist/core/business-mgt/product-order.schema.d.ts +326 -0
- package/dist/core/business-mgt/product-order.schema.js +153 -0
- package/dist/core/business-mgt/property-config.schema.d.ts +621 -0
- package/dist/core/business-mgt/property-config.schema.js +224 -0
- package/dist/core/business-mgt/property-inquiry.schema.d.ts +222 -0
- package/dist/core/business-mgt/property-inquiry.schema.js +112 -0
- package/dist/core/business-mgt/property-management/index.d.ts +6 -0
- package/dist/core/business-mgt/property-management/index.js +22 -0
- package/dist/core/business-mgt/property-management/property-config.schema.d.ts +1306 -0
- package/dist/core/business-mgt/property-management/property-config.schema.js +367 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.d.ts +254 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.js +131 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.d.ts +3 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.js +19 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.d.ts +139 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.js +90 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.js +70 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.js +72 -0
- package/dist/core/business-mgt/reservation-mgt/index.d.ts +14 -0
- package/dist/core/business-mgt/reservation-mgt/index.js +31 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.d.ts +180 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.js +75 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.d.ts +91 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.js +57 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.d.ts +334 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.js +179 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.d.ts +195 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.js +106 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.d.ts +402 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.js +198 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.d.ts +229 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.js +127 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.d.ts +382 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.js +322 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.d.ts +123 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.js +83 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.d.ts +167 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.js +84 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.d.ts +0 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.js +153 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.d.ts +4 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.js +20 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.d.ts +157 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.js +76 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.d.ts +137 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.js +94 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.d.ts +713 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.js +363 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.d.ts +151 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.js +147 -0
- package/dist/core/business-mgt/reservation-resource.schema.d.ts +154 -0
- package/dist/core/business-mgt/reservation-resource.schema.js +100 -0
- package/dist/core/business-mgt/reservation.schema.d.ts +119 -0
- package/dist/core/business-mgt/reservation.schema.js +89 -0
- package/dist/core/business-mgt/service-appointment.schema.d.ts +105 -0
- package/dist/core/business-mgt/service-appointment.schema.js +69 -0
- package/dist/core/business-mgt/service-config.schema.d.ts +453 -0
- package/dist/core/business-mgt/service-config.schema.js +102 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.d.ts +110 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.js +78 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.d.ts +304 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.js +75 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.d.ts +1226 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.js +317 -0
- package/dist/core/business-mgt/service-management/index.d.ts +13 -0
- package/dist/core/business-mgt/service-management/index.js +29 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.d.ts +531 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.js +116 -0
- package/dist/core/business-mgt/service-management/service-person.schema.d.ts +122 -0
- package/dist/core/business-mgt/service-management/service-person.schema.js +66 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.d.ts +221 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.js +118 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.js +54 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.js +113 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.d.ts +121 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.js +95 -0
- package/dist/core/business-mgt/service-person.schema.d.ts +43 -0
- package/dist/core/business-mgt/service-person.schema.js +38 -0
- package/dist/core/business-mgt/tax-rule.schema.d.ts +161 -0
- package/dist/core/business-mgt/tax-rule.schema.js +90 -0
- package/dist/core/conversation/conversation-config.schema.d.ts +644 -0
- package/dist/core/conversation/conversation-config.schema.js +351 -0
- package/dist/core/conversation/conversation-message.schema.d.ts +307 -0
- package/dist/core/conversation/conversation-message.schema.js +275 -0
- package/dist/core/conversation/index.d.ts +12 -0
- package/dist/core/conversation/index.js +28 -0
- package/dist/core/conversation/outbound-call.schema.d.ts +209 -0
- package/dist/core/conversation/outbound-call.schema.js +116 -0
- package/dist/core/conversation/outbound-email.schema.d.ts +338 -0
- package/dist/core/conversation/outbound-email.schema.js +150 -0
- package/dist/core/conversation/outbound-sms.schema.d.ts +163 -0
- package/dist/core/conversation/outbound-sms.schema.js +85 -0
- package/dist/core/conversation/outbound-template.schema.d.ts +375 -0
- package/dist/core/conversation/outbound-template.schema.js +160 -0
- package/dist/core/conversation/translation-config.schema.d.ts +92 -0
- package/dist/core/conversation/translation-config.schema.js +88 -0
- package/dist/core/conversation/translation-conversation.schema.d.ts +469 -0
- package/dist/core/conversation/translation-conversation.schema.js +175 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +30 -0
- package/dist/core/service-configuration/agent-config.schema.d.ts +236 -0
- package/dist/core/service-configuration/agent-config.schema.js +152 -0
- package/dist/core/service-configuration/base-agent-setup.d.ts +147 -0
- package/dist/core/service-configuration/base-agent-setup.js +123 -0
- package/dist/core/service-configuration/call-transfer-config.schema.d.ts +60 -0
- package/dist/core/service-configuration/call-transfer-config.schema.js +53 -0
- package/dist/core/service-configuration/deployment-config.schema.d.ts +522 -0
- package/dist/core/service-configuration/deployment-config.schema.js +271 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.d.ts +130 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.js +110 -0
- package/dist/core/service-configuration/dynamic_setup/index.d.ts +10 -0
- package/dist/core/service-configuration/dynamic_setup/index.js +26 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.d.ts +111 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.js +56 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.d.ts +113 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.js +55 -0
- package/dist/core/service-configuration/index.d.ts +17 -0
- package/dist/core/service-configuration/index.js +33 -0
- package/dist/core/service-configuration/instruction-config.schema.d.ts +183 -0
- package/dist/core/service-configuration/instruction-config.schema.js +139 -0
- package/dist/core/service-configuration/interaction-channels.schema.d.ts +469 -0
- package/dist/core/service-configuration/interaction-channels.schema.js +390 -0
- package/dist/core/service-configuration/knowledge.schema.d.ts +107 -0
- package/dist/core/service-configuration/knowledge.schema.js +106 -0
- package/dist/core/service-configuration/phone-config.schema.d.ts +206 -0
- package/dist/core/service-configuration/phone-config.schema.js +121 -0
- package/dist/core/service-configuration/phone-number.schema.d.ts +236 -0
- package/dist/core/service-configuration/phone-number.schema.js +211 -0
- package/dist/core/service-configuration/provisioning-config.d.ts +429 -0
- package/dist/core/service-configuration/provisioning-config.js +307 -0
- package/dist/core/service-configuration/support-llm.d.ts +95 -0
- package/dist/core/service-configuration/support-llm.js +76 -0
- package/dist/core/service-configuration/voice-language.schema.d.ts +200 -0
- package/dist/core/service-configuration/voice-language.schema.js +166 -0
- package/dist/core/type-definitions/account-definitions.d.ts +82 -0
- package/dist/core/type-definitions/account-definitions.js +88 -0
- package/dist/core/type-definitions/business-definitions.d.ts +394 -0
- package/dist/core/type-definitions/business-definitions.js +447 -0
- package/dist/core/type-definitions/conversation.type.definition.d.ts +223 -0
- package/dist/core/type-definitions/conversation.type.definition.js +236 -0
- package/dist/core/type-definitions/display-order.d.ts +154 -0
- package/dist/core/type-definitions/display-order.js +154 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.d.ts +165 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.js +97 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.d.ts +49 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.js +104 -0
- package/dist/core/type-definitions/dynamic-fields/index.d.ts +9 -0
- package/dist/core/type-definitions/dynamic-fields/index.js +25 -0
- package/dist/core/type-definitions/index.d.ts +10 -0
- package/dist/core/type-definitions/index.js +26 -0
- package/dist/core/type-definitions/knowledge-definitions.d.ts +30 -0
- package/dist/core/type-definitions/knowledge-definitions.js +37 -0
- package/dist/core/type-definitions/service-config.definitions.d.ts +112 -0
- package/dist/core/type-definitions/service-config.definitions.js +135 -0
- package/dist/core/validators/channel-validation.d.ts +19 -0
- package/dist/core/validators/channel-validation.js +40 -0
- package/dist/core/validators/index.d.ts +5 -0
- package/dist/core/validators/index.js +21 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +24 -0
- package/dist/request/index.d.ts +5 -0
- package/dist/request/index.js +21 -0
- package/dist/request/models/index.d.ts +6 -0
- package/dist/request/models/index.js +22 -0
- package/dist/request/models/paginated-quest.schema.d.ts +33 -0
- package/dist/request/models/paginated-quest.schema.js +35 -0
- package/dist/request/models/paginated-result.schema.d.ts +124 -0
- package/dist/request/models/paginated-result.schema.js +94 -0
- package/package.json +43 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProductCategoryWithDescendantsSchema = exports.BusinessProductCatalogSchema = exports.ProductCatalogSchema = exports.UpdateBusinessProductSchema = exports.CreateBusinessProductSchema = exports.UpdateProductCategorySchema = exports.CreateProductCategorySchema = exports.UpdateAttributeDefSchema = exports.CreateAttributeDefSchema = exports.BusinessProductSchema = exports.ProductCategorySchema = exports.ProductChannelMappingSchema = exports.ProductCategoryChannelMappingSchema = exports.ProductAttributeValueSchema = exports.CategoryAttributeBindingSchema = exports.AttributeDefSchema = exports.BarcodeFormat = exports.CategoryLocationScope = exports.AttributeDefType = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
const display_order_1 = require("../../type-definitions/display-order");
|
|
10
|
+
const product_variant_schema_1 = require("./product-variant.schema");
|
|
11
|
+
/**
|
|
12
|
+
* @fileoverview Product configuration schema definitions for business management.
|
|
13
|
+
* @module business-mgt/product-config
|
|
14
|
+
*
|
|
15
|
+
* Includes categories, products, attribute definitions, and channel mappings
|
|
16
|
+
* for multi-platform product catalog management.
|
|
17
|
+
*/
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// ENUMS
|
|
20
|
+
// ============================================================================
|
|
21
|
+
/**
|
|
22
|
+
* Attribute definition type.
|
|
23
|
+
* Determines the data type of attribute values.
|
|
24
|
+
*
|
|
25
|
+
* @enum {string}
|
|
26
|
+
*/
|
|
27
|
+
var AttributeDefType;
|
|
28
|
+
(function (AttributeDefType) {
|
|
29
|
+
AttributeDefType["STRING"] = "string";
|
|
30
|
+
AttributeDefType["NUMBER"] = "number";
|
|
31
|
+
AttributeDefType["BOOLEAN"] = "boolean";
|
|
32
|
+
AttributeDefType["ENUM"] = "enum";
|
|
33
|
+
AttributeDefType["DATE"] = "date";
|
|
34
|
+
AttributeDefType["URL"] = "url";
|
|
35
|
+
})(AttributeDefType || (exports.AttributeDefType = AttributeDefType = {}));
|
|
36
|
+
/**
|
|
37
|
+
* Category location scope.
|
|
38
|
+
* Determines whether category is inherited across locations or local.
|
|
39
|
+
*
|
|
40
|
+
* @enum {string}
|
|
41
|
+
*/
|
|
42
|
+
var CategoryLocationScope;
|
|
43
|
+
(function (CategoryLocationScope) {
|
|
44
|
+
/** Category is inherited from parent organization */
|
|
45
|
+
CategoryLocationScope["INHERITED"] = "inherited";
|
|
46
|
+
/** Category is local to specific location */
|
|
47
|
+
CategoryLocationScope["LOCAL"] = "local";
|
|
48
|
+
})(CategoryLocationScope || (exports.CategoryLocationScope = CategoryLocationScope = {}));
|
|
49
|
+
/**
|
|
50
|
+
* Barcode format types.
|
|
51
|
+
* Supported barcode formats for product identifiers.
|
|
52
|
+
*
|
|
53
|
+
* @enum {string}
|
|
54
|
+
*/
|
|
55
|
+
var BarcodeFormat;
|
|
56
|
+
(function (BarcodeFormat) {
|
|
57
|
+
BarcodeFormat["UPC_A"] = "UPC_A";
|
|
58
|
+
BarcodeFormat["UPC_E"] = "UPC_E";
|
|
59
|
+
BarcodeFormat["EAN_13"] = "EAN_13";
|
|
60
|
+
BarcodeFormat["EAN_8"] = "EAN_8";
|
|
61
|
+
BarcodeFormat["CODE_128"] = "CODE_128";
|
|
62
|
+
BarcodeFormat["CODE_39"] = "CODE_39";
|
|
63
|
+
BarcodeFormat["ITF_14"] = "ITF_14";
|
|
64
|
+
BarcodeFormat["QR"] = "QR";
|
|
65
|
+
})(BarcodeFormat || (exports.BarcodeFormat = BarcodeFormat = {}));
|
|
66
|
+
// ============================================================================
|
|
67
|
+
// ATTRIBUTE DEFINITION SCHEMAS
|
|
68
|
+
// ============================================================================
|
|
69
|
+
/**
|
|
70
|
+
* Attribute definition schema.
|
|
71
|
+
* Organization-level attribute definitions for products.
|
|
72
|
+
*
|
|
73
|
+
* @typedef {Object} AttributeDef
|
|
74
|
+
* @property {string} name - Attribute name (e.g., 'Voltage', 'Warranty Months')
|
|
75
|
+
* @property {string} slug - URL-friendly slug for the attribute
|
|
76
|
+
* @property {AttributeDefType} type - Attribute value type
|
|
77
|
+
* @property {string} [unit] - Unit of measurement
|
|
78
|
+
* @property {Array} [enumValues] - Allowed values for enum type
|
|
79
|
+
* @property {boolean} isActive - Whether attribute definition is active
|
|
80
|
+
*/
|
|
81
|
+
exports.AttributeDefSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
82
|
+
name: zod_1.default.string().min(1).describe("Attribute name (e.g., 'Voltage', 'Warranty Months'). Used for product specification display."),
|
|
83
|
+
slug: zod_1.default.string().min(1).describe("URL-friendly slug for the attribute. Used for filtering and API queries."),
|
|
84
|
+
type: zod_1.default.enum(AttributeDefType).describe("Attribute value type determining validation and display formatting."),
|
|
85
|
+
unit: zod_1.default.string().nullable().optional().describe("Unit of measurement (e.g., 'V', 'kg', 'cm'). Displayed alongside attribute value."),
|
|
86
|
+
enumValues: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("Allowed values for enum type. Only applicable when type is ENUM."),
|
|
87
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether this attribute definition is active and available for use."),
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Category attribute binding schema.
|
|
91
|
+
* Links categories to attribute definitions with category-specific settings.
|
|
92
|
+
*
|
|
93
|
+
* @typedef {Object} CategoryAttributeBinding
|
|
94
|
+
* @property {string} attributeDefId - Reference to AttributeDef.id
|
|
95
|
+
* @property {boolean} required - Whether attribute is required for products
|
|
96
|
+
* @property {number} displayOrder - Display order for this attribute
|
|
97
|
+
*/
|
|
98
|
+
exports.CategoryAttributeBindingSchema = zod_1.default.object({
|
|
99
|
+
attributeDefId: zod_1.default.string().describe("Reference to AttributeDef.id. Links category to organization-level attribute definition."),
|
|
100
|
+
required: zod_1.default.boolean().default(false).describe("Whether this attribute is required for products in this category."),
|
|
101
|
+
displayOrder: zod_1.default.number().int().default(0).describe("Display order for this attribute in the category. Lower numbers appear first."),
|
|
102
|
+
}).describe("Category-to-attribute binding with category-specific settings");
|
|
103
|
+
/**
|
|
104
|
+
* Product attribute value schema.
|
|
105
|
+
* Stores actual attribute values for products.
|
|
106
|
+
*
|
|
107
|
+
* @typedef {Object} ProductAttributeValue
|
|
108
|
+
* @property {string} attributeDefId - Reference to AttributeDef.id
|
|
109
|
+
* @property {string|number|boolean} value - Attribute value
|
|
110
|
+
*/
|
|
111
|
+
exports.ProductAttributeValueSchema = zod_1.default.object({
|
|
112
|
+
attributeDefId: zod_1.default.string().describe("Reference to AttributeDef.id. Links value to attribute definition for validation."),
|
|
113
|
+
value: zod_1.default.union([zod_1.default.string(), zod_1.default.number(), zod_1.default.boolean()]).describe("Attribute value. Type must match AttributeDef.type."),
|
|
114
|
+
}).describe("Product attribute value referencing a category attribute definition");
|
|
115
|
+
// ============================================================================
|
|
116
|
+
// CHANNEL MAPPING SCHEMAS
|
|
117
|
+
// ============================================================================
|
|
118
|
+
/**
|
|
119
|
+
* Product category channel mapping schema.
|
|
120
|
+
* Maps categories to external platform identifiers.
|
|
121
|
+
*
|
|
122
|
+
* @typedef {Object} ProductCategoryChannelMapping
|
|
123
|
+
* @property {string} channelId - Channel identifier
|
|
124
|
+
* @property {string} externalCategoryId - External category ID
|
|
125
|
+
*/
|
|
126
|
+
exports.ProductCategoryChannelMappingSchema = zod_1.default.object({
|
|
127
|
+
channelId: zod_1.default.string().describe("Channel ID (e.g., 'shopify', 'amazon'). Platform identifier for external system."),
|
|
128
|
+
externalCategoryId: zod_1.default.string().describe("External category ID for this specific channel. Used for synchronization."),
|
|
129
|
+
}).describe("Per-channel external category ID mapping");
|
|
130
|
+
/**
|
|
131
|
+
* Product channel mapping schema.
|
|
132
|
+
* Maps products to external platform identifiers.
|
|
133
|
+
*
|
|
134
|
+
* @typedef {Object} ProductChannelMapping
|
|
135
|
+
* @property {string} channelId - Channel identifier
|
|
136
|
+
* @property {string} externalProductId - External product ID
|
|
137
|
+
* @property {string} [externalCategoryId] - External category ID in channel
|
|
138
|
+
*/
|
|
139
|
+
exports.ProductChannelMappingSchema = zod_1.default.object({
|
|
140
|
+
channelId: zod_1.default.string().describe("Channel ID (e.g., 'shopify', 'amazon'). Platform identifier for external system."),
|
|
141
|
+
externalProductId: zod_1.default.string().describe("External product ID for this specific channel. Used for order reconciliation."),
|
|
142
|
+
externalCategoryId: zod_1.default.string().nullable().optional().describe("External category ID in this channel, if needed for sync payloads."),
|
|
143
|
+
}).describe("Per-channel external product ID mapping");
|
|
144
|
+
// ============================================================================
|
|
145
|
+
// PRODUCT CATEGORY SCHEMA
|
|
146
|
+
// ============================================================================
|
|
147
|
+
/**
|
|
148
|
+
* Product category schema.
|
|
149
|
+
*
|
|
150
|
+
* @typedef {Object} ProductCategory
|
|
151
|
+
* @property {string} [productRevisionId] - Version control for category changes
|
|
152
|
+
* @property {string} [parentId] - Parent category ID for nested hierarchy
|
|
153
|
+
* @property {string} name - Category name
|
|
154
|
+
* @property {string} [slug] - URL-friendly slug
|
|
155
|
+
* @property {string} [description] - Category description
|
|
156
|
+
* @property {Array} [channelMappings] - Per-channel category ID mappings
|
|
157
|
+
* @property {string} [iconId] - Icon image ID
|
|
158
|
+
* @property {string} [heroImageId] - Hero/banner image ID
|
|
159
|
+
* @property {number} [displayOrder] - Display order in catalog
|
|
160
|
+
* @property {boolean} isDefault - Whether this is the default category
|
|
161
|
+
* @property {Array} [attributeBindings] - Attribute bindings for products
|
|
162
|
+
* @property {Array} [defaultAxisIds] - Default variant axis IDs
|
|
163
|
+
* @property {Array} [defaultChannelIds] - Default channel IDs
|
|
164
|
+
* @property {string} [taxClassId] - Tax class ID
|
|
165
|
+
* @property {number} [targetMargin] - Target profit margin (0-1)
|
|
166
|
+
* @property {boolean} [ageRestricted] - Whether products are age-restricted
|
|
167
|
+
* @property {boolean} [requireImage] - Whether products must have an image
|
|
168
|
+
* @property {CategoryLocationScope} [locationScope] - Location inheritance scope
|
|
169
|
+
*/
|
|
170
|
+
exports.ProductCategorySchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
171
|
+
productRevisionId: zod_1.default.string().nullable().optional().describe("Optional product revision ID for version-scoped data. Ensures category applies to specific catalog version."),
|
|
172
|
+
parentId: zod_1.default.string().nullable().optional().describe("Parent category ID for nested hierarchy. Null for root categories."),
|
|
173
|
+
name: zod_1.default.string().min(1, "Category name is required").describe("Category name for product organization (e.g., Electronics, Clothing). Used by AI Powered Services when presenting product options."),
|
|
174
|
+
slug: zod_1.default.string().min(1).nullable().optional().describe("URL-friendly slug for the category. Used for SEO and deep linking."),
|
|
175
|
+
description: zod_1.default.string().nullable().optional().describe("Category description providing context about products included. Helps customers navigate the catalog."),
|
|
176
|
+
channelMappings: zod_1.default.array(exports.ProductCategoryChannelMappingSchema).nullable().optional().describe("Per-channel category ID mappings for external platform synchronization."),
|
|
177
|
+
// Media
|
|
178
|
+
iconId: zod_1.default.string().nullable().optional().describe("Icon image ID for category. Used in navigation menus and category lists."),
|
|
179
|
+
heroImageId: zod_1.default.string().nullable().optional().describe("Hero/banner image ID for category. Used on category landing pages."),
|
|
180
|
+
// Display
|
|
181
|
+
displayOrder: zod_1.default.number().int().nullable().optional().describe("Numeric order for category display in catalog. Lower numbers appear first."),
|
|
182
|
+
isDefault: zod_1.default.boolean().default(false).describe("Whether this is the default category for uncategorized products."),
|
|
183
|
+
// Attribute Bindings
|
|
184
|
+
attributeBindings: zod_1.default.array(exports.CategoryAttributeBindingSchema).nullable().optional().describe("Attribute bindings defining which attributes apply to products in this category."),
|
|
185
|
+
// Default Axes
|
|
186
|
+
defaultAxisIds: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("Default variant axis IDs for products in this category (e.g., Size, Color)."),
|
|
187
|
+
// Distribution
|
|
188
|
+
defaultChannelIds: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("Default channel IDs for products in this category. Products inherit these channels."),
|
|
189
|
+
// Tax & Margin
|
|
190
|
+
taxClassId: zod_1.default.string().nullable().optional().describe("Tax class ID for products in this category. Determines tax calculation rules."),
|
|
191
|
+
targetMargin: zod_1.default.number().min(0).max(1).nullable().optional().describe("Target profit margin (0-1) for products in this category. Used for pricing guidance."),
|
|
192
|
+
// Business Rules
|
|
193
|
+
ageRestricted: zod_1.default.boolean().nullable().optional().describe("Whether products in this category are age-restricted. Triggers age verification."),
|
|
194
|
+
requireImage: zod_1.default.boolean().nullable().optional().describe("Whether products in this category must have an image before publishing."),
|
|
195
|
+
// Location Scope
|
|
196
|
+
locationScope: zod_1.default.enum(CategoryLocationScope).nullable().optional().describe("Whether category is inherited across locations or local to specific location."),
|
|
197
|
+
});
|
|
198
|
+
// ============================================================================
|
|
199
|
+
// BUSINESS PRODUCT SCHEMA
|
|
200
|
+
// ============================================================================
|
|
201
|
+
/**
|
|
202
|
+
* Business product schema.
|
|
203
|
+
*
|
|
204
|
+
* @typedef {Object} BusinessProduct
|
|
205
|
+
* @property {string} [productRevisionId] - Version control for product changes
|
|
206
|
+
* @property {Array} [channelMappings] - Per-channel product ID mappings
|
|
207
|
+
* @property {string} name - Product name
|
|
208
|
+
* @property {string} [description] - Product description
|
|
209
|
+
* @property {string} [imageUrl] - Public image URL
|
|
210
|
+
* @property {Array} [imageUrls] - Product gallery image URLs
|
|
211
|
+
* @property {Array} [tags] - Product tags for search and filtering
|
|
212
|
+
* @property {number} price - Product price
|
|
213
|
+
* @property {number} [cost] - Cost of goods
|
|
214
|
+
* @property {number} [compareAtPrice] - Original price for sale display
|
|
215
|
+
* @property {string} [sku] - Stock Keeping Unit identifier
|
|
216
|
+
* @property {string} [skuPattern] - SKU template for variant generation
|
|
217
|
+
* @property {string} [barcode] - Product barcode
|
|
218
|
+
* @property {BarcodeFormat} [barcodeFormat] - Barcode format
|
|
219
|
+
* @property {boolean} [isAlcoholic] - Whether product is alcoholic
|
|
220
|
+
* @property {string} categoryId - Category ID
|
|
221
|
+
* @property {Object} [category] - Product category
|
|
222
|
+
* @property {string} [brand] - Product brand name
|
|
223
|
+
* @property {string} [brandId] - Product brand ID
|
|
224
|
+
* @property {boolean} trackInventory - Whether to track inventory
|
|
225
|
+
* @property {number} [stockQuantity] - Current stock quantity
|
|
226
|
+
* @property {number} [lowStockThreshold] - Low stock alert threshold
|
|
227
|
+
* @property {number} [stockedAt] - Unix timestamp when stock was last updated
|
|
228
|
+
* @property {number} [reorderPoint] - Inventory threshold for replenishment
|
|
229
|
+
* @property {number} [leadTime] - Supplier lead time in days
|
|
230
|
+
* @property {string} [supplierId] - Preferred supplier ID
|
|
231
|
+
* @property {number} [weight] - Product weight
|
|
232
|
+
* @property {Object} [dimensions] - Product dimensions
|
|
233
|
+
* @property {string} [shippingClassId] - Shipping class ID
|
|
234
|
+
* @property {string} [HSCode] - Harmonized System Code
|
|
235
|
+
* @property {Array} [attributes] - Product attribute values
|
|
236
|
+
* @property {Array} [taxRuleIds] - Tax rule IDs
|
|
237
|
+
* @property {boolean} isActive - Whether product is available for sale
|
|
238
|
+
* @property {number} [displayOrder] - Display order in category
|
|
239
|
+
*/
|
|
240
|
+
exports.BusinessProductSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
241
|
+
productRevisionId: zod_1.default.string().nullable().optional().describe("Optional product revision ID for version-scoped data. Ensures product applies to specific catalog version."),
|
|
242
|
+
channelMappings: zod_1.default.array(exports.ProductChannelMappingSchema).nullable().optional().describe("Per-channel product ID mappings for external platform synchronization."),
|
|
243
|
+
name: zod_1.default.string().min(1, "Product name is required").describe("Display name of the product shown to customers. Used by AI Powered Services in order conversations."),
|
|
244
|
+
description: zod_1.default.string().nullable().optional().describe("Detailed product description including features and benefits. Enables AI-powered recommendations."),
|
|
245
|
+
imageUrl: zod_1.default.url().nullable().optional().describe("Public image URL for the product. Primary image shown in catalog and search results."),
|
|
246
|
+
imageUrls: zod_1.default.array(zod_1.default.url()).nullable().optional().describe("Public image URLs for the product gallery. Additional images for product detail page."),
|
|
247
|
+
tags: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("List of product tags for search and filtering. Enables faceted navigation."),
|
|
248
|
+
// Pricing
|
|
249
|
+
price: zod_1.default.number().nonnegative().describe("Base price for this product in the account's currency. Used for order pricing calculations."),
|
|
250
|
+
cost: zod_1.default.number().nonnegative().nullable().optional().describe("Cost of goods for margin calculation. Used for profitability reporting."),
|
|
251
|
+
compareAtPrice: zod_1.default.number().nonnegative().nullable().optional().describe("Original price for sale/strikethrough display. Shows discount to customers."),
|
|
252
|
+
// Identifiers
|
|
253
|
+
sku: zod_1.default.string().nullable().optional().describe("Stock Keeping Unit identifier for inventory tracking. Unique alphanumeric code for warehouse operations."),
|
|
254
|
+
skuPattern: zod_1.default.string().nullable().optional().describe("SKU template/pattern for generating variant SKUs (e.g., 'PROD-{size}-{color}')."),
|
|
255
|
+
barcode: zod_1.default.string().nullable().optional().describe("Product barcode for point-of-sale scanning and inventory management."),
|
|
256
|
+
barcodeFormat: zod_1.default.enum(BarcodeFormat).nullable().optional().describe("Barcode format used for product identifiers (UPC-A, EAN-13, etc.)."),
|
|
257
|
+
// Classification
|
|
258
|
+
isAlcoholic: zod_1.default.boolean().nullable().optional().default(false).describe("Whether this product is alcoholic. Triggers age verification requirements."),
|
|
259
|
+
categoryId: zod_1.default.string().describe("References ProductCategory this product belongs to. Used for organization and browsing."),
|
|
260
|
+
category: exports.ProductCategorySchema.nullable().optional().describe("Populated ProductCategory object. Not required during creation."),
|
|
261
|
+
brand: zod_1.default.string().nullable().optional().describe("Product brand or manufacturer name for brand-based filtering."),
|
|
262
|
+
brandId: zod_1.default.string().nullable().optional().describe("Product brand ID for linking to brand entity."),
|
|
263
|
+
// Inventory
|
|
264
|
+
trackInventory: zod_1.default.boolean().default(false).describe("Whether inventory tracking is enabled. When true, stockQuantity is enforced."),
|
|
265
|
+
stockQuantity: zod_1.default.number().int().nonnegative().nullable().optional().describe("Current available stock quantity. Updated by orders and adjustments."),
|
|
266
|
+
lowStockThreshold: zod_1.default.number().int().nonnegative().nullable().optional().describe("Stock level that triggers low inventory alerts."),
|
|
267
|
+
stockedAt: zod_1.default.number().int().nullable().optional().describe("Unix timestamp when stock was last received or updated."),
|
|
268
|
+
reorderPoint: zod_1.default.number().int().nonnegative().nullable().optional().describe("Inventory threshold that should trigger replenishment order."),
|
|
269
|
+
leadTime: zod_1.default.number().int().nonnegative().nullable().optional().describe("Supplier lead time in days. Used for reorder timing."),
|
|
270
|
+
supplierId: zod_1.default.string().nullable().optional().describe("Preferred supplier ID for this product."),
|
|
271
|
+
// Physical Attributes
|
|
272
|
+
weight: zod_1.default.number().positive().nullable().optional().describe("Product weight for shipping calculations and carrier integration."),
|
|
273
|
+
dimensions: zod_1.default.object({
|
|
274
|
+
length: zod_1.default.number().positive().describe("Product length in specified units."),
|
|
275
|
+
width: zod_1.default.number().positive().describe("Product width in specified units."),
|
|
276
|
+
height: zod_1.default.number().positive().describe("Product height in specified units."),
|
|
277
|
+
unit: zod_1.default.enum(['inches', 'cm']).default('inches').describe("Measurement unit for dimensions."),
|
|
278
|
+
}).nullable().optional().describe("Physical dimensions for shipping cost estimation and warehouse management."),
|
|
279
|
+
// Shipping
|
|
280
|
+
shippingClassId: zod_1.default.string().nullable().optional().describe("Shipping class ID for the product. Determines shipping rates and methods."),
|
|
281
|
+
HSCode: zod_1.default.string().nullable().optional().describe("Harmonized System Code for international shipping and customs."),
|
|
282
|
+
// Attributes
|
|
283
|
+
attributes: zod_1.default.array(exports.ProductAttributeValueSchema).nullable().optional().describe("Product attribute values referencing category attribute definitions."),
|
|
284
|
+
// Tax
|
|
285
|
+
taxRuleIds: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("Tax rule IDs applicable to this product. Overrides category tax settings."),
|
|
286
|
+
// Business Management
|
|
287
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether product is active and available for sale. Inactive products are hidden."),
|
|
288
|
+
displayOrder: zod_1.default.number().int().nullable().optional().describe("Numeric order for product display within its category."),
|
|
289
|
+
// Ordering Analytics (Read Model only)
|
|
290
|
+
orderCount: zod_1.default.number().int().nonnegative().nullable().optional().describe("Total orders for this product (all time). Computed server-side."),
|
|
291
|
+
recentOrderCount: zod_1.default.number().int().nonnegative().nullable().optional().describe("Orders for this product in the last 30 days. Computed server-side."),
|
|
292
|
+
lastOrderedAt: zod_1.default.number().int().positive().nullable().optional().describe("Unix timestamp of the last order for this product. Computed server-side."),
|
|
293
|
+
});
|
|
294
|
+
// ============================================================================
|
|
295
|
+
// CREATE/UPDATE SCHEMAS
|
|
296
|
+
// ============================================================================
|
|
297
|
+
/**
|
|
298
|
+
* Schema for creating a new attribute definition.
|
|
299
|
+
* Omits auto-generated fields.
|
|
300
|
+
*/
|
|
301
|
+
exports.CreateAttributeDefSchema = exports.AttributeDefSchema.omit({
|
|
302
|
+
id: true,
|
|
303
|
+
createdAt: true,
|
|
304
|
+
updatedAt: true,
|
|
305
|
+
});
|
|
306
|
+
/**
|
|
307
|
+
* Schema for updating an existing attribute definition.
|
|
308
|
+
* All fields optional except id (required).
|
|
309
|
+
*/
|
|
310
|
+
exports.UpdateAttributeDefSchema = exports.CreateAttributeDefSchema.partial().safeExtend({
|
|
311
|
+
id: zod_1.default.string().describe("Unique identifier of the AttributeDef to update"),
|
|
312
|
+
});
|
|
313
|
+
/**
|
|
314
|
+
* Schema for creating a new product category.
|
|
315
|
+
* Omits auto-generated fields.
|
|
316
|
+
*/
|
|
317
|
+
exports.CreateProductCategorySchema = exports.ProductCategorySchema.omit({
|
|
318
|
+
id: true,
|
|
319
|
+
createdAt: true,
|
|
320
|
+
updatedAt: true,
|
|
321
|
+
}).safeExtend({
|
|
322
|
+
placement: display_order_1.CreateDisplayOrderPlacementSchema.optional().describe("Optional placement for display ordering"),
|
|
323
|
+
});
|
|
324
|
+
/**
|
|
325
|
+
* Schema for updating an existing product category.
|
|
326
|
+
* All fields optional except id (required).
|
|
327
|
+
*/
|
|
328
|
+
exports.UpdateProductCategorySchema = exports.CreateProductCategorySchema.partial().safeExtend({
|
|
329
|
+
id: zod_1.default.string().describe("Unique identifier of the ProductCategory to update"),
|
|
330
|
+
});
|
|
331
|
+
/**
|
|
332
|
+
* Schema for creating a new business product.
|
|
333
|
+
* Omits auto-generated fields, category object, and analytics.
|
|
334
|
+
*
|
|
335
|
+
* @remarks
|
|
336
|
+
* A product must be created with at least one variant. Nested variants use the
|
|
337
|
+
* product variant create schema with `productId` omitted; the parent link is
|
|
338
|
+
* assigned by the server once the product is created.
|
|
339
|
+
*/
|
|
340
|
+
exports.CreateBusinessProductSchema = exports.BusinessProductSchema.omit({
|
|
341
|
+
id: true,
|
|
342
|
+
createdAt: true,
|
|
343
|
+
updatedAt: true,
|
|
344
|
+
category: true,
|
|
345
|
+
categoryId: true,
|
|
346
|
+
orderCount: true,
|
|
347
|
+
recentOrderCount: true,
|
|
348
|
+
lastOrderedAt: true,
|
|
349
|
+
}).safeExtend({
|
|
350
|
+
categoryId: zod_1.default.string().optional().describe("Category ID this product belongs to"),
|
|
351
|
+
placement: display_order_1.CreateDisplayOrderPlacementSchema.optional().describe("Optional placement for display ordering"),
|
|
352
|
+
variants: zod_1.default.array(product_variant_schema_1.CreateProductVariantSchema.omit({ productId: true })).min(1, "A product must have at least one variant").describe("Variants to create with this product. At least one is required; the parent product ID is assigned by the server."),
|
|
353
|
+
});
|
|
354
|
+
/**
|
|
355
|
+
* Schema for updating an existing business product.
|
|
356
|
+
* All fields optional except id (required).
|
|
357
|
+
*/
|
|
358
|
+
exports.UpdateBusinessProductSchema = exports.CreateBusinessProductSchema.partial().safeExtend({
|
|
359
|
+
id: zod_1.default.string().describe("Unique identifier of the BusinessProduct to update"),
|
|
360
|
+
});
|
|
361
|
+
// ============================================================================
|
|
362
|
+
// CATALOG SCHEMAS
|
|
363
|
+
// ============================================================================
|
|
364
|
+
/**
|
|
365
|
+
* Product catalog schema.
|
|
366
|
+
* Represents a category with its list of products.
|
|
367
|
+
*
|
|
368
|
+
* @typedef {Object} ProductCatalog
|
|
369
|
+
* @property {Object} productCategory - The ProductCategory object
|
|
370
|
+
* @property {Array} items - List of products in this category
|
|
371
|
+
*/
|
|
372
|
+
exports.ProductCatalogSchema = zod_1.default.object({
|
|
373
|
+
productCategory: exports.ProductCategorySchema.describe("The category for this catalog section"),
|
|
374
|
+
items: zod_1.default.array(exports.BusinessProductSchema).describe("List of products in this category"),
|
|
375
|
+
}).describe("Schema representing a product category and its items");
|
|
376
|
+
/**
|
|
377
|
+
* Business product catalog schema.
|
|
378
|
+
* Full catalog as array of category sections.
|
|
379
|
+
*/
|
|
380
|
+
exports.BusinessProductCatalogSchema = zod_1.default.array(exports.ProductCatalogSchema).describe("Schema representing a complete business product catalog");
|
|
381
|
+
/**
|
|
382
|
+
* Product category with descendants schema.
|
|
383
|
+
* Read model only. Use when ProductCategoryFilters.includeDescendants is true.
|
|
384
|
+
*/
|
|
385
|
+
exports.ProductCategoryWithDescendantsSchema = zod_1.default.lazy(() => exports.ProductCategorySchema.safeExtend({
|
|
386
|
+
descendants: zod_1.default.array(exports.ProductCategoryWithDescendantsSchema).optional()
|
|
387
|
+
.describe("Nested descendant categories"),
|
|
388
|
+
descendantIds: zod_1.default.array(zod_1.default.string()).optional()
|
|
389
|
+
.describe("Flattened list of descendant category IDs"),
|
|
390
|
+
descendantCount: zod_1.default.number().int().nonnegative().optional()
|
|
391
|
+
.describe("Total number of descendants"),
|
|
392
|
+
}));
|