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,183 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DiscountCatalogScope, DiscountScope, DiscountType } from "../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Discount rule schema definitions for order pricing.
|
|
5
|
+
* @module business-mgt/discount-rule
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Discount rule schema.
|
|
9
|
+
* Defines discount configurations for orders including percentage and fixed amount discounts.
|
|
10
|
+
*
|
|
11
|
+
* @typedef {Object} DiscountRule
|
|
12
|
+
* @property {string} [locationId] - Business location where this discount applies
|
|
13
|
+
* @property {string} name - Discount display name
|
|
14
|
+
* @property {string} [code] - Discount code for promo codes
|
|
15
|
+
* @property {DiscountScope} scope - Discount scope (order, item, category)
|
|
16
|
+
* @property {DiscountType} type - Discount type (percentage, fixed)
|
|
17
|
+
* @property {number} value - Discount value (percentage or fixed amount)
|
|
18
|
+
* @property {string} currency - Currency code for fixed discounts
|
|
19
|
+
* @property {DiscountCatalogScope} catalogScope - Catalog scope for item-level discounts
|
|
20
|
+
* @property {string} [externalDiscountId] - External system discount ID
|
|
21
|
+
* @property {number} [minSubtotal] - Minimum order subtotal required
|
|
22
|
+
* @property {string} [customerSegment] - Target customer segment
|
|
23
|
+
* @property {boolean} firstOrderOnly - Whether discount is for first orders only
|
|
24
|
+
* @property {number} [maxUses] - Maximum total uses allowed
|
|
25
|
+
* @property {number} [maxUsesPerCustomer] - Maximum uses per customer
|
|
26
|
+
* @property {boolean} isStackable - Whether discount can stack with others
|
|
27
|
+
* @property {number} priority - Priority for discount application order
|
|
28
|
+
* @property {number} [effectiveFrom] - Start timestamp for discount validity
|
|
29
|
+
* @property {number} [effectiveTo] - End timestamp for discount validity
|
|
30
|
+
* @property {boolean} isActive - Whether discount is currently active
|
|
31
|
+
*/
|
|
32
|
+
export declare const DiscountRuleSchema: z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
code: z.ZodOptional<z.ZodString>;
|
|
39
|
+
scope: z.ZodDefault<z.ZodEnum<typeof DiscountScope>>;
|
|
40
|
+
type: z.ZodDefault<z.ZodEnum<typeof DiscountType>>;
|
|
41
|
+
value: z.ZodNumber;
|
|
42
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
43
|
+
catalogScope: z.ZodDefault<z.ZodEnum<typeof DiscountCatalogScope>>;
|
|
44
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
minSubtotal: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
46
|
+
customerSegment: z.ZodOptional<z.ZodString>;
|
|
47
|
+
firstOrderOnly: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
+
maxUses: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
49
|
+
maxUsesPerCustomer: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
50
|
+
isStackable: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
52
|
+
effectiveFrom: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
53
|
+
effectiveTo: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
/**
|
|
57
|
+
* Schema for creating a new discount rule.
|
|
58
|
+
* Omits auto-generated fields.
|
|
59
|
+
*/
|
|
60
|
+
export declare const CreateDiscountRuleSchema: z.ZodObject<{
|
|
61
|
+
type: z.ZodDefault<z.ZodEnum<typeof DiscountType>>;
|
|
62
|
+
value: z.ZodNumber;
|
|
63
|
+
code: z.ZodOptional<z.ZodString>;
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
67
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
scope: z.ZodDefault<z.ZodEnum<typeof DiscountScope>>;
|
|
69
|
+
catalogScope: z.ZodDefault<z.ZodEnum<typeof DiscountCatalogScope>>;
|
|
70
|
+
externalDiscountId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
minSubtotal: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
|
+
customerSegment: z.ZodOptional<z.ZodString>;
|
|
73
|
+
firstOrderOnly: z.ZodDefault<z.ZodBoolean>;
|
|
74
|
+
maxUses: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
75
|
+
maxUsesPerCustomer: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
76
|
+
isStackable: z.ZodDefault<z.ZodBoolean>;
|
|
77
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
effectiveFrom: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
79
|
+
effectiveTo: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
80
|
+
placement: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
placementIntent: z.ZodObject<{
|
|
82
|
+
mode: z.ZodEnum<{
|
|
83
|
+
BEGINNING: "BEGINNING";
|
|
84
|
+
END: "END";
|
|
85
|
+
KEEP_CURRENT: "KEEP_CURRENT";
|
|
86
|
+
BEFORE_ITEM: "BEFORE_ITEM";
|
|
87
|
+
AFTER_ITEM: "AFTER_ITEM";
|
|
88
|
+
ABSOLUTE_INDEX: "ABSOLUTE_INDEX";
|
|
89
|
+
}>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
anchorItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
absoluteIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
/**
|
|
96
|
+
* Schema for updating an existing discount rule.
|
|
97
|
+
* All fields optional except id.
|
|
98
|
+
*/
|
|
99
|
+
export declare const UpdateDiscountRuleSchema: z.ZodObject<{
|
|
100
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
code: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
102
|
+
name: z.ZodOptional<z.ZodString>;
|
|
103
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
104
|
+
externalDiscountId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
105
|
+
minSubtotal: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
106
|
+
customerSegment: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
107
|
+
maxUses: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
108
|
+
maxUsesPerCustomer: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
109
|
+
effectiveFrom: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
110
|
+
effectiveTo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
111
|
+
placement: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
112
|
+
placementIntent: z.ZodObject<{
|
|
113
|
+
mode: z.ZodEnum<{
|
|
114
|
+
BEGINNING: "BEGINNING";
|
|
115
|
+
END: "END";
|
|
116
|
+
KEEP_CURRENT: "KEEP_CURRENT";
|
|
117
|
+
BEFORE_ITEM: "BEFORE_ITEM";
|
|
118
|
+
AFTER_ITEM: "AFTER_ITEM";
|
|
119
|
+
ABSOLUTE_INDEX: "ABSOLUTE_INDEX";
|
|
120
|
+
}>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
anchorItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
absoluteIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
124
|
+
}, z.core.$strip>>>;
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof DiscountScope>>>;
|
|
127
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof DiscountType>>>;
|
|
128
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
catalogScope: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof DiscountCatalogScope>>>;
|
|
130
|
+
firstOrderOnly: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
131
|
+
isStackable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
132
|
+
priority: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
133
|
+
isActive: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
export type DiscountRule = z.infer<typeof DiscountRuleSchema>;
|
|
136
|
+
export type CreateDiscountRule = z.infer<typeof CreateDiscountRuleSchema>;
|
|
137
|
+
export type UpdateDiscountRule = z.infer<typeof UpdateDiscountRuleSchema>;
|
|
138
|
+
/**
|
|
139
|
+
* Discount rule filter options.
|
|
140
|
+
* @interface DiscountRuleFilters
|
|
141
|
+
*/
|
|
142
|
+
export interface DiscountRuleFilters {
|
|
143
|
+
/** Text search across discount name and code */
|
|
144
|
+
search?: string;
|
|
145
|
+
/** Filter by business location ID */
|
|
146
|
+
locationId?: string;
|
|
147
|
+
/** Filter by discount code */
|
|
148
|
+
code?: string;
|
|
149
|
+
/** Filter by discount scope */
|
|
150
|
+
scope?: DiscountScope;
|
|
151
|
+
/** Filter by discount type */
|
|
152
|
+
type?: DiscountType;
|
|
153
|
+
/** Filter by catalog scope */
|
|
154
|
+
catalogScope?: DiscountCatalogScope;
|
|
155
|
+
/** Filter by stackable status */
|
|
156
|
+
isStackable?: boolean;
|
|
157
|
+
/** Filter by active status */
|
|
158
|
+
isActive?: boolean;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Discount rule sorting options.
|
|
162
|
+
* @interface DiscountRuleSorting
|
|
163
|
+
*/
|
|
164
|
+
export interface DiscountRuleSorting {
|
|
165
|
+
/** Field to sort by */
|
|
166
|
+
field: "name" | "priority" | "value" | "createdAt";
|
|
167
|
+
/** Sort direction */
|
|
168
|
+
direction: "asc" | "desc";
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Discount rule query options.
|
|
172
|
+
* @interface DiscountRuleQueryOptions
|
|
173
|
+
*/
|
|
174
|
+
export interface DiscountRuleQueryOptions {
|
|
175
|
+
/** Page number (1-indexed) */
|
|
176
|
+
page: number;
|
|
177
|
+
/** Items per page */
|
|
178
|
+
pageSize: number;
|
|
179
|
+
/** Optional filters */
|
|
180
|
+
filters?: DiscountRuleFilters;
|
|
181
|
+
/** Optional sorting */
|
|
182
|
+
sorting?: DiscountRuleSorting;
|
|
183
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateDiscountRuleSchema = exports.CreateDiscountRuleSchema = exports.DiscountRuleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../base.schema");
|
|
6
|
+
const display_order_1 = require("../type-definitions/display-order");
|
|
7
|
+
const type_definitions_1 = require("../type-definitions");
|
|
8
|
+
/**
|
|
9
|
+
* @fileoverview Discount rule schema definitions for order pricing.
|
|
10
|
+
* @module business-mgt/discount-rule
|
|
11
|
+
*/
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// DISCOUNT RULE SCHEMA
|
|
14
|
+
// ============================================================================
|
|
15
|
+
/**
|
|
16
|
+
* Discount rule schema.
|
|
17
|
+
* Defines discount configurations for orders including percentage and fixed amount discounts.
|
|
18
|
+
*
|
|
19
|
+
* @typedef {Object} DiscountRule
|
|
20
|
+
* @property {string} [locationId] - Business location where this discount applies
|
|
21
|
+
* @property {string} name - Discount display name
|
|
22
|
+
* @property {string} [code] - Discount code for promo codes
|
|
23
|
+
* @property {DiscountScope} scope - Discount scope (order, item, category)
|
|
24
|
+
* @property {DiscountType} type - Discount type (percentage, fixed)
|
|
25
|
+
* @property {number} value - Discount value (percentage or fixed amount)
|
|
26
|
+
* @property {string} currency - Currency code for fixed discounts
|
|
27
|
+
* @property {DiscountCatalogScope} catalogScope - Catalog scope for item-level discounts
|
|
28
|
+
* @property {string} [externalDiscountId] - External system discount ID
|
|
29
|
+
* @property {number} [minSubtotal] - Minimum order subtotal required
|
|
30
|
+
* @property {string} [customerSegment] - Target customer segment
|
|
31
|
+
* @property {boolean} firstOrderOnly - Whether discount is for first orders only
|
|
32
|
+
* @property {number} [maxUses] - Maximum total uses allowed
|
|
33
|
+
* @property {number} [maxUsesPerCustomer] - Maximum uses per customer
|
|
34
|
+
* @property {boolean} isStackable - Whether discount can stack with others
|
|
35
|
+
* @property {number} priority - Priority for discount application order
|
|
36
|
+
* @property {number} [effectiveFrom] - Start timestamp for discount validity
|
|
37
|
+
* @property {number} [effectiveTo] - End timestamp for discount validity
|
|
38
|
+
* @property {boolean} isActive - Whether discount is currently active
|
|
39
|
+
*/
|
|
40
|
+
exports.DiscountRuleSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
41
|
+
locationId: zod_1.z.string().nullable().optional(),
|
|
42
|
+
name: zod_1.z.string().min(1).max(100),
|
|
43
|
+
code: zod_1.z.string().optional(),
|
|
44
|
+
scope: zod_1.z.enum(type_definitions_1.DiscountScope).default(type_definitions_1.DiscountScope.ORDER),
|
|
45
|
+
type: zod_1.z.enum(type_definitions_1.DiscountType).default(type_definitions_1.DiscountType.PERCENTAGE),
|
|
46
|
+
value: zod_1.z.number().nonnegative(),
|
|
47
|
+
currency: zod_1.z.string().length(3).default("USD"),
|
|
48
|
+
catalogScope: zod_1.z.enum(type_definitions_1.DiscountCatalogScope).default(type_definitions_1.DiscountCatalogScope.ALL),
|
|
49
|
+
externalDiscountId: zod_1.z.string().optional(),
|
|
50
|
+
minSubtotal: zod_1.z.number().nonnegative().nullable().optional(),
|
|
51
|
+
customerSegment: zod_1.z.string().optional(),
|
|
52
|
+
firstOrderOnly: zod_1.z.boolean().default(false),
|
|
53
|
+
maxUses: zod_1.z.number().int().positive().nullable().optional(),
|
|
54
|
+
maxUsesPerCustomer: zod_1.z.number().int().positive().nullable().optional(),
|
|
55
|
+
isStackable: zod_1.z.boolean().default(true),
|
|
56
|
+
priority: zod_1.z.number().int().nonnegative().default(0),
|
|
57
|
+
effectiveFrom: zod_1.z.number().int().nonnegative().nullable().optional(),
|
|
58
|
+
effectiveTo: zod_1.z.number().int().nonnegative().nullable().optional(),
|
|
59
|
+
isActive: zod_1.z.boolean().default(true),
|
|
60
|
+
}).superRefine((data, ctx) => {
|
|
61
|
+
if (data.type === type_definitions_1.DiscountType.PERCENTAGE && data.value > 100) {
|
|
62
|
+
ctx.addIssue({
|
|
63
|
+
code: "custom",
|
|
64
|
+
path: ["value"],
|
|
65
|
+
message: "value cannot exceed 100 for percentage discounts",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (data.effectiveFrom !== null &&
|
|
69
|
+
data.effectiveFrom !== undefined &&
|
|
70
|
+
data.effectiveTo !== null &&
|
|
71
|
+
data.effectiveTo !== undefined &&
|
|
72
|
+
data.effectiveTo < data.effectiveFrom) {
|
|
73
|
+
ctx.addIssue({
|
|
74
|
+
code: "custom",
|
|
75
|
+
path: ["effectiveTo"],
|
|
76
|
+
message: "effectiveTo must be greater than or equal to effectiveFrom",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
// ============================================================================
|
|
81
|
+
// CREATE/UPDATE SCHEMAS
|
|
82
|
+
// ============================================================================
|
|
83
|
+
/**
|
|
84
|
+
* Schema for creating a new discount rule.
|
|
85
|
+
* Omits auto-generated fields.
|
|
86
|
+
*/
|
|
87
|
+
exports.CreateDiscountRuleSchema = exports.DiscountRuleSchema.omit({
|
|
88
|
+
id: true,
|
|
89
|
+
createdAt: true,
|
|
90
|
+
updatedAt: true,
|
|
91
|
+
}).safeExtend({
|
|
92
|
+
placement: display_order_1.CreateDisplayOrderPlacementSchema.optional(),
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* Schema for updating an existing discount rule.
|
|
96
|
+
* All fields optional except id.
|
|
97
|
+
*/
|
|
98
|
+
exports.UpdateDiscountRuleSchema = exports.CreateDiscountRuleSchema.partial().extend({
|
|
99
|
+
id: zod_1.z.string().describe("Unique identifier of the discount rule to update"),
|
|
100
|
+
scope: zod_1.z.enum(type_definitions_1.DiscountScope).nullable().optional(),
|
|
101
|
+
type: zod_1.z.enum(type_definitions_1.DiscountType).nullable().optional(),
|
|
102
|
+
currency: zod_1.z.string().length(3).nullable().optional(),
|
|
103
|
+
catalogScope: zod_1.z.enum(type_definitions_1.DiscountCatalogScope).nullable().optional(),
|
|
104
|
+
firstOrderOnly: zod_1.z.boolean().nullable().optional(),
|
|
105
|
+
isStackable: zod_1.z.boolean().nullable().optional(),
|
|
106
|
+
priority: zod_1.z.number().int().nonnegative().nullable().optional(),
|
|
107
|
+
isActive: zod_1.z.boolean().nullable().optional(),
|
|
108
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Central export point for business management schemas.
|
|
3
|
+
* @module business-mgt
|
|
4
|
+
*/
|
|
5
|
+
export * from './bookings.shared.schema';
|
|
6
|
+
export * from './business-location.schema';
|
|
7
|
+
export * from './discount-rule.schema';
|
|
8
|
+
export * from './order.schema';
|
|
9
|
+
export * from './pricing-rule.shared.schema';
|
|
10
|
+
export * from './tax-rule.schema';
|
|
11
|
+
export * from './customer-management';
|
|
12
|
+
export * from './menu-management';
|
|
13
|
+
export * from './product-management';
|
|
14
|
+
export * from './property-management';
|
|
15
|
+
export * from './reservation-mgt';
|
|
16
|
+
export * from './service-management';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Central export point for business management schemas.
|
|
4
|
+
* @module business-mgt
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// SHARED SCHEMAS
|
|
23
|
+
// ============================================================================
|
|
24
|
+
__exportStar(require("./bookings.shared.schema"), exports);
|
|
25
|
+
__exportStar(require("./business-location.schema"), exports);
|
|
26
|
+
__exportStar(require("./discount-rule.schema"), exports);
|
|
27
|
+
__exportStar(require("./order.schema"), exports);
|
|
28
|
+
__exportStar(require("./pricing-rule.shared.schema"), exports);
|
|
29
|
+
__exportStar(require("./tax-rule.schema"), exports);
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// DOMAIN MODULES
|
|
32
|
+
// ============================================================================
|
|
33
|
+
__exportStar(require("./customer-management"), exports);
|
|
34
|
+
__exportStar(require("./menu-management"), exports);
|
|
35
|
+
__exportStar(require("./product-management"), exports);
|
|
36
|
+
__exportStar(require("./property-management"), exports);
|
|
37
|
+
__exportStar(require("./reservation-mgt"), exports);
|
|
38
|
+
__exportStar(require("./service-management"), exports);
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Business menu configuration schema definitions.
|
|
4
|
+
* @module business-mgt/business-menu-config
|
|
5
|
+
*/
|
|
6
|
+
export declare const MenuCategorySchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const BusinessMenuItemSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
price: z.ZodNumber;
|
|
21
|
+
categoryId: z.ZodString;
|
|
22
|
+
category: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
description: z.ZodOptional<z.ZodString>;
|
|
28
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
ingredients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
+
allergens: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
|
+
nutritionalInfo: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
calories: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
protein: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
carbs: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
fat: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
preparationTime: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const MenuQRCodeSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
menuUrl: z.ZodURL;
|
|
46
|
+
qrCodeImage: z.ZodOptional<z.ZodString>;
|
|
47
|
+
tableNumber: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
/**
|
|
50
|
+
* Zod schema for creating a new menu category.
|
|
51
|
+
*
|
|
52
|
+
* Omits auto-generated fields.
|
|
53
|
+
*/
|
|
54
|
+
export declare const CreateMenuCategorySchema: z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
description: z.ZodOptional<z.ZodString>;
|
|
57
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
/**
|
|
60
|
+
* Zod schema for creating a new business menu item.
|
|
61
|
+
*
|
|
62
|
+
* Omits auto-generated fields and allows optional category specification.
|
|
63
|
+
*/
|
|
64
|
+
export declare const CreateBusinessMenuItemSchema: z.ZodObject<{
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
description: z.ZodOptional<z.ZodString>;
|
|
67
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
68
|
+
price: z.ZodNumber;
|
|
69
|
+
displayOrder: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
ingredients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
|
+
allergens: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
nutritionalInfo: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
calories: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
protein: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
carbs: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
fat: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
isAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
preparationTime: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
categoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
/**
|
|
83
|
+
* Zod schema for updating an existing menu category.
|
|
84
|
+
*
|
|
85
|
+
* All fields are optional (partial) except id.
|
|
86
|
+
*/
|
|
87
|
+
export declare const UpdateMenuCategorySchema: z.ZodObject<{
|
|
88
|
+
name: z.ZodOptional<z.ZodString>;
|
|
89
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
90
|
+
displayOrder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
/**
|
|
94
|
+
* Zod schema for updating an existing business menu item.
|
|
95
|
+
*
|
|
96
|
+
* All fields are optional (partial) except id.
|
|
97
|
+
*/
|
|
98
|
+
export declare const UpdateBusinessMenuItemSchema: z.ZodObject<{
|
|
99
|
+
name: z.ZodOptional<z.ZodString>;
|
|
100
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
101
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
102
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
displayOrder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
104
|
+
ingredients: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
105
|
+
allergens: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
106
|
+
nutritionalInfo: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
107
|
+
calories: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
protein: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
carbs: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
fat: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strip>>>;
|
|
112
|
+
isAvailable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
113
|
+
preparationTime: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
114
|
+
categoryId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
/**
|
|
118
|
+
* Type definition for menu category.
|
|
119
|
+
*/
|
|
120
|
+
export type MenuCategory = z.infer<typeof MenuCategorySchema>;
|
|
121
|
+
/**
|
|
122
|
+
* Type definition for business menu item.
|
|
123
|
+
*/
|
|
124
|
+
export type BusinessMenuItem = z.infer<typeof BusinessMenuItemSchema>;
|
|
125
|
+
/**
|
|
126
|
+
* Type definition for menu QR code.
|
|
127
|
+
*/
|
|
128
|
+
export type MenuQRCode = z.infer<typeof MenuQRCodeSchema>;
|
|
129
|
+
/**
|
|
130
|
+
* Type definition for creating a menu category.
|
|
131
|
+
*/
|
|
132
|
+
export type CreateMenuCategory = z.infer<typeof CreateMenuCategorySchema>;
|
|
133
|
+
/**
|
|
134
|
+
* Type definition for creating a business menu item.
|
|
135
|
+
*/
|
|
136
|
+
export type CreateBusinessMenuItem = z.infer<typeof CreateBusinessMenuItemSchema>;
|
|
137
|
+
/**
|
|
138
|
+
* Type definition for updating a menu category.
|
|
139
|
+
*/
|
|
140
|
+
export type UpdateMenuCategory = z.infer<typeof UpdateMenuCategorySchema>;
|
|
141
|
+
/**
|
|
142
|
+
* Type definition for updating a business menu item.
|
|
143
|
+
*/
|
|
144
|
+
export type UpdateBusinessMenuItem = z.infer<typeof UpdateBusinessMenuItemSchema>;
|
|
145
|
+
export interface BusinessMenuItemFilters {
|
|
146
|
+
search?: string;
|
|
147
|
+
categoryId?: string;
|
|
148
|
+
isActive?: boolean;
|
|
149
|
+
isAvailable?: boolean;
|
|
150
|
+
allergens?: string[];
|
|
151
|
+
priceRange?: {
|
|
152
|
+
min?: number;
|
|
153
|
+
max?: number;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export interface BusinessMenuItemSorting {
|
|
157
|
+
field: 'name' | 'price' | 'createdAt' | 'displayOrder';
|
|
158
|
+
direction: 'asc' | 'desc';
|
|
159
|
+
}
|
|
160
|
+
export interface BusinessMenuItemQueryOptions {
|
|
161
|
+
page: number;
|
|
162
|
+
pageSize: number;
|
|
163
|
+
filters?: BusinessMenuItemFilters;
|
|
164
|
+
sorting?: BusinessMenuItemSorting;
|
|
165
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.MenuQRCodeSchema = exports.BusinessMenuItemSchema = exports.MenuCategorySchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_schema_1 = require("../base.schema");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Business menu configuration schema definitions.
|
|
11
|
+
* @module business-mgt/business-menu-config
|
|
12
|
+
*/
|
|
13
|
+
exports.MenuCategorySchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
14
|
+
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."),
|
|
15
|
+
description: zod_1.default.string().optional().describe("Category description providing context about the type of items included. Helps customers navigate the menu."),
|
|
16
|
+
displayOrder: zod_1.default.number().int().optional().describe("Numeric order for category display in menu listings. Lower numbers appear first. Enables custom menu organization."),
|
|
17
|
+
});
|
|
18
|
+
exports.BusinessMenuItemSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
19
|
+
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."),
|
|
20
|
+
description: zod_1.default.string().optional().describe("Detailed item description including preparation style, ingredients, or special features. Helps customers make informed selections."),
|
|
21
|
+
// Menu-specific fields
|
|
22
|
+
price: zod_1.default.number().nonnegative().describe("Base price for this menu item in the account's currency. Used for order pricing calculations."),
|
|
23
|
+
categoryId: zod_1.default.string().describe("References MenuCategory this item belongs to. Used for menu organization and AI-driven category-based browsing."),
|
|
24
|
+
category: exports.MenuCategorySchema.optional().describe("Populated MenuCategory object for convenient access. Not required during creation; managed by Menu Management."),
|
|
25
|
+
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')."),
|
|
26
|
+
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."),
|
|
27
|
+
nutritionalInfo: zod_1.default.object({
|
|
28
|
+
calories: zod_1.default.number().optional().describe("Caloric content per serving."),
|
|
29
|
+
protein: zod_1.default.number().optional().describe("Protein content in grams."),
|
|
30
|
+
carbs: zod_1.default.number().optional().describe("Carbohydrate content in grams."),
|
|
31
|
+
fat: zod_1.default.number().optional().describe("Fat content in grams."),
|
|
32
|
+
}).optional().describe("Optional nutritional information for health-conscious customers and dietary compliance."),
|
|
33
|
+
// Availability
|
|
34
|
+
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."),
|
|
35
|
+
preparationTime: zod_1.default.number().int().positive().optional().describe("Estimated preparation time in minutes. Used for setting customer expectations and order timing in Menu Order workflow."),
|
|
36
|
+
// Business Management
|
|
37
|
+
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."),
|
|
38
|
+
displayOrder: zod_1.default.number().int().optional().describe("Display order within category. Lower numbers appear first. Enables strategic item positioning."),
|
|
39
|
+
});
|
|
40
|
+
// Simple QR code for menu
|
|
41
|
+
exports.MenuQRCodeSchema = zod_1.default.object({
|
|
42
|
+
id: zod_1.default.string().describe("Unique identifier for this QR code instance."),
|
|
43
|
+
menuUrl: zod_1.default.url().describe("URL to the digital menu accessed by scanning this QR code. Links to menu browsing interface."),
|
|
44
|
+
qrCodeImage: zod_1.default.string().optional().describe("Base64 encoded QR code image for printing or digital display. Generated from menuUrl."),
|
|
45
|
+
tableNumber: zod_1.default.string().optional().describe("Optional table number for dine-in scenarios. Associates QR code with specific table for order attribution."),
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Zod schema for creating a new menu category.
|
|
49
|
+
*
|
|
50
|
+
* Omits auto-generated fields.
|
|
51
|
+
*/
|
|
52
|
+
exports.CreateMenuCategorySchema = exports.MenuCategorySchema.omit({
|
|
53
|
+
id: true,
|
|
54
|
+
createdAt: true,
|
|
55
|
+
updatedAt: true,
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Zod schema for creating a new business menu item.
|
|
59
|
+
*
|
|
60
|
+
* Omits auto-generated fields and allows optional category specification.
|
|
61
|
+
*/
|
|
62
|
+
exports.CreateBusinessMenuItemSchema = exports.BusinessMenuItemSchema.omit({
|
|
63
|
+
id: true,
|
|
64
|
+
createdAt: true,
|
|
65
|
+
updatedAt: true,
|
|
66
|
+
category: true,
|
|
67
|
+
categoryId: true,
|
|
68
|
+
}).safeExtend({
|
|
69
|
+
categoryId: zod_1.default.string().nullable().optional(),
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* Zod schema for updating an existing menu category.
|
|
73
|
+
*
|
|
74
|
+
* All fields are optional (partial) except id.
|
|
75
|
+
*/
|
|
76
|
+
exports.UpdateMenuCategorySchema = exports.CreateMenuCategorySchema.partial().safeExtend({
|
|
77
|
+
id: zod_1.default.string(),
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Zod schema for updating an existing business menu item.
|
|
81
|
+
*
|
|
82
|
+
* All fields are optional (partial) except id.
|
|
83
|
+
*/
|
|
84
|
+
exports.UpdateBusinessMenuItemSchema = exports.CreateBusinessMenuItemSchema.partial().safeExtend({
|
|
85
|
+
id: zod_1.default.string(),
|
|
86
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Central export point for menu management schemas.
|
|
3
|
+
* @module business-mgt/menu-management
|
|
4
|
+
*/
|
|
5
|
+
export * from './menu-config.schema';
|
|
6
|
+
export * from './menu-item-variant.schema';
|
|
7
|
+
export * from './modifier.schema';
|
|
8
|
+
export * from './menu-catalog.schema';
|
|
9
|
+
export * from './menu-set.schema';
|
|
10
|
+
export * from './menu-pricing-rule.schema';
|
|
11
|
+
export * from './menu.order.schema';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Central export point for menu management schemas.
|
|
4
|
+
* @module business-mgt/menu-management
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
__exportStar(require("./menu-config.schema"), exports);
|
|
22
|
+
__exportStar(require("./menu-item-variant.schema"), exports);
|
|
23
|
+
__exportStar(require("./modifier.schema"), exports);
|
|
24
|
+
__exportStar(require("./menu-catalog.schema"), exports);
|
|
25
|
+
__exportStar(require("./menu-set.schema"), exports);
|
|
26
|
+
__exportStar(require("./menu-pricing-rule.schema"), exports);
|
|
27
|
+
__exportStar(require("./menu.order.schema"), exports);
|