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.
Files changed (261) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/dist/core/account/index.d.ts +7 -0
  4. package/dist/core/account/index.js +23 -0
  5. package/dist/core/account/organization.schema.d.ts +118 -0
  6. package/dist/core/account/organization.schema.js +91 -0
  7. package/dist/core/account/project.schema.d.ts +121 -0
  8. package/dist/core/account/project.schema.js +102 -0
  9. package/dist/core/account/supported-business-verticals.d.ts +8 -0
  10. package/dist/core/account/supported-business-verticals.js +23 -0
  11. package/dist/core/assistant-setups/assistant-setup-result.schema.d.ts +115 -0
  12. package/dist/core/assistant-setups/assistant-setup-result.schema.js +17 -0
  13. package/dist/core/assistant-setups/base-assistant-setup.schema.d.ts +61 -0
  14. package/dist/core/assistant-setups/base-assistant-setup.schema.js +29 -0
  15. package/dist/core/assistant-setups/index.d.ts +4 -0
  16. package/dist/core/assistant-setups/index.js +21 -0
  17. package/dist/core/assistant-setups/phone-assistant-setup.schema.d.ts +63 -0
  18. package/dist/core/assistant-setups/phone-assistant-setup.schema.js +14 -0
  19. package/dist/core/assistant-setups/web-assitant-setup.schema.d.ts +56 -0
  20. package/dist/core/assistant-setups/web-assitant-setup.schema.js +17 -0
  21. package/dist/core/base.schema.d.ts +34 -0
  22. package/dist/core/base.schema.js +36 -0
  23. package/dist/core/business-mgt/appointment-additional-info.schema.d.ts +63 -0
  24. package/dist/core/business-mgt/appointment-additional-info.schema.js +53 -0
  25. package/dist/core/business-mgt/appointment-field-config.schema.d.ts +251 -0
  26. package/dist/core/business-mgt/appointment-field-config.schema.js +49 -0
  27. package/dist/core/business-mgt/bookings.shared.schema.d.ts +47 -0
  28. package/dist/core/business-mgt/bookings.shared.schema.js +60 -0
  29. package/dist/core/business-mgt/business-location.schema.d.ts +327 -0
  30. package/dist/core/business-mgt/business-location.schema.js +176 -0
  31. package/dist/core/business-mgt/customer-management/customer-group.schema.d.ts +87 -0
  32. package/dist/core/business-mgt/customer-management/customer-group.schema.js +53 -0
  33. package/dist/core/business-mgt/customer-management/customer.schema.d.ts +156 -0
  34. package/dist/core/business-mgt/customer-management/customer.schema.js +93 -0
  35. package/dist/core/business-mgt/customer-management/index.d.ts +7 -0
  36. package/dist/core/business-mgt/customer-management/index.js +23 -0
  37. package/dist/core/business-mgt/customer-management/shipping-address.schema.d.ts +112 -0
  38. package/dist/core/business-mgt/customer-management/shipping-address.schema.js +79 -0
  39. package/dist/core/business-mgt/customer.schema.d.ts +111 -0
  40. package/dist/core/business-mgt/customer.schema.js +73 -0
  41. package/dist/core/business-mgt/discount-rule.schema.d.ts +183 -0
  42. package/dist/core/business-mgt/discount-rule.schema.js +108 -0
  43. package/dist/core/business-mgt/index.d.ts +16 -0
  44. package/dist/core/business-mgt/index.js +38 -0
  45. package/dist/core/business-mgt/menu-config.schema.d.ts +165 -0
  46. package/dist/core/business-mgt/menu-config.schema.js +86 -0
  47. package/dist/core/business-mgt/menu-management/index.d.ts +11 -0
  48. package/dist/core/business-mgt/menu-management/index.js +27 -0
  49. package/dist/core/business-mgt/menu-management/menu-catalog.schema.d.ts +386 -0
  50. package/dist/core/business-mgt/menu-management/menu-catalog.schema.js +58 -0
  51. package/dist/core/business-mgt/menu-management/menu-config.schema.d.ts +301 -0
  52. package/dist/core/business-mgt/menu-management/menu-config.schema.js +169 -0
  53. package/dist/core/business-mgt/menu-management/menu-item-variant.schema.d.ts +143 -0
  54. package/dist/core/business-mgt/menu-management/menu-item-variant.schema.js +86 -0
  55. package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.d.ts +239 -0
  56. package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.js +117 -0
  57. package/dist/core/business-mgt/menu-management/menu-set.schema.d.ts +420 -0
  58. package/dist/core/business-mgt/menu-management/menu-set.schema.js +283 -0
  59. package/dist/core/business-mgt/menu-management/menu.order.schema.d.ts +654 -0
  60. package/dist/core/business-mgt/menu-management/menu.order.schema.js +204 -0
  61. package/dist/core/business-mgt/menu-management/modifier.schema.d.ts +585 -0
  62. package/dist/core/business-mgt/menu-management/modifier.schema.js +341 -0
  63. package/dist/core/business-mgt/menu.order.schema.d.ts +335 -0
  64. package/dist/core/business-mgt/menu.order.schema.js +149 -0
  65. package/dist/core/business-mgt/order.schema.d.ts +222 -0
  66. package/dist/core/business-mgt/order.schema.js +205 -0
  67. package/dist/core/business-mgt/pricing-rule.shared.schema.d.ts +56 -0
  68. package/dist/core/business-mgt/pricing-rule.shared.schema.js +68 -0
  69. package/dist/core/business-mgt/product-config.schema.d.ts +177 -0
  70. package/dist/core/business-mgt/product-config.schema.js +106 -0
  71. package/dist/core/business-mgt/product-management/index.d.ts +12 -0
  72. package/dist/core/business-mgt/product-management/index.js +28 -0
  73. package/dist/core/business-mgt/product-management/product-axis-binding.schema.d.ts +54 -0
  74. package/dist/core/business-mgt/product-management/product-axis-binding.schema.js +54 -0
  75. package/dist/core/business-mgt/product-management/product-config.schema.d.ts +1042 -0
  76. package/dist/core/business-mgt/product-management/product-config.schema.js +392 -0
  77. package/dist/core/business-mgt/product-management/product-display.schema.d.ts +548 -0
  78. package/dist/core/business-mgt/product-management/product-display.schema.js +80 -0
  79. package/dist/core/business-mgt/product-management/product-order.schema.d.ts +493 -0
  80. package/dist/core/business-mgt/product-management/product-order.schema.js +158 -0
  81. package/dist/core/business-mgt/product-management/product-pricing-rule.schema.d.ts +167 -0
  82. package/dist/core/business-mgt/product-management/product-pricing-rule.schema.js +68 -0
  83. package/dist/core/business-mgt/product-management/product-set.schema.d.ts +488 -0
  84. package/dist/core/business-mgt/product-management/product-set.schema.js +273 -0
  85. package/dist/core/business-mgt/product-management/product-variant-axis.schema.d.ts +156 -0
  86. package/dist/core/business-mgt/product-management/product-variant-axis.schema.js +98 -0
  87. package/dist/core/business-mgt/product-management/product-variant.schema.d.ts +219 -0
  88. package/dist/core/business-mgt/product-management/product-variant.schema.js +130 -0
  89. package/dist/core/business-mgt/product-order.schema.d.ts +326 -0
  90. package/dist/core/business-mgt/product-order.schema.js +153 -0
  91. package/dist/core/business-mgt/property-config.schema.d.ts +621 -0
  92. package/dist/core/business-mgt/property-config.schema.js +224 -0
  93. package/dist/core/business-mgt/property-inquiry.schema.d.ts +222 -0
  94. package/dist/core/business-mgt/property-inquiry.schema.js +112 -0
  95. package/dist/core/business-mgt/property-management/index.d.ts +6 -0
  96. package/dist/core/business-mgt/property-management/index.js +22 -0
  97. package/dist/core/business-mgt/property-management/property-config.schema.d.ts +1306 -0
  98. package/dist/core/business-mgt/property-management/property-config.schema.js +367 -0
  99. package/dist/core/business-mgt/property-management/property-inquiry.schema.d.ts +254 -0
  100. package/dist/core/business-mgt/property-management/property-inquiry.schema.js +131 -0
  101. package/dist/core/business-mgt/reservation-mgt/assignment/index.d.ts +3 -0
  102. package/dist/core/business-mgt/reservation-mgt/assignment/index.js +19 -0
  103. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.d.ts +139 -0
  104. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.js +90 -0
  105. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.d.ts +104 -0
  106. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.js +70 -0
  107. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.d.ts +104 -0
  108. package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.js +72 -0
  109. package/dist/core/business-mgt/reservation-mgt/index.d.ts +14 -0
  110. package/dist/core/business-mgt/reservation-mgt/index.js +31 -0
  111. package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.d.ts +180 -0
  112. package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.js +75 -0
  113. package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.d.ts +91 -0
  114. package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.js +57 -0
  115. package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.d.ts +334 -0
  116. package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.js +179 -0
  117. package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.d.ts +195 -0
  118. package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.js +106 -0
  119. package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.d.ts +402 -0
  120. package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.js +198 -0
  121. package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.d.ts +229 -0
  122. package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.js +127 -0
  123. package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.d.ts +382 -0
  124. package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.js +322 -0
  125. package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.d.ts +123 -0
  126. package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.js +83 -0
  127. package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.d.ts +167 -0
  128. package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.js +84 -0
  129. package/dist/core/business-mgt/reservation-mgt/reservation.schema.d.ts +0 -0
  130. package/dist/core/business-mgt/reservation-mgt/reservation.schema.js +153 -0
  131. package/dist/core/business-mgt/reservation-mgt/resource/index.d.ts +4 -0
  132. package/dist/core/business-mgt/reservation-mgt/resource/index.js +20 -0
  133. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.d.ts +157 -0
  134. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.js +76 -0
  135. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.d.ts +137 -0
  136. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.js +94 -0
  137. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.d.ts +713 -0
  138. package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.js +363 -0
  139. package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.d.ts +151 -0
  140. package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.js +147 -0
  141. package/dist/core/business-mgt/reservation-resource.schema.d.ts +154 -0
  142. package/dist/core/business-mgt/reservation-resource.schema.js +100 -0
  143. package/dist/core/business-mgt/reservation.schema.d.ts +119 -0
  144. package/dist/core/business-mgt/reservation.schema.js +89 -0
  145. package/dist/core/business-mgt/service-appointment.schema.d.ts +105 -0
  146. package/dist/core/business-mgt/service-appointment.schema.js +69 -0
  147. package/dist/core/business-mgt/service-config.schema.d.ts +453 -0
  148. package/dist/core/business-mgt/service-config.schema.js +102 -0
  149. package/dist/core/business-mgt/service-management/appointment-additional-info.schema.d.ts +110 -0
  150. package/dist/core/business-mgt/service-management/appointment-additional-info.schema.js +78 -0
  151. package/dist/core/business-mgt/service-management/appointment-field-config.schema.d.ts +304 -0
  152. package/dist/core/business-mgt/service-management/appointment-field-config.schema.js +75 -0
  153. package/dist/core/business-mgt/service-management/business-service-config.schema.d.ts +1226 -0
  154. package/dist/core/business-mgt/service-management/business-service-config.schema.js +317 -0
  155. package/dist/core/business-mgt/service-management/index.d.ts +13 -0
  156. package/dist/core/business-mgt/service-management/index.js +29 -0
  157. package/dist/core/business-mgt/service-management/service-appointment.schema.d.ts +531 -0
  158. package/dist/core/business-mgt/service-management/service-appointment.schema.js +116 -0
  159. package/dist/core/business-mgt/service-management/service-person.schema.d.ts +122 -0
  160. package/dist/core/business-mgt/service-management/service-person.schema.js +66 -0
  161. package/dist/core/business-mgt/service-management/service-pricing-rule.schema.d.ts +221 -0
  162. package/dist/core/business-mgt/service-management/service-pricing-rule.schema.js +118 -0
  163. package/dist/core/business-mgt/service-management/service-provider.schema.d.ts +90 -0
  164. package/dist/core/business-mgt/service-management/service-provider.schema.js +54 -0
  165. package/dist/core/business-mgt/service-management/service-slot-query.schema.d.ts +90 -0
  166. package/dist/core/business-mgt/service-management/service-slot-query.schema.js +113 -0
  167. package/dist/core/business-mgt/service-management/service-time-off.schema.d.ts +121 -0
  168. package/dist/core/business-mgt/service-management/service-time-off.schema.js +95 -0
  169. package/dist/core/business-mgt/service-person.schema.d.ts +43 -0
  170. package/dist/core/business-mgt/service-person.schema.js +38 -0
  171. package/dist/core/business-mgt/tax-rule.schema.d.ts +161 -0
  172. package/dist/core/business-mgt/tax-rule.schema.js +90 -0
  173. package/dist/core/conversation/conversation-config.schema.d.ts +644 -0
  174. package/dist/core/conversation/conversation-config.schema.js +351 -0
  175. package/dist/core/conversation/conversation-message.schema.d.ts +307 -0
  176. package/dist/core/conversation/conversation-message.schema.js +275 -0
  177. package/dist/core/conversation/index.d.ts +12 -0
  178. package/dist/core/conversation/index.js +28 -0
  179. package/dist/core/conversation/outbound-call.schema.d.ts +209 -0
  180. package/dist/core/conversation/outbound-call.schema.js +116 -0
  181. package/dist/core/conversation/outbound-email.schema.d.ts +338 -0
  182. package/dist/core/conversation/outbound-email.schema.js +150 -0
  183. package/dist/core/conversation/outbound-sms.schema.d.ts +163 -0
  184. package/dist/core/conversation/outbound-sms.schema.js +85 -0
  185. package/dist/core/conversation/outbound-template.schema.d.ts +375 -0
  186. package/dist/core/conversation/outbound-template.schema.js +160 -0
  187. package/dist/core/conversation/translation-config.schema.d.ts +92 -0
  188. package/dist/core/conversation/translation-config.schema.js +88 -0
  189. package/dist/core/conversation/translation-conversation.schema.d.ts +469 -0
  190. package/dist/core/conversation/translation-conversation.schema.js +175 -0
  191. package/dist/core/index.d.ts +12 -0
  192. package/dist/core/index.js +30 -0
  193. package/dist/core/service-configuration/agent-config.schema.d.ts +236 -0
  194. package/dist/core/service-configuration/agent-config.schema.js +152 -0
  195. package/dist/core/service-configuration/base-agent-setup.d.ts +147 -0
  196. package/dist/core/service-configuration/base-agent-setup.js +123 -0
  197. package/dist/core/service-configuration/call-transfer-config.schema.d.ts +60 -0
  198. package/dist/core/service-configuration/call-transfer-config.schema.js +53 -0
  199. package/dist/core/service-configuration/deployment-config.schema.d.ts +522 -0
  200. package/dist/core/service-configuration/deployment-config.schema.js +271 -0
  201. package/dist/core/service-configuration/dynamic_setup/base-agent-setup.d.ts +130 -0
  202. package/dist/core/service-configuration/dynamic_setup/base-agent-setup.js +110 -0
  203. package/dist/core/service-configuration/dynamic_setup/index.d.ts +10 -0
  204. package/dist/core/service-configuration/dynamic_setup/index.js +26 -0
  205. package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.d.ts +111 -0
  206. package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.js +56 -0
  207. package/dist/core/service-configuration/dynamic_setup/web-agent-setup.d.ts +113 -0
  208. package/dist/core/service-configuration/dynamic_setup/web-agent-setup.js +55 -0
  209. package/dist/core/service-configuration/index.d.ts +17 -0
  210. package/dist/core/service-configuration/index.js +33 -0
  211. package/dist/core/service-configuration/instruction-config.schema.d.ts +183 -0
  212. package/dist/core/service-configuration/instruction-config.schema.js +139 -0
  213. package/dist/core/service-configuration/interaction-channels.schema.d.ts +469 -0
  214. package/dist/core/service-configuration/interaction-channels.schema.js +390 -0
  215. package/dist/core/service-configuration/knowledge.schema.d.ts +107 -0
  216. package/dist/core/service-configuration/knowledge.schema.js +106 -0
  217. package/dist/core/service-configuration/phone-config.schema.d.ts +206 -0
  218. package/dist/core/service-configuration/phone-config.schema.js +121 -0
  219. package/dist/core/service-configuration/phone-number.schema.d.ts +236 -0
  220. package/dist/core/service-configuration/phone-number.schema.js +211 -0
  221. package/dist/core/service-configuration/provisioning-config.d.ts +429 -0
  222. package/dist/core/service-configuration/provisioning-config.js +307 -0
  223. package/dist/core/service-configuration/support-llm.d.ts +95 -0
  224. package/dist/core/service-configuration/support-llm.js +76 -0
  225. package/dist/core/service-configuration/voice-language.schema.d.ts +200 -0
  226. package/dist/core/service-configuration/voice-language.schema.js +166 -0
  227. package/dist/core/type-definitions/account-definitions.d.ts +82 -0
  228. package/dist/core/type-definitions/account-definitions.js +88 -0
  229. package/dist/core/type-definitions/business-definitions.d.ts +394 -0
  230. package/dist/core/type-definitions/business-definitions.js +447 -0
  231. package/dist/core/type-definitions/conversation.type.definition.d.ts +223 -0
  232. package/dist/core/type-definitions/conversation.type.definition.js +236 -0
  233. package/dist/core/type-definitions/display-order.d.ts +154 -0
  234. package/dist/core/type-definitions/display-order.js +154 -0
  235. package/dist/core/type-definitions/dynamic-fields/field-definition.schema.d.ts +165 -0
  236. package/dist/core/type-definitions/dynamic-fields/field-definition.schema.js +97 -0
  237. package/dist/core/type-definitions/dynamic-fields/field-types.d.ts +49 -0
  238. package/dist/core/type-definitions/dynamic-fields/field-types.js +104 -0
  239. package/dist/core/type-definitions/dynamic-fields/index.d.ts +9 -0
  240. package/dist/core/type-definitions/dynamic-fields/index.js +25 -0
  241. package/dist/core/type-definitions/index.d.ts +10 -0
  242. package/dist/core/type-definitions/index.js +26 -0
  243. package/dist/core/type-definitions/knowledge-definitions.d.ts +30 -0
  244. package/dist/core/type-definitions/knowledge-definitions.js +37 -0
  245. package/dist/core/type-definitions/service-config.definitions.d.ts +112 -0
  246. package/dist/core/type-definitions/service-config.definitions.js +135 -0
  247. package/dist/core/validators/channel-validation.d.ts +19 -0
  248. package/dist/core/validators/channel-validation.js +40 -0
  249. package/dist/core/validators/index.d.ts +5 -0
  250. package/dist/core/validators/index.js +21 -0
  251. package/dist/index.d.ts +6 -0
  252. package/dist/index.js +24 -0
  253. package/dist/request/index.d.ts +5 -0
  254. package/dist/request/index.js +21 -0
  255. package/dist/request/models/index.d.ts +6 -0
  256. package/dist/request/models/index.js +22 -0
  257. package/dist/request/models/paginated-quest.schema.d.ts +33 -0
  258. package/dist/request/models/paginated-quest.schema.js +35 -0
  259. package/dist/request/models/paginated-result.schema.d.ts +124 -0
  260. package/dist/request/models/paginated-result.schema.js +94 -0
  261. package/package.json +43 -0
