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,301 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Business menu configuration schema definitions.
|
|
4
|
+
* @module business-mgt/business-menu-config
|
|
5
|
+
*
|
|
6
|
+
* Includes menu categories, menu items, channel mappings,
|
|
7
|
+
* and nutritional information for restaurant/food service businesses.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Menu category channel mapping schema.
|
|
11
|
+
* Maps menu categories to external platform identifiers.
|
|
12
|
+
*
|
|
13
|
+
* @typedef {Object} MenuCategoryChannelMapping
|
|
14
|
+
* @property {string} channelId - Channel identifier (e.g., doordash, uber-eats)
|
|
15
|
+
* @property {string} externalCategoryId - External category ID for synchronization
|
|
16
|
+
*/
|
|
17
|
+
export declare const MenuCategoryChannelMappingSchema: z.ZodObject<{
|
|
18
|
+
channelId: z.ZodString;
|
|
19
|
+
externalCategoryId: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
/**
|
|
22
|
+
* Menu item channel mapping schema.
|
|
23
|
+
* Maps menu items to external platform identifiers.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {Object} MenuItemChannelMapping
|
|
26
|
+
* @property {string} channelId - Channel identifier (e.g., doordash, uber-eats)
|
|
27
|
+
* @property {string} externalMenuItemId - External menu item ID for synchronization
|
|
28
|
+
* @property {string} [externalCategoryId] - Optional external category ID in channel
|
|
29
|
+
*/
|
|
30
|
+
export declare const MenuItemChannelMappingSchema: z.ZodObject<{
|
|
31
|
+
channelId: z.ZodString;
|
|
32
|
+
externalMenuItemId: z.ZodString;
|
|
33
|
+
externalCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* Menu category schema.
|
|
37
|
+
* Categories for organizing menu items (e.g., Appetizers, Main Course, Desserts).
|
|
38
|
+
*
|
|
39
|
+
* @typedef {Object} MenuCategory
|
|
40
|
+
* @property {string} name - Category name for menu organization
|
|
41
|
+
* @property {string} [description] - Category description
|
|
42
|
+
* @property {number} [displayOrder] - Numeric order for display
|
|
43
|
+
* @property {MenuCategoryChannelMapping[]} [channelMappings] - Per-channel mappings
|
|
44
|
+
*/
|
|
45
|
+
export declare const MenuCategorySchema: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
53
|
+
channelId: z.ZodString;
|
|
54
|
+
externalCategoryId: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
/**
|
|
58
|
+
* Business menu item schema.
|
|
59
|
+
* Individual menu items available for ordering.
|
|
60
|
+
*
|
|
61
|
+
* @typedef {Object} BusinessMenuItem
|
|
62
|
+
* @property {string} name - Display name of the menu item
|
|
63
|
+
* @property {string} [description] - Detailed item description
|
|
64
|
+
* @property {number} price - Base price for this menu item
|
|
65
|
+
* @property {string} categoryId - References MenuCategory this item belongs to
|
|
66
|
+
* @property {MenuCategory} [category] - Populated MenuCategory object
|
|
67
|
+
* @property {string[]} [ingredients] - List of primary ingredients
|
|
68
|
+
* @property {string[]} [allergens] - Common allergens present
|
|
69
|
+
* @property {Object} [nutritionalInfo] - Nutritional information
|
|
70
|
+
* @property {boolean} isAvailable - Real-time availability status
|
|
71
|
+
* @property {number} [preparationTime] - Estimated preparation time in minutes
|
|
72
|
+
* @property {boolean} isActive - Whether item is active in the menu catalog
|
|
73
|
+
* @property {number} [displayOrder] - Display order within category
|
|
74
|
+
* @property {MenuItemChannelMapping[]} [channelMappings] - Per-channel mappings
|
|
75
|
+
* @property {Array} [dayParts] - Recurring availability dayparts
|
|
76
|
+
* @property {number} [orderCount] - Total orders for this item (read-only)
|
|
77
|
+
* @property {number} [recentOrderCount] - Orders in the last 30 days (read-only)
|
|
78
|
+
* @property {number} [lastOrderedAt] - Unix timestamp of the last order (read-only)
|
|
79
|
+
*/
|
|
80
|
+
export declare const BusinessMenuItemSchema: z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
price: z.ZodNumber;
|
|
87
|
+
categoryId: z.ZodString;
|
|
88
|
+
category: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
96
|
+
channelId: z.ZodString;
|
|
97
|
+
externalCategoryId: z.ZodString;
|
|
98
|
+
}, z.core.$strip>>>>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
ingredients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
101
|
+
allergens: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
nutritionalInfo: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
calories: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
protein: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
carbs: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
fat: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
109
|
+
preparationTime: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
110
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
111
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
113
|
+
channelId: z.ZodString;
|
|
114
|
+
externalMenuItemId: z.ZodString;
|
|
115
|
+
externalCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
}, z.core.$strip>>>>;
|
|
117
|
+
dayParts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
startTime: z.ZodString;
|
|
120
|
+
endTime: z.ZodString;
|
|
121
|
+
daysOfWeek: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
122
|
+
}, z.core.$strip>>>>;
|
|
123
|
+
orderCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
124
|
+
recentOrderCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
125
|
+
lastOrderedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
/**
|
|
128
|
+
* Schema for creating a new menu category.
|
|
129
|
+
* Omits auto-generated fields.
|
|
130
|
+
*/
|
|
131
|
+
export declare const CreateMenuCategorySchema: z.ZodObject<{
|
|
132
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
name: z.ZodString;
|
|
134
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
136
|
+
channelId: z.ZodString;
|
|
137
|
+
externalCategoryId: z.ZodString;
|
|
138
|
+
}, z.core.$strip>>>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
/**
|
|
141
|
+
* Schema for creating a new business menu item.
|
|
142
|
+
* Omits auto-generated fields and allows optional category specification.
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* A menu item must be created with at least one variant. Nested variants use the
|
|
146
|
+
* menu item variant create schema with `menuItemId` omitted; the parent link is
|
|
147
|
+
* assigned by the server once the menu item is created.
|
|
148
|
+
*/
|
|
149
|
+
export declare const CreateBusinessMenuItemSchema: z.ZodObject<{
|
|
150
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
name: z.ZodString;
|
|
152
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
153
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
154
|
+
price: z.ZodNumber;
|
|
155
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
156
|
+
channelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
157
|
+
channelId: z.ZodString;
|
|
158
|
+
externalMenuItemId: z.ZodString;
|
|
159
|
+
externalCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
160
|
+
}, z.core.$strip>>>>;
|
|
161
|
+
ingredients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
allergens: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
nutritionalInfo: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
calories: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
protein: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
carbs: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
fat: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
}, z.core.$strip>>;
|
|
169
|
+
preparationTime: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
170
|
+
dayParts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
171
|
+
name: z.ZodString;
|
|
172
|
+
startTime: z.ZodString;
|
|
173
|
+
endTime: z.ZodString;
|
|
174
|
+
daysOfWeek: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
175
|
+
}, z.core.$strip>>>>;
|
|
176
|
+
categoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
178
|
+
name: z.ZodString;
|
|
179
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
181
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
182
|
+
price: z.ZodNumber;
|
|
183
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
184
|
+
variantChannelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
185
|
+
channelId: z.ZodString;
|
|
186
|
+
externalVariantId: z.ZodString;
|
|
187
|
+
externalMenuItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
}, z.core.$strip>>>>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
/**
|
|
192
|
+
* Schema for updating an existing menu category.
|
|
193
|
+
* All fields optional except id (required).
|
|
194
|
+
*/
|
|
195
|
+
export declare const UpdateMenuCategorySchema: z.ZodObject<{
|
|
196
|
+
displayOrder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
197
|
+
name: z.ZodOptional<z.ZodString>;
|
|
198
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
199
|
+
channelMappings: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
200
|
+
channelId: z.ZodString;
|
|
201
|
+
externalCategoryId: z.ZodString;
|
|
202
|
+
}, z.core.$strip>>>>>;
|
|
203
|
+
id: z.ZodString;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
/**
|
|
206
|
+
* Schema for updating an existing business menu item.
|
|
207
|
+
* All fields optional except id (required).
|
|
208
|
+
*/
|
|
209
|
+
export declare const UpdateBusinessMenuItemSchema: z.ZodObject<{
|
|
210
|
+
displayOrder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
211
|
+
name: z.ZodOptional<z.ZodString>;
|
|
212
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
213
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
214
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
isAvailable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
216
|
+
channelMappings: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
217
|
+
channelId: z.ZodString;
|
|
218
|
+
externalMenuItemId: z.ZodString;
|
|
219
|
+
externalCategoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
+
}, z.core.$strip>>>>>;
|
|
221
|
+
ingredients: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
222
|
+
allergens: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
223
|
+
nutritionalInfo: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
224
|
+
calories: z.ZodOptional<z.ZodNumber>;
|
|
225
|
+
protein: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
carbs: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
fat: z.ZodOptional<z.ZodNumber>;
|
|
228
|
+
}, z.core.$strip>>>;
|
|
229
|
+
preparationTime: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
230
|
+
dayParts: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
231
|
+
name: z.ZodString;
|
|
232
|
+
startTime: z.ZodString;
|
|
233
|
+
endTime: z.ZodString;
|
|
234
|
+
daysOfWeek: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
235
|
+
}, z.core.$strip>>>>>;
|
|
236
|
+
categoryId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
237
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
238
|
+
name: z.ZodString;
|
|
239
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
241
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
242
|
+
price: z.ZodNumber;
|
|
243
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
244
|
+
variantChannelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
245
|
+
channelId: z.ZodString;
|
|
246
|
+
externalVariantId: z.ZodString;
|
|
247
|
+
externalMenuItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
248
|
+
}, z.core.$strip>>>>;
|
|
249
|
+
}, z.core.$strip>>>;
|
|
250
|
+
id: z.ZodString;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
export type MenuCategory = z.infer<typeof MenuCategorySchema>;
|
|
253
|
+
export type BusinessMenuItem = z.infer<typeof BusinessMenuItemSchema>;
|
|
254
|
+
export type CreateMenuCategory = z.infer<typeof CreateMenuCategorySchema>;
|
|
255
|
+
export type CreateBusinessMenuItem = z.infer<typeof CreateBusinessMenuItemSchema>;
|
|
256
|
+
export type UpdateMenuCategory = z.infer<typeof UpdateMenuCategorySchema>;
|
|
257
|
+
export type UpdateBusinessMenuItem = z.infer<typeof UpdateBusinessMenuItemSchema>;
|
|
258
|
+
export type MenuCategoryChannelMapping = z.infer<typeof MenuCategoryChannelMappingSchema>;
|
|
259
|
+
export type MenuItemChannelMapping = z.infer<typeof MenuItemChannelMappingSchema>;
|
|
260
|
+
/**
|
|
261
|
+
* Business menu item filter options.
|
|
262
|
+
* @interface BusinessMenuItemFilters
|
|
263
|
+
*/
|
|
264
|
+
export interface BusinessMenuItemFilters {
|
|
265
|
+
/** Text search across name/description */
|
|
266
|
+
search?: string;
|
|
267
|
+
/** Filter by location ID */
|
|
268
|
+
locationId?: string;
|
|
269
|
+
/** Filter by category ID */
|
|
270
|
+
categoryId?: string;
|
|
271
|
+
/** Filter by active status */
|
|
272
|
+
isActive?: boolean;
|
|
273
|
+
/** Filter by availability status */
|
|
274
|
+
isAvailable?: boolean;
|
|
275
|
+
/** Filter by allergens */
|
|
276
|
+
allergens?: string[];
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Business menu item sorting options.
|
|
280
|
+
* @interface BusinessMenuItemSorting
|
|
281
|
+
*/
|
|
282
|
+
export interface BusinessMenuItemSorting {
|
|
283
|
+
/** Field to sort by */
|
|
284
|
+
field: 'name' | 'price' | 'createdAt' | 'displayOrder';
|
|
285
|
+
/** Sort direction */
|
|
286
|
+
direction: 'asc' | 'desc';
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Business menu item query options.
|
|
290
|
+
* @interface BusinessMenuItemQueryOptions
|
|
291
|
+
*/
|
|
292
|
+
export interface BusinessMenuItemQueryOptions {
|
|
293
|
+
/** Page number (1-indexed) */
|
|
294
|
+
page: number;
|
|
295
|
+
/** Items per page */
|
|
296
|
+
pageSize: number;
|
|
297
|
+
/** Optional filters */
|
|
298
|
+
filters?: BusinessMenuItemFilters;
|
|
299
|
+
/** Optional sorting */
|
|
300
|
+
sorting?: BusinessMenuItemSorting;
|
|
301
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
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.UpdateBusinessMenuItemSchema = exports.UpdateMenuCategorySchema = exports.CreateBusinessMenuItemSchema = exports.CreateMenuCategorySchema = exports.BusinessMenuItemSchema = exports.MenuCategorySchema = exports.MenuItemChannelMappingSchema = exports.MenuCategoryChannelMappingSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../../base.schema");
|
|
9
|
+
const order_schema_1 = require("../order.schema");
|
|
10
|
+
const menu_item_variant_schema_1 = require("./menu-item-variant.schema");
|
|
11
|
+
/**
|
|
12
|
+
* @fileoverview Business menu configuration schema definitions.
|
|
13
|
+
* @module business-mgt/business-menu-config
|
|
14
|
+
*
|
|
15
|
+
* Includes menu categories, menu items, channel mappings,
|
|
16
|
+
* and nutritional information for restaurant/food service businesses.
|
|
17
|
+
*/
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// CHANNEL MAPPING SCHEMAS
|
|
20
|
+
// ============================================================================
|
|
21
|
+
/**
|
|
22
|
+
* Menu category channel mapping schema.
|
|
23
|
+
* Maps menu categories to external platform identifiers.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {Object} MenuCategoryChannelMapping
|
|
26
|
+
* @property {string} channelId - Channel identifier (e.g., doordash, uber-eats)
|
|
27
|
+
* @property {string} externalCategoryId - External category ID for synchronization
|
|
28
|
+
*/
|
|
29
|
+
exports.MenuCategoryChannelMappingSchema = zod_1.default.object({
|
|
30
|
+
channelId: zod_1.default.string().describe("Channel ID (e.g., doordash, uber-eats)"),
|
|
31
|
+
externalCategoryId: zod_1.default.string().describe("External category ID for this specific channel"),
|
|
32
|
+
}).describe("Per-channel external category ID mapping");
|
|
33
|
+
/**
|
|
34
|
+
* Menu item channel mapping schema.
|
|
35
|
+
* Maps menu items to external platform identifiers.
|
|
36
|
+
*
|
|
37
|
+
* @typedef {Object} MenuItemChannelMapping
|
|
38
|
+
* @property {string} channelId - Channel identifier (e.g., doordash, uber-eats)
|
|
39
|
+
* @property {string} externalMenuItemId - External menu item ID for synchronization
|
|
40
|
+
* @property {string} [externalCategoryId] - Optional external category ID in channel
|
|
41
|
+
*/
|
|
42
|
+
exports.MenuItemChannelMappingSchema = zod_1.default.object({
|
|
43
|
+
channelId: zod_1.default.string().describe("Channel ID (e.g., doordash, uber-eats)"),
|
|
44
|
+
externalMenuItemId: zod_1.default.string().describe("External menu item ID for this specific channel"),
|
|
45
|
+
externalCategoryId: zod_1.default.string().nullable().optional().describe("External category ID in this channel, if needed for sync payloads"),
|
|
46
|
+
}).describe("Per-channel external menu item ID mapping");
|
|
47
|
+
// ============================================================================
|
|
48
|
+
// MENU CATEGORY SCHEMA
|
|
49
|
+
// ============================================================================
|
|
50
|
+
/**
|
|
51
|
+
* Menu category schema.
|
|
52
|
+
* Categories for organizing menu items (e.g., Appetizers, Main Course, Desserts).
|
|
53
|
+
*
|
|
54
|
+
* @typedef {Object} MenuCategory
|
|
55
|
+
* @property {string} name - Category name for menu organization
|
|
56
|
+
* @property {string} [description] - Category description
|
|
57
|
+
* @property {number} [displayOrder] - Numeric order for display
|
|
58
|
+
* @property {MenuCategoryChannelMapping[]} [channelMappings] - Per-channel mappings
|
|
59
|
+
*/
|
|
60
|
+
exports.MenuCategorySchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
61
|
+
name: zod_1.default.string().min(1, "Category name is required").describe("Category name for menu organization (e.g., Appetizers, Main Course, Desserts). Used by AI Powered Services when presenting menu options to customers."),
|
|
62
|
+
description: zod_1.default.string().nullable().optional().describe("Category description providing context about the type of items included. Helps customers navigate the menu."),
|
|
63
|
+
displayOrder: zod_1.default.number().int().optional().describe("Numeric order for category display in menu listings. Lower numbers appear first. Enables custom menu organization."),
|
|
64
|
+
channelMappings: zod_1.default.array(exports.MenuCategoryChannelMappingSchema).nullable().optional().describe("Per-channel category ID mappings for external platform integrations"),
|
|
65
|
+
});
|
|
66
|
+
// ============================================================================
|
|
67
|
+
// BUSINESS MENU ITEM SCHEMA
|
|
68
|
+
// ============================================================================
|
|
69
|
+
/**
|
|
70
|
+
* Business menu item schema.
|
|
71
|
+
* Individual menu items available for ordering.
|
|
72
|
+
*
|
|
73
|
+
* @typedef {Object} BusinessMenuItem
|
|
74
|
+
* @property {string} name - Display name of the menu item
|
|
75
|
+
* @property {string} [description] - Detailed item description
|
|
76
|
+
* @property {number} price - Base price for this menu item
|
|
77
|
+
* @property {string} categoryId - References MenuCategory this item belongs to
|
|
78
|
+
* @property {MenuCategory} [category] - Populated MenuCategory object
|
|
79
|
+
* @property {string[]} [ingredients] - List of primary ingredients
|
|
80
|
+
* @property {string[]} [allergens] - Common allergens present
|
|
81
|
+
* @property {Object} [nutritionalInfo] - Nutritional information
|
|
82
|
+
* @property {boolean} isAvailable - Real-time availability status
|
|
83
|
+
* @property {number} [preparationTime] - Estimated preparation time in minutes
|
|
84
|
+
* @property {boolean} isActive - Whether item is active in the menu catalog
|
|
85
|
+
* @property {number} [displayOrder] - Display order within category
|
|
86
|
+
* @property {MenuItemChannelMapping[]} [channelMappings] - Per-channel mappings
|
|
87
|
+
* @property {Array} [dayParts] - Recurring availability dayparts
|
|
88
|
+
* @property {number} [orderCount] - Total orders for this item (read-only)
|
|
89
|
+
* @property {number} [recentOrderCount] - Orders in the last 30 days (read-only)
|
|
90
|
+
* @property {number} [lastOrderedAt] - Unix timestamp of the last order (read-only)
|
|
91
|
+
*/
|
|
92
|
+
exports.BusinessMenuItemSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
93
|
+
name: zod_1.default.string().min(1, "Menu item name is required").describe("Display name of the menu item shown to customers. Used by AI Powered Services in menu order conversations."),
|
|
94
|
+
description: zod_1.default.string().nullable().optional().describe("Detailed item description including preparation style, ingredients, or special features. Helps customers make informed selections."),
|
|
95
|
+
// Menu-specific fields
|
|
96
|
+
price: zod_1.default.number().nonnegative().describe("Base price for this menu item in the account's currency. Used for order pricing calculations."),
|
|
97
|
+
categoryId: zod_1.default.string().describe("References MenuCategory this item belongs to. Used for menu organization and AI-driven category-based browsing."),
|
|
98
|
+
category: exports.MenuCategorySchema.optional().describe("Populated MenuCategory object for convenient access. Not required during creation; managed by Menu Management."),
|
|
99
|
+
ingredients: zod_1.default.array(zod_1.default.string()).optional().describe("List of primary ingredients for dietary information and AI-powered ingredient-based searches (e.g., 'vegetarian options')."),
|
|
100
|
+
allergens: zod_1.default.array(zod_1.default.string()).optional().describe("Common allergens present (e.g., ['nuts', 'dairy', 'gluten']). Critical for customer safety and AI allergen filtering."),
|
|
101
|
+
nutritionalInfo: zod_1.default.object({
|
|
102
|
+
calories: zod_1.default.number().optional().describe("Caloric content per serving."),
|
|
103
|
+
protein: zod_1.default.number().optional().describe("Protein content in grams."),
|
|
104
|
+
carbs: zod_1.default.number().optional().describe("Carbohydrate content in grams."),
|
|
105
|
+
fat: zod_1.default.number().optional().describe("Fat content in grams."),
|
|
106
|
+
}).optional().describe("Optional nutritional information for health-conscious customers and dietary compliance."),
|
|
107
|
+
// Availability
|
|
108
|
+
isAvailable: zod_1.default.boolean().default(true).describe("Real-time availability status (e.g., sold out, temporarily unavailable). AI Powered Services only presents available items. Defaults to true."),
|
|
109
|
+
preparationTime: zod_1.default.number().int().positive().nullable().optional().describe("Estimated preparation time in minutes. Used for setting customer expectations and order timing in Menu Order workflow."),
|
|
110
|
+
// Business Management
|
|
111
|
+
isActive: zod_1.default.boolean().default(true).describe("Whether item is active in the menu catalog. Inactive items are hidden from customers. Defaults to true."),
|
|
112
|
+
displayOrder: zod_1.default.number().int().optional().describe("Display order within category. Lower numbers appear first. Enables strategic item positioning."),
|
|
113
|
+
channelMappings: zod_1.default.array(exports.MenuItemChannelMappingSchema).nullable().optional().describe("Per-channel menu item ID mappings for external platform integrations"),
|
|
114
|
+
// Daypart availability
|
|
115
|
+
dayParts: zod_1.default.array(order_schema_1.MenuItemDaypartSchema).nullable().optional().describe("Resolved recurring availability dayparts (e.g., Breakfast, Lunch, Dinner windows)"),
|
|
116
|
+
// Ordering analytics (View Model only - not set on create/update)
|
|
117
|
+
orderCount: zod_1.default.number().int().nonnegative().nullable().optional().describe("Total orders for this item (all time)"),
|
|
118
|
+
recentOrderCount: zod_1.default.number().int().nonnegative().nullable().optional().describe("Orders for this item in the last 30 days"),
|
|
119
|
+
lastOrderedAt: zod_1.default.number().int().positive().nullable().optional().describe("Unix timestamp of the last order for this item"),
|
|
120
|
+
});
|
|
121
|
+
// ============================================================================
|
|
122
|
+
// CREATE/UPDATE SCHEMAS
|
|
123
|
+
// ============================================================================
|
|
124
|
+
/**
|
|
125
|
+
* Schema for creating a new menu category.
|
|
126
|
+
* Omits auto-generated fields.
|
|
127
|
+
*/
|
|
128
|
+
exports.CreateMenuCategorySchema = exports.MenuCategorySchema.omit({
|
|
129
|
+
id: true,
|
|
130
|
+
createdAt: true,
|
|
131
|
+
updatedAt: true,
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* Schema for creating a new business menu item.
|
|
135
|
+
* Omits auto-generated fields and allows optional category specification.
|
|
136
|
+
*
|
|
137
|
+
* @remarks
|
|
138
|
+
* A menu item must be created with at least one variant. Nested variants use the
|
|
139
|
+
* menu item variant create schema with `menuItemId` omitted; the parent link is
|
|
140
|
+
* assigned by the server once the menu item is created.
|
|
141
|
+
*/
|
|
142
|
+
exports.CreateBusinessMenuItemSchema = exports.BusinessMenuItemSchema.omit({
|
|
143
|
+
id: true,
|
|
144
|
+
createdAt: true,
|
|
145
|
+
updatedAt: true,
|
|
146
|
+
category: true,
|
|
147
|
+
categoryId: true,
|
|
148
|
+
// Omit analytics fields (view model only)
|
|
149
|
+
orderCount: true,
|
|
150
|
+
recentOrderCount: true,
|
|
151
|
+
lastOrderedAt: true,
|
|
152
|
+
}).safeExtend({
|
|
153
|
+
categoryId: zod_1.default.string().nullable().optional(),
|
|
154
|
+
variants: zod_1.default.array(menu_item_variant_schema_1.CreateMenuItemVariantSchema.omit({ menuItemId: true })).min(1, "A menu item must have at least one variant").describe("Variants to create with this menu item. At least one is required; the parent menu item ID is assigned by the server."),
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Schema for updating an existing menu category.
|
|
158
|
+
* All fields optional except id (required).
|
|
159
|
+
*/
|
|
160
|
+
exports.UpdateMenuCategorySchema = exports.CreateMenuCategorySchema.partial().safeExtend({
|
|
161
|
+
id: zod_1.default.string(),
|
|
162
|
+
});
|
|
163
|
+
/**
|
|
164
|
+
* Schema for updating an existing business menu item.
|
|
165
|
+
* All fields optional except id (required).
|
|
166
|
+
*/
|
|
167
|
+
exports.UpdateBusinessMenuItemSchema = exports.CreateBusinessMenuItemSchema.partial().safeExtend({
|
|
168
|
+
id: zod_1.default.string(),
|
|
169
|
+
});
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Menu item variant schema definitions for business management.
|
|
4
|
+
* @module business-mgt/menu-item-variant
|
|
5
|
+
*
|
|
6
|
+
* Includes menu item variants for different sizes/options of the same
|
|
7
|
+
* menu item (e.g., Small, Medium, Large).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Menu item variant channel mapping schema.
|
|
11
|
+
* Maps menu item variants to external platform identifiers.
|
|
12
|
+
*
|
|
13
|
+
* @typedef {Object} MenuItemVariantChannelMapping
|
|
14
|
+
* @property {string} channelId - Channel identifier (e.g., doordash, uber-eats)
|
|
15
|
+
* @property {string} externalVariantId - External variant ID for synchronization
|
|
16
|
+
* @property {string} [externalMenuItemId] - Optional external parent menu item ID
|
|
17
|
+
*/
|
|
18
|
+
export declare const MenuItemVariantChannelMappingSchema: z.ZodObject<{
|
|
19
|
+
channelId: z.ZodString;
|
|
20
|
+
externalVariantId: z.ZodString;
|
|
21
|
+
externalMenuItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
/**
|
|
24
|
+
* Menu item variant schema.
|
|
25
|
+
* Different sizes/options for the same menu item.
|
|
26
|
+
*
|
|
27
|
+
* @typedef {Object} MenuItemVariant
|
|
28
|
+
* @property {string} menuItemId - Parent menu item ID
|
|
29
|
+
* @property {string} name - Variant name (e.g., Small, Medium, Large)
|
|
30
|
+
* @property {string} [description] - Variant description
|
|
31
|
+
* @property {number} price - Variant price
|
|
32
|
+
* @property {boolean} isAvailable - Whether variant is currently available
|
|
33
|
+
* @property {boolean} isActive - Whether variant is active in menu
|
|
34
|
+
* @property {boolean} isDefault - Whether this is the default variant
|
|
35
|
+
* @property {MenuItemVariantChannelMapping[]} [variantChannelMappings] - Per-channel mappings
|
|
36
|
+
* @property {number} [orderCount] - Total orders for this variant (read-only)
|
|
37
|
+
* @property {number} [recentOrderCount] - Orders in last 30 days (read-only)
|
|
38
|
+
* @property {number} [lastOrderedAt] - Unix timestamp of last order (read-only)
|
|
39
|
+
*/
|
|
40
|
+
export declare const MenuItemVariantSchema: z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
menuItemId: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
price: z.ZodNumber;
|
|
48
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
+
variantChannelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
52
|
+
channelId: z.ZodString;
|
|
53
|
+
externalVariantId: z.ZodString;
|
|
54
|
+
externalMenuItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
}, z.core.$strip>>>>;
|
|
56
|
+
orderCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
57
|
+
recentOrderCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
58
|
+
lastOrderedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
/**
|
|
61
|
+
* Schema for creating a new menu item variant.
|
|
62
|
+
* Omits auto-generated fields.
|
|
63
|
+
*/
|
|
64
|
+
export declare const CreateMenuItemVariantSchema: z.ZodObject<{
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
68
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
+
price: z.ZodNumber;
|
|
70
|
+
menuItemId: z.ZodString;
|
|
71
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
variantChannelMappings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
73
|
+
channelId: z.ZodString;
|
|
74
|
+
externalVariantId: z.ZodString;
|
|
75
|
+
externalMenuItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
}, z.core.$strip>>>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
/**
|
|
79
|
+
* Schema for updating an existing menu item variant.
|
|
80
|
+
* All fields are optional except id.
|
|
81
|
+
*/
|
|
82
|
+
export declare const UpdateMenuItemVariantSchema: z.ZodObject<{
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
85
|
+
isDefault: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
86
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
87
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
menuItemId: z.ZodOptional<z.ZodString>;
|
|
89
|
+
isAvailable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
90
|
+
variantChannelMappings: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
91
|
+
channelId: z.ZodString;
|
|
92
|
+
externalVariantId: z.ZodString;
|
|
93
|
+
externalMenuItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
}, z.core.$strip>>>>>;
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type MenuItemVariant = z.infer<typeof MenuItemVariantSchema>;
|
|
98
|
+
export type CreateMenuItemVariant = z.infer<typeof CreateMenuItemVariantSchema>;
|
|
99
|
+
export type UpdateMenuItemVariant = z.infer<typeof UpdateMenuItemVariantSchema>;
|
|
100
|
+
export type MenuItemVariantChannelMapping = z.infer<typeof MenuItemVariantChannelMappingSchema>;
|
|
101
|
+
/**
|
|
102
|
+
* Menu item variant filter options.
|
|
103
|
+
* @interface MenuItemVariantFilters
|
|
104
|
+
*/
|
|
105
|
+
export interface MenuItemVariantFilters {
|
|
106
|
+
/** Text search across name/description */
|
|
107
|
+
search?: string;
|
|
108
|
+
/** Filter by parent menu item ID */
|
|
109
|
+
menuItemId?: string;
|
|
110
|
+
/** Filter by active status */
|
|
111
|
+
isActive?: boolean;
|
|
112
|
+
/** Filter by availability status */
|
|
113
|
+
isAvailable?: boolean;
|
|
114
|
+
/** Filter by price range */
|
|
115
|
+
priceRange?: {
|
|
116
|
+
min?: number;
|
|
117
|
+
max?: number;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Menu item variant sorting options.
|
|
122
|
+
* @interface MenuItemVariantSorting
|
|
123
|
+
*/
|
|
124
|
+
export interface MenuItemVariantSorting {
|
|
125
|
+
/** Field to sort by */
|
|
126
|
+
field: 'name' | 'price' | 'createdAt';
|
|
127
|
+
/** Sort direction */
|
|
128
|
+
direction: 'asc' | 'desc';
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Menu item variant query options.
|
|
132
|
+
* @interface MenuItemVariantQueryOptions
|
|
133
|
+
*/
|
|
134
|
+
export interface MenuItemVariantQueryOptions {
|
|
135
|
+
/** Page number (1-indexed) */
|
|
136
|
+
page: number;
|
|
137
|
+
/** Items per page */
|
|
138
|
+
pageSize: number;
|
|
139
|
+
/** Optional filters */
|
|
140
|
+
filters?: MenuItemVariantFilters;
|
|
141
|
+
/** Optional sorting */
|
|
142
|
+
sorting?: MenuItemVariantSorting;
|
|
143
|
+
}
|