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,322 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReservationSlotQueryResponseSchema = exports.RentalReservationSlotQueryResponseSchema = exports.RoomReservationSlotQueryResponseSchema = exports.TableReservationSlotQueryResponseSchema = exports.RentalCandidateSlotSchema = exports.RoomCandidateSlotSchema = exports.ReservationCandidateSlotSchema = exports.ReservationSlotQueryRequestSchema = exports.RentalReservationSlotQueryRequestSchema = exports.RoomReservationSlotQueryRequestSchema = exports.TableReservationSlotQueryRequestSchema = exports.ReservationSlotResourceTypeSchema = exports.ReservationTimeOfDayValueSchema = exports.ReservationLocalDateSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const type_definitions_1 = require("../../type-definitions");
|
|
6
|
+
const reservation_room_schema_1 = require("./reservation-room.schema");
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Reservation slot query request and response schemas.
|
|
9
|
+
* @module business-mgt/reservation-mgt/slot-query
|
|
10
|
+
*/
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// SCALAR SCHEMAS
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Reservation local date schema.
|
|
16
|
+
* Validates business-local dates in YYYY-MM-DD format.
|
|
17
|
+
*
|
|
18
|
+
* @typedef {string} ReservationLocalDate
|
|
19
|
+
*/
|
|
20
|
+
exports.ReservationLocalDateSchema = zod_1.z
|
|
21
|
+
.string()
|
|
22
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, "localDate must be YYYY-MM-DD");
|
|
23
|
+
/**
|
|
24
|
+
* Reservation time-of-day value schema.
|
|
25
|
+
* Validates human-readable 12-hour local times such as "9:30 AM".
|
|
26
|
+
*
|
|
27
|
+
* @typedef {string} ReservationTimeOfDayValue
|
|
28
|
+
*/
|
|
29
|
+
exports.ReservationTimeOfDayValueSchema = zod_1.z
|
|
30
|
+
.string()
|
|
31
|
+
.regex(/^(0?[1-9]|1[0-2]):[0-5]\d\s?(AM|PM)$/i, "startTimeOfDay must be h:mm AM/PM");
|
|
32
|
+
/**
|
|
33
|
+
* Reservation slot resource type schema.
|
|
34
|
+
* Restricts slot queries to supported reservation resource types.
|
|
35
|
+
*
|
|
36
|
+
* @typedef {ResourceType} ReservationSlotResourceType
|
|
37
|
+
*/
|
|
38
|
+
exports.ReservationSlotResourceTypeSchema = zod_1.z.union([
|
|
39
|
+
zod_1.z.literal(type_definitions_1.ResourceType.TABLE),
|
|
40
|
+
zod_1.z.literal(type_definitions_1.ResourceType.ROOM),
|
|
41
|
+
zod_1.z.literal(type_definitions_1.ResourceType.RENTAL),
|
|
42
|
+
]);
|
|
43
|
+
const ReservationSlotQueryRequestBaseSchema = zod_1.z.object({
|
|
44
|
+
locationId: zod_1.z.string().nullable().optional().describe("Optional business location ID used to scope slot generation."),
|
|
45
|
+
resourceId: zod_1.z.string().nullable().optional().describe("Optional resource or category ID used to scope slot generation."),
|
|
46
|
+
localDate: exports.ReservationLocalDateSchema.describe("Business-local date to generate slots for."),
|
|
47
|
+
maxResults: zod_1.z.number().int().positive().max(1000).default(20).describe("Maximum number of slots returned by the query."),
|
|
48
|
+
});
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// REQUEST SCHEMAS
|
|
51
|
+
// ============================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Table reservation slot query request schema.
|
|
54
|
+
* Requests candidate table reservation slots for a business-local date.
|
|
55
|
+
*
|
|
56
|
+
* @typedef {Object} TableReservationSlotQueryRequest
|
|
57
|
+
* @property {ResourceType} resourceType - Table resource type discriminator
|
|
58
|
+
* @property {string} [locationId] - Business location used to scope slot generation
|
|
59
|
+
* @property {string} [resourceId] - Resource or category used to scope slot generation
|
|
60
|
+
* @property {string} localDate - Business-local date to generate slots for
|
|
61
|
+
* @property {number} maxResults - Maximum number of slots returned
|
|
62
|
+
* @property {number} partySize - Number of guests in the party
|
|
63
|
+
* @property {string} [floorPlanId] - Floor plan used to scope table slots
|
|
64
|
+
* @property {string} [floorPlanSectionId] - Preferred floor plan section
|
|
65
|
+
*/
|
|
66
|
+
exports.TableReservationSlotQueryRequestSchema = ReservationSlotQueryRequestBaseSchema.extend({
|
|
67
|
+
resourceType: zod_1.z.literal(type_definitions_1.ResourceType.TABLE),
|
|
68
|
+
partySize: zod_1.z.number().int().positive().describe("Number of guests in the table reservation party."),
|
|
69
|
+
floorPlanId: zod_1.z.string().nullable().optional().describe("Optional floor plan ID used to scope table slot generation."),
|
|
70
|
+
floorPlanSectionId: zod_1.z.string().nullable().optional().describe("Optional floor plan section ID used as a table preference."),
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Room reservation slot query request schema.
|
|
74
|
+
* Requests candidate room stay slots for a business-local check-in date.
|
|
75
|
+
*
|
|
76
|
+
* @typedef {Object} RoomReservationSlotQueryRequest
|
|
77
|
+
* @property {ResourceType} resourceType - Room resource type discriminator
|
|
78
|
+
* @property {string} [locationId] - Business location used to scope slot generation
|
|
79
|
+
* @property {string} [resourceId] - Resource or category used to scope slot generation
|
|
80
|
+
* @property {string} localDate - Business-local check-in date
|
|
81
|
+
* @property {number} maxResults - Maximum number of slots returned
|
|
82
|
+
* @property {number} nights - Requested stay length in nights
|
|
83
|
+
* @property {number} [occupancy] - Requested room occupancy
|
|
84
|
+
*/
|
|
85
|
+
exports.RoomReservationSlotQueryRequestSchema = ReservationSlotQueryRequestBaseSchema.extend({
|
|
86
|
+
resourceType: zod_1.z.literal(type_definitions_1.ResourceType.ROOM),
|
|
87
|
+
nights: zod_1.z.number().int().positive().default(1).describe("Requested stay length in nights."),
|
|
88
|
+
occupancy: zod_1.z.number().int().positive().nullable().optional().describe("Requested room occupancy."),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Rental reservation slot query request schema.
|
|
92
|
+
* Requests candidate rental slots for intra-day or multi-day rental periods.
|
|
93
|
+
*
|
|
94
|
+
* @typedef {Object} RentalReservationSlotQueryRequest
|
|
95
|
+
* @property {ResourceType} resourceType - Rental resource type discriminator
|
|
96
|
+
* @property {string} [locationId] - Business location used to scope slot generation
|
|
97
|
+
* @property {string} [resourceId] - Resource or category used to scope slot generation
|
|
98
|
+
* @property {string} localDate - Business-local pickup date
|
|
99
|
+
* @property {number} maxResults - Maximum number of slots returned
|
|
100
|
+
* @property {string} [returnDate] - Return date for multi-day rentals
|
|
101
|
+
* @property {string} [tierId] - Requested rental tier ID
|
|
102
|
+
* @property {number} [durationMinutes] - Requested intra-day duration in minutes
|
|
103
|
+
*/
|
|
104
|
+
exports.RentalReservationSlotQueryRequestSchema = ReservationSlotQueryRequestBaseSchema.extend({
|
|
105
|
+
resourceType: zod_1.z.literal(type_definitions_1.ResourceType.RENTAL),
|
|
106
|
+
returnDate: exports.ReservationLocalDateSchema.nullable().optional().describe("Return date in YYYY-MM-DD format. Omit for intra-day rentals that use durationMinutes."),
|
|
107
|
+
tierId: zod_1.z.string().nullable().optional().describe("Requested rental tier ID from ReservationSettings."),
|
|
108
|
+
durationMinutes: zod_1.z.number().int().positive().nullable().optional().describe("Requested intra-day rental duration in minutes."),
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* Reservation slot query request schema.
|
|
112
|
+
* Discriminated union of supported slot query request types.
|
|
113
|
+
*
|
|
114
|
+
* @typedef {TableReservationSlotQueryRequest|RoomReservationSlotQueryRequest|RentalReservationSlotQueryRequest} ReservationSlotQueryRequest
|
|
115
|
+
*/
|
|
116
|
+
exports.ReservationSlotQueryRequestSchema = zod_1.z.discriminatedUnion("resourceType", [
|
|
117
|
+
exports.TableReservationSlotQueryRequestSchema,
|
|
118
|
+
exports.RoomReservationSlotQueryRequestSchema,
|
|
119
|
+
exports.RentalReservationSlotQueryRequestSchema,
|
|
120
|
+
]);
|
|
121
|
+
// ============================================================================
|
|
122
|
+
// CANDIDATE SLOT SCHEMAS
|
|
123
|
+
// ============================================================================
|
|
124
|
+
/**
|
|
125
|
+
* Reservation candidate slot schema.
|
|
126
|
+
* Shared time-of-day window model for table availability candidates.
|
|
127
|
+
*
|
|
128
|
+
* @typedef {Object} ReservationCandidateSlot
|
|
129
|
+
* @property {string} resourceId - Resource category or type ID
|
|
130
|
+
* @property {string} startTimeOfDay - Local start time
|
|
131
|
+
* @property {number} startMinuteOfDay - Local start minute of day
|
|
132
|
+
* @property {number} endMinuteOfDay - Local end minute of day
|
|
133
|
+
* @property {number} startTimeUtcSec - Slot start timestamp in UTC seconds
|
|
134
|
+
* @property {number} endTimeUtcSec - Slot end timestamp in UTC seconds
|
|
135
|
+
* @property {boolean} isAvailable - Whether the slot can be booked
|
|
136
|
+
* @property {number} [capacityRemaining] - Remaining capacity for the slot
|
|
137
|
+
* @property {number} [priceQuote] - Quoted price before final checkout
|
|
138
|
+
*/
|
|
139
|
+
exports.ReservationCandidateSlotSchema = zod_1.z.object({
|
|
140
|
+
resourceId: zod_1.z.string().describe("Resource category or type ID represented by this candidate slot."),
|
|
141
|
+
startTimeOfDay: exports.ReservationTimeOfDayValueSchema.describe("Local start time in h:mm AM/PM format."),
|
|
142
|
+
startMinuteOfDay: zod_1.z.number().int().min(0).max(1439).describe("Local start minute within the business day."),
|
|
143
|
+
endMinuteOfDay: zod_1.z.number().int().min(1).max(1440).describe("Local end minute within the business day."),
|
|
144
|
+
startTimeUtcSec: zod_1.z.number().describe("Slot start timestamp in UTC seconds."),
|
|
145
|
+
endTimeUtcSec: zod_1.z.number().describe("Slot end timestamp in UTC seconds."),
|
|
146
|
+
isAvailable: zod_1.z.boolean().default(true).describe("Whether this slot can currently be booked."),
|
|
147
|
+
capacityRemaining: zod_1.z.number().int().nonnegative().nullable().optional().describe("Optional remaining capacity for capacity-based reservation modes."),
|
|
148
|
+
priceQuote: zod_1.z.number().nonnegative().nullable().optional().describe("Optional quoted price for the slot before final checkout."),
|
|
149
|
+
}).superRefine((slot, ctx) => {
|
|
150
|
+
if (slot.endMinuteOfDay <= slot.startMinuteOfDay) {
|
|
151
|
+
ctx.addIssue({
|
|
152
|
+
code: "custom",
|
|
153
|
+
path: ["endMinuteOfDay"],
|
|
154
|
+
message: "endMinuteOfDay must be greater than startMinuteOfDay",
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
if (slot.endTimeUtcSec <= slot.startTimeUtcSec) {
|
|
158
|
+
ctx.addIssue({
|
|
159
|
+
code: "custom",
|
|
160
|
+
path: ["endTimeUtcSec"],
|
|
161
|
+
message: "endTimeUtcSec must be greater than startTimeUtcSec",
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* Room candidate slot schema.
|
|
167
|
+
* Date-range model for room availability candidates measured in nights.
|
|
168
|
+
*
|
|
169
|
+
* @typedef {Object} RoomCandidateSlot
|
|
170
|
+
* @property {string} resourceId - Room resource or category ID
|
|
171
|
+
* @property {string} checkInDate - Check-in date
|
|
172
|
+
* @property {string} checkOutDate - Check-out date
|
|
173
|
+
* @property {number} nights - Number of nights
|
|
174
|
+
* @property {number} [occupancy] - Maximum guests supported
|
|
175
|
+
* @property {number} roomsAvailable - Rooms still bookable
|
|
176
|
+
* @property {RoomRatePerNight[]} ratePerNight - Per-date nightly rates
|
|
177
|
+
* @property {number} totalWithTax - Total including tax
|
|
178
|
+
* @property {boolean} isAvailable - Whether the slot can be booked
|
|
179
|
+
*/
|
|
180
|
+
exports.RoomCandidateSlotSchema = zod_1.z.object({
|
|
181
|
+
resourceId: zod_1.z.string().describe("Room type or category ID represented by this candidate slot."),
|
|
182
|
+
checkInDate: exports.ReservationLocalDateSchema.describe("Check-in date in YYYY-MM-DD format."),
|
|
183
|
+
checkOutDate: exports.ReservationLocalDateSchema.describe("Check-out date in YYYY-MM-DD format."),
|
|
184
|
+
nights: zod_1.z.number().int().positive().describe("Number of nights in the candidate stay."),
|
|
185
|
+
occupancy: zod_1.z.number().int().positive().nullable().optional().describe("Maximum guests supported by this room type."),
|
|
186
|
+
roomsAvailable: zod_1.z.number().int().nonnegative().describe("Number of rooms still bookable for the requested dates."),
|
|
187
|
+
ratePerNight: zod_1.z.array(reservation_room_schema_1.RoomRatePerNightSchema).default([]).describe("Per-date nightly rates used to quote this stay."),
|
|
188
|
+
totalWithTax: zod_1.z.number().nonnegative().describe("Pre-computed total including tax."),
|
|
189
|
+
isAvailable: zod_1.z.boolean().default(true).describe("Whether this room slot can currently be booked."),
|
|
190
|
+
}).superRefine((slot, ctx) => {
|
|
191
|
+
if (slot.checkOutDate <= slot.checkInDate) {
|
|
192
|
+
ctx.addIssue({
|
|
193
|
+
code: "custom",
|
|
194
|
+
path: ["checkOutDate"],
|
|
195
|
+
message: "checkOutDate must be after checkInDate",
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
/**
|
|
200
|
+
* Rental candidate slot schema.
|
|
201
|
+
* Hybrid model supporting both intra-day time windows and multi-day date ranges.
|
|
202
|
+
*
|
|
203
|
+
* @typedef {Object} RentalCandidateSlot
|
|
204
|
+
* @property {string} resourceId - Rental resource or category ID
|
|
205
|
+
* @property {string} pickupDate - Pickup date
|
|
206
|
+
* @property {string} returnDate - Return date
|
|
207
|
+
* @property {string} [pickupTimeOfDay] - Pickup time for intra-day rentals
|
|
208
|
+
* @property {string} [returnTimeOfDay] - Return time for intra-day rentals
|
|
209
|
+
* @property {number} [durationMinutes] - Intra-day duration in minutes
|
|
210
|
+
* @property {number} startTimeUtcSec - Pickup timestamp in UTC seconds
|
|
211
|
+
* @property {number} endTimeUtcSec - Return timestamp in UTC seconds
|
|
212
|
+
* @property {number} unitsAvailable - Units still available
|
|
213
|
+
* @property {number} totalWithTax - Total including tax
|
|
214
|
+
* @property {number} [priceQuote] - Quoted price before tax
|
|
215
|
+
* @property {boolean} isAvailable - Whether the slot can be booked
|
|
216
|
+
*/
|
|
217
|
+
exports.RentalCandidateSlotSchema = zod_1.z.object({
|
|
218
|
+
resourceId: zod_1.z.string().describe("Rental resource type or category ID represented by this candidate slot."),
|
|
219
|
+
pickupDate: exports.ReservationLocalDateSchema.describe("Pickup date in YYYY-MM-DD format."),
|
|
220
|
+
returnDate: exports.ReservationLocalDateSchema.describe("Return date in YYYY-MM-DD format. Same as pickupDate for intra-day rentals."),
|
|
221
|
+
pickupTimeOfDay: exports.ReservationTimeOfDayValueSchema.nullable().optional().describe("Pickup time of day for intra-day rentals."),
|
|
222
|
+
returnTimeOfDay: exports.ReservationTimeOfDayValueSchema.nullable().optional().describe("Return time of day for intra-day rentals."),
|
|
223
|
+
durationMinutes: zod_1.z.number().int().positive().nullable().optional().describe("Duration in minutes for intra-day rentals."),
|
|
224
|
+
startTimeUtcSec: zod_1.z.number().describe("Pickup timestamp in UTC seconds."),
|
|
225
|
+
endTimeUtcSec: zod_1.z.number().describe("Return timestamp in UTC seconds."),
|
|
226
|
+
unitsAvailable: zod_1.z.number().int().nonnegative().describe("Number of rental units still available for the requested period."),
|
|
227
|
+
totalWithTax: zod_1.z.number().nonnegative().describe("Pre-computed total including tax."),
|
|
228
|
+
priceQuote: zod_1.z.number().nonnegative().nullable().optional().describe("Quoted price before tax."),
|
|
229
|
+
isAvailable: zod_1.z.boolean().default(true).describe("Whether this rental slot can currently be booked."),
|
|
230
|
+
}).superRefine((slot, ctx) => {
|
|
231
|
+
if (slot.returnDate < slot.pickupDate) {
|
|
232
|
+
ctx.addIssue({
|
|
233
|
+
code: "custom",
|
|
234
|
+
path: ["returnDate"],
|
|
235
|
+
message: "returnDate must be on or after pickupDate",
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
if (slot.endTimeUtcSec <= slot.startTimeUtcSec) {
|
|
239
|
+
ctx.addIssue({
|
|
240
|
+
code: "custom",
|
|
241
|
+
path: ["endTimeUtcSec"],
|
|
242
|
+
message: "endTimeUtcSec must be greater than startTimeUtcSec",
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
const hasPickupTime = slot.pickupTimeOfDay != null;
|
|
246
|
+
const hasReturnTime = slot.returnTimeOfDay != null;
|
|
247
|
+
if (hasPickupTime !== hasReturnTime) {
|
|
248
|
+
ctx.addIssue({
|
|
249
|
+
code: "custom",
|
|
250
|
+
path: ["returnTimeOfDay"],
|
|
251
|
+
message: "pickupTimeOfDay and returnTimeOfDay must both be present or both absent",
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
// ============================================================================
|
|
256
|
+
// RESPONSE SCHEMAS
|
|
257
|
+
// ============================================================================
|
|
258
|
+
/**
|
|
259
|
+
* Table reservation slot query response schema.
|
|
260
|
+
* Returns generated table slot candidates for the requested date.
|
|
261
|
+
*
|
|
262
|
+
* @typedef {Object} TableReservationSlotQueryResponse
|
|
263
|
+
* @property {ResourceType} resourceType - Table resource type discriminator
|
|
264
|
+
* @property {string} localDate - Requested business-local date
|
|
265
|
+
* @property {number} generatedAt - Generation timestamp in UTC seconds
|
|
266
|
+
* @property {ReservationCandidateSlot[]} slots - Candidate table slots
|
|
267
|
+
*/
|
|
268
|
+
exports.TableReservationSlotQueryResponseSchema = zod_1.z.object({
|
|
269
|
+
resourceType: zod_1.z.literal(type_definitions_1.ResourceType.TABLE),
|
|
270
|
+
localDate: exports.ReservationLocalDateSchema,
|
|
271
|
+
generatedAt: zod_1.z.number().describe("Generation timestamp in UTC seconds."),
|
|
272
|
+
slots: zod_1.z.array(exports.ReservationCandidateSlotSchema).describe("Available candidate table slots."),
|
|
273
|
+
});
|
|
274
|
+
/**
|
|
275
|
+
* Room reservation slot query response schema.
|
|
276
|
+
* Returns generated room slot candidates for the requested stay.
|
|
277
|
+
*
|
|
278
|
+
* @typedef {Object} RoomReservationSlotQueryResponse
|
|
279
|
+
* @property {ResourceType} resourceType - Room resource type discriminator
|
|
280
|
+
* @property {string} checkInDate - Requested check-in date
|
|
281
|
+
* @property {string} checkOutDate - Requested check-out date
|
|
282
|
+
* @property {number} nights - Requested number of nights
|
|
283
|
+
* @property {number} generatedAt - Generation timestamp in UTC seconds
|
|
284
|
+
* @property {RoomCandidateSlot[]} slots - Candidate room slots
|
|
285
|
+
*/
|
|
286
|
+
exports.RoomReservationSlotQueryResponseSchema = zod_1.z.object({
|
|
287
|
+
resourceType: zod_1.z.literal(type_definitions_1.ResourceType.ROOM),
|
|
288
|
+
checkInDate: exports.ReservationLocalDateSchema.describe("Requested check-in date."),
|
|
289
|
+
checkOutDate: exports.ReservationLocalDateSchema.describe("Requested check-out date."),
|
|
290
|
+
nights: zod_1.z.number().int().positive().describe("Requested number of nights."),
|
|
291
|
+
generatedAt: zod_1.z.number().describe("Generation timestamp in UTC seconds."),
|
|
292
|
+
slots: zod_1.z.array(exports.RoomCandidateSlotSchema).describe("Available candidate room slots."),
|
|
293
|
+
});
|
|
294
|
+
/**
|
|
295
|
+
* Rental reservation slot query response schema.
|
|
296
|
+
* Returns generated rental slot candidates for the requested period.
|
|
297
|
+
*
|
|
298
|
+
* @typedef {Object} RentalReservationSlotQueryResponse
|
|
299
|
+
* @property {ResourceType} resourceType - Rental resource type discriminator
|
|
300
|
+
* @property {string} pickupDate - Requested pickup date
|
|
301
|
+
* @property {string} returnDate - Requested return date
|
|
302
|
+
* @property {number} generatedAt - Generation timestamp in UTC seconds
|
|
303
|
+
* @property {RentalCandidateSlot[]} slots - Candidate rental slots
|
|
304
|
+
*/
|
|
305
|
+
exports.RentalReservationSlotQueryResponseSchema = zod_1.z.object({
|
|
306
|
+
resourceType: zod_1.z.literal(type_definitions_1.ResourceType.RENTAL),
|
|
307
|
+
pickupDate: exports.ReservationLocalDateSchema.describe("Requested pickup date."),
|
|
308
|
+
returnDate: exports.ReservationLocalDateSchema.describe("Requested return date."),
|
|
309
|
+
generatedAt: zod_1.z.number().describe("Generation timestamp in UTC seconds."),
|
|
310
|
+
slots: zod_1.z.array(exports.RentalCandidateSlotSchema).describe("Available candidate rental slots."),
|
|
311
|
+
});
|
|
312
|
+
/**
|
|
313
|
+
* Reservation slot query response schema.
|
|
314
|
+
* Discriminated union of supported slot query response types.
|
|
315
|
+
*
|
|
316
|
+
* @typedef {TableReservationSlotQueryResponse|RoomReservationSlotQueryResponse|RentalReservationSlotQueryResponse} ReservationSlotQueryResponse
|
|
317
|
+
*/
|
|
318
|
+
exports.ReservationSlotQueryResponseSchema = zod_1.z.discriminatedUnion("resourceType", [
|
|
319
|
+
exports.TableReservationSlotQueryResponseSchema,
|
|
320
|
+
exports.RoomReservationSlotQueryResponseSchema,
|
|
321
|
+
exports.RentalReservationSlotQueryResponseSchema,
|
|
322
|
+
]);
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Floor plan schema definitions for table reservations.
|
|
4
|
+
* @module business-mgt/reservation-mgt/table-layout
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Canvas coordinate unit.
|
|
8
|
+
*
|
|
9
|
+
* @enum {string}
|
|
10
|
+
*/
|
|
11
|
+
export declare enum CanvasUnit {
|
|
12
|
+
PX = "px",
|
|
13
|
+
FT = "ft",
|
|
14
|
+
M = "m"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Canvas dimensions schema.
|
|
18
|
+
* Defines the coordinate space used for floor plan rendering.
|
|
19
|
+
*
|
|
20
|
+
* @typedef {Object} CanvasDimensions
|
|
21
|
+
* @property {number} width - Canvas width
|
|
22
|
+
* @property {number} height - Canvas height
|
|
23
|
+
* @property {CanvasUnit} unit - Coordinate unit
|
|
24
|
+
*/
|
|
25
|
+
export declare const CanvasDimensionsSchema: z.ZodObject<{
|
|
26
|
+
width: z.ZodNumber;
|
|
27
|
+
height: z.ZodNumber;
|
|
28
|
+
unit: z.ZodDefault<z.ZodEnum<typeof CanvasUnit>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
/**
|
|
31
|
+
* Floor plan schema.
|
|
32
|
+
* Represents a table layout canvas for a reservable business location.
|
|
33
|
+
*
|
|
34
|
+
* @typedef {Object} FloorPlan
|
|
35
|
+
* @property {string} [locationId] - Business location where the floor plan applies
|
|
36
|
+
* @property {string} name - Floor plan name
|
|
37
|
+
* @property {string} description - Floor plan description
|
|
38
|
+
* @property {string[]} [imageUrls] - Optional floor plan reference images
|
|
39
|
+
* @property {boolean} isActive - Whether the floor plan is active
|
|
40
|
+
* @property {CanvasDimensions} canvasDimensions - Floor plan coordinate space
|
|
41
|
+
* @property {number} capacity - Total seating capacity
|
|
42
|
+
* @property {Object} [metadata] - Additional floor plan metadata
|
|
43
|
+
*/
|
|
44
|
+
export declare const FloorPlanSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
description: z.ZodString;
|
|
51
|
+
imageUrls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodURL>>>;
|
|
52
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
+
canvasDimensions: z.ZodObject<{
|
|
54
|
+
width: z.ZodNumber;
|
|
55
|
+
height: z.ZodNumber;
|
|
56
|
+
unit: z.ZodDefault<z.ZodEnum<typeof CanvasUnit>>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
capacity: z.ZodNumber;
|
|
59
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
/**
|
|
62
|
+
* Schema for creating a new floor plan.
|
|
63
|
+
* Omits auto-generated fields.
|
|
64
|
+
*/
|
|
65
|
+
export declare const CreateFloorPlanSchema: z.ZodObject<{
|
|
66
|
+
capacity: z.ZodNumber;
|
|
67
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
description: z.ZodString;
|
|
70
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
71
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
imageUrls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodURL>>>;
|
|
73
|
+
canvasDimensions: z.ZodObject<{
|
|
74
|
+
width: z.ZodNumber;
|
|
75
|
+
height: z.ZodNumber;
|
|
76
|
+
unit: z.ZodDefault<z.ZodEnum<typeof CanvasUnit>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
/**
|
|
80
|
+
* Schema for updating an existing floor plan.
|
|
81
|
+
* All fields optional except id.
|
|
82
|
+
*/
|
|
83
|
+
export declare const UpdateFloorPlanSchema: z.ZodObject<{
|
|
84
|
+
capacity: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
|
|
86
|
+
name: z.ZodOptional<z.ZodString>;
|
|
87
|
+
description: z.ZodOptional<z.ZodString>;
|
|
88
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
89
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
90
|
+
imageUrls: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodURL>>>>;
|
|
91
|
+
canvasDimensions: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
width: z.ZodNumber;
|
|
93
|
+
height: z.ZodNumber;
|
|
94
|
+
unit: z.ZodDefault<z.ZodEnum<typeof CanvasUnit>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export type CanvasDimensions = z.infer<typeof CanvasDimensionsSchema>;
|
|
99
|
+
export type FloorPlan = z.infer<typeof FloorPlanSchema>;
|
|
100
|
+
export type CreateFloorPlan = z.infer<typeof CreateFloorPlanSchema>;
|
|
101
|
+
export type UpdateFloorPlan = z.infer<typeof UpdateFloorPlanSchema>;
|
|
102
|
+
/**
|
|
103
|
+
* Floor plan filter options.
|
|
104
|
+
* @interface FloorPlanFilters
|
|
105
|
+
*/
|
|
106
|
+
export interface FloorPlanFilters {
|
|
107
|
+
/** Filter by business location ID */
|
|
108
|
+
locationId?: string;
|
|
109
|
+
/** Filter by active status */
|
|
110
|
+
isActive?: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Floor plan query options.
|
|
114
|
+
* @interface FloorPlanQueryOptions
|
|
115
|
+
*/
|
|
116
|
+
export interface FloorPlanQueryOptions {
|
|
117
|
+
/** Page number (1-indexed) */
|
|
118
|
+
page: number;
|
|
119
|
+
/** Items per page */
|
|
120
|
+
pageSize: number;
|
|
121
|
+
/** Optional filters */
|
|
122
|
+
filters?: FloorPlanFilters;
|
|
123
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateFloorPlanSchema = exports.CreateFloorPlanSchema = exports.FloorPlanSchema = exports.CanvasDimensionsSchema = exports.CanvasUnit = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../../base.schema");
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Floor plan schema definitions for table reservations.
|
|
8
|
+
* @module business-mgt/reservation-mgt/table-layout
|
|
9
|
+
*/
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// ENUMS
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Canvas coordinate unit.
|
|
15
|
+
*
|
|
16
|
+
* @enum {string}
|
|
17
|
+
*/
|
|
18
|
+
var CanvasUnit;
|
|
19
|
+
(function (CanvasUnit) {
|
|
20
|
+
CanvasUnit["PX"] = "px";
|
|
21
|
+
CanvasUnit["FT"] = "ft";
|
|
22
|
+
CanvasUnit["M"] = "m";
|
|
23
|
+
})(CanvasUnit || (exports.CanvasUnit = CanvasUnit = {}));
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// FLOOR PLAN SCHEMAS
|
|
26
|
+
// ============================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Canvas dimensions schema.
|
|
29
|
+
* Defines the coordinate space used for floor plan rendering.
|
|
30
|
+
*
|
|
31
|
+
* @typedef {Object} CanvasDimensions
|
|
32
|
+
* @property {number} width - Canvas width
|
|
33
|
+
* @property {number} height - Canvas height
|
|
34
|
+
* @property {CanvasUnit} unit - Coordinate unit
|
|
35
|
+
*/
|
|
36
|
+
exports.CanvasDimensionsSchema = zod_1.z.object({
|
|
37
|
+
width: zod_1.z.number().positive().describe("Canvas width"),
|
|
38
|
+
height: zod_1.z.number().positive().describe("Canvas height"),
|
|
39
|
+
unit: zod_1.z.enum(CanvasUnit).default(CanvasUnit.PX).describe("Coordinate unit"),
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Floor plan schema.
|
|
43
|
+
* Represents a table layout canvas for a reservable business location.
|
|
44
|
+
*
|
|
45
|
+
* @typedef {Object} FloorPlan
|
|
46
|
+
* @property {string} [locationId] - Business location where the floor plan applies
|
|
47
|
+
* @property {string} name - Floor plan name
|
|
48
|
+
* @property {string} description - Floor plan description
|
|
49
|
+
* @property {string[]} [imageUrls] - Optional floor plan reference images
|
|
50
|
+
* @property {boolean} isActive - Whether the floor plan is active
|
|
51
|
+
* @property {CanvasDimensions} canvasDimensions - Floor plan coordinate space
|
|
52
|
+
* @property {number} capacity - Total seating capacity
|
|
53
|
+
* @property {Object} [metadata] - Additional floor plan metadata
|
|
54
|
+
*/
|
|
55
|
+
exports.FloorPlanSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
56
|
+
locationId: zod_1.z.string().nullable().optional().describe("Business location ID where the floor plan applies. Null applies when the layout is not location-specific."),
|
|
57
|
+
name: zod_1.z.string().min(1).describe("Floor plan name (e.g., Main Floor, Rooftop)"),
|
|
58
|
+
description: zod_1.z.string().describe("Floor plan description"),
|
|
59
|
+
imageUrls: zod_1.z.array(zod_1.z.url()).nullable().optional().describe("Optional floor plan images for reference"),
|
|
60
|
+
isActive: zod_1.z.boolean().default(true).describe("Whether floor plan is active"),
|
|
61
|
+
canvasDimensions: exports.CanvasDimensionsSchema.describe("Canvas coordinate space"),
|
|
62
|
+
capacity: zod_1.z.number().int().positive().describe("Total seating capacity of the floor plan"),
|
|
63
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable().optional().describe("Additional floor plan metadata"),
|
|
64
|
+
});
|
|
65
|
+
// ============================================================================
|
|
66
|
+
// CREATE/UPDATE SCHEMAS
|
|
67
|
+
// ============================================================================
|
|
68
|
+
/**
|
|
69
|
+
* Schema for creating a new floor plan.
|
|
70
|
+
* Omits auto-generated fields.
|
|
71
|
+
*/
|
|
72
|
+
exports.CreateFloorPlanSchema = exports.FloorPlanSchema.omit({
|
|
73
|
+
id: true,
|
|
74
|
+
createdAt: true,
|
|
75
|
+
updatedAt: true,
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Schema for updating an existing floor plan.
|
|
79
|
+
* All fields optional except id.
|
|
80
|
+
*/
|
|
81
|
+
exports.UpdateFloorPlanSchema = exports.CreateFloorPlanSchema.partial().safeExtend({
|
|
82
|
+
id: zod_1.z.string().describe("Unique identifier of the floor plan to update."),
|
|
83
|
+
});
|