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,334 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DepositStatus } from "../../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Rental reservation schema definitions.
|
|
5
|
+
* @module business-mgt/reservation-mgt/rental-reservation
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Rental reservation lifecycle status.
|
|
9
|
+
*
|
|
10
|
+
* @enum {string}
|
|
11
|
+
*/
|
|
12
|
+
export declare enum RentalReservationStatus {
|
|
13
|
+
UPCOMING = "upcoming",
|
|
14
|
+
PICKUP_SOON = "pickup_soon",
|
|
15
|
+
OUT = "out",
|
|
16
|
+
RETURNED = "returned",
|
|
17
|
+
OVERDUE = "overdue",
|
|
18
|
+
CANCELLED = "cancelled"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Rental reservation payment schema.
|
|
22
|
+
* Captures rental charge and security deposit state for a rental booking.
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Object} RentalReservationPayment
|
|
25
|
+
* @property {number} rentalCharge - Rental charge amount
|
|
26
|
+
* @property {number} securityDeposit - Security deposit amount
|
|
27
|
+
* @property {DepositStatus} depositStatus - Security deposit status
|
|
28
|
+
*/
|
|
29
|
+
export declare const RentalReservationPaymentSchema: z.ZodObject<{
|
|
30
|
+
rentalCharge: z.ZodNumber;
|
|
31
|
+
securityDeposit: z.ZodNumber;
|
|
32
|
+
depositStatus: z.ZodEnum<typeof DepositStatus>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
/**
|
|
35
|
+
* Checklist completion schema.
|
|
36
|
+
* Tracks completion of checklist items defined on Resource.checklistTemplate.
|
|
37
|
+
*
|
|
38
|
+
* @typedef {Object} ChecklistCompletion
|
|
39
|
+
* @property {string} itemId - Checklist template item ID
|
|
40
|
+
* @property {boolean} completed - Whether the item is completed
|
|
41
|
+
* @property {number} [completedAt] - Completion timestamp
|
|
42
|
+
* @property {string} [completedBy] - User ID that completed the item
|
|
43
|
+
*/
|
|
44
|
+
export declare const ChecklistCompletionSchema: z.ZodObject<{
|
|
45
|
+
itemId: z.ZodString;
|
|
46
|
+
completed: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
48
|
+
completedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
/**
|
|
51
|
+
* Waiver reference schema.
|
|
52
|
+
* Captures waiver document status for rental reservations that require signed waivers.
|
|
53
|
+
*
|
|
54
|
+
* @typedef {Object} WaiverRef
|
|
55
|
+
* @property {string} waiverId - Waiver document ID
|
|
56
|
+
* @property {number} [signedAt] - Waiver signature timestamp
|
|
57
|
+
* @property {string} status - Waiver status
|
|
58
|
+
*/
|
|
59
|
+
export declare const WaiverRefSchema: z.ZodObject<{
|
|
60
|
+
waiverId: z.ZodString;
|
|
61
|
+
signedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
62
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
63
|
+
required: "required";
|
|
64
|
+
signed: "signed";
|
|
65
|
+
waived: "waived";
|
|
66
|
+
}>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
/**
|
|
69
|
+
* Identity verification reference schema.
|
|
70
|
+
* Captures the external identity verification record for a rental reservation.
|
|
71
|
+
*
|
|
72
|
+
* @typedef {Object} IDRef
|
|
73
|
+
* @property {string} verificationId - Identity verification reference ID
|
|
74
|
+
* @property {string} [provider] - Verification provider
|
|
75
|
+
* @property {number} [verifiedAt] - Verification timestamp
|
|
76
|
+
* @property {string} status - Identity verification status
|
|
77
|
+
*/
|
|
78
|
+
export declare const IDRefSchema: z.ZodObject<{
|
|
79
|
+
verificationId: z.ZodString;
|
|
80
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
verifiedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
82
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
83
|
+
rejected: "rejected";
|
|
84
|
+
required: "required";
|
|
85
|
+
verified: "verified";
|
|
86
|
+
}>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
/**
|
|
89
|
+
* Rental reservation schema.
|
|
90
|
+
* Represents a time-bounded rental booking with payment, waiver, and inspection state.
|
|
91
|
+
*
|
|
92
|
+
* @typedef {Object} RentalReservation
|
|
93
|
+
* @property {string} [locationId] - Business location where the rental reservation is booked
|
|
94
|
+
* @property {string} [channelId] - Channel that created or owns the booking
|
|
95
|
+
* @property {string} customerId - Customer who owns the rental reservation
|
|
96
|
+
* @property {string} resourceId - Rental resource being reserved
|
|
97
|
+
* @property {number} startAt - Rental start timestamp
|
|
98
|
+
* @property {number} endAt - Rental end timestamp
|
|
99
|
+
* @property {number} [actualReturnAt] - Actual return timestamp
|
|
100
|
+
* @property {string} tierId - Rental tier used for the booking
|
|
101
|
+
* @property {RentalReservationStatus} status - Current rental reservation status
|
|
102
|
+
* @property {RentalReservationPayment} payment - Rental payment and deposit details
|
|
103
|
+
* @property {ChecklistCompletion[]} checklistCompletions - Completed checklist items
|
|
104
|
+
* @property {WaiverRef} [waiver] - Waiver reference and status
|
|
105
|
+
* @property {IDRef} [idVerification] - Identity verification reference and status
|
|
106
|
+
* @property {string} [notes] - Internal staff notes
|
|
107
|
+
* @property {Object} [externalRef] - External platform reference
|
|
108
|
+
*/
|
|
109
|
+
export declare const RentalReservationSchema: z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
customerId: z.ZodString;
|
|
116
|
+
resourceId: z.ZodString;
|
|
117
|
+
startAt: z.ZodNumber;
|
|
118
|
+
endAt: z.ZodNumber;
|
|
119
|
+
actualReturnAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
|
+
tierId: z.ZodString;
|
|
121
|
+
status: z.ZodDefault<z.ZodEnum<typeof RentalReservationStatus>>;
|
|
122
|
+
payment: z.ZodObject<{
|
|
123
|
+
rentalCharge: z.ZodNumber;
|
|
124
|
+
securityDeposit: z.ZodNumber;
|
|
125
|
+
depositStatus: z.ZodEnum<typeof DepositStatus>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
checklistCompletions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
128
|
+
itemId: z.ZodString;
|
|
129
|
+
completed: z.ZodDefault<z.ZodBoolean>;
|
|
130
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
131
|
+
completedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
}, z.core.$strip>>>;
|
|
133
|
+
waiver: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
134
|
+
waiverId: z.ZodString;
|
|
135
|
+
signedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
136
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
137
|
+
required: "required";
|
|
138
|
+
signed: "signed";
|
|
139
|
+
waived: "waived";
|
|
140
|
+
}>>;
|
|
141
|
+
}, z.core.$strip>>>;
|
|
142
|
+
idVerification: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
143
|
+
verificationId: z.ZodString;
|
|
144
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
verifiedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
146
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
147
|
+
rejected: "rejected";
|
|
148
|
+
required: "required";
|
|
149
|
+
verified: "verified";
|
|
150
|
+
}>>;
|
|
151
|
+
}, z.core.$strip>>>;
|
|
152
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
153
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
154
|
+
externalId: z.ZodString;
|
|
155
|
+
source: z.ZodString;
|
|
156
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
157
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
158
|
+
}, z.core.$strip>>>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
/**
|
|
161
|
+
* Schema for creating a new rental reservation.
|
|
162
|
+
* Omits auto-generated fields.
|
|
163
|
+
*/
|
|
164
|
+
export declare const CreateRentalReservationSchema: z.ZodObject<{
|
|
165
|
+
status: z.ZodDefault<z.ZodEnum<typeof RentalReservationStatus>>;
|
|
166
|
+
locationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
167
|
+
customerId: z.ZodString;
|
|
168
|
+
channelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
externalRef: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
171
|
+
externalId: z.ZodString;
|
|
172
|
+
source: z.ZodString;
|
|
173
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
174
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
175
|
+
}, z.core.$strip>>>;
|
|
176
|
+
resourceId: z.ZodString;
|
|
177
|
+
startAt: z.ZodNumber;
|
|
178
|
+
endAt: z.ZodNumber;
|
|
179
|
+
actualReturnAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
180
|
+
tierId: z.ZodString;
|
|
181
|
+
payment: z.ZodObject<{
|
|
182
|
+
rentalCharge: z.ZodNumber;
|
|
183
|
+
securityDeposit: z.ZodNumber;
|
|
184
|
+
depositStatus: z.ZodEnum<typeof DepositStatus>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
checklistCompletions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
187
|
+
itemId: z.ZodString;
|
|
188
|
+
completed: z.ZodDefault<z.ZodBoolean>;
|
|
189
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
190
|
+
completedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
}, z.core.$strip>>>;
|
|
192
|
+
waiver: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
193
|
+
waiverId: z.ZodString;
|
|
194
|
+
signedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
195
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
196
|
+
required: "required";
|
|
197
|
+
signed: "signed";
|
|
198
|
+
waived: "waived";
|
|
199
|
+
}>>;
|
|
200
|
+
}, z.core.$strip>>>;
|
|
201
|
+
idVerification: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
202
|
+
verificationId: z.ZodString;
|
|
203
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
verifiedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
205
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
206
|
+
rejected: "rejected";
|
|
207
|
+
required: "required";
|
|
208
|
+
verified: "verified";
|
|
209
|
+
}>>;
|
|
210
|
+
}, z.core.$strip>>>;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
/**
|
|
213
|
+
* Schema for updating an existing rental reservation.
|
|
214
|
+
* All fields optional except id.
|
|
215
|
+
*/
|
|
216
|
+
export declare const UpdateRentalReservationSchema: z.ZodObject<{
|
|
217
|
+
locationId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
218
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
219
|
+
channelId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
220
|
+
notes: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
221
|
+
externalRef: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
222
|
+
externalId: z.ZodString;
|
|
223
|
+
source: z.ZodString;
|
|
224
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
225
|
+
syncedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
226
|
+
}, z.core.$strip>>>>;
|
|
227
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
228
|
+
startAt: z.ZodOptional<z.ZodNumber>;
|
|
229
|
+
endAt: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
actualReturnAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
231
|
+
tierId: z.ZodOptional<z.ZodString>;
|
|
232
|
+
payment: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
rentalCharge: z.ZodNumber;
|
|
234
|
+
securityDeposit: z.ZodNumber;
|
|
235
|
+
depositStatus: z.ZodEnum<typeof DepositStatus>;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
checklistCompletions: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
238
|
+
itemId: z.ZodString;
|
|
239
|
+
completed: z.ZodDefault<z.ZodBoolean>;
|
|
240
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
241
|
+
completedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
242
|
+
}, z.core.$strip>>>>;
|
|
243
|
+
waiver: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
244
|
+
waiverId: z.ZodString;
|
|
245
|
+
signedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
246
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
247
|
+
required: "required";
|
|
248
|
+
signed: "signed";
|
|
249
|
+
waived: "waived";
|
|
250
|
+
}>>;
|
|
251
|
+
}, z.core.$strip>>>>;
|
|
252
|
+
idVerification: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
253
|
+
verificationId: z.ZodString;
|
|
254
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
255
|
+
verifiedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
256
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
257
|
+
rejected: "rejected";
|
|
258
|
+
required: "required";
|
|
259
|
+
verified: "verified";
|
|
260
|
+
}>>;
|
|
261
|
+
}, z.core.$strip>>>>;
|
|
262
|
+
id: z.ZodString;
|
|
263
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof RentalReservationStatus>>>;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
/**
|
|
266
|
+
* Schema for reassigning a rental reservation to a different rental instance.
|
|
267
|
+
*/
|
|
268
|
+
export declare const RentalReAssignmentSchema: z.ZodObject<{
|
|
269
|
+
reservationId: z.ZodString;
|
|
270
|
+
toRentalInstanceId: z.ZodString;
|
|
271
|
+
fromRentalInstanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
272
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
export type RentalReservationPayment = z.infer<typeof RentalReservationPaymentSchema>;
|
|
275
|
+
export type ChecklistCompletion = z.infer<typeof ChecklistCompletionSchema>;
|
|
276
|
+
export type WaiverRef = z.infer<typeof WaiverRefSchema>;
|
|
277
|
+
export type IDRef = z.infer<typeof IDRefSchema>;
|
|
278
|
+
export type RentalReservation = z.infer<typeof RentalReservationSchema>;
|
|
279
|
+
export type CreateRentalReservation = z.infer<typeof CreateRentalReservationSchema>;
|
|
280
|
+
export type UpdateRentalReservation = z.infer<typeof UpdateRentalReservationSchema>;
|
|
281
|
+
export type RentalReAssignment = z.infer<typeof RentalReAssignmentSchema>;
|
|
282
|
+
/**
|
|
283
|
+
* Rental reservation filter options.
|
|
284
|
+
* @interface RentalReservationFilters
|
|
285
|
+
*/
|
|
286
|
+
export interface RentalReservationFilters {
|
|
287
|
+
/** Text search across rental reservation fields */
|
|
288
|
+
search?: string;
|
|
289
|
+
/** Filter by business location ID */
|
|
290
|
+
locationId?: string;
|
|
291
|
+
/** Filter by booking channel ID */
|
|
292
|
+
channelId?: string;
|
|
293
|
+
/** Filter by customer ID */
|
|
294
|
+
customerId?: string;
|
|
295
|
+
/** Filter by rental resource ID */
|
|
296
|
+
resourceId?: string;
|
|
297
|
+
/** Filter by rental tier IDs */
|
|
298
|
+
tierId?: string[];
|
|
299
|
+
/** Filter by rental reservation statuses */
|
|
300
|
+
status?: RentalReservationStatus[];
|
|
301
|
+
/** Filter by security deposit statuses */
|
|
302
|
+
depositStatus?: DepositStatus[];
|
|
303
|
+
/** Filter by rental start timestamp range */
|
|
304
|
+
dateRange?: {
|
|
305
|
+
start?: number;
|
|
306
|
+
end?: number;
|
|
307
|
+
};
|
|
308
|
+
/** Filter by external source platform */
|
|
309
|
+
externalSource?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Rental reservation sorting options.
|
|
313
|
+
* @interface RentalReservationSorting
|
|
314
|
+
*/
|
|
315
|
+
export interface RentalReservationSorting {
|
|
316
|
+
/** Field to sort by */
|
|
317
|
+
field: "startAt" | "endAt" | "createdAt";
|
|
318
|
+
/** Sort direction */
|
|
319
|
+
direction: "asc" | "desc";
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Rental reservation query options.
|
|
323
|
+
* @interface RentalReservationQueryOptions
|
|
324
|
+
*/
|
|
325
|
+
export interface RentalReservationQueryOptions {
|
|
326
|
+
/** Page number (1-indexed) */
|
|
327
|
+
page: number;
|
|
328
|
+
/** Items per page */
|
|
329
|
+
pageSize: number;
|
|
330
|
+
/** Optional filters */
|
|
331
|
+
filters?: RentalReservationFilters;
|
|
332
|
+
/** Optional sorting */
|
|
333
|
+
sorting?: RentalReservationSorting;
|
|
334
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RentalReAssignmentSchema = exports.UpdateRentalReservationSchema = exports.CreateRentalReservationSchema = exports.RentalReservationSchema = exports.IDRefSchema = exports.WaiverRefSchema = exports.ChecklistCompletionSchema = exports.RentalReservationPaymentSchema = exports.RentalReservationStatus = 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 Rental reservation schema definitions.
|
|
9
|
+
* @module business-mgt/reservation-mgt/rental-reservation
|
|
10
|
+
*/
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// ENUMS
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Rental reservation lifecycle status.
|
|
16
|
+
*
|
|
17
|
+
* @enum {string}
|
|
18
|
+
*/
|
|
19
|
+
var RentalReservationStatus;
|
|
20
|
+
(function (RentalReservationStatus) {
|
|
21
|
+
RentalReservationStatus["UPCOMING"] = "upcoming";
|
|
22
|
+
RentalReservationStatus["PICKUP_SOON"] = "pickup_soon";
|
|
23
|
+
RentalReservationStatus["OUT"] = "out";
|
|
24
|
+
RentalReservationStatus["RETURNED"] = "returned";
|
|
25
|
+
RentalReservationStatus["OVERDUE"] = "overdue";
|
|
26
|
+
RentalReservationStatus["CANCELLED"] = "cancelled";
|
|
27
|
+
})(RentalReservationStatus || (exports.RentalReservationStatus = RentalReservationStatus = {}));
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// RENTAL RESERVATION SUPPORTING SCHEMAS
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Rental reservation payment schema.
|
|
33
|
+
* Captures rental charge and security deposit state for a rental booking.
|
|
34
|
+
*
|
|
35
|
+
* @typedef {Object} RentalReservationPayment
|
|
36
|
+
* @property {number} rentalCharge - Rental charge amount
|
|
37
|
+
* @property {number} securityDeposit - Security deposit amount
|
|
38
|
+
* @property {DepositStatus} depositStatus - Security deposit status
|
|
39
|
+
*/
|
|
40
|
+
exports.RentalReservationPaymentSchema = zod_1.z.object({
|
|
41
|
+
rentalCharge: zod_1.z.number().nonnegative().describe("Rental charge amount"),
|
|
42
|
+
securityDeposit: zod_1.z.number().nonnegative().describe("Security deposit amount"),
|
|
43
|
+
depositStatus: zod_1.z.enum(type_definitions_1.DepositStatus).describe("Security deposit status"),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Checklist completion schema.
|
|
47
|
+
* Tracks completion of checklist items defined on Resource.checklistTemplate.
|
|
48
|
+
*
|
|
49
|
+
* @typedef {Object} ChecklistCompletion
|
|
50
|
+
* @property {string} itemId - Checklist template item ID
|
|
51
|
+
* @property {boolean} completed - Whether the item is completed
|
|
52
|
+
* @property {number} [completedAt] - Completion timestamp
|
|
53
|
+
* @property {string} [completedBy] - User ID that completed the item
|
|
54
|
+
*/
|
|
55
|
+
exports.ChecklistCompletionSchema = zod_1.z.object({
|
|
56
|
+
itemId: zod_1.z.string().describe("Reference to ChecklistTemplateItem.id on the Resource"),
|
|
57
|
+
completed: zod_1.z.boolean().default(false).describe("Whether checklist item is completed"),
|
|
58
|
+
completedAt: zod_1.z.number().nullable().optional().describe("Completion timestamp"),
|
|
59
|
+
completedBy: zod_1.z.string().nullable().optional().describe("User ID who completed this item"),
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Waiver reference schema.
|
|
63
|
+
* Captures waiver document status for rental reservations that require signed waivers.
|
|
64
|
+
*
|
|
65
|
+
* @typedef {Object} WaiverRef
|
|
66
|
+
* @property {string} waiverId - Waiver document ID
|
|
67
|
+
* @property {number} [signedAt] - Waiver signature timestamp
|
|
68
|
+
* @property {string} status - Waiver status
|
|
69
|
+
*/
|
|
70
|
+
exports.WaiverRefSchema = zod_1.z.object({
|
|
71
|
+
waiverId: zod_1.z.string().describe("Waiver document ID"),
|
|
72
|
+
signedAt: zod_1.z.number().nullable().optional().describe("Waiver signature timestamp"),
|
|
73
|
+
status: zod_1.z.enum(["required", "signed", "waived"]).default("required").describe("Waiver status"),
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* Identity verification reference schema.
|
|
77
|
+
* Captures the external identity verification record for a rental reservation.
|
|
78
|
+
*
|
|
79
|
+
* @typedef {Object} IDRef
|
|
80
|
+
* @property {string} verificationId - Identity verification reference ID
|
|
81
|
+
* @property {string} [provider] - Verification provider
|
|
82
|
+
* @property {number} [verifiedAt] - Verification timestamp
|
|
83
|
+
* @property {string} status - Identity verification status
|
|
84
|
+
*/
|
|
85
|
+
exports.IDRefSchema = zod_1.z.object({
|
|
86
|
+
verificationId: zod_1.z.string().describe("Identity verification reference ID"),
|
|
87
|
+
provider: zod_1.z.string().nullable().optional().describe("Verification provider"),
|
|
88
|
+
verifiedAt: zod_1.z.number().nullable().optional().describe("Verification timestamp"),
|
|
89
|
+
status: zod_1.z.enum(["required", "verified", "rejected"]).default("required").describe("Identity verification status"),
|
|
90
|
+
});
|
|
91
|
+
// ============================================================================
|
|
92
|
+
// RENTAL RESERVATION SCHEMA
|
|
93
|
+
// ============================================================================
|
|
94
|
+
/**
|
|
95
|
+
* Rental reservation schema.
|
|
96
|
+
* Represents a time-bounded rental booking with payment, waiver, and inspection state.
|
|
97
|
+
*
|
|
98
|
+
* @typedef {Object} RentalReservation
|
|
99
|
+
* @property {string} [locationId] - Business location where the rental reservation is booked
|
|
100
|
+
* @property {string} [channelId] - Channel that created or owns the booking
|
|
101
|
+
* @property {string} customerId - Customer who owns the rental reservation
|
|
102
|
+
* @property {string} resourceId - Rental resource being reserved
|
|
103
|
+
* @property {number} startAt - Rental start timestamp
|
|
104
|
+
* @property {number} endAt - Rental end timestamp
|
|
105
|
+
* @property {number} [actualReturnAt] - Actual return timestamp
|
|
106
|
+
* @property {string} tierId - Rental tier used for the booking
|
|
107
|
+
* @property {RentalReservationStatus} status - Current rental reservation status
|
|
108
|
+
* @property {RentalReservationPayment} payment - Rental payment and deposit details
|
|
109
|
+
* @property {ChecklistCompletion[]} checklistCompletions - Completed checklist items
|
|
110
|
+
* @property {WaiverRef} [waiver] - Waiver reference and status
|
|
111
|
+
* @property {IDRef} [idVerification] - Identity verification reference and status
|
|
112
|
+
* @property {string} [notes] - Internal staff notes
|
|
113
|
+
* @property {Object} [externalRef] - External platform reference
|
|
114
|
+
*/
|
|
115
|
+
exports.RentalReservationSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
116
|
+
locationId: zod_1.z.string().nullable().optional().describe("Business location ID where the rental reservation is booked. Null applies when the reservation is not location-specific."),
|
|
117
|
+
channelId: zod_1.z.string().nullable().optional().describe("Channel ID for multi-channel bookings (e.g., web, marketplace, partner)"),
|
|
118
|
+
customerId: zod_1.z.string().describe("Customer ID"),
|
|
119
|
+
resourceId: zod_1.z.string().describe("Resource type ID"),
|
|
120
|
+
startAt: zod_1.z.number().describe("Rental start timestamp"),
|
|
121
|
+
endAt: zod_1.z.number().describe("Rental end timestamp"),
|
|
122
|
+
actualReturnAt: zod_1.z.number().nullable().optional().describe("Actual return timestamp"),
|
|
123
|
+
tierId: zod_1.z.string().describe("Rental tier ID (references ReservationSettings.rental.tiers)"),
|
|
124
|
+
status: zod_1.z.enum(RentalReservationStatus).default(RentalReservationStatus.UPCOMING).describe("Rental reservation lifecycle status"),
|
|
125
|
+
payment: exports.RentalReservationPaymentSchema.describe("Rental payment and deposit details"),
|
|
126
|
+
checklistCompletions: zod_1.z.array(exports.ChecklistCompletionSchema).default([]).describe("Completed checklist items (references Resource.checklistTemplate)"),
|
|
127
|
+
waiver: exports.WaiverRefSchema.nullable().optional().describe("Waiver reference"),
|
|
128
|
+
idVerification: exports.IDRefSchema.nullable().optional().describe("Identity verification reference"),
|
|
129
|
+
notes: zod_1.z.string().nullable().optional().describe("Internal notes"),
|
|
130
|
+
externalRef: type_definitions_1.ExternalRefSchema.nullable().optional().describe("External system reference (when imported/synced)"),
|
|
131
|
+
}).superRefine((data, ctx) => {
|
|
132
|
+
if (data.endAt <= data.startAt) {
|
|
133
|
+
ctx.addIssue({
|
|
134
|
+
code: "custom",
|
|
135
|
+
path: ["endAt"],
|
|
136
|
+
message: "endAt must be greater than startAt",
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
if (data.actualReturnAt !== null && data.actualReturnAt !== undefined && data.actualReturnAt < data.startAt) {
|
|
140
|
+
ctx.addIssue({
|
|
141
|
+
code: "custom",
|
|
142
|
+
path: ["actualReturnAt"],
|
|
143
|
+
message: "actualReturnAt must be greater than or equal to startAt",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// CREATE/UPDATE SCHEMAS
|
|
149
|
+
// ============================================================================
|
|
150
|
+
/**
|
|
151
|
+
* Schema for creating a new rental reservation.
|
|
152
|
+
* Omits auto-generated fields.
|
|
153
|
+
*/
|
|
154
|
+
exports.CreateRentalReservationSchema = exports.RentalReservationSchema.omit({
|
|
155
|
+
id: true,
|
|
156
|
+
createdAt: true,
|
|
157
|
+
updatedAt: true,
|
|
158
|
+
});
|
|
159
|
+
/**
|
|
160
|
+
* Schema for updating an existing rental reservation.
|
|
161
|
+
* All fields optional except id.
|
|
162
|
+
*/
|
|
163
|
+
exports.UpdateRentalReservationSchema = exports.CreateRentalReservationSchema.partial().extend({
|
|
164
|
+
id: zod_1.z.string().describe("Unique identifier of the rental reservation to update."),
|
|
165
|
+
// Re-declared without the base `.default()` so partial updates don't inject a status the caller never set
|
|
166
|
+
status: zod_1.z.enum(RentalReservationStatus).nullable().optional().describe("Rental reservation lifecycle status"),
|
|
167
|
+
});
|
|
168
|
+
// ============================================================================
|
|
169
|
+
// REASSIGNMENT SCHEMA
|
|
170
|
+
// ============================================================================
|
|
171
|
+
/**
|
|
172
|
+
* Schema for reassigning a rental reservation to a different rental instance.
|
|
173
|
+
*/
|
|
174
|
+
exports.RentalReAssignmentSchema = zod_1.z.object({
|
|
175
|
+
reservationId: zod_1.z.string().describe("Rental reservation ID being reassigned."),
|
|
176
|
+
toRentalInstanceId: zod_1.z.string().describe("Target rental instance ID the reservation is being moved to."),
|
|
177
|
+
fromRentalInstanceId: zod_1.z.string().nullable().optional().describe("Current rental instance ID the reservation is being moved from."),
|
|
178
|
+
reason: zod_1.z.string().nullable().optional().describe("Optional reason for the reassignment."),
|
|
179
|
+
});
|