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,402 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Floor plan section and table placement schema definitions.
|
|
4
|
+
* @module business-mgt/reservation-mgt/section
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Rendered table shape for floor plan layouts.
|
|
8
|
+
*
|
|
9
|
+
* @enum {string}
|
|
10
|
+
*/
|
|
11
|
+
export declare enum TableShape {
|
|
12
|
+
ROUND = "round",
|
|
13
|
+
SQUARE = "square",
|
|
14
|
+
BOOTH = "booth",
|
|
15
|
+
RECT = "rect",
|
|
16
|
+
CURVED = "curved",
|
|
17
|
+
HIGH_TOP = "high_top",
|
|
18
|
+
BAR = "bar"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Two-dimensional point schema.
|
|
22
|
+
* Uses the same coordinate system as table placement x/y values.
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Object} Point2D
|
|
25
|
+
* @property {number} x - Point x position
|
|
26
|
+
* @property {number} y - Point y position
|
|
27
|
+
*/
|
|
28
|
+
export declare const point2DSchema: z.ZodObject<{
|
|
29
|
+
x: z.ZodNumber;
|
|
30
|
+
y: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type Point2D = z.infer<typeof point2DSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* Section geometry schema.
|
|
35
|
+
* Supports automatic, rectangular, and polygon-based section boundaries.
|
|
36
|
+
*
|
|
37
|
+
* @typedef {Object} SectionGeometry
|
|
38
|
+
* @property {string} kind - Geometry mode
|
|
39
|
+
* @property {number} [x] - Rectangle x position
|
|
40
|
+
* @property {number} [y] - Rectangle y position
|
|
41
|
+
* @property {number} [width] - Rectangle width
|
|
42
|
+
* @property {number} [height] - Rectangle height
|
|
43
|
+
* @property {Point2D[]} [points] - Polygon vertices
|
|
44
|
+
* @property {number} [rotation] - Optional rotation in degrees
|
|
45
|
+
*/
|
|
46
|
+
export declare const SectionGeometrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"auto">;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
kind: z.ZodLiteral<"rect">;
|
|
50
|
+
x: z.ZodNumber;
|
|
51
|
+
y: z.ZodNumber;
|
|
52
|
+
width: z.ZodNumber;
|
|
53
|
+
height: z.ZodNumber;
|
|
54
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
kind: z.ZodLiteral<"polygon">;
|
|
57
|
+
points: z.ZodArray<z.ZodObject<{
|
|
58
|
+
x: z.ZodNumber;
|
|
59
|
+
y: z.ZodNumber;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, z.core.$strip>], "kind">;
|
|
63
|
+
export type SectionGeometry = z.infer<typeof SectionGeometrySchema>;
|
|
64
|
+
/**
|
|
65
|
+
* Table placement schema.
|
|
66
|
+
* Represents a physical table's position and seating constraints within a floor plan section.
|
|
67
|
+
*
|
|
68
|
+
* @typedef {Object} TablePlacement
|
|
69
|
+
* @property {string} tableResourceId - Table resource represented by this placement
|
|
70
|
+
* @property {string} floorPlanSectionId - Floor plan section containing the table
|
|
71
|
+
* @property {string} number - Human-readable table number
|
|
72
|
+
* @property {number} x - Table x position
|
|
73
|
+
* @property {number} y - Table y position
|
|
74
|
+
* @property {number} width - Table width
|
|
75
|
+
* @property {number} height - Table height
|
|
76
|
+
* @property {TableShape} shape - Rendered table shape
|
|
77
|
+
* @property {number} [rotation] - Optional rotation in degrees
|
|
78
|
+
* @property {number} minParty - Minimum supported party size
|
|
79
|
+
* @property {number} maxParty - Maximum supported party size
|
|
80
|
+
* @property {string[]} combinableWith - Table IDs that can be combined with this table
|
|
81
|
+
* @property {string} [serverSectionId] - Optional server section assignment
|
|
82
|
+
*/
|
|
83
|
+
export declare const TablePlacementSchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
tableResourceId: z.ZodString;
|
|
88
|
+
floorPlanSectionId: z.ZodString;
|
|
89
|
+
number: z.ZodString;
|
|
90
|
+
x: z.ZodNumber;
|
|
91
|
+
y: z.ZodNumber;
|
|
92
|
+
width: z.ZodNumber;
|
|
93
|
+
height: z.ZodNumber;
|
|
94
|
+
shape: z.ZodEnum<typeof TableShape>;
|
|
95
|
+
rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
96
|
+
minParty: z.ZodNumber;
|
|
97
|
+
maxParty: z.ZodNumber;
|
|
98
|
+
combinableWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
|
+
serverSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
/**
|
|
102
|
+
* Schema for creating a new table placement.
|
|
103
|
+
* Omits auto-generated fields.
|
|
104
|
+
*/
|
|
105
|
+
export declare const CreateTablePlacementSchema: z.ZodObject<{
|
|
106
|
+
number: z.ZodString;
|
|
107
|
+
width: z.ZodNumber;
|
|
108
|
+
height: z.ZodNumber;
|
|
109
|
+
floorPlanSectionId: z.ZodString;
|
|
110
|
+
x: z.ZodNumber;
|
|
111
|
+
y: z.ZodNumber;
|
|
112
|
+
rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
113
|
+
tableResourceId: z.ZodString;
|
|
114
|
+
shape: z.ZodEnum<typeof TableShape>;
|
|
115
|
+
minParty: z.ZodNumber;
|
|
116
|
+
maxParty: z.ZodNumber;
|
|
117
|
+
combinableWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
118
|
+
serverSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
/**
|
|
121
|
+
* Schema for updating an existing table placement.
|
|
122
|
+
* All fields optional except id.
|
|
123
|
+
*/
|
|
124
|
+
export declare const UpdateTablePlacementSchema: z.ZodObject<{
|
|
125
|
+
number: z.ZodOptional<z.ZodString>;
|
|
126
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
floorPlanSectionId: z.ZodOptional<z.ZodString>;
|
|
129
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
rotation: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
132
|
+
tableResourceId: z.ZodOptional<z.ZodString>;
|
|
133
|
+
shape: z.ZodOptional<z.ZodEnum<typeof TableShape>>;
|
|
134
|
+
minParty: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
maxParty: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
combinableWith: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
137
|
+
serverSectionId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
/**
|
|
141
|
+
* Section schema.
|
|
142
|
+
* Represents a named seating area within a floor plan, including its tables and boundary geometry.
|
|
143
|
+
*
|
|
144
|
+
* @typedef {Object} Section
|
|
145
|
+
* @property {string} locationId - Business location where the section applies
|
|
146
|
+
* @property {string} floorPlanId - Parent floor plan ID
|
|
147
|
+
* @property {string} name - Section name
|
|
148
|
+
* @property {number} capacity - Total seating capacity
|
|
149
|
+
* @property {string} color - Hex color used for rendering
|
|
150
|
+
* @property {boolean} isActive - Whether the section is active
|
|
151
|
+
* @property {number} sortOrder - Display order
|
|
152
|
+
* @property {TablePlacement[]} tables - Table placements in this section
|
|
153
|
+
* @property {SectionGeometry} [geometry] - Optional section boundary geometry
|
|
154
|
+
*/
|
|
155
|
+
export declare const SectionSchema: z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
locationId: z.ZodString;
|
|
160
|
+
floorPlanId: z.ZodString;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
capacity: z.ZodNumber;
|
|
163
|
+
color: z.ZodString;
|
|
164
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
165
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
166
|
+
tables: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
167
|
+
id: z.ZodString;
|
|
168
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
tableResourceId: z.ZodString;
|
|
171
|
+
floorPlanSectionId: z.ZodString;
|
|
172
|
+
number: z.ZodString;
|
|
173
|
+
x: z.ZodNumber;
|
|
174
|
+
y: z.ZodNumber;
|
|
175
|
+
width: z.ZodNumber;
|
|
176
|
+
height: z.ZodNumber;
|
|
177
|
+
shape: z.ZodEnum<typeof TableShape>;
|
|
178
|
+
rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
179
|
+
minParty: z.ZodNumber;
|
|
180
|
+
maxParty: z.ZodNumber;
|
|
181
|
+
combinableWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
182
|
+
serverSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
}, z.core.$strip>>>;
|
|
184
|
+
geometry: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
185
|
+
kind: z.ZodLiteral<"auto">;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
kind: z.ZodLiteral<"rect">;
|
|
188
|
+
x: z.ZodNumber;
|
|
189
|
+
y: z.ZodNumber;
|
|
190
|
+
width: z.ZodNumber;
|
|
191
|
+
height: z.ZodNumber;
|
|
192
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
+
kind: z.ZodLiteral<"polygon">;
|
|
195
|
+
points: z.ZodArray<z.ZodObject<{
|
|
196
|
+
x: z.ZodNumber;
|
|
197
|
+
y: z.ZodNumber;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
}, z.core.$strip>], "kind">>>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
/**
|
|
203
|
+
* Schema for creating a new floor plan section.
|
|
204
|
+
* Omits auto-generated fields.
|
|
205
|
+
*/
|
|
206
|
+
export declare const CreateSectionSchema: z.ZodObject<{
|
|
207
|
+
capacity: z.ZodNumber;
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
210
|
+
locationId: z.ZodString;
|
|
211
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
212
|
+
floorPlanId: z.ZodString;
|
|
213
|
+
color: z.ZodString;
|
|
214
|
+
tables: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
tableResourceId: z.ZodString;
|
|
219
|
+
floorPlanSectionId: z.ZodString;
|
|
220
|
+
number: z.ZodString;
|
|
221
|
+
x: z.ZodNumber;
|
|
222
|
+
y: z.ZodNumber;
|
|
223
|
+
width: z.ZodNumber;
|
|
224
|
+
height: z.ZodNumber;
|
|
225
|
+
shape: z.ZodEnum<typeof TableShape>;
|
|
226
|
+
rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
227
|
+
minParty: z.ZodNumber;
|
|
228
|
+
maxParty: z.ZodNumber;
|
|
229
|
+
combinableWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
230
|
+
serverSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
}, z.core.$strip>>>;
|
|
232
|
+
geometry: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
233
|
+
kind: z.ZodLiteral<"auto">;
|
|
234
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
235
|
+
kind: z.ZodLiteral<"rect">;
|
|
236
|
+
x: z.ZodNumber;
|
|
237
|
+
y: z.ZodNumber;
|
|
238
|
+
width: z.ZodNumber;
|
|
239
|
+
height: z.ZodNumber;
|
|
240
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
242
|
+
kind: z.ZodLiteral<"polygon">;
|
|
243
|
+
points: z.ZodArray<z.ZodObject<{
|
|
244
|
+
x: z.ZodNumber;
|
|
245
|
+
y: z.ZodNumber;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>], "kind">>>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
/**
|
|
251
|
+
* Schema for updating an existing floor plan section.
|
|
252
|
+
* All fields optional except id.
|
|
253
|
+
*/
|
|
254
|
+
export declare const UpdateSectionSchema: z.ZodObject<{
|
|
255
|
+
capacity: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
name: z.ZodOptional<z.ZodString>;
|
|
257
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
258
|
+
locationId: z.ZodOptional<z.ZodString>;
|
|
259
|
+
sortOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
260
|
+
floorPlanId: z.ZodOptional<z.ZodString>;
|
|
261
|
+
color: z.ZodOptional<z.ZodString>;
|
|
262
|
+
tables: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
263
|
+
id: z.ZodString;
|
|
264
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
tableResourceId: z.ZodString;
|
|
267
|
+
floorPlanSectionId: z.ZodString;
|
|
268
|
+
number: z.ZodString;
|
|
269
|
+
x: z.ZodNumber;
|
|
270
|
+
y: z.ZodNumber;
|
|
271
|
+
width: z.ZodNumber;
|
|
272
|
+
height: z.ZodNumber;
|
|
273
|
+
shape: z.ZodEnum<typeof TableShape>;
|
|
274
|
+
rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
275
|
+
minParty: z.ZodNumber;
|
|
276
|
+
maxParty: z.ZodNumber;
|
|
277
|
+
combinableWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
278
|
+
serverSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
279
|
+
}, z.core.$strip>>>>;
|
|
280
|
+
geometry: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
281
|
+
kind: z.ZodLiteral<"auto">;
|
|
282
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
283
|
+
kind: z.ZodLiteral<"rect">;
|
|
284
|
+
x: z.ZodNumber;
|
|
285
|
+
y: z.ZodNumber;
|
|
286
|
+
width: z.ZodNumber;
|
|
287
|
+
height: z.ZodNumber;
|
|
288
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
290
|
+
kind: z.ZodLiteral<"polygon">;
|
|
291
|
+
points: z.ZodArray<z.ZodObject<{
|
|
292
|
+
x: z.ZodNumber;
|
|
293
|
+
y: z.ZodNumber;
|
|
294
|
+
}, z.core.$strip>>;
|
|
295
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
}, z.core.$strip>], "kind">>>>;
|
|
297
|
+
id: z.ZodString;
|
|
298
|
+
}, z.core.$strip>;
|
|
299
|
+
export type TablePlacement = z.infer<typeof TablePlacementSchema>;
|
|
300
|
+
export type CreateTablePlacement = z.infer<typeof CreateTablePlacementSchema>;
|
|
301
|
+
export type UpdateTablePlacement = z.infer<typeof UpdateTablePlacementSchema>;
|
|
302
|
+
export type Section = z.infer<typeof SectionSchema>;
|
|
303
|
+
export type CreateSection = z.infer<typeof CreateSectionSchema>;
|
|
304
|
+
export type UpdateSection = z.infer<typeof UpdateSectionSchema>;
|
|
305
|
+
/**
|
|
306
|
+
* Floor plan section filter options.
|
|
307
|
+
* @interface SectionFilters
|
|
308
|
+
*/
|
|
309
|
+
export interface SectionFilters {
|
|
310
|
+
/** Filter by business location ID */
|
|
311
|
+
locationId?: string;
|
|
312
|
+
/** Filter by active status */
|
|
313
|
+
isActive?: boolean;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Floor plan section query options.
|
|
317
|
+
* @interface SectionQueryOptions
|
|
318
|
+
*/
|
|
319
|
+
export interface SectionQueryOptions {
|
|
320
|
+
/** Page number (1-indexed) */
|
|
321
|
+
page: number;
|
|
322
|
+
/** Items per page */
|
|
323
|
+
pageSize: number;
|
|
324
|
+
/** Optional filters */
|
|
325
|
+
filters?: SectionFilters;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Table placement with context schema.
|
|
329
|
+
* Returns a table placement together with its containing section.
|
|
330
|
+
*
|
|
331
|
+
* @typedef {Object} TablePlacementWithContext
|
|
332
|
+
* @property {TablePlacement} placement - Table placement
|
|
333
|
+
* @property {Section} section - Containing floor plan section
|
|
334
|
+
*/
|
|
335
|
+
export declare const TablePlacementWithContextSchema: z.ZodObject<{
|
|
336
|
+
placement: z.ZodObject<{
|
|
337
|
+
id: z.ZodString;
|
|
338
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
339
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
340
|
+
tableResourceId: z.ZodString;
|
|
341
|
+
floorPlanSectionId: z.ZodString;
|
|
342
|
+
number: z.ZodString;
|
|
343
|
+
x: z.ZodNumber;
|
|
344
|
+
y: z.ZodNumber;
|
|
345
|
+
width: z.ZodNumber;
|
|
346
|
+
height: z.ZodNumber;
|
|
347
|
+
shape: z.ZodEnum<typeof TableShape>;
|
|
348
|
+
rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
349
|
+
minParty: z.ZodNumber;
|
|
350
|
+
maxParty: z.ZodNumber;
|
|
351
|
+
combinableWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
352
|
+
serverSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
section: z.ZodObject<{
|
|
355
|
+
id: z.ZodString;
|
|
356
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
357
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
358
|
+
locationId: z.ZodString;
|
|
359
|
+
floorPlanId: z.ZodString;
|
|
360
|
+
name: z.ZodString;
|
|
361
|
+
capacity: z.ZodNumber;
|
|
362
|
+
color: z.ZodString;
|
|
363
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
364
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
365
|
+
tables: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
366
|
+
id: z.ZodString;
|
|
367
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
368
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
tableResourceId: z.ZodString;
|
|
370
|
+
floorPlanSectionId: z.ZodString;
|
|
371
|
+
number: z.ZodString;
|
|
372
|
+
x: z.ZodNumber;
|
|
373
|
+
y: z.ZodNumber;
|
|
374
|
+
width: z.ZodNumber;
|
|
375
|
+
height: z.ZodNumber;
|
|
376
|
+
shape: z.ZodEnum<typeof TableShape>;
|
|
377
|
+
rotation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
378
|
+
minParty: z.ZodNumber;
|
|
379
|
+
maxParty: z.ZodNumber;
|
|
380
|
+
combinableWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
381
|
+
serverSectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
382
|
+
}, z.core.$strip>>>;
|
|
383
|
+
geometry: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
384
|
+
kind: z.ZodLiteral<"auto">;
|
|
385
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
386
|
+
kind: z.ZodLiteral<"rect">;
|
|
387
|
+
x: z.ZodNumber;
|
|
388
|
+
y: z.ZodNumber;
|
|
389
|
+
width: z.ZodNumber;
|
|
390
|
+
height: z.ZodNumber;
|
|
391
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
392
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
393
|
+
kind: z.ZodLiteral<"polygon">;
|
|
394
|
+
points: z.ZodArray<z.ZodObject<{
|
|
395
|
+
x: z.ZodNumber;
|
|
396
|
+
y: z.ZodNumber;
|
|
397
|
+
}, z.core.$strip>>;
|
|
398
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
399
|
+
}, z.core.$strip>], "kind">>>;
|
|
400
|
+
}, z.core.$strip>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
export type TablePlacementWithContext = z.infer<typeof TablePlacementWithContextSchema>;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TablePlacementWithContextSchema = exports.UpdateSectionSchema = exports.CreateSectionSchema = exports.SectionSchema = exports.UpdateTablePlacementSchema = exports.CreateTablePlacementSchema = exports.TablePlacementSchema = exports.SectionGeometrySchema = exports.point2DSchema = exports.TableShape = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../../base.schema");
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Floor plan section and table placement schema definitions.
|
|
8
|
+
* @module business-mgt/reservation-mgt/section
|
|
9
|
+
*/
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// ENUMS
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Rendered table shape for floor plan layouts.
|
|
15
|
+
*
|
|
16
|
+
* @enum {string}
|
|
17
|
+
*/
|
|
18
|
+
var TableShape;
|
|
19
|
+
(function (TableShape) {
|
|
20
|
+
TableShape["ROUND"] = "round";
|
|
21
|
+
TableShape["SQUARE"] = "square";
|
|
22
|
+
TableShape["BOOTH"] = "booth";
|
|
23
|
+
TableShape["RECT"] = "rect";
|
|
24
|
+
TableShape["CURVED"] = "curved";
|
|
25
|
+
TableShape["HIGH_TOP"] = "high_top";
|
|
26
|
+
TableShape["BAR"] = "bar";
|
|
27
|
+
})(TableShape || (exports.TableShape = TableShape = {}));
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// GEOMETRY SCHEMAS
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Two-dimensional point schema.
|
|
33
|
+
* Uses the same coordinate system as table placement x/y values.
|
|
34
|
+
*
|
|
35
|
+
* @typedef {Object} Point2D
|
|
36
|
+
* @property {number} x - Point x position
|
|
37
|
+
* @property {number} y - Point y position
|
|
38
|
+
*/
|
|
39
|
+
exports.point2DSchema = zod_1.z.object({
|
|
40
|
+
x: zod_1.z.number().describe("Point x position in floor plan coordinate space."),
|
|
41
|
+
y: zod_1.z.number().describe("Point y position in floor plan coordinate space."),
|
|
42
|
+
}).describe("Two-dimensional point in floor plan coordinate space");
|
|
43
|
+
/**
|
|
44
|
+
* Section geometry schema.
|
|
45
|
+
* Supports automatic, rectangular, and polygon-based section boundaries.
|
|
46
|
+
*
|
|
47
|
+
* @typedef {Object} SectionGeometry
|
|
48
|
+
* @property {string} kind - Geometry mode
|
|
49
|
+
* @property {number} [x] - Rectangle x position
|
|
50
|
+
* @property {number} [y] - Rectangle y position
|
|
51
|
+
* @property {number} [width] - Rectangle width
|
|
52
|
+
* @property {number} [height] - Rectangle height
|
|
53
|
+
* @property {Point2D[]} [points] - Polygon vertices
|
|
54
|
+
* @property {number} [rotation] - Optional rotation in degrees
|
|
55
|
+
*/
|
|
56
|
+
exports.SectionGeometrySchema = zod_1.z.discriminatedUnion("kind", [
|
|
57
|
+
zod_1.z.object({
|
|
58
|
+
kind: zod_1.z.literal("auto").describe("Automatically derive the section geometry from its table placements."),
|
|
59
|
+
}),
|
|
60
|
+
zod_1.z.object({
|
|
61
|
+
kind: zod_1.z.literal("rect"),
|
|
62
|
+
x: zod_1.z.number().describe("Rectangle x position in floor plan coordinate space."),
|
|
63
|
+
y: zod_1.z.number().describe("Rectangle y position in floor plan coordinate space."),
|
|
64
|
+
width: zod_1.z.number().positive().describe("Rectangle width in floor plan coordinate units."),
|
|
65
|
+
height: zod_1.z.number().positive().describe("Rectangle height in floor plan coordinate units."),
|
|
66
|
+
rotation: zod_1.z.number().min(-360).max(360).optional().describe("Optional rectangle rotation in degrees."),
|
|
67
|
+
}),
|
|
68
|
+
zod_1.z.object({
|
|
69
|
+
kind: zod_1.z.literal("polygon"),
|
|
70
|
+
points: zod_1.z.array(exports.point2DSchema).min(3).max(64).describe("Polygon vertices in floor plan coordinate space."),
|
|
71
|
+
rotation: zod_1.z.number().min(-360).max(360).optional().describe("Optional polygon rotation in degrees."),
|
|
72
|
+
}),
|
|
73
|
+
]);
|
|
74
|
+
// ============================================================================
|
|
75
|
+
// TABLE PLACEMENT SCHEMA
|
|
76
|
+
// ============================================================================
|
|
77
|
+
/**
|
|
78
|
+
* Table placement schema.
|
|
79
|
+
* Represents a physical table's position and seating constraints within a floor plan section.
|
|
80
|
+
*
|
|
81
|
+
* @typedef {Object} TablePlacement
|
|
82
|
+
* @property {string} tableResourceId - Table resource represented by this placement
|
|
83
|
+
* @property {string} floorPlanSectionId - Floor plan section containing the table
|
|
84
|
+
* @property {string} number - Human-readable table number
|
|
85
|
+
* @property {number} x - Table x position
|
|
86
|
+
* @property {number} y - Table y position
|
|
87
|
+
* @property {number} width - Table width
|
|
88
|
+
* @property {number} height - Table height
|
|
89
|
+
* @property {TableShape} shape - Rendered table shape
|
|
90
|
+
* @property {number} [rotation] - Optional rotation in degrees
|
|
91
|
+
* @property {number} minParty - Minimum supported party size
|
|
92
|
+
* @property {number} maxParty - Maximum supported party size
|
|
93
|
+
* @property {string[]} combinableWith - Table IDs that can be combined with this table
|
|
94
|
+
* @property {string} [serverSectionId] - Optional server section assignment
|
|
95
|
+
*/
|
|
96
|
+
exports.TablePlacementSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
97
|
+
tableResourceId: zod_1.z.string().describe("Table resource ID represented by this floor plan placement."),
|
|
98
|
+
floorPlanSectionId: zod_1.z.string().describe("Floor plan section ID that groups this table placement."),
|
|
99
|
+
number: zod_1.z.string().describe("Human-readable table number shown on the floor plan."),
|
|
100
|
+
x: zod_1.z.number().describe("Table x position in layout coordinate space."),
|
|
101
|
+
y: zod_1.z.number().describe("Table y position in layout coordinate space."),
|
|
102
|
+
width: zod_1.z.number().positive().describe("Table width in layout units."),
|
|
103
|
+
height: zod_1.z.number().positive().describe("Table height in layout units."),
|
|
104
|
+
shape: zod_1.z.enum(TableShape).describe("Rendered table shape."),
|
|
105
|
+
rotation: zod_1.z.number().nullable().optional().describe("Optional table rotation in degrees."),
|
|
106
|
+
minParty: zod_1.z.number().int().positive().describe("Minimum party size supported by this table."),
|
|
107
|
+
maxParty: zod_1.z.number().int().positive().describe("Maximum party size supported by this table."),
|
|
108
|
+
combinableWith: zod_1.z.array(zod_1.z.string()).default([]).describe("Table resource IDs that can be combined with this table."),
|
|
109
|
+
serverSectionId: zod_1.z.string().nullable().optional().describe("Optional server section assignment for operations."),
|
|
110
|
+
}).superRefine((data, ctx) => {
|
|
111
|
+
if (data.maxParty < data.minParty) {
|
|
112
|
+
ctx.addIssue({
|
|
113
|
+
code: "custom",
|
|
114
|
+
path: ["maxParty"],
|
|
115
|
+
message: "maxParty must be greater than or equal to minParty",
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (data.combinableWith.includes(data.tableResourceId)) {
|
|
119
|
+
ctx.addIssue({
|
|
120
|
+
code: "custom",
|
|
121
|
+
path: ["combinableWith"],
|
|
122
|
+
message: "combinableWith cannot include the table itself",
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
/**
|
|
127
|
+
* Schema for creating a new table placement.
|
|
128
|
+
* Omits auto-generated fields.
|
|
129
|
+
*/
|
|
130
|
+
exports.CreateTablePlacementSchema = exports.TablePlacementSchema.omit({
|
|
131
|
+
id: true,
|
|
132
|
+
createdAt: true,
|
|
133
|
+
updatedAt: true,
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Schema for updating an existing table placement.
|
|
137
|
+
* All fields optional except id.
|
|
138
|
+
*/
|
|
139
|
+
exports.UpdateTablePlacementSchema = exports.CreateTablePlacementSchema.partial().safeExtend({
|
|
140
|
+
id: zod_1.z.string().describe("Unique identifier of the table placement to update."),
|
|
141
|
+
});
|
|
142
|
+
// ============================================================================
|
|
143
|
+
// SECTION SCHEMA
|
|
144
|
+
// ============================================================================
|
|
145
|
+
/**
|
|
146
|
+
* Section schema.
|
|
147
|
+
* Represents a named seating area within a floor plan, including its tables and boundary geometry.
|
|
148
|
+
*
|
|
149
|
+
* @typedef {Object} Section
|
|
150
|
+
* @property {string} locationId - Business location where the section applies
|
|
151
|
+
* @property {string} floorPlanId - Parent floor plan ID
|
|
152
|
+
* @property {string} name - Section name
|
|
153
|
+
* @property {number} capacity - Total seating capacity
|
|
154
|
+
* @property {string} color - Hex color used for rendering
|
|
155
|
+
* @property {boolean} isActive - Whether the section is active
|
|
156
|
+
* @property {number} sortOrder - Display order
|
|
157
|
+
* @property {TablePlacement[]} tables - Table placements in this section
|
|
158
|
+
* @property {SectionGeometry} [geometry] - Optional section boundary geometry
|
|
159
|
+
*/
|
|
160
|
+
exports.SectionSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
161
|
+
locationId: zod_1.z.string().describe("Business location ID where this floor plan section applies."),
|
|
162
|
+
floorPlanId: zod_1.z.string().describe("Parent floor plan ID that owns this section."),
|
|
163
|
+
name: zod_1.z.string().min(1).describe("Section name (e.g., Patio, Main Dining, Bar)."),
|
|
164
|
+
capacity: zod_1.z.number().int().positive().describe("Total seating capacity of the section."),
|
|
165
|
+
color: zod_1.z.string().regex(/^#[0-9A-Fa-f]{6}$/).describe("Hex color used when rendering this section on the floor plan."),
|
|
166
|
+
isActive: zod_1.z.boolean().default(true).describe("Whether this section is currently active and bookable."),
|
|
167
|
+
sortOrder: zod_1.z.number().int().nonnegative().default(0).describe("Display order for section lists and floor plan controls."),
|
|
168
|
+
tables: zod_1.z.array(exports.TablePlacementSchema).default([]).describe("Table placements contained in this section."),
|
|
169
|
+
geometry: exports.SectionGeometrySchema.nullable().optional().describe("Optional boundary geometry for rendering this floor plan section."),
|
|
170
|
+
});
|
|
171
|
+
/**
|
|
172
|
+
* Schema for creating a new floor plan section.
|
|
173
|
+
* Omits auto-generated fields.
|
|
174
|
+
*/
|
|
175
|
+
exports.CreateSectionSchema = exports.SectionSchema.omit({
|
|
176
|
+
id: true,
|
|
177
|
+
createdAt: true,
|
|
178
|
+
updatedAt: true,
|
|
179
|
+
});
|
|
180
|
+
/**
|
|
181
|
+
* Schema for updating an existing floor plan section.
|
|
182
|
+
* All fields optional except id.
|
|
183
|
+
*/
|
|
184
|
+
exports.UpdateSectionSchema = exports.CreateSectionSchema.partial().safeExtend({
|
|
185
|
+
id: zod_1.z.string().describe("Unique identifier of the floor plan section to update."),
|
|
186
|
+
});
|
|
187
|
+
/**
|
|
188
|
+
* Table placement with context schema.
|
|
189
|
+
* Returns a table placement together with its containing section.
|
|
190
|
+
*
|
|
191
|
+
* @typedef {Object} TablePlacementWithContext
|
|
192
|
+
* @property {TablePlacement} placement - Table placement
|
|
193
|
+
* @property {Section} section - Containing floor plan section
|
|
194
|
+
*/
|
|
195
|
+
exports.TablePlacementWithContextSchema = zod_1.z.object({
|
|
196
|
+
placement: exports.TablePlacementSchema,
|
|
197
|
+
section: exports.SectionSchema,
|
|
198
|
+
}).describe("Table placement with containing floor plan section context");
|