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,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PricingRuleActionSchema = exports.PricingRuleCommonConditionSchema = exports.PricingRuleChannelMappingSchema = exports.PricingRuleApplyLevel = exports.PricingRuleAdjustmentType = exports.PricingChannel = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const type_definitions_1 = require("../type-definitions");
|
|
6
|
+
Object.defineProperty(exports, "PricingChannel", { enumerable: true, get: function () { return type_definitions_1.PricingChannel; } });
|
|
7
|
+
Object.defineProperty(exports, "PricingRuleAdjustmentType", { enumerable: true, get: function () { return type_definitions_1.PricingRuleAdjustmentType; } });
|
|
8
|
+
Object.defineProperty(exports, "PricingRuleApplyLevel", { enumerable: true, get: function () { return type_definitions_1.PricingRuleApplyLevel; } });
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// CHANNEL MAPPING SCHEMA
|
|
11
|
+
// ============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Pricing rule channel mapping schema.
|
|
14
|
+
* Maps pricing rules to external platform pricing rule IDs.
|
|
15
|
+
*
|
|
16
|
+
* @typedef {Object} PricingRuleChannelMapping
|
|
17
|
+
* @property {string} channelId - Channel identifier
|
|
18
|
+
* @property {string} externalPricingRuleId - External pricing rule ID
|
|
19
|
+
*/
|
|
20
|
+
exports.PricingRuleChannelMappingSchema = zod_1.z.object({
|
|
21
|
+
channelId: zod_1.z.string().describe("Channel ID (e.g., doordash, uber-eats)"),
|
|
22
|
+
externalPricingRuleId: zod_1.z.string().describe("External pricing rule ID for this specific channel"),
|
|
23
|
+
}).describe("Per-channel external pricing rule ID mapping");
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// CONDITION AND ACTION SCHEMAS
|
|
26
|
+
// ============================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Pricing rule common condition schema.
|
|
29
|
+
* Defines when a pricing rule should be applied based on time, day, customer, and channel.
|
|
30
|
+
*
|
|
31
|
+
* @typedef {Object} PricingRuleCommonCondition
|
|
32
|
+
* @property {number[]} daysOfWeek - Days of week (0-6, Sunday=0)
|
|
33
|
+
* @property {number} [startMinute] - Start minute of day (0-1439)
|
|
34
|
+
* @property {number} [endMinute] - End minute of day (0-1439)
|
|
35
|
+
* @property {string[]} [customerSegmentIds] - Target customer segment IDs
|
|
36
|
+
* @property {PricingChannel} channel - Channel scope for the rule
|
|
37
|
+
*/
|
|
38
|
+
exports.PricingRuleCommonConditionSchema = zod_1.z.object({
|
|
39
|
+
daysOfWeek: zod_1.z.array(zod_1.z.number().int().min(0).max(6)).default([]).describe("Days of week when rule applies (0=Sunday, 6=Saturday)"),
|
|
40
|
+
startMinute: zod_1.z.number().int().min(0).max(1439).optional().describe("Start minute of day (0-1439)"),
|
|
41
|
+
endMinute: zod_1.z.number().int().min(0).max(1439).optional().describe("End minute of day (0-1439)"),
|
|
42
|
+
customerSegmentIds: zod_1.z.array(zod_1.z.string()).optional().describe("Target customer segment IDs"),
|
|
43
|
+
channel: zod_1.z.enum(type_definitions_1.PricingChannel).default(type_definitions_1.PricingChannel.ALL).describe("Channel scope for the rule"),
|
|
44
|
+
}).superRefine((data, ctx) => {
|
|
45
|
+
if (data.startMinute !== undefined && data.endMinute !== undefined && data.endMinute < data.startMinute) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
code: "custom",
|
|
48
|
+
path: ["endMinute"],
|
|
49
|
+
message: "endMinute must be greater than or equal to startMinute",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Pricing rule action schema.
|
|
55
|
+
* Defines the price adjustment to apply when rule conditions are met.
|
|
56
|
+
*
|
|
57
|
+
* @typedef {Object} PricingRuleAction
|
|
58
|
+
* @property {PricingRuleAdjustmentType} adjustmentType - Type of price adjustment
|
|
59
|
+
* @property {number} adjustmentValue - Adjustment value (percentage or fixed amount)
|
|
60
|
+
* @property {string} currency - Currency code for fixed adjustments
|
|
61
|
+
* @property {number} [maxAdjustmentAmount] - Maximum adjustment cap
|
|
62
|
+
*/
|
|
63
|
+
exports.PricingRuleActionSchema = zod_1.z.object({
|
|
64
|
+
adjustmentType: zod_1.z.enum(type_definitions_1.PricingRuleAdjustmentType).describe("Type of price adjustment"),
|
|
65
|
+
adjustmentValue: zod_1.z.number().nonnegative().describe("Adjustment value (percentage or fixed amount)"),
|
|
66
|
+
currency: zod_1.z.string().length(3).default("USD").describe("Currency code for fixed adjustments"),
|
|
67
|
+
maxAdjustmentAmount: zod_1.z.number().nonnegative().optional().describe("Maximum adjustment cap"),
|
|
68
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Product configuration schema definitions for business management.
|
|
4
|
+
* @module business-mgt/product-config
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Product category schema.
|
|
8
|
+
*
|
|
9
|
+
* @typedef {Object} ProductCategory
|
|
10
|
+
* @property {string} name - Category name (e.g., Electronics, Clothing)
|
|
11
|
+
* @property {string} [description] - Category description
|
|
12
|
+
* @property {number} [displayOrder] - Display order in catalog
|
|
13
|
+
*/
|
|
14
|
+
export declare const ProductCategorySchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
/**
|
|
23
|
+
* Business product schema.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {Object} BusinessProduct
|
|
26
|
+
* @property {string} name - Product name
|
|
27
|
+
* @property {string} [description] - Product description
|
|
28
|
+
* @property {number} price - Product price
|
|
29
|
+
* @property {string} [sku] - Stock Keeping Unit identifier
|
|
30
|
+
* @property {string} [barcode] - Product barcode
|
|
31
|
+
* @property {string} categoryId - Category ID
|
|
32
|
+
* @property {Object} [category] - Product category
|
|
33
|
+
* @property {string} [brand] - Product brand name
|
|
34
|
+
* @property {boolean} trackInventory - Whether to track inventory
|
|
35
|
+
* @property {number} [stockQuantity] - Current stock quantity
|
|
36
|
+
* @property {number} [lowStockThreshold] - Low stock alert threshold
|
|
37
|
+
* @property {number} [weight] - Product weight
|
|
38
|
+
* @property {Object} [dimensions] - Product dimensions
|
|
39
|
+
* @property {boolean} isActive - Whether product is available for sale
|
|
40
|
+
* @property {number} [displayOrder] - Display order in category
|
|
41
|
+
*/
|
|
42
|
+
export declare const BusinessProductSchema: z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
description: z.ZodOptional<z.ZodString>;
|
|
48
|
+
price: z.ZodNumber;
|
|
49
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
50
|
+
barcode: z.ZodOptional<z.ZodString>;
|
|
51
|
+
categoryId: z.ZodString;
|
|
52
|
+
category: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
description: z.ZodOptional<z.ZodString>;
|
|
58
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
brand: z.ZodOptional<z.ZodString>;
|
|
61
|
+
trackInventory: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
stockQuantity: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
lowStockThreshold: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
dimensions: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
length: z.ZodNumber;
|
|
67
|
+
width: z.ZodNumber;
|
|
68
|
+
height: z.ZodNumber;
|
|
69
|
+
unit: z.ZodDefault<z.ZodEnum<{
|
|
70
|
+
cm: "cm";
|
|
71
|
+
inches: "inches";
|
|
72
|
+
}>>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
/**
|
|
77
|
+
* Schema for creating a new product category.
|
|
78
|
+
* Omits auto-generated fields.
|
|
79
|
+
*/
|
|
80
|
+
export declare const CreateProductCategorySchema: z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
description: z.ZodOptional<z.ZodString>;
|
|
83
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
/**
|
|
86
|
+
* Schema for updating an existing product category.
|
|
87
|
+
* All fields are optional except id.
|
|
88
|
+
*/
|
|
89
|
+
export declare const UpdateProductCategorySchema: z.ZodObject<{
|
|
90
|
+
name: z.ZodOptional<z.ZodString>;
|
|
91
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
92
|
+
displayOrder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
/**
|
|
96
|
+
* Schema for creating a new business product.
|
|
97
|
+
* Omits auto-generated fields and category object.
|
|
98
|
+
*/
|
|
99
|
+
export declare const CreateBusinessProductSchema: z.ZodObject<{
|
|
100
|
+
name: z.ZodString;
|
|
101
|
+
description: z.ZodOptional<z.ZodString>;
|
|
102
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
103
|
+
price: z.ZodNumber;
|
|
104
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
105
|
+
barcode: z.ZodOptional<z.ZodString>;
|
|
106
|
+
brand: z.ZodOptional<z.ZodString>;
|
|
107
|
+
trackInventory: z.ZodDefault<z.ZodBoolean>;
|
|
108
|
+
stockQuantity: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
lowStockThreshold: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
dimensions: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
length: z.ZodNumber;
|
|
113
|
+
width: z.ZodNumber;
|
|
114
|
+
height: z.ZodNumber;
|
|
115
|
+
unit: z.ZodDefault<z.ZodEnum<{
|
|
116
|
+
cm: "cm";
|
|
117
|
+
inches: "inches";
|
|
118
|
+
}>>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
categoryId: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
/**
|
|
123
|
+
* Schema for updating an existing business product.
|
|
124
|
+
* All fields are optional except id.
|
|
125
|
+
*/
|
|
126
|
+
export declare const UpdateBusinessProductSchema: z.ZodObject<{
|
|
127
|
+
name: z.ZodOptional<z.ZodString>;
|
|
128
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
129
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
130
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
sku: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
132
|
+
barcode: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
133
|
+
brand: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
134
|
+
trackInventory: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
135
|
+
stockQuantity: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
136
|
+
lowStockThreshold: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
137
|
+
weight: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
138
|
+
dimensions: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
139
|
+
length: z.ZodNumber;
|
|
140
|
+
width: z.ZodNumber;
|
|
141
|
+
height: z.ZodNumber;
|
|
142
|
+
unit: z.ZodDefault<z.ZodEnum<{
|
|
143
|
+
cm: "cm";
|
|
144
|
+
inches: "inches";
|
|
145
|
+
}>>;
|
|
146
|
+
}, z.core.$strip>>>;
|
|
147
|
+
categoryId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
148
|
+
id: z.ZodString;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
export type ProductCategory = z.infer<typeof ProductCategorySchema>;
|
|
151
|
+
export type CreateProductCategory = z.infer<typeof CreateProductCategorySchema>;
|
|
152
|
+
export type UpdateProductCategory = z.infer<typeof UpdateProductCategorySchema>;
|
|
153
|
+
export type BusinessProduct = z.infer<typeof BusinessProductSchema>;
|
|
154
|
+
export type CreateBusinessProduct = z.infer<typeof CreateBusinessProductSchema>;
|
|
155
|
+
export type UpdateBusinessProduct = z.infer<typeof UpdateBusinessProductSchema>;
|
|
156
|
+
export interface BusinessProductFilters {
|
|
157
|
+
search?: string;
|
|
158
|
+
categoryId?: string;
|
|
159
|
+
isActive?: boolean;
|
|
160
|
+
brand?: string;
|
|
161
|
+
trackInventory?: boolean;
|
|
162
|
+
priceRange?: {
|
|
163
|
+
min?: number;
|
|
164
|
+
max?: number;
|
|
165
|
+
};
|
|
166
|
+
lowStock?: boolean;
|
|
167
|
+
}
|
|
168
|
+
export interface BusinessProductSorting {
|
|
169
|
+
field: 'name' | 'price' | 'createdAt' | 'displayOrder';
|
|
170
|
+
direction: 'asc' | 'desc';
|
|
171
|
+
}
|
|
172
|
+
export interface BusinessProductQueryOptions {
|
|
173
|
+
page: number;
|
|
174
|
+
pageSize: number;
|
|
175
|
+
filters?: BusinessProductFilters;
|
|
176
|
+
sorting?: BusinessProductSorting;
|
|
177
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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.UpdateBusinessProductSchema = exports.CreateBusinessProductSchema = exports.UpdateProductCategorySchema = exports.CreateProductCategorySchema = exports.BusinessProductSchema = exports.ProductCategorySchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../base.schema");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Product configuration schema definitions for business management.
|
|
11
|
+
* @module business-mgt/product-config
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Product category schema.
|
|
15
|
+
*
|
|
16
|
+
* @typedef {Object} ProductCategory
|
|
17
|
+
* @property {string} name - Category name (e.g., Electronics, Clothing)
|
|
18
|
+
* @property {string} [description] - Category description
|
|
19
|
+
* @property {number} [displayOrder] - Display order in catalog
|
|
20
|
+
*/
|
|
21
|
+
exports.ProductCategorySchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
22
|
+
name: zod_1.default.string().min(1, "Category name is required").describe("Category name for product organization (e.g., Electronics, Clothing, Home & Garden). Used by AI Powered Services when presenting product options to customers."),
|
|
23
|
+
description: zod_1.default.string().optional().describe("Category description providing context about the type of products included. Helps customers navigate the product catalog and understand category scope."),
|
|
24
|
+
displayOrder: zod_1.default.number().int().optional().describe("Numeric order for category display in product catalog. Lower numbers appear first. Enables strategic category positioning."),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Business product schema.
|
|
28
|
+
*
|
|
29
|
+
* @typedef {Object} BusinessProduct
|
|
30
|
+
* @property {string} name - Product name
|
|
31
|
+
* @property {string} [description] - Product description
|
|
32
|
+
* @property {number} price - Product price
|
|
33
|
+
* @property {string} [sku] - Stock Keeping Unit identifier
|
|
34
|
+
* @property {string} [barcode] - Product barcode
|
|
35
|
+
* @property {string} categoryId - Category ID
|
|
36
|
+
* @property {Object} [category] - Product category
|
|
37
|
+
* @property {string} [brand] - Product brand name
|
|
38
|
+
* @property {boolean} trackInventory - Whether to track inventory
|
|
39
|
+
* @property {number} [stockQuantity] - Current stock quantity
|
|
40
|
+
* @property {number} [lowStockThreshold] - Low stock alert threshold
|
|
41
|
+
* @property {number} [weight] - Product weight
|
|
42
|
+
* @property {Object} [dimensions] - Product dimensions
|
|
43
|
+
* @property {boolean} isActive - Whether product is available for sale
|
|
44
|
+
* @property {number} [displayOrder] - Display order in category
|
|
45
|
+
*/
|
|
46
|
+
exports.BusinessProductSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
47
|
+
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 product order conversations."),
|
|
48
|
+
description: zod_1.default.string().optional().describe("Detailed product description including features, specifications, or benefits. Helps customers make informed purchasing decisions and enables AI-powered product recommendations."),
|
|
49
|
+
// Product-specific fields
|
|
50
|
+
price: zod_1.default.number().nonnegative().describe("Base price for this product in the account's currency. Used for order pricing calculations and Product Order workflow."),
|
|
51
|
+
sku: zod_1.default.string().optional().describe("Stock Keeping Unit identifier for internal inventory tracking and integration with external inventory systems. Unique alphanumeric code for warehouse and fulfillment operations."),
|
|
52
|
+
barcode: zod_1.default.string().optional().describe("Product barcode (UPC, EAN, ISBN) for point-of-sale scanning and inventory management. Links physical products to digital catalog."),
|
|
53
|
+
categoryId: zod_1.default.string().describe("References ProductCategory this product belongs to. Used for product organization and AI-driven category-based browsing."),
|
|
54
|
+
category: exports.ProductCategorySchema.optional().describe("Populated ProductCategory object for convenient access. Not required during creation; managed by Product Management."),
|
|
55
|
+
brand: zod_1.default.string().optional().describe("Product brand or manufacturer name for brand-based filtering and customer preference matching in AI conversations."),
|
|
56
|
+
// Inventory
|
|
57
|
+
trackInventory: zod_1.default.boolean().default(false).describe("Whether inventory tracking is enabled for this product. When true, stockQuantity is enforced and Product Order validates availability. Defaults to false for digital or unlimited products."),
|
|
58
|
+
stockQuantity: zod_1.default.number().int().nonnegative().optional().describe("Current available stock quantity. Only applicable when trackInventory is true. AI Powered Services checks availability before accepting orders. Updated by Product Order and inventory adjustments."),
|
|
59
|
+
lowStockThreshold: zod_1.default.number().int().nonnegative().optional().describe("Stock level that triggers low inventory alerts for replenishment. Used by inventory management systems to maintain optimal stock levels."),
|
|
60
|
+
// Physical attributes
|
|
61
|
+
weight: zod_1.default.number().positive().optional().describe("Product weight for shipping calculations and carrier integration. Used in delivery cost estimation for Product Order fulfillment."),
|
|
62
|
+
dimensions: zod_1.default.object({
|
|
63
|
+
length: zod_1.default.number().positive().describe("Product length in specified units. Used for shipping calculations and warehouse storage planning."),
|
|
64
|
+
width: zod_1.default.number().positive().describe("Product width in specified units. Used for shipping calculations and package sizing."),
|
|
65
|
+
height: zod_1.default.number().positive().describe("Product height in specified units. Used for shipping calculations and storage optimization."),
|
|
66
|
+
unit: zod_1.default.enum(['inches', 'cm']).default('inches').describe("Measurement unit for length, width, and height dimensions. Supports inches or centimeters. Defaults to inches."),
|
|
67
|
+
}).optional().describe("Physical dimensions of the product for shipping cost estimation, warehouse management, and packaging requirements. Required for physical goods with dimensional weight pricing."),
|
|
68
|
+
// Business Management
|
|
69
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether product is active and available for sale. Inactive products are hidden from customers and AI Powered Services. Defaults to true."),
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* Schema for creating a new product category.
|
|
73
|
+
* Omits auto-generated fields.
|
|
74
|
+
*/
|
|
75
|
+
exports.CreateProductCategorySchema = exports.ProductCategorySchema.omit({
|
|
76
|
+
id: true,
|
|
77
|
+
createdAt: true,
|
|
78
|
+
updatedAt: true,
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Schema for updating an existing product category.
|
|
82
|
+
* All fields are optional except id.
|
|
83
|
+
*/
|
|
84
|
+
exports.UpdateProductCategorySchema = exports.CreateProductCategorySchema.partial().safeExtend({
|
|
85
|
+
id: zod_1.default.string(),
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* Schema for creating a new business product.
|
|
89
|
+
* Omits auto-generated fields and category object.
|
|
90
|
+
*/
|
|
91
|
+
exports.CreateBusinessProductSchema = exports.BusinessProductSchema.omit({
|
|
92
|
+
id: true,
|
|
93
|
+
createdAt: true,
|
|
94
|
+
updatedAt: true,
|
|
95
|
+
category: true,
|
|
96
|
+
categoryId: true,
|
|
97
|
+
}).safeExtend({
|
|
98
|
+
categoryId: zod_1.default.string().optional(),
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Schema for updating an existing business product.
|
|
102
|
+
* All fields are optional except id.
|
|
103
|
+
*/
|
|
104
|
+
exports.UpdateBusinessProductSchema = exports.CreateBusinessProductSchema.partial().safeExtend({
|
|
105
|
+
id: zod_1.default.string(),
|
|
106
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Central export point for product management schemas.
|
|
3
|
+
* @module business-mgt/product-management
|
|
4
|
+
*/
|
|
5
|
+
export * from './product-config.schema';
|
|
6
|
+
export * from './product-variant.schema';
|
|
7
|
+
export * from './product-axis-binding.schema';
|
|
8
|
+
export * from './product-variant-axis.schema';
|
|
9
|
+
export * from './product-display.schema';
|
|
10
|
+
export * from './product-set.schema';
|
|
11
|
+
export * from './product-pricing-rule.schema';
|
|
12
|
+
export * from './product-order.schema';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Central export point for product management schemas.
|
|
4
|
+
* @module business-mgt/product-management
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
__exportStar(require("./product-config.schema"), exports);
|
|
22
|
+
__exportStar(require("./product-variant.schema"), exports);
|
|
23
|
+
__exportStar(require("./product-axis-binding.schema"), exports);
|
|
24
|
+
__exportStar(require("./product-variant-axis.schema"), exports);
|
|
25
|
+
__exportStar(require("./product-display.schema"), exports);
|
|
26
|
+
__exportStar(require("./product-set.schema"), exports);
|
|
27
|
+
__exportStar(require("./product-pricing-rule.schema"), exports);
|
|
28
|
+
__exportStar(require("./product-order.schema"), exports);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Product axis binding schema definitions.
|
|
4
|
+
* @module business-mgt/product-axis-binding
|
|
5
|
+
*
|
|
6
|
+
* Links products to their applicable variant axes, defining which axes apply to each product.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Product axis binding schema.
|
|
10
|
+
* Links products to their applicable variant axes, defining which axes apply to each product.
|
|
11
|
+
*
|
|
12
|
+
* @typedef {Object} ProductAxisBinding
|
|
13
|
+
* @property {string} [productRevisionId] - Version control for product changes
|
|
14
|
+
* @property {string} productId - Product ID being bound to an axis
|
|
15
|
+
* @property {string} axisId - Variant axis ID being bound
|
|
16
|
+
* @property {number} displayOrder - Display order for this axis on the product
|
|
17
|
+
* @property {boolean} isActive - Whether this binding is active
|
|
18
|
+
*/
|
|
19
|
+
export declare const ProductAxisBindingSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
productRevisionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
productId: z.ZodString;
|
|
25
|
+
axisId: z.ZodString;
|
|
26
|
+
displayOrder: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/**
|
|
30
|
+
* Schema for creating a new product axis binding.
|
|
31
|
+
* Omits auto-generated fields.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CreateProductAxisBindingSchema: z.ZodObject<{
|
|
34
|
+
displayOrder: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
+
productRevisionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
productId: z.ZodString;
|
|
38
|
+
axisId: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
/**
|
|
41
|
+
* Schema for updating an existing product axis binding.
|
|
42
|
+
* All fields optional except id (required).
|
|
43
|
+
*/
|
|
44
|
+
export declare const UpdateProductAxisBindingSchema: z.ZodObject<{
|
|
45
|
+
displayOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
46
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
47
|
+
productRevisionId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
48
|
+
productId: z.ZodOptional<z.ZodString>;
|
|
49
|
+
axisId: z.ZodOptional<z.ZodString>;
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type ProductAxisBinding = z.infer<typeof ProductAxisBindingSchema>;
|
|
53
|
+
export type CreateProductAxisBinding = z.infer<typeof CreateProductAxisBindingSchema>;
|
|
54
|
+
export type UpdateProductAxisBinding = z.infer<typeof UpdateProductAxisBindingSchema>;
|
|
@@ -0,0 +1,54 @@
|
|
|
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.UpdateProductAxisBindingSchema = exports.CreateProductAxisBindingSchema = exports.ProductAxisBindingSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Product axis binding schema definitions.
|
|
11
|
+
* @module business-mgt/product-axis-binding
|
|
12
|
+
*
|
|
13
|
+
* Links products to their applicable variant axes, defining which axes apply to each product.
|
|
14
|
+
*/
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// PRODUCT AXIS BINDING SCHEMA
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Product axis binding schema.
|
|
20
|
+
* Links products to their applicable variant axes, defining which axes apply to each product.
|
|
21
|
+
*
|
|
22
|
+
* @typedef {Object} ProductAxisBinding
|
|
23
|
+
* @property {string} [productRevisionId] - Version control for product changes
|
|
24
|
+
* @property {string} productId - Product ID being bound to an axis
|
|
25
|
+
* @property {string} axisId - Variant axis ID being bound
|
|
26
|
+
* @property {number} displayOrder - Display order for this axis on the product
|
|
27
|
+
* @property {boolean} isActive - Whether this binding is active
|
|
28
|
+
*/
|
|
29
|
+
exports.ProductAxisBindingSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
30
|
+
productRevisionId: zod_1.default.string().nullable().optional().describe("Optional product revision ID for version-scoped data"),
|
|
31
|
+
productId: zod_1.default.string().describe("Product ID"),
|
|
32
|
+
axisId: zod_1.default.string().describe("Variant axis ID"),
|
|
33
|
+
displayOrder: zod_1.default.number().int().default(0).describe("Display order for this axis on the product"),
|
|
34
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether this binding is active"),
|
|
35
|
+
});
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// CREATE/UPDATE SCHEMAS
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* Schema for creating a new product axis binding.
|
|
41
|
+
* Omits auto-generated fields.
|
|
42
|
+
*/
|
|
43
|
+
exports.CreateProductAxisBindingSchema = exports.ProductAxisBindingSchema.omit({
|
|
44
|
+
id: true,
|
|
45
|
+
createdAt: true,
|
|
46
|
+
updatedAt: true,
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Schema for updating an existing product axis binding.
|
|
50
|
+
* All fields optional except id (required).
|
|
51
|
+
*/
|
|
52
|
+
exports.UpdateProductAxisBindingSchema = exports.CreateProductAxisBindingSchema.partial().safeExtend({
|
|
53
|
+
id: zod_1.default.string().describe("Unique identifier of the ProductAxisBinding to update"),
|
|
54
|
+
});
|