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,195 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PaymentStatus, ReservationStatus } from "../../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Room reservation schema definitions.
|
|
5
|
+
* @module business-mgt/reservation-mgt/room-reservation
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Room rate per night schema.
|
|
9
|
+
* Captures the nightly rate snapshot for a room reservation.
|
|
10
|
+
*
|
|
11
|
+
* @typedef {Object} RoomRatePerNight
|
|
12
|
+
* @property {string} date - Business-local rate date in YYYY-MM-DD format
|
|
13
|
+
* @property {number} amount - Nightly rate amount for the date
|
|
14
|
+
*/
|
|
15
|
+
export declare const RoomRatePerNightSchema: z.ZodObject<{
|
|
16
|
+
date: z.ZodString;
|
|
17
|
+
amount: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/**
|
|
20
|
+
* Room reservation schema.
|
|
21
|
+
* Represents a lodging reservation with check-in/check-out dates and nightly pricing.
|
|
22
|
+
*
|
|
23
|
+
* @typedef {Object} RoomReservation
|
|
24
|
+
* @property {string} [locationId] - Business location where the room reservation is booked
|
|
25
|
+
* @property {string} [channelId] - Channel that created or owns the booking
|
|
26
|
+
* @property {string} resourceId - Room resource or category being reserved
|
|
27
|
+
* @property {string} guestId - Guest or customer who owns the stay
|
|
28
|
+
* @property {number} personsNumber - Number of guests in the party
|
|
29
|
+
* @property {number} checkIn - Check-in timestamp
|
|
30
|
+
* @property {number} checkOut - Check-out timestamp
|
|
31
|
+
* @property {number} nights - Number of nights in the stay
|
|
32
|
+
* @property {ReservationStatus} status - Current room reservation status
|
|
33
|
+
* @property {string} [source] - Source or channel label for the reservation
|
|
34
|
+
* @property {RoomRatePerNight[]} ratePerNight - Nightly pricing breakdown
|
|
35
|
+
* @property {number} totalWithTax - Total reservation amount including tax
|
|
36
|
+
* @property {number} deposit - Deposit amount collected or required
|
|
37
|
+
* @property {PaymentStatus} [paymentStatus] - Payment status for the stay
|
|
38
|
+
* @property {string} [notes] - Internal staff notes
|
|
39
|
+
* @property {Object} [externalRef] - External platform reference
|
|
40
|
+
*/
|
|
41
|
+
export declare const RoomReservationSchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
resourceId: z.ZodString;
|
|
48
|
+
guestId: z.ZodString;
|
|
49
|
+
personsNumber: z.ZodNumber;
|
|
50
|
+
checkIn: z.ZodNumber;
|
|
51
|
+
checkOut: z.ZodNumber;
|
|
52
|
+
nights: z.ZodNumber;
|
|
53
|
+
status: z.ZodDefault<z.ZodEnum<typeof ReservationStatus>>;
|
|
54
|
+
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
ratePerNight: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
56
|
+
date: z.ZodString;
|
|
57
|
+
amount: z.ZodNumber;
|
|
58
|
+
}, z.core.$strip>>>;
|
|
59
|
+
totalWithTax: z.ZodNumber;
|
|
60
|
+
deposit: z.ZodDefault<z.ZodNumber>;
|
|
61
|
+
paymentStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof PaymentStatus>>>;
|
|
62
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
64
|
+
externalId: z.ZodString;
|
|
65
|
+
source: z.ZodString;
|
|
66
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
67
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
/**
|
|
71
|
+
* Schema for creating a new room reservation.
|
|
72
|
+
* Omits auto-generated fields.
|
|
73
|
+
*/
|
|
74
|
+
export declare const CreateRoomReservationSchema: z.ZodObject<{
|
|
75
|
+
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
nights: z.ZodNumber;
|
|
77
|
+
status: z.ZodDefault<z.ZodEnum<typeof ReservationStatus>>;
|
|
78
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
paymentStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof PaymentStatus>>>;
|
|
82
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
83
|
+
externalId: z.ZodString;
|
|
84
|
+
source: z.ZodString;
|
|
85
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
86
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
87
|
+
}, z.core.$strip>>>;
|
|
88
|
+
resourceId: z.ZodString;
|
|
89
|
+
personsNumber: z.ZodNumber;
|
|
90
|
+
guestId: z.ZodString;
|
|
91
|
+
checkIn: z.ZodNumber;
|
|
92
|
+
checkOut: z.ZodNumber;
|
|
93
|
+
ratePerNight: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
94
|
+
date: z.ZodString;
|
|
95
|
+
amount: z.ZodNumber;
|
|
96
|
+
}, z.core.$strip>>>;
|
|
97
|
+
totalWithTax: z.ZodNumber;
|
|
98
|
+
deposit: z.ZodDefault<z.ZodNumber>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
/**
|
|
101
|
+
* Schema for updating an existing room reservation.
|
|
102
|
+
* All fields optional except id.
|
|
103
|
+
*/
|
|
104
|
+
export declare const UpdateRoomReservationSchema: z.ZodObject<{
|
|
105
|
+
source: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
106
|
+
nights: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
108
|
+
channelId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
109
|
+
notes: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
110
|
+
paymentStatus: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof PaymentStatus>>>>;
|
|
111
|
+
externalRef: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
112
|
+
externalId: z.ZodString;
|
|
113
|
+
source: z.ZodString;
|
|
114
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
115
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
116
|
+
}, z.core.$strip>>>>;
|
|
117
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
118
|
+
personsNumber: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
guestId: z.ZodOptional<z.ZodString>;
|
|
120
|
+
checkIn: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
checkOut: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
ratePerNight: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
123
|
+
date: z.ZodString;
|
|
124
|
+
amount: z.ZodNumber;
|
|
125
|
+
}, z.core.$strip>>>>;
|
|
126
|
+
totalWithTax: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
deposit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
128
|
+
id: z.ZodString;
|
|
129
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof ReservationStatus>>>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
/**
|
|
132
|
+
* Schema for reassigning a room reservation to a different room instance.
|
|
133
|
+
*/
|
|
134
|
+
export declare const RoomReAssignmentSchema: z.ZodObject<{
|
|
135
|
+
reservationId: z.ZodString;
|
|
136
|
+
fromRoomInstanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
137
|
+
toRoomInstanceId: z.ZodString;
|
|
138
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
export type RoomRatePerNight = z.infer<typeof RoomRatePerNightSchema>;
|
|
141
|
+
export type RoomReservation = z.infer<typeof RoomReservationSchema>;
|
|
142
|
+
export type CreateRoomReservation = z.infer<typeof CreateRoomReservationSchema>;
|
|
143
|
+
export type UpdateRoomReservation = z.infer<typeof UpdateRoomReservationSchema>;
|
|
144
|
+
export type RoomReAssignment = z.infer<typeof RoomReAssignmentSchema>;
|
|
145
|
+
/**
|
|
146
|
+
* Room reservation filter options.
|
|
147
|
+
* @interface RoomReservationFilters
|
|
148
|
+
*/
|
|
149
|
+
export interface RoomReservationFilters {
|
|
150
|
+
/** Text search across room reservation fields */
|
|
151
|
+
search?: string;
|
|
152
|
+
/** Filter by business location ID */
|
|
153
|
+
locationId?: string;
|
|
154
|
+
/** Filter by booking channel ID */
|
|
155
|
+
channelId?: string;
|
|
156
|
+
/** Filter by room resource ID */
|
|
157
|
+
resourceId?: string;
|
|
158
|
+
/** Filter by guest/customer ID */
|
|
159
|
+
guestId?: string;
|
|
160
|
+
/** Filter by reservation statuses */
|
|
161
|
+
status?: ReservationStatus[];
|
|
162
|
+
/** Filter by payment statuses */
|
|
163
|
+
paymentStatus?: PaymentStatus[];
|
|
164
|
+
/** Filter by check-in timestamp range */
|
|
165
|
+
dateRange?: {
|
|
166
|
+
start?: number;
|
|
167
|
+
end?: number;
|
|
168
|
+
};
|
|
169
|
+
/** Filter by external source platform */
|
|
170
|
+
externalSource?: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Room reservation sorting options.
|
|
174
|
+
* @interface RoomReservationSorting
|
|
175
|
+
*/
|
|
176
|
+
export interface RoomReservationSorting {
|
|
177
|
+
/** Field to sort by */
|
|
178
|
+
field: "checkIn" | "checkOut" | "createdAt";
|
|
179
|
+
/** Sort direction */
|
|
180
|
+
direction: "asc" | "desc";
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Room reservation query options.
|
|
184
|
+
* @interface RoomReservationQueryOptions
|
|
185
|
+
*/
|
|
186
|
+
export interface RoomReservationQueryOptions {
|
|
187
|
+
/** Page number (1-indexed) */
|
|
188
|
+
page: number;
|
|
189
|
+
/** Items per page */
|
|
190
|
+
pageSize: number;
|
|
191
|
+
/** Optional filters */
|
|
192
|
+
filters?: RoomReservationFilters;
|
|
193
|
+
/** Optional sorting */
|
|
194
|
+
sorting?: RoomReservationSorting;
|
|
195
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoomReAssignmentSchema = exports.UpdateRoomReservationSchema = exports.CreateRoomReservationSchema = exports.RoomReservationSchema = exports.RoomRatePerNightSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../../base.schema");
|
|
6
|
+
const type_definitions_1 = require("../../type-definitions");
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Room reservation schema definitions.
|
|
9
|
+
* @module business-mgt/reservation-mgt/room-reservation
|
|
10
|
+
*/
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// ROOM RESERVATION SCHEMAS
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Room rate per night schema.
|
|
16
|
+
* Captures the nightly rate snapshot for a room reservation.
|
|
17
|
+
*
|
|
18
|
+
* @typedef {Object} RoomRatePerNight
|
|
19
|
+
* @property {string} date - Business-local rate date in YYYY-MM-DD format
|
|
20
|
+
* @property {number} amount - Nightly rate amount for the date
|
|
21
|
+
*/
|
|
22
|
+
exports.RoomRatePerNightSchema = zod_1.z.object({
|
|
23
|
+
date: zod_1.z.string().describe("Business-local rate date in YYYY-MM-DD format."),
|
|
24
|
+
amount: zod_1.z.number().nonnegative().describe("Nightly room rate amount for this date before aggregation."),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Room reservation schema.
|
|
28
|
+
* Represents a lodging reservation with check-in/check-out dates and nightly pricing.
|
|
29
|
+
*
|
|
30
|
+
* @typedef {Object} RoomReservation
|
|
31
|
+
* @property {string} [locationId] - Business location where the room reservation is booked
|
|
32
|
+
* @property {string} [channelId] - Channel that created or owns the booking
|
|
33
|
+
* @property {string} resourceId - Room resource or category being reserved
|
|
34
|
+
* @property {string} guestId - Guest or customer who owns the stay
|
|
35
|
+
* @property {number} personsNumber - Number of guests in the party
|
|
36
|
+
* @property {number} checkIn - Check-in timestamp
|
|
37
|
+
* @property {number} checkOut - Check-out timestamp
|
|
38
|
+
* @property {number} nights - Number of nights in the stay
|
|
39
|
+
* @property {ReservationStatus} status - Current room reservation status
|
|
40
|
+
* @property {string} [source] - Source or channel label for the reservation
|
|
41
|
+
* @property {RoomRatePerNight[]} ratePerNight - Nightly pricing breakdown
|
|
42
|
+
* @property {number} totalWithTax - Total reservation amount including tax
|
|
43
|
+
* @property {number} deposit - Deposit amount collected or required
|
|
44
|
+
* @property {PaymentStatus} [paymentStatus] - Payment status for the stay
|
|
45
|
+
* @property {string} [notes] - Internal staff notes
|
|
46
|
+
* @property {Object} [externalRef] - External platform reference
|
|
47
|
+
*/
|
|
48
|
+
exports.RoomReservationSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
49
|
+
locationId: zod_1.z.string().nullable().optional().describe("Business location ID where the room reservation is booked. Null applies when the reservation is not location-specific."),
|
|
50
|
+
channelId: zod_1.z.string().nullable().optional().describe("Channel ID for multi-channel bookings (e.g., web, marketplace, partner)"),
|
|
51
|
+
resourceId: zod_1.z.string().describe("Room type/category ID"),
|
|
52
|
+
guestId: zod_1.z.string().describe("Guest/customer ID"),
|
|
53
|
+
personsNumber: zod_1.z.number().int().positive().describe("Party size"),
|
|
54
|
+
checkIn: zod_1.z.number().describe("Check-in timestamp"),
|
|
55
|
+
checkOut: zod_1.z.number().describe("Check-out timestamp"),
|
|
56
|
+
nights: zod_1.z.number().int().positive().describe("Number of nights"),
|
|
57
|
+
status: zod_1.z.enum(type_definitions_1.ReservationStatus).default(type_definitions_1.ReservationStatus.PENDING).describe("Room reservation lifecycle status"),
|
|
58
|
+
source: zod_1.z.string().nullable().optional().describe("Source/channel of the reservation"),
|
|
59
|
+
ratePerNight: zod_1.z.array(exports.RoomRatePerNightSchema).default([]).describe("Per-night pricing"),
|
|
60
|
+
totalWithTax: zod_1.z.number().nonnegative().describe("Total amount including tax"),
|
|
61
|
+
deposit: zod_1.z.number().nonnegative().default(0).describe("Deposit amount"),
|
|
62
|
+
paymentStatus: zod_1.z.enum(type_definitions_1.PaymentStatus).nullable().optional().describe("Payment status"),
|
|
63
|
+
notes: zod_1.z.string().nullable().optional().describe("Internal notes"),
|
|
64
|
+
externalRef: type_definitions_1.ExternalRefSchema.nullable().optional().describe("External system reference (when imported/synced)"),
|
|
65
|
+
}).superRefine((data, ctx) => {
|
|
66
|
+
if (data.checkOut <= data.checkIn) {
|
|
67
|
+
ctx.addIssue({
|
|
68
|
+
code: "custom",
|
|
69
|
+
path: ["checkOut"],
|
|
70
|
+
message: "checkOut must be greater than checkIn",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
// ============================================================================
|
|
75
|
+
// CREATE/UPDATE SCHEMAS
|
|
76
|
+
// ============================================================================
|
|
77
|
+
/**
|
|
78
|
+
* Schema for creating a new room reservation.
|
|
79
|
+
* Omits auto-generated fields.
|
|
80
|
+
*/
|
|
81
|
+
exports.CreateRoomReservationSchema = exports.RoomReservationSchema.omit({
|
|
82
|
+
id: true,
|
|
83
|
+
createdAt: true,
|
|
84
|
+
updatedAt: true,
|
|
85
|
+
});
|
|
86
|
+
/**
|
|
87
|
+
* Schema for updating an existing room reservation.
|
|
88
|
+
* All fields optional except id.
|
|
89
|
+
*/
|
|
90
|
+
exports.UpdateRoomReservationSchema = exports.CreateRoomReservationSchema.partial().extend({
|
|
91
|
+
id: zod_1.z.string().describe("Unique identifier of the room reservation to update."),
|
|
92
|
+
// Re-declared without the base `.default()` so partial updates don't inject a status the caller never set
|
|
93
|
+
status: zod_1.z.enum(type_definitions_1.ReservationStatus).nullable().optional().describe("Room reservation lifecycle status"),
|
|
94
|
+
});
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// REASSIGNMENT SCHEMA
|
|
97
|
+
// ============================================================================
|
|
98
|
+
/**
|
|
99
|
+
* Schema for reassigning a room reservation to a different room instance.
|
|
100
|
+
*/
|
|
101
|
+
exports.RoomReAssignmentSchema = zod_1.z.object({
|
|
102
|
+
reservationId: zod_1.z.string().describe("Room reservation ID being reassigned."),
|
|
103
|
+
fromRoomInstanceId: zod_1.z.string().nullable().optional().describe("Current room instance ID the reservation is being moved from."),
|
|
104
|
+
toRoomInstanceId: zod_1.z.string().describe("Target room instance ID the reservation is being moved to."),
|
|
105
|
+
reason: zod_1.z.string().nullable().optional().describe("Optional reason for the reassignment."),
|
|
106
|
+
});
|