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,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateItemModifierBindingSchema = exports.UpdateModifierGroupSchema = exports.UpdateModifierOptionSchema = exports.CreateItemModifierBindingSchema = exports.CreateModifierGroupSchema = exports.CreateModifierGroupOptionSchema = exports.CreateModifierOptionSchema = exports.ModifierGroupViewSchema = exports.ModifierOptionViewSchema = exports.AppliedModifierSchema = exports.ItemModifierBindingSchema = exports.ModifierOptionOverrideSchema = exports.ModifierGroupSchema = exports.ModifierOptionSchema = exports.ModifierOptionChannelMappingSchema = exports.ModifierGroupChannelMappingSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../../base.schema");
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Modifier schema definitions for business management.
|
|
8
|
+
* @module business-mgt/modifier
|
|
9
|
+
*
|
|
10
|
+
* Includes modifier groups, options, bindings, and applied modifiers
|
|
11
|
+
* for menu item customization (e.g., sizes, add-ons, toppings).
|
|
12
|
+
*/
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// CHANNEL MAPPING SCHEMAS
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Modifier group channel mapping schema.
|
|
18
|
+
* Maps modifier groups to external platform identifiers.
|
|
19
|
+
*
|
|
20
|
+
* @typedef {Object} ModifierGroupChannelMapping
|
|
21
|
+
* @property {string} channelId - Channel identifier (e.g., doordash, uber-eats)
|
|
22
|
+
* @property {string} externalModifierGroupId - External modifier group ID for synchronization
|
|
23
|
+
*/
|
|
24
|
+
exports.ModifierGroupChannelMappingSchema = zod_1.z.object({
|
|
25
|
+
channelId: zod_1.z.string().describe("Channel ID (e.g., doordash, uber-eats)"),
|
|
26
|
+
externalModifierGroupId: zod_1.z.string().describe("External modifier group ID for this specific channel"),
|
|
27
|
+
}).describe("Per-channel external modifier group ID mapping");
|
|
28
|
+
/**
|
|
29
|
+
* Modifier option channel mapping schema.
|
|
30
|
+
* Maps modifier options to external platform identifiers.
|
|
31
|
+
*
|
|
32
|
+
* @typedef {Object} ModifierOptionChannelMapping
|
|
33
|
+
* @property {string} channelId - Channel identifier (e.g., doordash, uber-eats)
|
|
34
|
+
* @property {string} externalModifierOptionId - External modifier option ID for synchronization
|
|
35
|
+
* @property {string} [externalModifierGroupId] - Optional external parent modifier group ID
|
|
36
|
+
*/
|
|
37
|
+
exports.ModifierOptionChannelMappingSchema = zod_1.z.object({
|
|
38
|
+
channelId: zod_1.z.string().describe("Channel ID (e.g., doordash, uber-eats)"),
|
|
39
|
+
externalModifierOptionId: zod_1.z.string().describe("External modifier option ID for this specific channel"),
|
|
40
|
+
externalModifierGroupId: zod_1.z.string().nullable().optional().describe("Optional external parent modifier group ID in this channel"),
|
|
41
|
+
}).describe("Per-channel external modifier option ID mapping");
|
|
42
|
+
// ============================================================================
|
|
43
|
+
// MODIFIER OPTION SCHEMA
|
|
44
|
+
// ============================================================================
|
|
45
|
+
/**
|
|
46
|
+
* Modifier option schema.
|
|
47
|
+
* Individual option within a modifier group.
|
|
48
|
+
*
|
|
49
|
+
* @typedef {Object} ModifierOption
|
|
50
|
+
* @property {string} [modifierRevisionId] - Modifier revision ID for version-scoped data
|
|
51
|
+
* @property {string} [locationId] - Location ID for location-specific modifiers
|
|
52
|
+
* @property {string} modifierGroupId - Parent modifier group ID
|
|
53
|
+
* @property {string} name - Modifier option name (e.g., Large, Extra Cheese)
|
|
54
|
+
* @property {string} [description] - Modifier option description
|
|
55
|
+
* @property {number} priceDelta - Price adjustment for selecting this option
|
|
56
|
+
* @property {boolean} isDefault - Whether this is the default option
|
|
57
|
+
* @property {number} displayOrder - Display order within the group
|
|
58
|
+
* @property {ModifierOptionChannelMapping[]} [channelMappings] - Per-channel mappings
|
|
59
|
+
* @property {boolean} isActive - Whether this option is active
|
|
60
|
+
*/
|
|
61
|
+
exports.ModifierOptionSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
62
|
+
modifierRevisionId: zod_1.z.string().nullable().optional().describe("Optional modifier revision ID for version-scoped data"),
|
|
63
|
+
locationId: zod_1.z.string().nullable().optional().describe("Location ID for location-specific modifiers"),
|
|
64
|
+
modifierGroupId: zod_1.z.string().describe("Parent modifier group ID"),
|
|
65
|
+
name: zod_1.z.string().min(1).describe("Modifier option name (e.g., Large, Extra Cheese)"),
|
|
66
|
+
description: zod_1.z.string().nullable().optional().describe("Modifier option description"),
|
|
67
|
+
priceDelta: zod_1.z.number().default(0).describe("Price adjustment for selecting this option"),
|
|
68
|
+
isDefault: zod_1.z.boolean().default(false).describe("Whether this is the default option"),
|
|
69
|
+
displayOrder: zod_1.z.number().int().nonnegative().default(0).describe("Display order within the group"),
|
|
70
|
+
channelMappings: zod_1.z.array(exports.ModifierOptionChannelMappingSchema).nullable().optional().describe("Per-channel modifier option ID mappings"),
|
|
71
|
+
isActive: zod_1.z.boolean().default(true).describe("Whether this option is active"),
|
|
72
|
+
});
|
|
73
|
+
// ============================================================================
|
|
74
|
+
// MODIFIER GROUP SCHEMA
|
|
75
|
+
// ============================================================================
|
|
76
|
+
/**
|
|
77
|
+
* Modifier group schema.
|
|
78
|
+
* Group of related modifier options (e.g., Size, Add-ons, Toppings).
|
|
79
|
+
*
|
|
80
|
+
* @typedef {Object} ModifierGroup
|
|
81
|
+
* @property {string} [modifierRevisionId] - Modifier revision ID for version-scoped data
|
|
82
|
+
* @property {string} [locationId] - Location ID for location-specific modifiers
|
|
83
|
+
* @property {string} name - Modifier group name (e.g., Size, Add-ons)
|
|
84
|
+
* @property {string} [description] - Modifier group description
|
|
85
|
+
* @property {ModifierOption[]} options - Modifier options within this group
|
|
86
|
+
* @property {number} minSelection - Minimum number of options that must be selected
|
|
87
|
+
* @property {number} [maxSelection] - Maximum number of options that can be selected
|
|
88
|
+
* @property {boolean} isRequired - Whether selection from this group is required
|
|
89
|
+
* @property {number} displayOrder - Display order in the menu
|
|
90
|
+
* @property {ModifierGroupChannelMapping[]} [channelMappings] - Per-channel mappings
|
|
91
|
+
* @property {boolean} isActive - Whether this group is active
|
|
92
|
+
*/
|
|
93
|
+
exports.ModifierGroupSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
94
|
+
modifierRevisionId: zod_1.z.string().nullable().optional().describe("Optional modifier revision ID for version-scoped data"),
|
|
95
|
+
locationId: zod_1.z.string().nullable().optional().describe("Location ID for location-specific modifiers"),
|
|
96
|
+
name: zod_1.z.string().min(1).describe("Modifier group name (e.g., Size, Add-ons)"),
|
|
97
|
+
description: zod_1.z.string().nullable().optional().describe("Modifier group description"),
|
|
98
|
+
options: zod_1.z.array(exports.ModifierOptionSchema).min(1, "At least one modifier option is required").describe("Modifier options within this group"),
|
|
99
|
+
minSelection: zod_1.z.number().int().nonnegative().default(0).describe("Minimum number of options that must be selected"),
|
|
100
|
+
maxSelection: zod_1.z.number().int().positive().nullable().optional().describe("Maximum number of options that can be selected"),
|
|
101
|
+
isRequired: zod_1.z.boolean().default(false).describe("Whether selection from this group is required"),
|
|
102
|
+
displayOrder: zod_1.z.number().int().nonnegative().default(0).describe("Display order in the menu"),
|
|
103
|
+
channelMappings: zod_1.z.array(exports.ModifierGroupChannelMappingSchema).nullable().optional().describe("Per-channel modifier group ID mappings"),
|
|
104
|
+
isActive: zod_1.z.boolean().default(true).describe("Whether this group is active"),
|
|
105
|
+
}).superRefine((data, ctx) => {
|
|
106
|
+
if (data.maxSelection !== undefined && data.maxSelection !== null && data.maxSelection < data.minSelection) {
|
|
107
|
+
ctx.addIssue({
|
|
108
|
+
code: "custom",
|
|
109
|
+
path: ["maxSelection"],
|
|
110
|
+
message: "maxSelection must be greater than or equal to minSelection",
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
// ============================================================================
|
|
115
|
+
// BINDING SCHEMAS
|
|
116
|
+
// ============================================================================
|
|
117
|
+
/**
|
|
118
|
+
* Modifier option override schema.
|
|
119
|
+
* Per-option override within a binding.
|
|
120
|
+
*
|
|
121
|
+
* @typedef {Object} ModifierOptionOverride
|
|
122
|
+
* @property {string} modifierOptionId - Target modifier option ID
|
|
123
|
+
* @property {number} [priceDeltaOverride] - Override price delta
|
|
124
|
+
* @property {boolean} [isDefaultOverride] - Override default selection
|
|
125
|
+
* @property {number} [displayOrderOverride] - Override display order
|
|
126
|
+
*/
|
|
127
|
+
exports.ModifierOptionOverrideSchema = zod_1.z.object({
|
|
128
|
+
modifierOptionId: zod_1.z.string().describe("Target modifier option ID"),
|
|
129
|
+
priceDeltaOverride: zod_1.z.number().nullable().optional().describe("Override price delta"),
|
|
130
|
+
isDefaultOverride: zod_1.z.boolean().nullable().optional().describe("Override default selection"),
|
|
131
|
+
displayOrderOverride: zod_1.z.number().int().nullable().optional().describe("Override display order"),
|
|
132
|
+
}).describe("Per-option override within a binding");
|
|
133
|
+
/**
|
|
134
|
+
* Item modifier binding schema.
|
|
135
|
+
* Links modifier groups to menu items or sets.
|
|
136
|
+
*
|
|
137
|
+
* @typedef {Object} ItemModifierBinding
|
|
138
|
+
* @property {string} [modifierRevisionId] - Modifier revision ID for version-scoped data
|
|
139
|
+
* @property {string} [locationId] - Location ID for location-specific bindings
|
|
140
|
+
* @property {string} [menuItemId] - Menu item ID target
|
|
141
|
+
* @property {string} [menuItemVariantId] - Menu item variant ID target
|
|
142
|
+
* @property {string} [menuSetId] - Menu set ID target
|
|
143
|
+
* @property {string} modifierGroupId - Modifier group ID to bind
|
|
144
|
+
* @property {boolean} [isRequiredOverride] - Override isRequired from modifier group
|
|
145
|
+
* @property {number} [minSelectionOverride] - Override minSelection
|
|
146
|
+
* @property {number} [maxSelectionOverride] - Override maxSelection
|
|
147
|
+
* @property {string[]} [excludedOptionIds] - Option IDs to exclude from this binding
|
|
148
|
+
* @property {ModifierOptionOverride[]} [optionOverrides] - Per-option overrides
|
|
149
|
+
* @property {number} displayOrder - Display order
|
|
150
|
+
* @property {boolean} isActive - Whether this binding is active
|
|
151
|
+
*/
|
|
152
|
+
exports.ItemModifierBindingSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
153
|
+
modifierRevisionId: zod_1.z.string().nullable().optional().describe("Optional modifier revision ID for version-scoped data"),
|
|
154
|
+
locationId: zod_1.z.string().nullable().optional().describe("Location ID for location-specific bindings"),
|
|
155
|
+
menuItemId: zod_1.z.string().nullable().optional().describe("Menu item ID target"),
|
|
156
|
+
menuItemVariantId: zod_1.z.string().nullable().optional().describe("Optional menu item variant ID target"),
|
|
157
|
+
menuSetId: zod_1.z.string().nullable().optional().describe("Optional menu set ID target"),
|
|
158
|
+
modifierGroupId: zod_1.z.string().describe("Modifier group ID to bind"),
|
|
159
|
+
isRequiredOverride: zod_1.z.boolean().nullable().optional().describe("Override isRequired from modifier group"),
|
|
160
|
+
minSelectionOverride: zod_1.z.number().int().nonnegative().nullable().optional().describe("Override minSelection"),
|
|
161
|
+
maxSelectionOverride: zod_1.z.number().int().positive().nullable().optional().describe("Override maxSelection"),
|
|
162
|
+
excludedOptionIds: zod_1.z.array(zod_1.z.string()).nullable().optional().describe("Option IDs to exclude from this binding"),
|
|
163
|
+
optionOverrides: zod_1.z.array(exports.ModifierOptionOverrideSchema).nullable().optional().describe("Per-option overrides for this binding"),
|
|
164
|
+
displayOrder: zod_1.z.number().int().nonnegative().default(0).describe("Display order"),
|
|
165
|
+
isActive: zod_1.z.boolean().default(true).describe("Whether this binding is active"),
|
|
166
|
+
}).superRefine((data, ctx) => {
|
|
167
|
+
if (data.minSelectionOverride !== undefined &&
|
|
168
|
+
data.minSelectionOverride !== null &&
|
|
169
|
+
data.maxSelectionOverride !== undefined &&
|
|
170
|
+
data.maxSelectionOverride !== null &&
|
|
171
|
+
data.maxSelectionOverride < data.minSelectionOverride) {
|
|
172
|
+
ctx.addIssue({
|
|
173
|
+
code: "custom",
|
|
174
|
+
path: ["maxSelectionOverride"],
|
|
175
|
+
message: "maxSelectionOverride must be greater than or equal to minSelectionOverride",
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const hasMenuItemTarget = !!data.menuItemId;
|
|
179
|
+
const hasMenuSetTarget = !!data.menuSetId;
|
|
180
|
+
if (hasMenuItemTarget === hasMenuSetTarget) {
|
|
181
|
+
ctx.addIssue({
|
|
182
|
+
code: "custom",
|
|
183
|
+
path: ["menuItemId"],
|
|
184
|
+
message: "Exactly one of menuItemId or menuSetId is required",
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (data.menuItemVariantId && !hasMenuItemTarget) {
|
|
188
|
+
ctx.addIssue({
|
|
189
|
+
code: "custom",
|
|
190
|
+
path: ["menuItemVariantId"],
|
|
191
|
+
message: "menuItemVariantId can only be provided when menuItemId is set",
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
// ============================================================================
|
|
196
|
+
// APPLIED MODIFIER SCHEMA
|
|
197
|
+
// ============================================================================
|
|
198
|
+
/**
|
|
199
|
+
* Applied modifier schema.
|
|
200
|
+
* Modifier selected on an order item.
|
|
201
|
+
*
|
|
202
|
+
* @typedef {Object} AppliedModifier
|
|
203
|
+
* @property {string} [modifierGroupId] - Internal modifier group ID
|
|
204
|
+
* @property {string} [modifierOptionId] - Internal modifier option ID
|
|
205
|
+
* @property {string} [externalModifierGroupId] - External modifier group ID
|
|
206
|
+
* @property {string} [externalModifierOptionId] - External modifier option ID
|
|
207
|
+
* @property {string} groupName - Modifier group name
|
|
208
|
+
* @property {string} optionName - Modifier option name
|
|
209
|
+
* @property {number} quantity - Quantity of this modifier
|
|
210
|
+
* @property {number} priceDelta - Price adjustment for this modifier
|
|
211
|
+
*/
|
|
212
|
+
exports.AppliedModifierSchema = zod_1.z.object({
|
|
213
|
+
modifierGroupId: zod_1.z.string().nullable().optional().describe("Internal modifier group ID"),
|
|
214
|
+
modifierOptionId: zod_1.z.string().nullable().optional().describe("Internal modifier option ID"),
|
|
215
|
+
externalModifierGroupId: zod_1.z.string().nullable().optional().describe("External modifier group ID"),
|
|
216
|
+
externalModifierOptionId: zod_1.z.string().nullable().optional().describe("External modifier option ID"),
|
|
217
|
+
groupName: zod_1.z.string().min(1).describe("Modifier group name"),
|
|
218
|
+
optionName: zod_1.z.string().min(1).describe("Modifier option name"),
|
|
219
|
+
quantity: zod_1.z.number().int().positive().default(1).describe("Quantity of this modifier"),
|
|
220
|
+
priceDelta: zod_1.z.number().default(0).describe("Price adjustment for this modifier"),
|
|
221
|
+
});
|
|
222
|
+
// ============================================================================
|
|
223
|
+
// VIEW SCHEMAS
|
|
224
|
+
// ============================================================================
|
|
225
|
+
/**
|
|
226
|
+
* Modifier option view schema.
|
|
227
|
+
* Simplified view for display purposes.
|
|
228
|
+
*
|
|
229
|
+
* @typedef {Object} ModifierOptionView
|
|
230
|
+
* @property {string} id - Modifier option ID
|
|
231
|
+
* @property {string} name - Option name
|
|
232
|
+
* @property {string} [description] - Option description
|
|
233
|
+
* @property {number} priceDelta - Price adjustment
|
|
234
|
+
* @property {boolean} isDefault - Whether this is the default option
|
|
235
|
+
* @property {number} displayOrder - Display order
|
|
236
|
+
* @property {ModifierOptionChannelMapping[]} [channelMappings] - Channel mappings
|
|
237
|
+
* @property {boolean} isActive - Whether active
|
|
238
|
+
*/
|
|
239
|
+
exports.ModifierOptionViewSchema = zod_1.z.object({
|
|
240
|
+
id: zod_1.z.string().describe("Modifier option ID"),
|
|
241
|
+
name: zod_1.z.string().min(1).describe("Option name"),
|
|
242
|
+
description: zod_1.z.string().nullable().optional().describe("Option description"),
|
|
243
|
+
priceDelta: zod_1.z.number().default(0).describe("Price adjustment"),
|
|
244
|
+
isDefault: zod_1.z.boolean().default(false).describe("Whether this is the default option"),
|
|
245
|
+
displayOrder: zod_1.z.number().int().nonnegative().default(0).describe("Display order"),
|
|
246
|
+
channelMappings: zod_1.z.array(exports.ModifierOptionChannelMappingSchema).nullable().optional().describe("Channel mappings"),
|
|
247
|
+
isActive: zod_1.z.boolean().default(true).describe("Whether active"),
|
|
248
|
+
});
|
|
249
|
+
/**
|
|
250
|
+
* Modifier group view schema.
|
|
251
|
+
* Simplified view for display purposes.
|
|
252
|
+
*
|
|
253
|
+
* @typedef {Object} ModifierGroupView
|
|
254
|
+
* @property {string} id - Modifier group ID
|
|
255
|
+
* @property {string} name - Group name
|
|
256
|
+
* @property {string} [description] - Group description
|
|
257
|
+
* @property {number} displayOrder - Display order
|
|
258
|
+
* @property {ModifierGroupChannelMapping[]} [channelMappings] - Channel mappings
|
|
259
|
+
* @property {boolean} isActive - Whether active
|
|
260
|
+
* @property {boolean} isRequired - Whether required
|
|
261
|
+
* @property {number} minSelection - Minimum selections
|
|
262
|
+
* @property {number} [maxSelection] - Maximum selections
|
|
263
|
+
* @property {ModifierOptionView[]} options - Options in this group
|
|
264
|
+
*/
|
|
265
|
+
exports.ModifierGroupViewSchema = zod_1.z.object({
|
|
266
|
+
id: zod_1.z.string().describe("Modifier group ID"),
|
|
267
|
+
name: zod_1.z.string().min(1).describe("Group name"),
|
|
268
|
+
description: zod_1.z.string().nullable().optional().describe("Group description"),
|
|
269
|
+
displayOrder: zod_1.z.number().int().nonnegative().default(0).describe("Display order"),
|
|
270
|
+
channelMappings: zod_1.z.array(exports.ModifierGroupChannelMappingSchema).nullable().optional().describe("Channel mappings"),
|
|
271
|
+
isActive: zod_1.z.boolean().default(true).describe("Whether active"),
|
|
272
|
+
isRequired: zod_1.z.boolean().default(false).describe("Whether required"),
|
|
273
|
+
minSelection: zod_1.z.number().int().nonnegative().default(0).describe("Minimum selections"),
|
|
274
|
+
maxSelection: zod_1.z.number().int().positive().nullable().optional().describe("Maximum selections"),
|
|
275
|
+
options: zod_1.z.array(exports.ModifierOptionViewSchema).default([]).describe("Options in this group"),
|
|
276
|
+
});
|
|
277
|
+
// ============================================================================
|
|
278
|
+
// CREATE/UPDATE SCHEMAS
|
|
279
|
+
// ============================================================================
|
|
280
|
+
/**
|
|
281
|
+
* Schema for creating a new modifier option.
|
|
282
|
+
* Omits auto-generated fields.
|
|
283
|
+
*/
|
|
284
|
+
exports.CreateModifierOptionSchema = exports.ModifierOptionSchema.omit({
|
|
285
|
+
id: true,
|
|
286
|
+
createdAt: true,
|
|
287
|
+
updatedAt: true,
|
|
288
|
+
});
|
|
289
|
+
exports.CreateModifierGroupOptionSchema = exports.CreateModifierOptionSchema.omit({
|
|
290
|
+
modifierGroupId: true,
|
|
291
|
+
});
|
|
292
|
+
/**
|
|
293
|
+
* Schema for creating a new modifier group.
|
|
294
|
+
* Omits auto-generated fields.
|
|
295
|
+
*/
|
|
296
|
+
exports.CreateModifierGroupSchema = exports.ModifierGroupSchema.omit({
|
|
297
|
+
id: true,
|
|
298
|
+
createdAt: true,
|
|
299
|
+
updatedAt: true,
|
|
300
|
+
options: true,
|
|
301
|
+
}).safeExtend({
|
|
302
|
+
options: zod_1.z.array(exports.CreateModifierGroupOptionSchema).min(1, "At least one modifier option is required").describe("Modifier options within this group"),
|
|
303
|
+
}).superRefine((data, ctx) => {
|
|
304
|
+
if (data.maxSelection !== undefined && data.maxSelection !== null && data.maxSelection > data.options.length) {
|
|
305
|
+
ctx.addIssue({
|
|
306
|
+
code: "custom",
|
|
307
|
+
path: ["maxSelection"],
|
|
308
|
+
message: "maxSelection cannot exceed the number of provided options",
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
/**
|
|
313
|
+
* Schema for creating a new item modifier binding.
|
|
314
|
+
* Omits auto-generated fields.
|
|
315
|
+
*/
|
|
316
|
+
exports.CreateItemModifierBindingSchema = exports.ItemModifierBindingSchema.omit({
|
|
317
|
+
id: true,
|
|
318
|
+
createdAt: true,
|
|
319
|
+
updatedAt: true,
|
|
320
|
+
});
|
|
321
|
+
/**
|
|
322
|
+
* Schema for updating an existing modifier option.
|
|
323
|
+
* All fields optional except id (required).
|
|
324
|
+
*/
|
|
325
|
+
exports.UpdateModifierOptionSchema = exports.CreateModifierOptionSchema.partial().safeExtend({
|
|
326
|
+
id: zod_1.z.string(),
|
|
327
|
+
});
|
|
328
|
+
/**
|
|
329
|
+
* Schema for updating an existing modifier group.
|
|
330
|
+
* All fields optional except id (required).
|
|
331
|
+
*/
|
|
332
|
+
exports.UpdateModifierGroupSchema = exports.CreateModifierGroupSchema.partial().safeExtend({
|
|
333
|
+
id: zod_1.z.string(),
|
|
334
|
+
});
|
|
335
|
+
/**
|
|
336
|
+
* Schema for updating an existing item modifier binding.
|
|
337
|
+
* All fields optional except id (required).
|
|
338
|
+
*/
|
|
339
|
+
exports.UpdateItemModifierBindingSchema = exports.CreateItemModifierBindingSchema.partial().safeExtend({
|
|
340
|
+
id: zod_1.z.string(),
|
|
341
|
+
});
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { MenuOrderType, OrderStatus, PaymentStatus } from "../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Menu order schema definitions for restaurant/food service.
|
|
5
|
+
* @module business-mgt/menu-order
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base menu order item schema (without IDs for creation).
|
|
9
|
+
*
|
|
10
|
+
* @typedef {Object} MenuOrderItemBase
|
|
11
|
+
* @property {string} menuItemId - Menu item ID being ordered
|
|
12
|
+
* @property {string} itemName - Name of the menu item
|
|
13
|
+
* @property {number} quantity - Quantity ordered
|
|
14
|
+
* @property {number} unitPrice - Price per unit
|
|
15
|
+
* @property {number} totalPrice - Total price for this item
|
|
16
|
+
* @property {string} [specialInstructions] - Special preparation instructions
|
|
17
|
+
* @property {Array} [customizations] - Item customizations with additional costs
|
|
18
|
+
* @property {string} status - Item status
|
|
19
|
+
* @property {number} [preparationTime] - Estimated prep time in minutes
|
|
20
|
+
* @property {string} [notes] - Additional notes
|
|
21
|
+
*/
|
|
22
|
+
export declare const MenuOrderItemBaseSchema: z.ZodObject<{
|
|
23
|
+
menuItemId: z.ZodString;
|
|
24
|
+
itemName: z.ZodString;
|
|
25
|
+
quantity: z.ZodNumber;
|
|
26
|
+
unitPrice: z.ZodNumber;
|
|
27
|
+
totalPrice: z.ZodNumber;
|
|
28
|
+
specialInstructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
customizations: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
value: z.ZodString;
|
|
32
|
+
additionalCost: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
}, z.core.$strip>>>>;
|
|
34
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
35
|
+
preparationTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
36
|
+
notes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
/**
|
|
39
|
+
* Menu order item schema with IDs (for existing items).
|
|
40
|
+
*/
|
|
41
|
+
export declare const MenuOrderItemSchema: z.ZodObject<{
|
|
42
|
+
menuItemId: z.ZodString;
|
|
43
|
+
itemName: z.ZodString;
|
|
44
|
+
quantity: z.ZodNumber;
|
|
45
|
+
unitPrice: z.ZodNumber;
|
|
46
|
+
totalPrice: z.ZodNumber;
|
|
47
|
+
specialInstructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
customizations: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
value: z.ZodString;
|
|
51
|
+
additionalCost: z.ZodDefault<z.ZodNumber>;
|
|
52
|
+
}, z.core.$strip>>>>;
|
|
53
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
54
|
+
preparationTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
55
|
+
notes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
menuOrderId: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
/**
|
|
60
|
+
* Menu order schema - for restaurants/food service.
|
|
61
|
+
*
|
|
62
|
+
* @typedef {Object} MenuOrder
|
|
63
|
+
* @property {string} [orderNumber] - Human-readable order number
|
|
64
|
+
* @property {string} type - Order type (dine-in, takeout, delivery)
|
|
65
|
+
* @property {string} status - Current order status
|
|
66
|
+
* @property {Array} items - Items in the order
|
|
67
|
+
* @property {string} customerId - ID of the customer placing the order
|
|
68
|
+
* @property {Object} [customer] - Customer information
|
|
69
|
+
* @property {Object} pricing - Pricing details
|
|
70
|
+
* @property {string} paymentStatus - Payment status
|
|
71
|
+
* @property {string} [paymentMethod] - Payment method used
|
|
72
|
+
* @property {string} [paymentReference] - Payment reference number
|
|
73
|
+
* @property {number} orderDate - Order date as Unix timestamp
|
|
74
|
+
* @property {number} [requestedTime] - Requested pickup/delivery time
|
|
75
|
+
* @property {number} [estimatedReadyTime] - Estimated ready time
|
|
76
|
+
* @property {number} [actualReadyTime] - Actual ready time
|
|
77
|
+
* @property {string} [specialInstructions] - Special instructions
|
|
78
|
+
* @property {string[]} [allergies] - Customer allergies
|
|
79
|
+
* @property {string} [tableNumber] - Table number for dine-in
|
|
80
|
+
* @property {string} [externalOrderId] - External order ID for integrations
|
|
81
|
+
* @property {string} source - Order source
|
|
82
|
+
* @property {string} [cancelReason] - Reason for cancellation
|
|
83
|
+
* @property {string} [notes] - Additional notes
|
|
84
|
+
* @property {string} [serviceConversationConfigId] - Service conversation config ID
|
|
85
|
+
* @property {Object} [deliveryAddress] - Delivery address if applicable
|
|
86
|
+
* @property {number} [tip] - Tip amount for the order
|
|
87
|
+
*/
|
|
88
|
+
export declare const MenuOrderSchema: z.ZodObject<{
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
orderNumber: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
93
|
+
type: z.ZodEnum<typeof MenuOrderType>;
|
|
94
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
95
|
+
items: z.ZodArray<z.ZodObject<{
|
|
96
|
+
menuItemId: z.ZodString;
|
|
97
|
+
itemName: z.ZodString;
|
|
98
|
+
quantity: z.ZodNumber;
|
|
99
|
+
unitPrice: z.ZodNumber;
|
|
100
|
+
totalPrice: z.ZodNumber;
|
|
101
|
+
specialInstructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
customizations: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
value: z.ZodString;
|
|
105
|
+
additionalCost: z.ZodDefault<z.ZodNumber>;
|
|
106
|
+
}, z.core.$strip>>>>;
|
|
107
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
108
|
+
preparationTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
109
|
+
notes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
menuOrderId: z.ZodString;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
customerId: z.ZodString;
|
|
114
|
+
customer: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
115
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
118
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
119
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
street: z.ZodString;
|
|
121
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
122
|
+
city: z.ZodString;
|
|
123
|
+
state: z.ZodString;
|
|
124
|
+
postalCode: z.ZodString;
|
|
125
|
+
country: z.ZodString;
|
|
126
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
129
|
+
pricing: z.ZodObject<{
|
|
130
|
+
subtotal: z.ZodNumber;
|
|
131
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
132
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
133
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
134
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
135
|
+
total: z.ZodNumber;
|
|
136
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
paymentStatus: z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>;
|
|
139
|
+
paymentMethod: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
paymentReference: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
141
|
+
orderDate: z.ZodNumber;
|
|
142
|
+
requestedTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
143
|
+
estimatedReadyTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
144
|
+
actualReadyTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
145
|
+
specialInstructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
allergies: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
147
|
+
tableNumber: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
148
|
+
externalOrderId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
149
|
+
source: z.ZodDefault<z.ZodString>;
|
|
150
|
+
cancelReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
151
|
+
notes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
152
|
+
serviceConversationConfigId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
153
|
+
deliveryAddress: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
154
|
+
street: z.ZodString;
|
|
155
|
+
city: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
156
|
+
postalCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
157
|
+
}, z.core.$strip>>>;
|
|
158
|
+
tip: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
/**
|
|
161
|
+
* Schema for creating a new menu order.
|
|
162
|
+
* Omits auto-generated fields and uses base items without IDs.
|
|
163
|
+
*/
|
|
164
|
+
export declare const CreateMenuOrderSchema: z.ZodObject<{
|
|
165
|
+
type: z.ZodEnum<typeof MenuOrderType>;
|
|
166
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
167
|
+
customerId: z.ZodString;
|
|
168
|
+
notes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
169
|
+
tableNumber: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
tip: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
171
|
+
specialInstructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
customer: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
173
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
174
|
+
name: z.ZodString;
|
|
175
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
176
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
177
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
street: z.ZodString;
|
|
179
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
180
|
+
city: z.ZodString;
|
|
181
|
+
state: z.ZodString;
|
|
182
|
+
postalCode: z.ZodString;
|
|
183
|
+
country: z.ZodString;
|
|
184
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
}, z.core.$strip>>>;
|
|
187
|
+
pricing: z.ZodObject<{
|
|
188
|
+
subtotal: z.ZodNumber;
|
|
189
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
190
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
191
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
192
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
193
|
+
total: z.ZodNumber;
|
|
194
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
paymentStatus: z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>;
|
|
197
|
+
paymentMethod: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
paymentReference: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
199
|
+
orderDate: z.ZodNumber;
|
|
200
|
+
requestedTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
201
|
+
estimatedReadyTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
202
|
+
allergies: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
203
|
+
externalOrderId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
source: z.ZodDefault<z.ZodString>;
|
|
205
|
+
deliveryAddress: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
206
|
+
street: z.ZodString;
|
|
207
|
+
city: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
postalCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
209
|
+
}, z.core.$strip>>>;
|
|
210
|
+
items: z.ZodArray<z.ZodObject<{
|
|
211
|
+
menuItemId: z.ZodString;
|
|
212
|
+
itemName: z.ZodString;
|
|
213
|
+
quantity: z.ZodNumber;
|
|
214
|
+
unitPrice: z.ZodNumber;
|
|
215
|
+
totalPrice: z.ZodNumber;
|
|
216
|
+
specialInstructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
217
|
+
customizations: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
218
|
+
name: z.ZodString;
|
|
219
|
+
value: z.ZodString;
|
|
220
|
+
additionalCost: z.ZodDefault<z.ZodNumber>;
|
|
221
|
+
}, z.core.$strip>>>>;
|
|
222
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
223
|
+
preparationTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
224
|
+
notes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
cancelReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
/**
|
|
229
|
+
* Schema for updating an existing menu order.
|
|
230
|
+
* All fields are optional except id.
|
|
231
|
+
*/
|
|
232
|
+
export declare const UpdateMenuOrderSchema: z.ZodObject<{
|
|
233
|
+
type: z.ZodOptional<z.ZodEnum<typeof MenuOrderType>>;
|
|
234
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof OrderStatus>>>;
|
|
235
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
236
|
+
notes: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
237
|
+
tableNumber: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
238
|
+
tip: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
|
|
239
|
+
specialInstructions: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
240
|
+
customer: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
241
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
242
|
+
name: z.ZodString;
|
|
243
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
244
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
245
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
street: z.ZodString;
|
|
247
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
248
|
+
city: z.ZodString;
|
|
249
|
+
state: z.ZodString;
|
|
250
|
+
postalCode: z.ZodString;
|
|
251
|
+
country: z.ZodString;
|
|
252
|
+
deliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
}, z.core.$strip>>>>;
|
|
255
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
subtotal: z.ZodNumber;
|
|
257
|
+
tax: z.ZodDefault<z.ZodNumber>;
|
|
258
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
259
|
+
shippingAmount: z.ZodDefault<z.ZodNumber>;
|
|
260
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
261
|
+
total: z.ZodNumber;
|
|
262
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
263
|
+
}, z.core.$strip>>;
|
|
264
|
+
paymentStatus: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof PaymentStatus>>>;
|
|
265
|
+
paymentMethod: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
266
|
+
paymentReference: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
267
|
+
orderDate: z.ZodOptional<z.ZodNumber>;
|
|
268
|
+
requestedTime: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
|
|
269
|
+
estimatedReadyTime: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
|
|
270
|
+
allergies: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>>;
|
|
271
|
+
externalOrderId: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
272
|
+
source: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
273
|
+
deliveryAddress: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
274
|
+
street: z.ZodString;
|
|
275
|
+
city: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
276
|
+
postalCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
277
|
+
}, z.core.$strip>>>>;
|
|
278
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
279
|
+
menuItemId: z.ZodString;
|
|
280
|
+
itemName: z.ZodString;
|
|
281
|
+
quantity: z.ZodNumber;
|
|
282
|
+
unitPrice: z.ZodNumber;
|
|
283
|
+
totalPrice: z.ZodNumber;
|
|
284
|
+
specialInstructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
285
|
+
customizations: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
286
|
+
name: z.ZodString;
|
|
287
|
+
value: z.ZodString;
|
|
288
|
+
additionalCost: z.ZodDefault<z.ZodNumber>;
|
|
289
|
+
}, z.core.$strip>>>>;
|
|
290
|
+
status: z.ZodDefault<z.ZodEnum<typeof OrderStatus>>;
|
|
291
|
+
preparationTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
292
|
+
notes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
293
|
+
}, z.core.$strip>>>;
|
|
294
|
+
cancelReason: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
295
|
+
id: z.ZodString;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
/**
|
|
298
|
+
* Quick status update schema for menu orders.
|
|
299
|
+
*/
|
|
300
|
+
export declare const UpdateMenuOrderStatusSchema: z.ZodObject<{
|
|
301
|
+
id: z.ZodString;
|
|
302
|
+
status: z.ZodEnum<typeof OrderStatus>;
|
|
303
|
+
estimatedReadyTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
304
|
+
actualReadyTime: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
305
|
+
}, z.core.$strip>;
|
|
306
|
+
export type MenuOrderItemBase = z.infer<typeof MenuOrderItemBaseSchema>;
|
|
307
|
+
export type MenuOrderItem = z.infer<typeof MenuOrderItemSchema>;
|
|
308
|
+
export type MenuOrder = z.infer<typeof MenuOrderSchema>;
|
|
309
|
+
export type CreateMenuOrder = z.infer<typeof CreateMenuOrderSchema>;
|
|
310
|
+
export type UpdateMenuOrder = z.infer<typeof UpdateMenuOrderSchema>;
|
|
311
|
+
export type UpdateMenuOrderStatus = z.infer<typeof UpdateMenuOrderStatusSchema>;
|
|
312
|
+
export type CreateMenuOrderItem = z.infer<typeof MenuOrderItemBaseSchema>;
|
|
313
|
+
export interface MenuOrderFilters {
|
|
314
|
+
search?: string;
|
|
315
|
+
type?: MenuOrderType[];
|
|
316
|
+
status?: OrderStatus[];
|
|
317
|
+
paymentStatus?: PaymentStatus[];
|
|
318
|
+
customerId?: string;
|
|
319
|
+
tableNumber?: string;
|
|
320
|
+
source?: string;
|
|
321
|
+
dateRange?: {
|
|
322
|
+
start?: number;
|
|
323
|
+
end?: number;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
export interface MenuOrderSorting {
|
|
327
|
+
field: 'orderDate' | 'createdAt' | 'totalAmount';
|
|
328
|
+
direction: 'asc' | 'desc';
|
|
329
|
+
}
|
|
330
|
+
export interface MenuOrderQueryOptions {
|
|
331
|
+
page: number;
|
|
332
|
+
pageSize: number;
|
|
333
|
+
filters?: MenuOrderFilters;
|
|
334
|
+
sorting?: MenuOrderSorting;
|
|
335
|
+
}
|