@@ -0,0 +1,154 @@
1
+ import { z } from "zod";
2
+ import { ResourceReservationDurationUnit, ResourceType } from "../type-definitions";
3
+ /**
4
+ * @fileoverview Reservation resource schema definitions for various resource types.
5
+ * @module business-mgt/reservation-resource
6
+ */
7
+ /**
8
+ * Room resource schema for hotel/accommodation bookings.
9
+ *
10
+ * @typedef {Object} RoomResource
11
+ * @property {string} roomNumber - Room number or identifier
12
+ * @property {string} roomType - Type of room (e.g., Standard Queen, Deluxe King)
13
+ * @property {number} pricePerNight - Price per night for the room
14
+ * @property {string} [view] - Room view (e.g., City View, Ocean View)
15
+ * @property {string} [bedType] - Type of bed (e.g., Queen, King, Twin)
16
+ * @property {boolean} isSmoking - Whether smoking is allowed
17
+ * @property {string} [accessibilityFeatures] - Accessibility features available
18
+ */
19
+ export declare const RoomResourceSchema: z.ZodObject<{
20
+ roomNumber: z.ZodString;
21
+ roomType: z.ZodString;
22
+ pricePerNight: z.ZodNumber;
23
+ view: z.ZodOptional<z.ZodString>;
24
+ bedType: z.ZodOptional<z.ZodString>;
25
+ isSmoking: z.ZodDefault<z.ZodBoolean>;
26
+ accessibilityFeatures: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>;
28
+ /**
29
+ * Rental resource schema for hourly rentals.
30
+ *
31
+ * @typedef {Object} RentalResource
32
+ * @property {string} itemType - Type of rental item (e.g., Game Room, Conference Room)
33
+ * @property {number} pricePerHour - Hourly rate for this rental
34
+ */
35
+ export declare const RentalResourceSchema: z.ZodObject<{
36
+ itemType: z.ZodString;
37
+ pricePerHour: z.ZodNumber;
38
+ }, z.core.$strip>;
39
+ /**
40
+ * Main resource schema for managing reservable resources.
41
+ *
42
+ * @typedef {Object} Resource
43
+ * @property {string} resourceType - Type of resource
44
+ * @property {string} name - Name of the resource (table, room, etc.)
45
+ * @property {string} [description] - Description of the resource
46
+ * @property {number} [capacity] - Maximum capacity (e.g., number of people)
47
+ * @property {boolean} isAvailable - Whether the resource is available for reservation
48
+ * @property {string} [location] - Physical location of the resource
49
+ * @property {string[]} amenities - Available amenities
50
+ * @property {number} [reservationDuration] - Default reservation duration
51
+ * @property {string} [reservationDurationUnit] - Unit of the default reservation duration
52
+ * @property {string} [calendarId] - Calendar ID for availability sync
53
+ * @property {boolean} syncEnabled - Whether calendar sync is enabled
54
+ * @property {number} [lastSyncAt] - Last sync timestamp
55
+ * @property {Object} [roomResource] - Room-specific fields
56
+ * @property {Object} [rentalResource] - Rental-specific fields
57
+ * @property {Object} [metadata] - Additional metadata for other resource types
58
+ */
59
+ export declare const ResourceSchema: z.ZodObject<{
60
+ id: z.ZodString;
61
+ createdAt: z.ZodOptional<z.ZodNumber>;
62
+ updatedAt: z.ZodOptional<z.ZodNumber>;
63
+ resourceType: z.ZodEnum<typeof ResourceType>;
64
+ name: z.ZodString;
65
+ description: z.ZodOptional<z.ZodString>;
66
+ capacity: z.ZodOptional<z.ZodNumber>;
67
+ isAvailable: z.ZodDefault<z.ZodBoolean>;
68
+ location: z.ZodOptional<z.ZodString>;
69
+ amenities: z.ZodDefault<z.ZodArray<z.ZodString>>;
70
+ reservationDuration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
71
+ reservationDurationUnit: z.ZodNullable<z.ZodOptional<z.ZodEnum<typeof ResourceReservationDurationUnit>>>;
72
+ calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
+ syncEnabled: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
74
+ lastSyncAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
75
+ roomResource: z.ZodOptional<z.ZodNullable<z.ZodObject<{
76
+ roomNumber: z.ZodString;
77
+ roomType: z.ZodString;
78
+ pricePerNight: z.ZodNumber;
79
+ view: z.ZodOptional<z.ZodString>;
80
+ bedType: z.ZodOptional<z.ZodString>;
81
+ isSmoking: z.ZodDefault<z.ZodBoolean>;
82
+ accessibilityFeatures: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strip>>>;
84
+ rentalResource: z.ZodOptional<z.ZodNullable<z.ZodObject<{
85
+ itemType: z.ZodString;
86
+ pricePerHour: z.ZodNumber;
87
+ }, z.core.$strip>>>;
88
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
89
+ }, z.core.$strip>;
90
+ /**
91
+ * Schema for creating a new resource.
92
+ * Omits auto-generated fields.
93
+ */
94
+ export declare const CreateResourceSchema: z.ZodObject<{
95
+ capacity: z.ZodOptional<z.ZodNumber>;
96
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
97
+ name: z.ZodString;
98
+ description: z.ZodOptional<z.ZodString>;
99
+ isAvailable: z.ZodDefault<z.ZodBoolean>;
100
+ amenities: z.ZodDefault<z.ZodArray<z.ZodString>>;
101
+ calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
+ resourceType: z.ZodEnum<typeof ResourceType>;
103
+ location: z.ZodOptional<z.ZodString>;
104
+ reservationDuration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
105
+ reservationDurationUnit: z.ZodNullable<z.ZodOptional<z.ZodEnum<typeof ResourceReservationDurationUnit>>>;
106
+ roomResource: z.ZodOptional<z.ZodNullable<z.ZodObject<{
107
+ roomNumber: z.ZodString;
108
+ roomType: z.ZodString;
109
+ pricePerNight: z.ZodNumber;
110
+ view: z.ZodOptional<z.ZodString>;
111
+ bedType: z.ZodOptional<z.ZodString>;
112
+ isSmoking: z.ZodDefault<z.ZodBoolean>;
113
+ accessibilityFeatures: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strip>>>;
115
+ rentalResource: z.ZodOptional<z.ZodNullable<z.ZodObject<{
116
+ itemType: z.ZodString;
117
+ pricePerHour: z.ZodNumber;
118
+ }, z.core.$strip>>>;
119
+ }, z.core.$strip>;
120
+ /**
121
+ * Schema for updating an existing resource.
122
+ * All fields are optional except id.
123
+ */
124
+ export declare const UpdateResourceSchema: z.ZodObject<{
125
+ capacity: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
126
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
127
+ name: z.ZodOptional<z.ZodString>;
128
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
129
+ isAvailable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
130
+ amenities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
131
+ calendarId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
132
+ resourceType: z.ZodOptional<z.ZodEnum<typeof ResourceType>>;
133
+ location: z.ZodOptional<z.ZodOptional<z.ZodString>>;
134
+ reservationDuration: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
135
+ reservationDurationUnit: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<typeof ResourceReservationDurationUnit>>>>;
136
+ roomResource: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
137
+ roomNumber: z.ZodString;
138
+ roomType: z.ZodString;
139
+ pricePerNight: z.ZodNumber;
140
+ view: z.ZodOptional<z.ZodString>;
141
+ bedType: z.ZodOptional<z.ZodString>;
142
+ isSmoking: z.ZodDefault<z.ZodBoolean>;
143
+ accessibilityFeatures: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>>>>;
145
+ rentalResource: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
146
+ itemType: z.ZodString;
147
+ pricePerHour: z.ZodNumber;
148
+ }, z.core.$strip>>>>;
149
+ id: z.ZodString;
150
+ syncEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
151
+ }, z.core.$strip>;
152
+ export type Resource = z.infer<typeof ResourceSchema>;
153
+ export type CreateResource = z.infer<typeof CreateResourceSchema>;
154
+ export type UpdateResource = z.infer<typeof UpdateResourceSchema>;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateResourceSchema = exports.CreateResourceSchema = exports.ResourceSchema = exports.RentalResourceSchema = exports.RoomResourceSchema = 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 Reservation resource schema definitions for various resource types.
9
+ * @module business-mgt/reservation-resource
10
+ */
11
+ /**
12
+ * Room resource schema for hotel/accommodation bookings.
13
+ *
14
+ * @typedef {Object} RoomResource
15
+ * @property {string} roomNumber - Room number or identifier
16
+ * @property {string} roomType - Type of room (e.g., Standard Queen, Deluxe King)
17
+ * @property {number} pricePerNight - Price per night for the room
18
+ * @property {string} [view] - Room view (e.g., City View, Ocean View)
19
+ * @property {string} [bedType] - Type of bed (e.g., Queen, King, Twin)
20
+ * @property {boolean} isSmoking - Whether smoking is allowed
21
+ * @property {string} [accessibilityFeatures] - Accessibility features available
22
+ */
23
+ exports.RoomResourceSchema = zod_1.z.object({
24
+ roomNumber: zod_1.z.string().describe("Unique room identifier or number (e.g., '101', 'Penthouse A'). Used for guest communication, housekeeping coordination, and reservation assignment."),
25
+ roomType: zod_1.z.string().describe("Room category or class (e.g., 'Standard Queen', 'Deluxe King', 'Executive Suite'). Used by AI Powered Services to match customer preferences with available room types."),
26
+ pricePerNight: zod_1.z.number().nonnegative().describe("Nightly rate for this room in the account's currency. Used for Reservation pricing calculations and dynamic rate management."),
27
+ view: zod_1.z.string().optional().describe("Room view classification (e.g., 'City View', 'Ocean View', 'Garden View'). Premium feature for upselling and guest preference matching."),
28
+ bedType: zod_1.z.string().optional().describe("Bed configuration (e.g., 'Queen', 'King', 'Twin', '2 Double'). Important for guest comfort and party size accommodation."),
29
+ isSmoking: zod_1.z.boolean().default(false).describe("Whether smoking is permitted in this room. Used for guest preference filtering and regulatory compliance. Defaults to false (non-smoking)."),
30
+ accessibilityFeatures: zod_1.z.string().optional().describe("ADA/accessibility accommodations available (e.g., 'Roll-in shower', 'Grab bars', 'Hearing accessible'). Critical for inclusive booking and regulatory compliance."),
31
+ });
32
+ /**
33
+ * Rental resource schema for hourly rentals.
34
+ *
35
+ * @typedef {Object} RentalResource
36
+ * @property {string} itemType - Type of rental item (e.g., Game Room, Conference Room)
37
+ * @property {number} pricePerHour - Hourly rate for this rental
38
+ */
39
+ exports.RentalResourceSchema = zod_1.z.object({
40
+ itemType: zod_1.z.string().describe("Rental category or equipment type (e.g., 'Game Room', 'Conference Room', 'Sports Equipment'). Used by AI Powered Services to categorize and present rental options."),
41
+ pricePerHour: zod_1.z.number().nonnegative().describe("Hourly rental rate in the account's currency. Used for Reservation pricing calculations for time-based bookings."),
42
+ });
43
+ /**
44
+ * Main resource schema for managing reservable resources.
45
+ *
46
+ * @typedef {Object} Resource
47
+ * @property {string} resourceType - Type of resource
48
+ * @property {string} name - Name of the resource (table, room, etc.)
49
+ * @property {string} [description] - Description of the resource
50
+ * @property {number} [capacity] - Maximum capacity (e.g., number of people)
51
+ * @property {boolean} isAvailable - Whether the resource is available for reservation
52
+ * @property {string} [location] - Physical location of the resource
53
+ * @property {string[]} amenities - Available amenities
54
+ * @property {number} [reservationDuration] - Default reservation duration
55
+ * @property {string} [reservationDurationUnit] - Unit of the default reservation duration
56
+ * @property {string} [calendarId] - Calendar ID for availability sync
57
+ * @property {boolean} syncEnabled - Whether calendar sync is enabled
58
+ * @property {number} [lastSyncAt] - Last sync timestamp
59
+ * @property {Object} [roomResource] - Room-specific fields
60
+ * @property {Object} [rentalResource] - Rental-specific fields
61
+ * @property {Object} [metadata] - Additional metadata for other resource types
62
+ */
63
+ exports.ResourceSchema = base_schema_1.BaseModelSchema.safeExtend({
64
+ resourceType: zod_1.z.enum(type_definitions_1.ResourceType).describe("Category of reservable resource: ROOM (hotel/accommodation), TABLE (restaurant seating), RENTAL (hourly equipment/space), or OTHER. Determines pricing model and booking workflow."),
65
+ name: zod_1.z.string().describe("Display name of the resource (e.g., 'Table 5', 'Conference Room A', 'Room 101'). Used by AI Powered Services when presenting reservation options to customers."),
66
+ description: zod_1.z.string().optional().describe("Detailed description of the resource including features, special characteristics, or usage guidelines. Helps customers make informed reservation decisions."),
67
+ capacity: zod_1.z.number().int().positive().optional().describe("Maximum occupancy or party size for this resource (e.g., table seats 4, room sleeps 2). Used by AI Powered Services to match customer group size with appropriate resources."),
68
+ isAvailable: zod_1.z.boolean().default(true).describe("Whether this resource is currently active and available for reservations. Disabled resources are hidden from customers and AI Powered Services. Defaults to true."),
69
+ location: zod_1.z.string().optional().describe("Physical location or placement (e.g., 'Window side', 'Third floor', 'Main dining area'). Helps with customer preferences and operational logistics."),
70
+ amenities: zod_1.z.array(zod_1.z.string()).default([]).describe("List of available features or amenities (e.g., ['WiFi', 'Projector', 'Whiteboard'] for conference room). Used for filtering and customer preference matching. Defaults to empty array."),
71
+ reservationDuration: zod_1.z.number().int().positive().nullable().optional().describe("Default or standard reservation length in specified units. Used for availability slot calculations and customer guidance in Reservation workflow."),
72
+ reservationDurationUnit: zod_1.z.enum(type_definitions_1.ResourceReservationDurationUnit).optional().nullable().describe("Time unit for reservationDuration: HOURS, DAYS, or MINUTES. Determines how reservation pricing and availability are calculated."),
73
+ // Calendar integration (optional)
74
+ calendarId: zod_1.z.string().nullable().optional().describe("External calendar system ID for real-time availability synchronization (Google Calendar, Outlook, etc.). Enables two-way booking sync."),
75
+ syncEnabled: zod_1.z.boolean().nullable().optional().default(false).describe("Whether automatic calendar synchronization is active for this resource. When true, availability updates from external calendar system. Defaults to false."),
76
+ lastSyncAt: zod_1.z.number().nullable().optional().describe("Unix timestamp of most recent calendar synchronization. Used for sync health monitoring and troubleshooting availability discrepancies."),
77
+ // Type-specific fields
78
+ roomResource: exports.RoomResourceSchema.nullable().optional().describe("Hotel/accommodation-specific fields (room number, bed type, view, etc.). Only populated when resourceType is ROOM."),
79
+ rentalResource: exports.RentalResourceSchema.nullable().optional().describe("Hourly rental-specific fields (item type, hourly rate). Only populated when resourceType is RENTAL."),
80
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Extensible key-value storage for custom resource attributes not covered by standard fields. Provides flexibility for unique business requirements."),
81
+ });
82
+ /**
83
+ * Schema for creating a new resource.
84
+ * Omits auto-generated fields.
85
+ */
86
+ exports.CreateResourceSchema = exports.ResourceSchema.omit({
87
+ id: true,
88
+ createdAt: true,
89
+ updatedAt: true,
90
+ lastSyncAt: true,
91
+ syncEnabled: true,
92
+ });
93
+ /**
94
+ * Schema for updating an existing resource.
95
+ * All fields are optional except id.
96
+ */
97
+ exports.UpdateResourceSchema = exports.CreateResourceSchema.partial().safeExtend({
98
+ id: zod_1.z.string(),
99
+ syncEnabled: zod_1.z.boolean().nullable().optional(),
100
+ });
@@ -0,0 +1,119 @@
1
+ import { z } from "zod";
2
+ import { AppointmentStatus, ReservationSettingType, ResourceReservationDurationUnit, ResourceType } from "../type-definitions";
3
+ /**
4
+ * @fileoverview Reservation schema definitions for managing resource reservations.
5
+ * @module business-mgt/reservation
6
+ */
7
+ /**
8
+ * Reservation settings schema.
9
+ *
10
+ * @typedef {Object} ReservationSettings
11
+ * @property {string} reservationType - Type of reservation (table, room, rentals, etc.)
12
+ * @property {string} settingType - Type of reservation setting
13
+ * @property {number} [defaultReservationDuration] - Default reservation duration
14
+ * @property {string} [defaultReservationDurationUnit] - Unit of the default reservation duration
15
+ * @property {boolean} isActive - Whether this reservation setting is active
16
+ */
17
+ export declare const ReservationSettingsSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ createdAt: z.ZodOptional<z.ZodNumber>;
20
+ updatedAt: z.ZodOptional<z.ZodNumber>;
21
+ reservationType: z.ZodEnum<typeof ResourceType>;
22
+ settingType: z.ZodEnum<typeof ReservationSettingType>;
23
+ defaultReservationDuration: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
24
+ defaultReservationDurationUnit: z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof ResourceReservationDurationUnit>>>;
25
+ isActive: z.ZodDefault<z.ZodBoolean>;
26
+ }, z.core.$strip>;
27
+ /**
28
+ * Schema for updating existing reservation settings.
29
+ * All fields are optional except id.
30
+ */
31
+ export declare const UpdateReservationSettingsSchema: z.ZodObject<{
32
+ createdAt: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
33
+ updatedAt: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
34
+ reservationType: z.ZodOptional<z.ZodEnum<typeof ResourceType>>;
35
+ settingType: z.ZodOptional<z.ZodEnum<typeof ReservationSettingType>>;
36
+ defaultReservationDuration: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
37
+ defaultReservationDurationUnit: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof ResourceReservationDurationUnit>>>>;
38
+ isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
39
+ id: z.ZodString;
40
+ }, z.core.$strip>;
41
+ export type ReservationSettings = z.infer<typeof ReservationSettingsSchema>;
42
+ export type UpdateReservationSettings = z.infer<typeof UpdateReservationSettingsSchema>;
43
+ /**
44
+ * Reservation schema for managing bookings.
45
+ *
46
+ * @typedef {Object} Reservation
47
+ * @property {string} reservationType - Type of reservation
48
+ * @property {string} [resourceId] - ID of the reserved resource (table, room, etc.)
49
+ * @property {string} customerId - Customer ID if registered
50
+ * @property {number} startTime - Reservation start time as Unix timestamp
51
+ * @property {number} [endTime] - Reservation end time as Unix timestamp
52
+ * @property {number} [duration] - Duration based on resource type
53
+ * @property {number} [personsNumber] - Number of people for the reservation
54
+ * @property {number} [totalPrice] - Total price for the reservation
55
+ * @property {number} depositPaid - Deposit amount paid
56
+ * @property {string} status - Current reservation status
57
+ * @property {string} [notes] - Special requests or notes
58
+ * @property {string} [cancelReason] - Reason for cancellation, if applicable
59
+ * @property {boolean} isResourceReservation - Indicates if this reservation is for a specific resource
60
+ * @property {string} [serviceConversationConfigId] - Configuration ID for service conversation
61
+ */
62
+ export declare const ReservationSchema: z.ZodObject<{
63
+ id: z.ZodString;
64
+ createdAt: z.ZodOptional<z.ZodNumber>;
65
+ updatedAt: z.ZodOptional<z.ZodNumber>;
66
+ reservationType: z.ZodEnum<typeof ResourceType>;
67
+ resourceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
+ customerId: z.ZodString;
69
+ startTime: z.ZodNumber;
70
+ endTime: z.ZodOptional<z.ZodNumber>;
71
+ duration: z.ZodOptional<z.ZodNumber>;
72
+ personsNumber: z.ZodOptional<z.ZodNumber>;
73
+ totalPrice: z.ZodOptional<z.ZodNumber>;
74
+ depositPaid: z.ZodDefault<z.ZodNumber>;
75
+ status: z.ZodDefault<z.ZodEnum<typeof AppointmentStatus>>;
76
+ notes: z.ZodOptional<z.ZodString>;
77
+ cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
+ isResourceReservation: z.ZodDefault<z.ZodBoolean>;
79
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
+ }, z.core.$strip>;
81
+ /**
82
+ * Schema for creating a new reservation.
83
+ * Omits auto-generated fields.
84
+ */
85
+ export declare const CreateReservationSchema: z.ZodObject<{
86
+ customerId: z.ZodString;
87
+ duration: z.ZodOptional<z.ZodNumber>;
88
+ notes: z.ZodOptional<z.ZodString>;
89
+ totalPrice: z.ZodOptional<z.ZodNumber>;
90
+ reservationType: z.ZodEnum<typeof ResourceType>;
91
+ resourceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
92
+ startTime: z.ZodNumber;
93
+ endTime: z.ZodOptional<z.ZodNumber>;
94
+ personsNumber: z.ZodOptional<z.ZodNumber>;
95
+ depositPaid: z.ZodDefault<z.ZodNumber>;
96
+ isResourceReservation: z.ZodDefault<z.ZodBoolean>;
97
+ }, z.core.$strip>;
98
+ /**
99
+ * Schema for updating an existing reservation.
100
+ * All fields are optional except id.
101
+ */
102
+ export declare const UpdateReservationSchema: z.ZodObject<{
103
+ customerId: z.ZodOptional<z.ZodString>;
104
+ duration: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
105
+ notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
106
+ totalPrice: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
107
+ reservationType: z.ZodOptional<z.ZodEnum<typeof ResourceType>>;
108
+ resourceId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
109
+ startTime: z.ZodOptional<z.ZodNumber>;
110
+ endTime: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
111
+ personsNumber: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
112
+ depositPaid: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
113
+ isResourceReservation: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
114
+ id: z.ZodString;
115
+ cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
116
+ }, z.core.$strip>;
117
+ export type Reservation = z.infer<typeof ReservationSchema>;
118
+ export type CreateReservation = z.infer<typeof CreateReservationSchema>;
119
+ export type UpdateReservation = z.infer<typeof UpdateReservationSchema>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateReservationSchema = exports.CreateReservationSchema = exports.ReservationSchema = exports.UpdateReservationSettingsSchema = exports.ReservationSettingsSchema = 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 Reservation schema definitions for managing resource reservations.
9
+ * @module business-mgt/reservation
10
+ */
11
+ /**
12
+ * Reservation settings schema.
13
+ *
14
+ * @typedef {Object} ReservationSettings
15
+ * @property {string} reservationType - Type of reservation (table, room, rentals, etc.)
16
+ * @property {string} settingType - Type of reservation setting
17
+ * @property {number} [defaultReservationDuration] - Default reservation duration
18
+ * @property {string} [defaultReservationDurationUnit] - Unit of the default reservation duration
19
+ * @property {boolean} isActive - Whether this reservation setting is active
20
+ */
21
+ exports.ReservationSettingsSchema = base_schema_1.BaseModelSchema.safeExtend({
22
+ reservationType: zod_1.z.enum(type_definitions_1.ResourceType).describe("Resource type this setting applies to: ROOM, TABLE, RENTAL, or OTHER. Determines which resources inherit these default reservation parameters."),
23
+ settingType: zod_1.z.enum(type_definitions_1.ReservationSettingType).describe("Configuration category defining what aspect of reservations this setting controls. Enables flexible reservation policy management."),
24
+ defaultReservationDuration: zod_1.z.number().int().positive().default(1).optional().describe("Standard reservation length in specified units. Applied as default when customers make reservations via AI Powered Services. Defaults to 1."),
25
+ defaultReservationDurationUnit: zod_1.z.enum(type_definitions_1.ResourceReservationDurationUnit).optional().default(type_definitions_1.ResourceReservationDurationUnit.HOURS).describe("Time unit for defaultReservationDuration: HOURS (restaurant tables, rentals), DAYS (hotel rooms), or MINUTES (short-term use). Defaults to HOURS."),
26
+ isActive: zod_1.z.boolean().default(false).describe("Whether this configuration is currently active and applied to new reservations. Inactive settings are ignored. Defaults to false."),
27
+ });
28
+ /**
29
+ * Schema for updating existing reservation settings.
30
+ * All fields are optional except id.
31
+ */
32
+ exports.UpdateReservationSettingsSchema = exports.ReservationSettingsSchema.partial().safeExtend({
33
+ id: zod_1.z.string(),
34
+ });
35
+ /**
36
+ * Reservation schema for managing bookings.
37
+ *
38
+ * @typedef {Object} Reservation
39
+ * @property {string} reservationType - Type of reservation
40
+ * @property {string} [resourceId] - ID of the reserved resource (table, room, etc.)
41
+ * @property {string} customerId - Customer ID if registered
42
+ * @property {number} startTime - Reservation start time as Unix timestamp
43
+ * @property {number} [endTime] - Reservation end time as Unix timestamp
44
+ * @property {number} [duration] - Duration based on resource type
45
+ * @property {number} [personsNumber] - Number of people for the reservation
46
+ * @property {number} [totalPrice] - Total price for the reservation
47
+ * @property {number} depositPaid - Deposit amount paid
48
+ * @property {string} status - Current reservation status
49
+ * @property {string} [notes] - Special requests or notes
50
+ * @property {string} [cancelReason] - Reason for cancellation, if applicable
51
+ * @property {boolean} isResourceReservation - Indicates if this reservation is for a specific resource
52
+ * @property {string} [serviceConversationConfigId] - Configuration ID for service conversation
53
+ */
54
+ exports.ReservationSchema = base_schema_1.BaseModelSchema.safeExtend({
55
+ reservationType: zod_1.z.enum(type_definitions_1.ResourceType).describe("Category of reservation: ROOM (hotel stay), TABLE (restaurant seating), RENTAL (hourly/daily equipment/space), or OTHER. Determines pricing model and fulfillment workflow."),
56
+ resourceId: zod_1.z.string().optional().nullable().describe("References specific Resource from reservation-resource.schema being reserved (e.g., 'Table 5', 'Room 101'). Null for general availability reservations without specific resource assignment."),
57
+ customerId: zod_1.z.string().describe("References Customer who made this reservation. Links to customer profile for history, preferences, and communication."),
58
+ startTime: zod_1.z.number().describe("Unix timestamp for reservation start. Critical for availability management, customer notifications, and operational scheduling."),
59
+ endTime: zod_1.z.number().optional().describe("Unix timestamp for reservation end. Calculated from startTime + duration. Used for availability blocking and checkout management."),
60
+ duration: zod_1.z.number().nonnegative().optional().describe("Reservation length in units matching reservationType (hours for TABLE/RENTAL, days for ROOM). Used for pricing calculations and availability management."),
61
+ personsNumber: zod_1.z.number().int().nonnegative().optional().describe("Party size or occupancy count. Used to match customers with appropriately sized resources (table capacity, room occupancy). Critical for resource allocation."),
62
+ totalPrice: zod_1.z.number().nonnegative().optional().describe("Total reservation cost in account's currency. Calculated from duration, resource pricing, and any applicable fees. Used for payment processing."),
63
+ depositPaid: zod_1.z.number().nonnegative().default(0).describe("Deposit amount already paid to secure reservation. Used for payment tracking and no-show protection. Defaults to 0."),
64
+ status: zod_1.z.enum(type_definitions_1.AppointmentStatus).default(type_definitions_1.AppointmentStatus.PENDING).describe("Current reservation status tracking from booking through check-in to completion. Used for operational workflow and customer notifications. Defaults to PENDING."),
65
+ notes: zod_1.z.string().optional().describe("Customer's special requests or preferences (e.g., 'window table', 'early check-in', 'quiet room'). Communicated to staff for enhanced service delivery."),
66
+ cancelReason: zod_1.z.string().nullable().optional().describe("Reason provided when reservation is cancelled. Used for analytics, refund processing, and customer service improvement."),
67
+ isResourceReservation: zod_1.z.boolean().default(false).describe("Whether this is a specific resource reservation (true) or general availability booking (false). True when resourceId is assigned. Defaults to false."),
68
+ serviceConversationConfigId: zod_1.z.string().nullable().optional().describe("References the AI Powered Services conversation configuration that powered this reservation. Links reservation to deployment channel and conversation history."),
69
+ });
70
+ /**
71
+ * Schema for creating a new reservation.
72
+ * Omits auto-generated fields.
73
+ */
74
+ exports.CreateReservationSchema = exports.ReservationSchema.omit({
75
+ id: true,
76
+ createdAt: true,
77
+ updatedAt: true,
78
+ status: true,
79
+ cancelReason: true,
80
+ serviceConversationConfigId: true,
81
+ });
82
+ /**
83
+ * Schema for updating an existing reservation.
84
+ * All fields are optional except id.
85
+ */
86
+ exports.UpdateReservationSchema = exports.CreateReservationSchema.partial().safeExtend({
87
+ id: zod_1.z.string(),
88
+ cancelReason: zod_1.z.string().nullable().optional(),
89
+ });
@@ -0,0 +1,105 @@
1
+ import z from "zod";
2
+ import { AppointmentStatus, CalendarProvider, ResourceType } from "../type-definitions";
3
+ /**
4
+ * @fileoverview Service appointment schema definitions for managing appointment bookings.
5
+ * @module business-mgt/service-appointment
6
+ */
7
+ /**
8
+ * Service appointment schema.
9
+ *
10
+ * @typedef {Object} ServiceAppointment
11
+ * @property {string} businessServiceId - ID of the service being booked
12
+ * @property {string} customerId - Customer ID if registered
13
+ * @property {number} startTime - Appointment start time as Unix timestamp
14
+ * @property {number} [endTime] - Appointment end time as Unix timestamp
15
+ * @property {number} duration - Duration in minutes
16
+ * @property {number} totalPrice - Total price for the service
17
+ * @property {number} depositPaid - Deposit amount paid
18
+ * @property {string} status - Current appointment status
19
+ * @property {string} [assignedUserAccountId] - User account managing the appointment
20
+ * @property {string} [calendarId] - Calendar ID where appointment is stored
21
+ * @property {string} [calendarEventId] - External calendar event ID
22
+ * @property {string} [calendarProvider] - Calendar provider type
23
+ * @property {string} [cancelReason] - Reason for cancellation, if applicable
24
+ * @property {string} [serviceConversationConfigId] - Configuration ID for service conversation
25
+ */
26
+ export declare const ServiceAppointmentSchema: z.ZodObject<{
27
+ id: z.ZodString;
28
+ createdAt: z.ZodOptional<z.ZodNumber>;
29
+ updatedAt: z.ZodOptional<z.ZodNumber>;
30
+ businessServiceId: z.ZodString;
31
+ customerId: z.ZodString;
32
+ startTime: z.ZodNumber;
33
+ endTime: z.ZodOptional<z.ZodNumber>;
34
+ duration: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
35
+ totalPrice: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
36
+ depositPaid: z.ZodDefault<z.ZodNumber>;
37
+ status: z.ZodDefault<z.ZodEnum<typeof AppointmentStatus>>;
38
+ assignedUserAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ calendarEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
+ calendarProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>;
42
+ cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ serviceConversationConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ }, z.core.$strip>;
45
+ /**
46
+ * Schema for creating a new service appointment.
47
+ * Omits auto-generated fields.
48
+ */
49
+ export declare const CreateServiceAppointmentSchema: z.ZodObject<{
50
+ businessServiceId: z.ZodString;
51
+ customerId: z.ZodString;
52
+ duration: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
53
+ totalPrice: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
54
+ assignedUserAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ calendarId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ calendarEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ calendarProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>;
58
+ startTime: z.ZodNumber;
59
+ endTime: z.ZodOptional<z.ZodNumber>;
60
+ depositPaid: z.ZodDefault<z.ZodNumber>;
61
+ }, z.core.$strip>;
62
+ /**
63
+ * Schema for updating an existing service appointment.
64
+ * All fields are optional except id.
65
+ */
66
+ export declare const UpdateServiceAppointmentSchema: z.ZodObject<{
67
+ businessServiceId: z.ZodOptional<z.ZodString>;
68
+ customerId: z.ZodOptional<z.ZodString>;
69
+ duration: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
70
+ totalPrice: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
71
+ assignedUserAccountId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
72
+ calendarId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
73
+ calendarEventId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
74
+ calendarProvider: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof CalendarProvider>>>>;
75
+ startTime: z.ZodOptional<z.ZodNumber>;
76
+ endTime: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
77
+ depositPaid: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
78
+ id: z.ZodString;
79
+ cancelReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
+ }, z.core.$strip>;
81
+ export type ServiceAppointment = z.infer<typeof ServiceAppointmentSchema>;
82
+ export type CreateServiceAppointment = z.infer<typeof CreateServiceAppointmentSchema>;
83
+ export type UpdateServiceAppointment = z.infer<typeof UpdateServiceAppointmentSchema>;
84
+ export interface ReservationFilters {
85
+ search?: string;
86
+ status?: AppointmentStatus[];
87
+ reservationType?: ResourceType[];
88
+ resourceId?: string;
89
+ customerId?: string;
90
+ isResourceReservation?: boolean;
91
+ dateRange?: {
92
+ start?: number;
93
+ end?: number;
94
+ };
95
+ }
96
+ export interface ReservationSorting {
97
+ field: 'startTime' | 'endTime' | 'createdAt';
98
+ direction: 'asc' | 'desc';
99
+ }
100
+ export interface ReservationQueryOptions {
101
+ page: number;
102
+ pageSize: number;
103
+ filters?: ReservationFilters;
104
+ sorting?: ReservationSorting;
105
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UpdateServiceAppointmentSchema = exports.CreateServiceAppointmentSchema = exports.ServiceAppointmentSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const base_schema_1 = require("../base.schema");
9
+ const type_definitions_1 = require("../type-definitions");
10
+ /**
11
+ * @fileoverview Service appointment schema definitions for managing appointment bookings.
12
+ * @module business-mgt/service-appointment
13
+ */
14
+ /**
15
+ * Service appointment schema.
16
+ *
17
+ * @typedef {Object} ServiceAppointment
18
+ * @property {string} businessServiceId - ID of the service being booked
19
+ * @property {string} customerId - Customer ID if registered
20
+ * @property {number} startTime - Appointment start time as Unix timestamp
21
+ * @property {number} [endTime] - Appointment end time as Unix timestamp
22
+ * @property {number} duration - Duration in minutes
23
+ * @property {number} totalPrice - Total price for the service
24
+ * @property {number} depositPaid - Deposit amount paid
25
+ * @property {string} status - Current appointment status
26
+ * @property {string} [assignedUserAccountId] - User account managing the appointment
27
+ * @property {string} [calendarId] - Calendar ID where appointment is stored
28
+ * @property {string} [calendarEventId] - External calendar event ID
29
+ * @property {string} [calendarProvider] - Calendar provider type
30
+ * @property {string} [cancelReason] - Reason for cancellation, if applicable
31
+ * @property {string} [serviceConversationConfigId] - Configuration ID for service conversation
32
+ */
33
+ exports.ServiceAppointmentSchema = base_schema_1.BaseModelSchema.safeExtend({
34
+ businessServiceId: zod_1.default.string().describe("References Business Service from service-config.schema being booked. Links appointment to service catalog for pricing, duration, and service details."),
35
+ customerId: zod_1.default.string().describe("References Customer who booked this appointment. Links to customer profile for history, preferences, and communication."),
36
+ startTime: zod_1.default.number().describe("Unix timestamp for appointment start. Critical for Service Person scheduling, availability management, and customer notifications."),
37
+ endTime: zod_1.default.number().optional().describe("Unix timestamp for appointment end. Calculated from startTime + duration. Used for calendar blocking and scheduling next appointments."),
38
+ duration: zod_1.default.number().int().positive().default(30).optional().describe("Appointment length in minutes. Typically inherited from Business Service duration but can be customized per appointment. Defaults to 30 minutes."),
39
+ totalPrice: zod_1.default.number().nonnegative().default(0).optional().describe("Total service cost in account's currency. Typically inherited from Business Service price but may include customizations or discounts. Defaults to 0 for complimentary services."),
40
+ depositPaid: zod_1.default.number().nonnegative().default(0).describe("Deposit amount already paid to secure appointment. Used for payment tracking and no-show protection. Defaults to 0."),
41
+ status: zod_1.default.enum(type_definitions_1.AppointmentStatus).default(type_definitions_1.AppointmentStatus.PENDING).describe("Current appointment status tracking from booking through completion or cancellation. Used for operational workflow and customer notifications. Defaults to PENDING."),
42
+ // Calendar Integration
43
+ assignedUserAccountId: zod_1.default.string().nullable().optional().describe("References Service Person assigned to perform this service. Links to accountId from service-person.schema for provider scheduling and workload distribution."),
44
+ calendarId: zod_1.default.string().nullable().optional().describe("External calendar system ID where this appointment is synced (Google Calendar, Outlook, etc.). Enables two-way appointment synchronization."),
45
+ calendarEventId: zod_1.default.string().nullable().optional().describe("Event ID in external calendar system. Used to update or delete calendar events when appointment changes. Links WIIL appointment to calendar provider's event."),
46
+ calendarProvider: zod_1.default.enum(type_definitions_1.CalendarProvider).nullable().optional().describe("Calendar system type (GOOGLE, MICROSOFT, APPLE, etc.). Determines API endpoints and authentication for calendar sync operations."),
47
+ cancelReason: zod_1.default.string().nullable().optional().describe("Reason provided when appointment is cancelled. Used for analytics, refund processing, and service improvement."),
48
+ serviceConversationConfigId: zod_1.default.string().nullable().optional().describe("References the AI Powered Services conversation configuration that powered this appointment booking. Links appointment to deployment channel and conversation history."),
49
+ });
50
+ /**
51
+ * Schema for creating a new service appointment.
52
+ * Omits auto-generated fields.
53
+ */
54
+ exports.CreateServiceAppointmentSchema = exports.ServiceAppointmentSchema.omit({
55
+ id: true,
56
+ createdAt: true,
57
+ updatedAt: true,
58
+ status: true,
59
+ cancelReason: true,
60
+ serviceConversationConfigId: true,
61
+ });
62
+ /**
63
+ * Schema for updating an existing service appointment.
64
+ * All fields are optional except id.
65
+ */
66
+ exports.UpdateServiceAppointmentSchema = exports.CreateServiceAppointmentSchema.partial().safeExtend({
67
+ id: zod_1.default.string(),
68
+ cancelReason: zod_1.default.string().nullable().optional(),
69
+ });