@lyxa.ai/core 1.4.298-alpha.1 → 1.4.298

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 (991) hide show
  1. package/dist/libraries/mongo/models/embedded/service-line-item.model.d.ts +4 -6
  2. package/dist/libraries/mongo/models/embedded/service-line-item.model.js +8 -18
  3. package/dist/libraries/mongo/models/embedded/service-line-item.model.js.map +1 -1
  4. package/dist/libraries/mongo/models/service-booking.model.d.ts +0 -1
  5. package/dist/libraries/mongo/models/service-booking.model.js +0 -5
  6. package/dist/libraries/mongo/models/service-booking.model.js.map +1 -1
  7. package/dist/types/README.md +1 -1
  8. package/dist/types/index.js.map +1 -0
  9. package/dist/types/libraries/auth/index.d.ts +77 -0
  10. package/dist/types/libraries/auth/index.js +270 -0
  11. package/dist/types/libraries/auth/index.js.map +1 -0
  12. package/dist/types/libraries/auth/refreshtoken.d.ts +15 -0
  13. package/dist/types/libraries/auth/refreshtoken.js +91 -0
  14. package/dist/types/libraries/auth/refreshtoken.js.map +1 -0
  15. package/dist/types/libraries/auth/repository.d.ts +18 -0
  16. package/dist/types/libraries/auth/repository.js +43 -0
  17. package/dist/types/libraries/auth/repository.js.map +1 -0
  18. package/dist/types/libraries/bullmq/bull-mq-service.d.ts +9 -0
  19. package/dist/types/libraries/bullmq/bull-mq-service.js +42 -0
  20. package/dist/types/libraries/bullmq/bull-mq-service.js.map +1 -0
  21. package/dist/types/libraries/cache/settings/index.d.ts +7 -0
  22. package/dist/types/libraries/cache/settings/index.js +56 -0
  23. package/dist/types/libraries/cache/settings/index.js.map +1 -0
  24. package/dist/types/libraries/cash-settlement/cashSettlementService.d.ts +16 -0
  25. package/dist/types/libraries/cash-settlement/cashSettlementService.js +53 -0
  26. package/dist/types/libraries/cash-settlement/cashSettlementService.js.map +1 -0
  27. package/dist/types/libraries/cash-settlement/index.d.ts +2 -0
  28. package/dist/types/libraries/cash-settlement/index.js +19 -0
  29. package/dist/types/libraries/cash-settlement/index.js.map +1 -0
  30. package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.d.ts +24 -0
  31. package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js +10 -0
  32. package/dist/types/libraries/cash-settlement/interfaces/ICashSettlement.js.map +1 -0
  33. package/dist/types/libraries/cash-settlement/providers/bob.d.ts +45 -0
  34. package/dist/types/libraries/cash-settlement/providers/bob.js +634 -0
  35. package/dist/types/libraries/cash-settlement/providers/bob.js.map +1 -0
  36. package/dist/types/libraries/cash-settlement/providers/index.d.ts +1 -0
  37. package/dist/types/libraries/cash-settlement/providers/index.js +18 -0
  38. package/dist/types/libraries/cash-settlement/providers/index.js.map +1 -0
  39. package/dist/types/libraries/cloud-storage/CloudStorageFactory.d.ts +7 -0
  40. package/dist/types/libraries/cloud-storage/CloudStorageFactory.js +18 -0
  41. package/dist/types/libraries/cloud-storage/CloudStorageFactory.js.map +1 -0
  42. package/dist/types/libraries/cloud-storage/index.d.ts +4 -0
  43. package/dist/types/libraries/cloud-storage/index.js +21 -0
  44. package/dist/types/libraries/cloud-storage/index.js.map +1 -0
  45. package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.d.ts +8 -0
  46. package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js +3 -0
  47. package/dist/types/libraries/cloud-storage/interfaces/ICloudStorage.js.map +1 -0
  48. package/dist/types/libraries/cloud-storage/providers/GcsStorageService.d.ts +11 -0
  49. package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js +63 -0
  50. package/dist/types/libraries/cloud-storage/providers/GcsStorageService.js.map +1 -0
  51. package/dist/types/libraries/cloud-storage/types/FileUploadResult.d.ts +11 -0
  52. package/dist/types/libraries/cloud-storage/types/FileUploadResult.js +3 -0
  53. package/dist/types/libraries/cloud-storage/types/FileUploadResult.js.map +1 -0
  54. package/dist/types/libraries/configuration/index.d.ts +39 -0
  55. package/dist/types/libraries/configuration/index.js +84 -0
  56. package/dist/types/libraries/configuration/index.js.map +1 -0
  57. package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.d.ts +9 -0
  58. package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js +14 -0
  59. package/dist/types/libraries/configuration/types/EnvironmentConfigurationType.js.map +1 -0
  60. package/dist/types/libraries/dispatcher/index.d.ts +10 -0
  61. package/dist/types/libraries/dispatcher/index.js +43 -0
  62. package/dist/types/libraries/dispatcher/index.js.map +1 -0
  63. package/dist/types/libraries/event/BaseEvent.d.ts +7 -0
  64. package/dist/types/libraries/event/BaseEvent.js +19 -0
  65. package/dist/types/libraries/event/BaseEvent.js.map +1 -0
  66. package/dist/types/libraries/event/EventEnums.d.ts +26 -0
  67. package/dist/types/libraries/event/EventEnums.js +31 -0
  68. package/dist/types/libraries/event/EventEnums.js.map +1 -0
  69. package/dist/types/libraries/event/decorators/metadata.d.ts +13 -0
  70. package/dist/types/libraries/event/decorators/metadata.js +20 -0
  71. package/dist/types/libraries/event/decorators/metadata.js.map +1 -0
  72. package/dist/types/libraries/event/events/index.d.ts +2 -0
  73. package/dist/types/libraries/event/events/index.js +19 -0
  74. package/dist/types/libraries/event/events/index.js.map +1 -0
  75. package/dist/types/libraries/event/events/payout/index.d.ts +1 -0
  76. package/dist/types/libraries/event/events/payout/index.js +18 -0
  77. package/dist/types/libraries/event/events/payout/index.js.map +1 -0
  78. package/dist/types/libraries/event/events/payout/payout-schedule.event.d.ts +9 -0
  79. package/dist/types/libraries/event/events/payout/payout-schedule.event.js +12 -0
  80. package/dist/types/libraries/event/events/payout/payout-schedule.event.js.map +1 -0
  81. package/dist/types/libraries/event/events/rider/cash/index.d.ts +5 -0
  82. package/dist/types/libraries/event/events/rider/cash/index.js +14 -0
  83. package/dist/types/libraries/event/events/rider/cash/index.js.map +1 -0
  84. package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.d.ts +11 -0
  85. package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js +19 -0
  86. package/dist/types/libraries/event/events/rider/cash/rider-cash-added.event.js.map +1 -0
  87. package/dist/types/libraries/event/events/rider/cash/rider-cash-event.d.ts +11 -0
  88. package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js +18 -0
  89. package/dist/types/libraries/event/events/rider/cash/rider-cash-event.js.map +1 -0
  90. package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.d.ts +10 -0
  91. package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js +17 -0
  92. package/dist/types/libraries/event/events/rider/cash/rider-cash-hold-period-changed.event.js.map +1 -0
  93. package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.d.ts +11 -0
  94. package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js +19 -0
  95. package/dist/types/libraries/event/events/rider/cash/rider-cash-settled.event.js.map +1 -0
  96. package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.d.ts +10 -0
  97. package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js +17 -0
  98. package/dist/types/libraries/event/events/rider/cash/rider-max-cash-balance-for-bob-payout-updated.event.js.map +1 -0
  99. package/dist/types/libraries/event/events/rider/index.d.ts +2 -0
  100. package/dist/types/libraries/event/events/rider/index.js +19 -0
  101. package/dist/types/libraries/event/events/rider/index.js.map +1 -0
  102. package/dist/types/libraries/event/events/rider/scoring/index.d.ts +7 -0
  103. package/dist/types/libraries/event/events/rider/scoring/index.js +18 -0
  104. package/dist/types/libraries/event/events/rider/scoring/index.js.map +1 -0
  105. package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.d.ts +11 -0
  106. package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js +20 -0
  107. package/dist/types/libraries/event/events/rider/scoring/rider-accepted-order.event.js.map +1 -0
  108. package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.d.ts +13 -0
  109. package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js +24 -0
  110. package/dist/types/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js.map +1 -0
  111. package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.d.ts +11 -0
  112. package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js +20 -0
  113. package/dist/types/libraries/event/events/rider/scoring/rider-assigned-order.event.js.map +1 -0
  114. package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.d.ts +13 -0
  115. package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js +24 -0
  116. package/dist/types/libraries/event/events/rider/scoring/rider-delivered-order.event.js.map +1 -0
  117. package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.d.ts +19 -0
  118. package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js +36 -0
  119. package/dist/types/libraries/event/events/rider/scoring/rider-order-completed.event.js.map +1 -0
  120. package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.d.ts +13 -0
  121. package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js +18 -0
  122. package/dist/types/libraries/event/events/rider/scoring/rider-rating.event.js.map +1 -0
  123. package/dist/types/libraries/event/events/rider/scoring/rider-score-event.d.ts +14 -0
  124. package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js +21 -0
  125. package/dist/types/libraries/event/events/rider/scoring/rider-score-event.js.map +1 -0
  126. package/dist/types/libraries/event/index.d.ts +11 -0
  127. package/dist/types/libraries/event/index.js +152 -0
  128. package/dist/types/libraries/event/index.js.map +1 -0
  129. package/dist/types/libraries/event/registry/SubscriptionRegistry.d.ts +11 -0
  130. package/dist/types/libraries/event/registry/SubscriptionRegistry.js +14 -0
  131. package/dist/types/libraries/event/registry/SubscriptionRegistry.js.map +1 -0
  132. package/dist/types/libraries/firebase/index.d.ts +16 -0
  133. package/dist/types/libraries/firebase/index.js +107 -0
  134. package/dist/types/libraries/firebase/index.js.map +1 -0
  135. package/dist/types/libraries/google-translate/google-translate.client.d.ts +5 -0
  136. package/dist/types/libraries/google-translate/google-translate.client.js +44 -0
  137. package/dist/types/libraries/google-translate/google-translate.client.js.map +1 -0
  138. package/dist/types/libraries/google-translate/google-translate.dto.d.ts +13 -0
  139. package/dist/types/libraries/google-translate/google-translate.dto.js +3 -0
  140. package/dist/types/libraries/google-translate/google-translate.dto.js.map +1 -0
  141. package/dist/types/libraries/google-translate/google-translate.service.d.ts +9 -0
  142. package/dist/types/libraries/google-translate/google-translate.service.js +102 -0
  143. package/dist/types/libraries/google-translate/google-translate.service.js.map +1 -0
  144. package/dist/types/libraries/google-translate/index.d.ts +1 -0
  145. package/dist/types/libraries/google-translate/index.js +18 -0
  146. package/dist/types/libraries/google-translate/index.js.map +1 -0
  147. package/dist/types/libraries/index.d.ts +43 -0
  148. package/dist/types/libraries/index.js +102 -0
  149. package/dist/types/libraries/index.js.map +1 -0
  150. package/dist/types/libraries/llm/interfaces/common-llm-interfaces.d.ts +28 -0
  151. package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js +3 -0
  152. package/dist/types/libraries/llm/interfaces/common-llm-interfaces.js.map +1 -0
  153. package/dist/types/libraries/llm/llm-provider-service.d.ts +13 -0
  154. package/dist/types/libraries/llm/llm-provider-service.js +47 -0
  155. package/dist/types/libraries/llm/llm-provider-service.js.map +1 -0
  156. package/dist/types/libraries/llm/providers/openai-provider.d.ts +19 -0
  157. package/dist/types/libraries/llm/providers/openai-provider.js +223 -0
  158. package/dist/types/libraries/llm/providers/openai-provider.js.map +1 -0
  159. package/dist/types/libraries/logger/index.d.ts +8 -0
  160. package/dist/types/libraries/logger/index.js +75 -0
  161. package/dist/types/libraries/logger/index.js.map +1 -0
  162. package/dist/types/libraries/logger-kit/index.d.ts +3 -0
  163. package/dist/types/libraries/logger-kit/index.js +22 -0
  164. package/dist/types/libraries/logger-kit/index.js.map +1 -0
  165. package/dist/types/libraries/logger-kit/logger.service.d.ts +117 -0
  166. package/dist/types/libraries/logger-kit/logger.service.js +304 -0
  167. package/dist/types/libraries/logger-kit/logger.service.js.map +1 -0
  168. package/dist/types/libraries/logger-kit/types.d.ts +34 -0
  169. package/dist/types/libraries/logger-kit/types.js +3 -0
  170. package/dist/types/libraries/logger-kit/types.js.map +1 -0
  171. package/dist/types/libraries/map/index.d.ts +2 -0
  172. package/dist/types/libraries/map/index.js +19 -0
  173. package/dist/types/libraries/map/index.js.map +1 -0
  174. package/dist/types/libraries/map/interfaces/IMapService.d.ts +43 -0
  175. package/dist/types/libraries/map/interfaces/IMapService.js +9 -0
  176. package/dist/types/libraries/map/interfaces/IMapService.js.map +1 -0
  177. package/dist/types/libraries/map/mapService.d.ts +21 -0
  178. package/dist/types/libraries/map/mapService.js +57 -0
  179. package/dist/types/libraries/map/mapService.js.map +1 -0
  180. package/dist/types/libraries/map/providers/google-maps.d.ts +27 -0
  181. package/dist/types/libraries/map/providers/google-maps.js +462 -0
  182. package/dist/types/libraries/map/providers/google-maps.js.map +1 -0
  183. package/dist/types/libraries/map/providers/index.d.ts +1 -0
  184. package/dist/types/libraries/map/providers/index.js +18 -0
  185. package/dist/types/libraries/map/providers/index.js.map +1 -0
  186. package/dist/types/libraries/map/providers/osrm.d.ts +13 -0
  187. package/dist/types/libraries/map/providers/osrm.js +137 -0
  188. package/dist/types/libraries/map/providers/osrm.js.map +1 -0
  189. package/dist/types/libraries/mongo/index.d.ts +7 -0
  190. package/dist/types/libraries/mongo/index.js +87 -0
  191. package/dist/types/libraries/mongo/index.js.map +1 -0
  192. package/dist/types/libraries/mongo/models/activity-log.model.d.ts +10 -0
  193. package/dist/types/libraries/mongo/models/activity-log.model.js +48 -0
  194. package/dist/types/libraries/mongo/models/activity-log.model.js.map +1 -0
  195. package/dist/types/libraries/mongo/models/admin-access-control.model.d.ts +11 -0
  196. package/dist/types/libraries/mongo/models/admin-access-control.model.js +75 -0
  197. package/dist/types/libraries/mongo/models/admin-access-control.model.js.map +1 -0
  198. package/dist/types/libraries/mongo/models/admin.model.d.ts +11 -0
  199. package/dist/types/libraries/mongo/models/admin.model.js +65 -0
  200. package/dist/types/libraries/mongo/models/admin.model.js.map +1 -0
  201. package/dist/types/libraries/mongo/models/agent-performance.model.d.ts +15 -0
  202. package/dist/types/libraries/mongo/models/agent-performance.model.js +73 -0
  203. package/dist/types/libraries/mongo/models/agent-performance.model.js.map +1 -0
  204. package/dist/types/libraries/mongo/models/app-appearance.model.d.ts +25 -0
  205. package/dist/types/libraries/mongo/models/app-appearance.model.js +102 -0
  206. package/dist/types/libraries/mongo/models/app-appearance.model.js.map +1 -0
  207. package/dist/types/libraries/mongo/models/app-instance.model.d.ts +10 -0
  208. package/dist/types/libraries/mongo/models/app-instance.model.js +54 -0
  209. package/dist/types/libraries/mongo/models/app-instance.model.js.map +1 -0
  210. package/dist/types/libraries/mongo/models/attribute.model.d.ts +13 -0
  211. package/dist/types/libraries/mongo/models/attribute.model.js +58 -0
  212. package/dist/types/libraries/mongo/models/attribute.model.js.map +1 -0
  213. package/dist/types/libraries/mongo/models/banner.model.d.ts +27 -0
  214. package/dist/types/libraries/mongo/models/banner.model.js +118 -0
  215. package/dist/types/libraries/mongo/models/banner.model.js.map +1 -0
  216. package/dist/types/libraries/mongo/models/base/base-coupon.model.d.ts +19 -0
  217. package/dist/types/libraries/mongo/models/base/base-coupon.model.js +90 -0
  218. package/dist/types/libraries/mongo/models/base/base-coupon.model.js.map +1 -0
  219. package/dist/types/libraries/mongo/models/bob-finance.model.d.ts +19 -0
  220. package/dist/types/libraries/mongo/models/bob-finance.model.js +88 -0
  221. package/dist/types/libraries/mongo/models/bob-finance.model.js.map +1 -0
  222. package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.d.ts +9 -0
  223. package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js +48 -0
  224. package/dist/types/libraries/mongo/models/booking-cancellation-rescheduling-rules.model.js.map +1 -0
  225. package/dist/types/libraries/mongo/models/brand.model.d.ts +5 -0
  226. package/dist/types/libraries/mongo/models/brand.model.js +32 -0
  227. package/dist/types/libraries/mongo/models/brand.model.js.map +1 -0
  228. package/dist/types/libraries/mongo/models/cancellation-reason.model.d.ts +8 -0
  229. package/dist/types/libraries/mongo/models/cancellation-reason.model.js +55 -0
  230. package/dist/types/libraries/mongo/models/cancellation-reason.model.js.map +1 -0
  231. package/dist/types/libraries/mongo/models/card.model.d.ts +19 -0
  232. package/dist/types/libraries/mongo/models/card.model.js +88 -0
  233. package/dist/types/libraries/mongo/models/card.model.js.map +1 -0
  234. package/dist/types/libraries/mongo/models/cart-participant.model.d.ts +29 -0
  235. package/dist/types/libraries/mongo/models/cart-participant.model.js +130 -0
  236. package/dist/types/libraries/mongo/models/cart-participant.model.js.map +1 -0
  237. package/dist/types/libraries/mongo/models/cart.model.d.ts +39 -0
  238. package/dist/types/libraries/mongo/models/cart.model.js +184 -0
  239. package/dist/types/libraries/mongo/models/cart.model.js.map +1 -0
  240. package/dist/types/libraries/mongo/models/category.model.d.ts +12 -0
  241. package/dist/types/libraries/mongo/models/category.model.js +68 -0
  242. package/dist/types/libraries/mongo/models/category.model.js.map +1 -0
  243. package/dist/types/libraries/mongo/models/chat-room.model.d.ts +28 -0
  244. package/dist/types/libraries/mongo/models/chat-room.model.js +99 -0
  245. package/dist/types/libraries/mongo/models/chat-room.model.js.map +1 -0
  246. package/dist/types/libraries/mongo/models/copy-attribute-map.model.d.ts +8 -0
  247. package/dist/types/libraries/mongo/models/copy-attribute-map.model.js +38 -0
  248. package/dist/types/libraries/mongo/models/copy-attribute-map.model.js.map +1 -0
  249. package/dist/types/libraries/mongo/models/copy-product-job.model.d.ts +21 -0
  250. package/dist/types/libraries/mongo/models/copy-product-job.model.js +101 -0
  251. package/dist/types/libraries/mongo/models/copy-product-job.model.js.map +1 -0
  252. package/dist/types/libraries/mongo/models/copy-product-map.model.d.ts +8 -0
  253. package/dist/types/libraries/mongo/models/copy-product-map.model.js +38 -0
  254. package/dist/types/libraries/mongo/models/copy-product-map.model.js.map +1 -0
  255. package/dist/types/libraries/mongo/models/copy-shop-category-map.model.d.ts +8 -0
  256. package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js +38 -0
  257. package/dist/types/libraries/mongo/models/copy-shop-category-map.model.js.map +1 -0
  258. package/dist/types/libraries/mongo/models/core-auth-identity.model.d.ts +7 -0
  259. package/dist/types/libraries/mongo/models/core-auth-identity.model.js +32 -0
  260. package/dist/types/libraries/mongo/models/core-auth-identity.model.js.map +1 -0
  261. package/dist/types/libraries/mongo/models/core-user.model.d.ts +16 -0
  262. package/dist/types/libraries/mongo/models/core-user.model.js +85 -0
  263. package/dist/types/libraries/mongo/models/core-user.model.js.map +1 -0
  264. package/dist/types/libraries/mongo/models/counter.model.d.ts +8 -0
  265. package/dist/types/libraries/mongo/models/counter.model.js +42 -0
  266. package/dist/types/libraries/mongo/models/counter.model.js.map +1 -0
  267. package/dist/types/libraries/mongo/models/coupon.model.d.ts +13 -0
  268. package/dist/types/libraries/mongo/models/coupon.model.js +60 -0
  269. package/dist/types/libraries/mongo/models/coupon.model.js.map +1 -0
  270. package/dist/types/libraries/mongo/models/deal-setting.model.d.ts +10 -0
  271. package/dist/types/libraries/mongo/models/deal-setting.model.js +52 -0
  272. package/dist/types/libraries/mongo/models/deal-setting.model.js.map +1 -0
  273. package/dist/types/libraries/mongo/models/default-chat.model.d.ts +4 -0
  274. package/dist/types/libraries/mongo/models/default-chat.model.js +26 -0
  275. package/dist/types/libraries/mongo/models/default-chat.model.js.map +1 -0
  276. package/dist/types/libraries/mongo/models/delivery-charges.model.d.ts +13 -0
  277. package/dist/types/libraries/mongo/models/delivery-charges.model.js +63 -0
  278. package/dist/types/libraries/mongo/models/delivery-charges.model.js.map +1 -0
  279. package/dist/types/libraries/mongo/models/dish.model.d.ts +18 -0
  280. package/dist/types/libraries/mongo/models/dish.model.js +92 -0
  281. package/dist/types/libraries/mongo/models/dish.model.js.map +1 -0
  282. package/dist/types/libraries/mongo/models/embedded/address-change-history.model.d.ts +25 -0
  283. package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js +112 -0
  284. package/dist/types/libraries/mongo/models/embedded/address-change-history.model.js.map +1 -0
  285. package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.d.ts +33 -0
  286. package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js +133 -0
  287. package/dist/types/libraries/mongo/models/embedded/adjustment-information.model.js.map +1 -0
  288. package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.d.ts +4 -0
  289. package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js +27 -0
  290. package/dist/types/libraries/mongo/models/embedded/agent-notification-setting.model.js.map +1 -0
  291. package/dist/types/libraries/mongo/models/embedded/app-force-update.d.ts +9 -0
  292. package/dist/types/libraries/mongo/models/embedded/app-force-update.js +52 -0
  293. package/dist/types/libraries/mongo/models/embedded/app-force-update.js.map +1 -0
  294. package/dist/types/libraries/mongo/models/embedded/attribute-item.model.d.ts +5 -0
  295. package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js +32 -0
  296. package/dist/types/libraries/mongo/models/embedded/attribute-item.model.js.map +1 -0
  297. package/dist/types/libraries/mongo/models/embedded/attribute-map.model.d.ts +7 -0
  298. package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js +29 -0
  299. package/dist/types/libraries/mongo/models/embedded/attribute-map.model.js.map +1 -0
  300. package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.d.ts +4 -0
  301. package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js +27 -0
  302. package/dist/types/libraries/mongo/models/embedded/business-development-setting.model.js.map +1 -0
  303. package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.d.ts +9 -0
  304. package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js +52 -0
  305. package/dist/types/libraries/mongo/models/embedded/cash-settlement.model.js.map +1 -0
  306. package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.d.ts +5 -0
  307. package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js +32 -0
  308. package/dist/types/libraries/mongo/models/embedded/cashback-amounts.model.js.map +1 -0
  309. package/dist/types/libraries/mongo/models/embedded/charge.model.d.ts +5 -0
  310. package/dist/types/libraries/mongo/models/embedded/charge.model.js +28 -0
  311. package/dist/types/libraries/mongo/models/embedded/charge.model.js.map +1 -0
  312. package/dist/types/libraries/mongo/models/embedded/chat-participant.model.d.ts +18 -0
  313. package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js +64 -0
  314. package/dist/types/libraries/mongo/models/embedded/chat-participant.model.js.map +1 -0
  315. package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.d.ts +4 -0
  316. package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js +27 -0
  317. package/dist/types/libraries/mongo/models/embedded/cleaning-material.model.js.map +1 -0
  318. package/dist/types/libraries/mongo/models/embedded/company-info.model.d.ts +6 -0
  319. package/dist/types/libraries/mongo/models/embedded/company-info.model.js +37 -0
  320. package/dist/types/libraries/mongo/models/embedded/company-info.model.js.map +1 -0
  321. package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.d.ts +9 -0
  322. package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js +36 -0
  323. package/dist/types/libraries/mongo/models/embedded/courier-order-finance.model.js.map +1 -0
  324. package/dist/types/libraries/mongo/models/embedded/courier-setting.model.d.ts +4 -0
  325. package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js +27 -0
  326. package/dist/types/libraries/mongo/models/embedded/courier-setting.model.js.map +1 -0
  327. package/dist/types/libraries/mongo/models/embedded/currency-setting.model.d.ts +7 -0
  328. package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js +38 -0
  329. package/dist/types/libraries/mongo/models/embedded/currency-setting.model.js.map +1 -0
  330. package/dist/types/libraries/mongo/models/embedded/currency.model.d.ts +5 -0
  331. package/dist/types/libraries/mongo/models/embedded/currency.model.js +32 -0
  332. package/dist/types/libraries/mongo/models/embedded/currency.model.js.map +1 -0
  333. package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.d.ts +4 -0
  334. package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js +27 -0
  335. package/dist/types/libraries/mongo/models/embedded/customer-support-batches.model.js.map +1 -0
  336. package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.d.ts +4 -0
  337. package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js +27 -0
  338. package/dist/types/libraries/mongo/models/embedded/customer-support-numbers.model.js.map +1 -0
  339. package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.d.ts +10 -0
  340. package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js +51 -0
  341. package/dist/types/libraries/mongo/models/embedded/delivery-charge-setting.model.js.map +1 -0
  342. package/dist/types/libraries/mongo/models/embedded/delivery-info.model.d.ts +4 -0
  343. package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js +27 -0
  344. package/dist/types/libraries/mongo/models/embedded/delivery-info.model.js.map +1 -0
  345. package/dist/types/libraries/mongo/models/embedded/external-ref.model.d.ts +4 -0
  346. package/dist/types/libraries/mongo/models/embedded/external-ref.model.js +32 -0
  347. package/dist/types/libraries/mongo/models/embedded/external-ref.model.js.map +1 -0
  348. package/dist/types/libraries/mongo/models/embedded/featured-item.mode.d.ts +6 -0
  349. package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js +33 -0
  350. package/dist/types/libraries/mongo/models/embedded/featured-item.mode.js.map +1 -0
  351. package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.d.ts +7 -0
  352. package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js +38 -0
  353. package/dist/types/libraries/mongo/models/embedded/frequency-configuration.model.js.map +1 -0
  354. package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.d.ts +17 -0
  355. package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js +63 -0
  356. package/dist/types/libraries/mongo/models/embedded/line-item-attribute.model.js.map +1 -0
  357. package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.d.ts +46 -0
  358. package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js +178 -0
  359. package/dist/types/libraries/mongo/models/embedded/marketing-cut.model.js.map +1 -0
  360. package/dist/types/libraries/mongo/models/embedded/order-cancel.model.d.ts +26 -0
  361. package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js +110 -0
  362. package/dist/types/libraries/mongo/models/embedded/order-cancel.model.js.map +1 -0
  363. package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.d.ts +12 -0
  364. package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js +67 -0
  365. package/dist/types/libraries/mongo/models/embedded/order-delivery-information.model.js.map +1 -0
  366. package/dist/types/libraries/mongo/models/embedded/order-finance.model.d.ts +18 -0
  367. package/dist/types/libraries/mongo/models/embedded/order-finance.model.js +64 -0
  368. package/dist/types/libraries/mongo/models/embedded/order-finance.model.js.map +1 -0
  369. package/dist/types/libraries/mongo/models/embedded/order-pricing.model.d.ts +34 -0
  370. package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js +163 -0
  371. package/dist/types/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -0
  372. package/dist/types/libraries/mongo/models/embedded/order-refund.model.d.ts +28 -0
  373. package/dist/types/libraries/mongo/models/embedded/order-refund.model.js +113 -0
  374. package/dist/types/libraries/mongo/models/embedded/order-refund.model.js.map +1 -0
  375. package/dist/types/libraries/mongo/models/embedded/otp-fields.model.d.ts +7 -0
  376. package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js +46 -0
  377. package/dist/types/libraries/mongo/models/embedded/otp-fields.model.js.map +1 -0
  378. package/dist/types/libraries/mongo/models/embedded/package.model.d.ts +25 -0
  379. package/dist/types/libraries/mongo/models/embedded/package.model.js +86 -0
  380. package/dist/types/libraries/mongo/models/embedded/package.model.js.map +1 -0
  381. package/dist/types/libraries/mongo/models/embedded/parent-document.model.d.ts +5 -0
  382. package/dist/types/libraries/mongo/models/embedded/parent-document.model.js +32 -0
  383. package/dist/types/libraries/mongo/models/embedded/parent-document.model.js.map +1 -0
  384. package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.d.ts +7 -0
  385. package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js +38 -0
  386. package/dist/types/libraries/mongo/models/embedded/payment-infromation.model.js.map +1 -0
  387. package/dist/types/libraries/mongo/models/embedded/payment-record.model.d.ts +10 -0
  388. package/dist/types/libraries/mongo/models/embedded/payment-record.model.js +53 -0
  389. package/dist/types/libraries/mongo/models/embedded/payment-record.model.js.map +1 -0
  390. package/dist/types/libraries/mongo/models/embedded/payout-setting.model.d.ts +5 -0
  391. package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js +28 -0
  392. package/dist/types/libraries/mongo/models/embedded/payout-setting.model.js.map +1 -0
  393. package/dist/types/libraries/mongo/models/embedded/plus-settings.model.d.ts +6 -0
  394. package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js +33 -0
  395. package/dist/types/libraries/mongo/models/embedded/plus-settings.model.js.map +1 -0
  396. package/dist/types/libraries/mongo/models/embedded/preparing-time.model.d.ts +4 -0
  397. package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js +27 -0
  398. package/dist/types/libraries/mongo/models/embedded/preparing-time.model.js.map +1 -0
  399. package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.d.ts +16 -0
  400. package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js +80 -0
  401. package/dist/types/libraries/mongo/models/embedded/price-breakdown.model.js.map +1 -0
  402. package/dist/types/libraries/mongo/models/embedded/product-category.model.d.ts +4 -0
  403. package/dist/types/libraries/mongo/models/embedded/product-category.model.js +32 -0
  404. package/dist/types/libraries/mongo/models/embedded/product-category.model.js.map +1 -0
  405. package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.d.ts +17 -0
  406. package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js +72 -0
  407. package/dist/types/libraries/mongo/models/embedded/product-marketing-info.model.js.map +1 -0
  408. package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.d.ts +5 -0
  409. package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js +32 -0
  410. package/dist/types/libraries/mongo/models/embedded/product-nutrition.model.js.map +1 -0
  411. package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.d.ts +12 -0
  412. package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js +60 -0
  413. package/dist/types/libraries/mongo/models/embedded/product-search-fields.model.js.map +1 -0
  414. package/dist/types/libraries/mongo/models/embedded/product-snap.model.d.ts +16 -0
  415. package/dist/types/libraries/mongo/models/embedded/product-snap.model.js +79 -0
  416. package/dist/types/libraries/mongo/models/embedded/product-snap.model.js.map +1 -0
  417. package/dist/types/libraries/mongo/models/embedded/profit.model.d.ts +22 -0
  418. package/dist/types/libraries/mongo/models/embedded/profit.model.js +96 -0
  419. package/dist/types/libraries/mongo/models/embedded/profit.model.js.map +1 -0
  420. package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.d.ts +6 -0
  421. package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js +38 -0
  422. package/dist/types/libraries/mongo/models/embedded/referral-discount-config.model.js.map +1 -0
  423. package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.d.ts +18 -0
  424. package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js +73 -0
  425. package/dist/types/libraries/mongo/models/embedded/regular-order-finance.model.js.map +1 -0
  426. package/dist/types/libraries/mongo/models/embedded/replacement-order.model.d.ts +28 -0
  427. package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js +109 -0
  428. package/dist/types/libraries/mongo/models/embedded/replacement-order.model.js.map +1 -0
  429. package/dist/types/libraries/mongo/models/embedded/rest-password.model.d.ts +4 -0
  430. package/dist/types/libraries/mongo/models/embedded/rest-password.model.js +27 -0
  431. package/dist/types/libraries/mongo/models/embedded/rest-password.model.js.map +1 -0
  432. package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.d.ts +9 -0
  433. package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js +44 -0
  434. package/dist/types/libraries/mongo/models/embedded/rider-assignment-model.js.map +1 -0
  435. package/dist/types/libraries/mongo/models/embedded/rider-batches.model.d.ts +4 -0
  436. package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js +27 -0
  437. package/dist/types/libraries/mongo/models/embedded/rider-batches.model.js.map +1 -0
  438. package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.d.ts +4 -0
  439. package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js +27 -0
  440. package/dist/types/libraries/mongo/models/embedded/rider-equipment.model.js.map +1 -0
  441. package/dist/types/libraries/mongo/models/embedded/rider-setting.model.d.ts +8 -0
  442. package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js +47 -0
  443. package/dist/types/libraries/mongo/models/embedded/rider-setting.model.js.map +1 -0
  444. package/dist/types/libraries/mongo/models/embedded/rider-statistics.d.ts +11 -0
  445. package/dist/types/libraries/mongo/models/embedded/rider-statistics.js +62 -0
  446. package/dist/types/libraries/mongo/models/embedded/rider-statistics.js.map +1 -0
  447. package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.d.ts +18 -0
  448. package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js +77 -0
  449. package/dist/types/libraries/mongo/models/embedded/service-booking-cancellation-details.model.js.map +1 -0
  450. package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.d.ts +23 -0
  451. package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js +85 -0
  452. package/dist/types/libraries/mongo/models/embedded/service-booking-finance.model.js.map +1 -0
  453. package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.d.ts +24 -0
  454. package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js +127 -0
  455. package/dist/types/libraries/mongo/models/embedded/service-booking-pricing.model.js.map +1 -0
  456. package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.d.ts +16 -0
  457. package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js +70 -0
  458. package/dist/types/libraries/mongo/models/embedded/service-booking-refund-information.model.js.map +1 -0
  459. package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.d.ts +19 -0
  460. package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js +76 -0
  461. package/dist/types/libraries/mongo/models/embedded/service-booking-replacement-information.model.js.map +1 -0
  462. package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.d.ts +9 -0
  463. package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js +57 -0
  464. package/dist/types/libraries/mongo/models/embedded/service-booking-settings.model.js.map +1 -0
  465. package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.d.ts +5 -0
  466. package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js +28 -0
  467. package/dist/types/libraries/mongo/models/embedded/service-fee-setting.model.js.map +1 -0
  468. package/dist/types/libraries/mongo/models/embedded/service-line-item.model.d.ts +38 -0
  469. package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js +154 -0
  470. package/dist/types/libraries/mongo/models/embedded/service-line-item.model.js.map +1 -0
  471. package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.d.ts +5 -0
  472. package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js +32 -0
  473. package/dist/types/libraries/mongo/models/embedded/shop-company-details.model.js.map +1 -0
  474. package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.d.ts +12 -0
  475. package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js +47 -0
  476. package/dist/types/libraries/mongo/models/embedded/shop-default-category.model.js.map +1 -0
  477. package/dist/types/libraries/mongo/models/embedded/shop-document.model.d.ts +6 -0
  478. package/dist/types/libraries/mongo/models/embedded/shop-document.model.js +37 -0
  479. package/dist/types/libraries/mongo/models/embedded/shop-document.model.js.map +1 -0
  480. package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.d.ts +15 -0
  481. package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js +75 -0
  482. package/dist/types/libraries/mongo/models/embedded/shop-search-fields.model.js.map +1 -0
  483. package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.d.ts +8 -0
  484. package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js +43 -0
  485. package/dist/types/libraries/mongo/models/embedded/spend-to-get-tier.model.js.map +1 -0
  486. package/dist/types/libraries/mongo/models/embedded/status-timeline.model.d.ts +25 -0
  487. package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js +97 -0
  488. package/dist/types/libraries/mongo/models/embedded/status-timeline.model.js.map +1 -0
  489. package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.d.ts +8 -0
  490. package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js +47 -0
  491. package/dist/types/libraries/mongo/models/embedded/subscription-summary.model.js.map +1 -0
  492. package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.d.ts +4 -0
  493. package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js +27 -0
  494. package/dist/types/libraries/mongo/models/embedded/support-reason-info.model.js.map +1 -0
  495. package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.d.ts +28 -0
  496. package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js +134 -0
  497. package/dist/types/libraries/mongo/models/embedded/trip-leg.mode.js.map +1 -0
  498. package/dist/types/libraries/mongo/models/embedded/vat.model.d.ts +5 -0
  499. package/dist/types/libraries/mongo/models/embedded/vat.model.js +32 -0
  500. package/dist/types/libraries/mongo/models/embedded/vat.model.js.map +1 -0
  501. package/dist/types/libraries/mongo/models/embedded/wallet.model.d.ts +5 -0
  502. package/dist/types/libraries/mongo/models/embedded/wallet.model.js +32 -0
  503. package/dist/types/libraries/mongo/models/embedded/wallet.model.js.map +1 -0
  504. package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.d.ts +5 -0
  505. package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js +28 -0
  506. package/dist/types/libraries/mongo/models/embedded/zone-geometry.mode.js.map +1 -0
  507. package/dist/types/libraries/mongo/models/favourite.model.d.ts +14 -0
  508. package/dist/types/libraries/mongo/models/favourite.model.js +52 -0
  509. package/dist/types/libraries/mongo/models/favourite.model.js.map +1 -0
  510. package/dist/types/libraries/mongo/models/featured-setting.model.d.ts +7 -0
  511. package/dist/types/libraries/mongo/models/featured-setting.model.js +33 -0
  512. package/dist/types/libraries/mongo/models/featured-setting.model.js.map +1 -0
  513. package/dist/types/libraries/mongo/models/filter-container.model.d.ts +10 -0
  514. package/dist/types/libraries/mongo/models/filter-container.model.js +63 -0
  515. package/dist/types/libraries/mongo/models/filter-container.model.js.map +1 -0
  516. package/dist/types/libraries/mongo/models/finance-settlement.model.d.ts +41 -0
  517. package/dist/types/libraries/mongo/models/finance-settlement.model.js +175 -0
  518. package/dist/types/libraries/mongo/models/finance-settlement.model.js.map +1 -0
  519. package/dist/types/libraries/mongo/models/flag.model.d.ts +22 -0
  520. package/dist/types/libraries/mongo/models/flag.model.js +83 -0
  521. package/dist/types/libraries/mongo/models/flag.model.js.map +1 -0
  522. package/dist/types/libraries/mongo/models/gallery-upload.model.d.ts +17 -0
  523. package/dist/types/libraries/mongo/models/gallery-upload.model.js +77 -0
  524. package/dist/types/libraries/mongo/models/gallery-upload.model.js.map +1 -0
  525. package/dist/types/libraries/mongo/models/gallery.model.d.ts +13 -0
  526. package/dist/types/libraries/mongo/models/gallery.model.js +59 -0
  527. package/dist/types/libraries/mongo/models/gallery.model.js.map +1 -0
  528. package/dist/types/libraries/mongo/models/google-maps-usage.model.d.ts +21 -0
  529. package/dist/types/libraries/mongo/models/google-maps-usage.model.js +255 -0
  530. package/dist/types/libraries/mongo/models/google-maps-usage.model.js.map +1 -0
  531. package/dist/types/libraries/mongo/models/index.d.ts +395 -0
  532. package/dist/types/libraries/mongo/models/index.js +485 -0
  533. package/dist/types/libraries/mongo/models/index.js.map +1 -0
  534. package/dist/types/libraries/mongo/models/integration-configuration.model.d.ts +5 -0
  535. package/dist/types/libraries/mongo/models/integration-configuration.model.js +33 -0
  536. package/dist/types/libraries/mongo/models/integration-configuration.model.js.map +1 -0
  537. package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.d.ts +9 -0
  538. package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js +45 -0
  539. package/dist/types/libraries/mongo/models/limited-time-offer-campaign-session.model.js.map +1 -0
  540. package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.d.ts +14 -0
  541. package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js +76 -0
  542. package/dist/types/libraries/mongo/models/limited-time-offer-campaign.model.js.map +1 -0
  543. package/dist/types/libraries/mongo/models/limited-time-offer-config.d.ts +6 -0
  544. package/dist/types/libraries/mongo/models/limited-time-offer-config.js +36 -0
  545. package/dist/types/libraries/mongo/models/limited-time-offer-config.js.map +1 -0
  546. package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.d.ts +22 -0
  547. package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js +96 -0
  548. package/dist/types/libraries/mongo/models/limited-time-offer-participant.model.js.map +1 -0
  549. package/dist/types/libraries/mongo/models/line-item.model.d.ts +47 -0
  550. package/dist/types/libraries/mongo/models/line-item.model.js +205 -0
  551. package/dist/types/libraries/mongo/models/line-item.model.js.map +1 -0
  552. package/dist/types/libraries/mongo/models/list-container.model.d.ts +19 -0
  553. package/dist/types/libraries/mongo/models/list-container.model.js +92 -0
  554. package/dist/types/libraries/mongo/models/list-container.model.js.map +1 -0
  555. package/dist/types/libraries/mongo/models/log.model.d.ts +35 -0
  556. package/dist/types/libraries/mongo/models/log.model.js +163 -0
  557. package/dist/types/libraries/mongo/models/log.model.js.map +1 -0
  558. package/dist/types/libraries/mongo/models/marketing.model.d.ts +18 -0
  559. package/dist/types/libraries/mongo/models/marketing.model.js +88 -0
  560. package/dist/types/libraries/mongo/models/marketing.model.js.map +1 -0
  561. package/dist/types/libraries/mongo/models/meal-plan.model.d.ts +9 -0
  562. package/dist/types/libraries/mongo/models/meal-plan.model.js +51 -0
  563. package/dist/types/libraries/mongo/models/meal-plan.model.js.map +1 -0
  564. package/dist/types/libraries/mongo/models/message.model.d.ts +25 -0
  565. package/dist/types/libraries/mongo/models/message.model.js +105 -0
  566. package/dist/types/libraries/mongo/models/message.model.js.map +1 -0
  567. package/dist/types/libraries/mongo/models/notification.model.d.ts +53 -0
  568. package/dist/types/libraries/mongo/models/notification.model.js +201 -0
  569. package/dist/types/libraries/mongo/models/notification.model.js.map +1 -0
  570. package/dist/types/libraries/mongo/models/nutrition.model.d.ts +6 -0
  571. package/dist/types/libraries/mongo/models/nutrition.model.js +33 -0
  572. package/dist/types/libraries/mongo/models/nutrition.model.js.map +1 -0
  573. package/dist/types/libraries/mongo/models/order.model.d.ts +66 -0
  574. package/dist/types/libraries/mongo/models/order.model.js +350 -0
  575. package/dist/types/libraries/mongo/models/order.model.js.map +1 -0
  576. package/dist/types/libraries/mongo/models/parent.model.d.ts +29 -0
  577. package/dist/types/libraries/mongo/models/parent.model.js +144 -0
  578. package/dist/types/libraries/mongo/models/parent.model.js.map +1 -0
  579. package/dist/types/libraries/mongo/models/payment-configuration.model.d.ts +6 -0
  580. package/dist/types/libraries/mongo/models/payment-configuration.model.js +33 -0
  581. package/dist/types/libraries/mongo/models/payment-configuration.model.js.map +1 -0
  582. package/dist/types/libraries/mongo/models/payment-intent.model.d.ts +17 -0
  583. package/dist/types/libraries/mongo/models/payment-intent.model.js +79 -0
  584. package/dist/types/libraries/mongo/models/payment-intent.model.js.map +1 -0
  585. package/dist/types/libraries/mongo/models/payout.model.d.ts +15 -0
  586. package/dist/types/libraries/mongo/models/payout.model.js +86 -0
  587. package/dist/types/libraries/mongo/models/payout.model.js.map +1 -0
  588. package/dist/types/libraries/mongo/models/product-brand.model.d.ts +7 -0
  589. package/dist/types/libraries/mongo/models/product-brand.model.js +38 -0
  590. package/dist/types/libraries/mongo/models/product-brand.model.js.map +1 -0
  591. package/dist/types/libraries/mongo/models/product-marketing.model.d.ts +13 -0
  592. package/dist/types/libraries/mongo/models/product-marketing.model.js +57 -0
  593. package/dist/types/libraries/mongo/models/product-marketing.model.js.map +1 -0
  594. package/dist/types/libraries/mongo/models/product-stock-tracker.model.d.ts +15 -0
  595. package/dist/types/libraries/mongo/models/product-stock-tracker.model.js +57 -0
  596. package/dist/types/libraries/mongo/models/product-stock-tracker.model.js.map +1 -0
  597. package/dist/types/libraries/mongo/models/product-upload.model.d.ts +25 -0
  598. package/dist/types/libraries/mongo/models/product-upload.model.js +105 -0
  599. package/dist/types/libraries/mongo/models/product-upload.model.js.map +1 -0
  600. package/dist/types/libraries/mongo/models/product.model.d.ts +63 -0
  601. package/dist/types/libraries/mongo/models/product.model.js +339 -0
  602. package/dist/types/libraries/mongo/models/product.model.js.map +1 -0
  603. package/dist/types/libraries/mongo/models/professional-blocked-time.model.d.ts +10 -0
  604. package/dist/types/libraries/mongo/models/professional-blocked-time.model.js +49 -0
  605. package/dist/types/libraries/mongo/models/professional-blocked-time.model.js.map +1 -0
  606. package/dist/types/libraries/mongo/models/professional.model.d.ts +17 -0
  607. package/dist/types/libraries/mongo/models/professional.model.js +91 -0
  608. package/dist/types/libraries/mongo/models/professional.model.js.map +1 -0
  609. package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.d.ts +16 -0
  610. package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js +62 -0
  611. package/dist/types/libraries/mongo/models/providers/buy1-get1-marketing.model.js.map +1 -0
  612. package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.d.ts +5 -0
  613. package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js +28 -0
  614. package/dist/types/libraries/mongo/models/providers/core-apple-auth-identity.model.js.map +1 -0
  615. package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.d.ts +9 -0
  616. package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js +69 -0
  617. package/dist/types/libraries/mongo/models/providers/core-email-auth-identity.model.js.map +1 -0
  618. package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.d.ts +5 -0
  619. package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js +28 -0
  620. package/dist/types/libraries/mongo/models/providers/core-google-auth-identity.model.js.map +1 -0
  621. package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.d.ts +6 -0
  622. package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js +29 -0
  623. package/dist/types/libraries/mongo/models/providers/core-phone-auth-identity.model.js.map +1 -0
  624. package/dist/types/libraries/mongo/models/providers/courier-order.model.d.ts +41 -0
  625. package/dist/types/libraries/mongo/models/providers/courier-order.model.js +151 -0
  626. package/dist/types/libraries/mongo/models/providers/courier-order.model.js.map +1 -0
  627. package/dist/types/libraries/mongo/models/providers/custom-coupon.model.d.ts +13 -0
  628. package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js +43 -0
  629. package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js.map +1 -0
  630. package/dist/types/libraries/mongo/models/providers/discount-marketing.model.d.ts +22 -0
  631. package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js +92 -0
  632. package/dist/types/libraries/mongo/models/providers/discount-marketing.model.js.map +1 -0
  633. package/dist/types/libraries/mongo/models/providers/featured-marketing.model.d.ts +6 -0
  634. package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js +25 -0
  635. package/dist/types/libraries/mongo/models/providers/featured-marketing.model.js.map +1 -0
  636. package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.d.ts +7 -0
  637. package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js +30 -0
  638. package/dist/types/libraries/mongo/models/providers/free-delivery-marketing.model.js.map +1 -0
  639. package/dist/types/libraries/mongo/models/providers/global-coupon.model.d.ts +5 -0
  640. package/dist/types/libraries/mongo/models/providers/global-coupon.model.js +10 -0
  641. package/dist/types/libraries/mongo/models/providers/global-coupon.model.js.map +1 -0
  642. package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.d.ts +12 -0
  643. package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js +42 -0
  644. package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -0
  645. package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.d.ts +13 -0
  646. package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js +43 -0
  647. package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -0
  648. package/dist/types/libraries/mongo/models/providers/punch-marketing.model.d.ts +11 -0
  649. package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js +50 -0
  650. package/dist/types/libraries/mongo/models/providers/punch-marketing.model.js.map +1 -0
  651. package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.d.ts +9 -0
  652. package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js +27 -0
  653. package/dist/types/libraries/mongo/models/providers/referral-code-coupon.model.js.map +1 -0
  654. package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.d.ts +11 -0
  655. package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js +37 -0
  656. package/dist/types/libraries/mongo/models/providers/referral-reward-coupon.model.js.map +1 -0
  657. package/dist/types/libraries/mongo/models/providers/regular-order.model.d.ts +54 -0
  658. package/dist/types/libraries/mongo/models/providers/regular-order.model.js +204 -0
  659. package/dist/types/libraries/mongo/models/providers/regular-order.model.js.map +1 -0
  660. package/dist/types/libraries/mongo/models/providers/rider-payout.model.d.ts +23 -0
  661. package/dist/types/libraries/mongo/models/providers/rider-payout.model.js +94 -0
  662. package/dist/types/libraries/mongo/models/providers/rider-payout.model.js.map +1 -0
  663. package/dist/types/libraries/mongo/models/providers/rider-review.model.d.ts +10 -0
  664. package/dist/types/libraries/mongo/models/providers/rider-review.model.js +32 -0
  665. package/dist/types/libraries/mongo/models/providers/rider-review.model.js.map +1 -0
  666. package/dist/types/libraries/mongo/models/providers/service-package-review.model.d.ts +14 -0
  667. package/dist/types/libraries/mongo/models/providers/service-package-review.model.js +44 -0
  668. package/dist/types/libraries/mongo/models/providers/service-package-review.model.js.map +1 -0
  669. package/dist/types/libraries/mongo/models/providers/shop-courier.model.d.ts +26 -0
  670. package/dist/types/libraries/mongo/models/providers/shop-courier.model.js +93 -0
  671. package/dist/types/libraries/mongo/models/providers/shop-courier.model.js.map +1 -0
  672. package/dist/types/libraries/mongo/models/providers/shop-payout.model.d.ts +62 -0
  673. package/dist/types/libraries/mongo/models/providers/shop-payout.model.js +244 -0
  674. package/dist/types/libraries/mongo/models/providers/shop-payout.model.js.map +1 -0
  675. package/dist/types/libraries/mongo/models/providers/shop-review.model.d.ts +12 -0
  676. package/dist/types/libraries/mongo/models/providers/shop-review.model.js +38 -0
  677. package/dist/types/libraries/mongo/models/providers/shop-review.model.js.map +1 -0
  678. package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.d.ts +13 -0
  679. package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js +47 -0
  680. package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js.map +1 -0
  681. package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.d.ts +11 -0
  682. package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js +46 -0
  683. package/dist/types/libraries/mongo/models/providers/spend-to-get-marketing.model.js.map +1 -0
  684. package/dist/types/libraries/mongo/models/providers/vendor-payout.model.d.ts +50 -0
  685. package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js +192 -0
  686. package/dist/types/libraries/mongo/models/providers/vendor-payout.model.js.map +1 -0
  687. package/dist/types/libraries/mongo/models/providers/vendor-review.model.d.ts +12 -0
  688. package/dist/types/libraries/mongo/models/providers/vendor-review.model.js +38 -0
  689. package/dist/types/libraries/mongo/models/providers/vendor-review.model.js.map +1 -0
  690. package/dist/types/libraries/mongo/models/punch-marketing-history.model.d.ts +24 -0
  691. package/dist/types/libraries/mongo/models/punch-marketing-history.model.js +101 -0
  692. package/dist/types/libraries/mongo/models/punch-marketing-history.model.js.map +1 -0
  693. package/dist/types/libraries/mongo/models/rating-setting.model.d.ts +8 -0
  694. package/dist/types/libraries/mongo/models/rating-setting.model.js +46 -0
  695. package/dist/types/libraries/mongo/models/rating-setting.model.js.map +1 -0
  696. package/dist/types/libraries/mongo/models/referral-setting.model.d.ts +6 -0
  697. package/dist/types/libraries/mongo/models/referral-setting.model.js +32 -0
  698. package/dist/types/libraries/mongo/models/referral-setting.model.js.map +1 -0
  699. package/dist/types/libraries/mongo/models/request-area.model.d.ts +8 -0
  700. package/dist/types/libraries/mongo/models/request-area.model.js +33 -0
  701. package/dist/types/libraries/mongo/models/request-area.model.js.map +1 -0
  702. package/dist/types/libraries/mongo/models/review.model.d.ts +15 -0
  703. package/dist/types/libraries/mongo/models/review.model.js +68 -0
  704. package/dist/types/libraries/mongo/models/review.model.js.map +1 -0
  705. package/dist/types/libraries/mongo/models/reward.model.d.ts +16 -0
  706. package/dist/types/libraries/mongo/models/reward.model.js +70 -0
  707. package/dist/types/libraries/mongo/models/reward.model.js.map +1 -0
  708. package/dist/types/libraries/mongo/models/rider-timeout.model.d.ts +10 -0
  709. package/dist/types/libraries/mongo/models/rider-timeout.model.js +47 -0
  710. package/dist/types/libraries/mongo/models/rider-timeout.model.js.map +1 -0
  711. package/dist/types/libraries/mongo/models/rider-tracking.model.d.ts +10 -0
  712. package/dist/types/libraries/mongo/models/rider-tracking.model.js +47 -0
  713. package/dist/types/libraries/mongo/models/rider-tracking.model.js.map +1 -0
  714. package/dist/types/libraries/mongo/models/rider.model.d.ts +70 -0
  715. package/dist/types/libraries/mongo/models/rider.model.js +358 -0
  716. package/dist/types/libraries/mongo/models/rider.model.js.map +1 -0
  717. package/dist/types/libraries/mongo/models/service-addon.model.d.ts +16 -0
  718. package/dist/types/libraries/mongo/models/service-addon.model.js +86 -0
  719. package/dist/types/libraries/mongo/models/service-addon.model.js.map +1 -0
  720. package/dist/types/libraries/mongo/models/service-booking.model.d.ts +68 -0
  721. package/dist/types/libraries/mongo/models/service-booking.model.js +310 -0
  722. package/dist/types/libraries/mongo/models/service-booking.model.js.map +1 -0
  723. package/dist/types/libraries/mongo/models/service-cart.model.d.ts +14 -0
  724. package/dist/types/libraries/mongo/models/service-cart.model.js +51 -0
  725. package/dist/types/libraries/mongo/models/service-cart.model.js.map +1 -0
  726. package/dist/types/libraries/mongo/models/service-category.model.d.ts +14 -0
  727. package/dist/types/libraries/mongo/models/service-category.model.js +87 -0
  728. package/dist/types/libraries/mongo/models/service-category.model.js.map +1 -0
  729. package/dist/types/libraries/mongo/models/service-control.model.d.ts +8 -0
  730. package/dist/types/libraries/mongo/models/service-control.model.js +50 -0
  731. package/dist/types/libraries/mongo/models/service-control.model.js.map +1 -0
  732. package/dist/types/libraries/mongo/models/service-flag.model.d.ts +19 -0
  733. package/dist/types/libraries/mongo/models/service-flag.model.js +72 -0
  734. package/dist/types/libraries/mongo/models/service-flag.model.js.map +1 -0
  735. package/dist/types/libraries/mongo/models/service-package.model.d.ts +27 -0
  736. package/dist/types/libraries/mongo/models/service-package.model.js +142 -0
  737. package/dist/types/libraries/mongo/models/service-package.model.js.map +1 -0
  738. package/dist/types/libraries/mongo/models/service-promotion.model.d.ts +27 -0
  739. package/dist/types/libraries/mongo/models/service-promotion.model.js +120 -0
  740. package/dist/types/libraries/mongo/models/service-promotion.model.js.map +1 -0
  741. package/dist/types/libraries/mongo/models/service.model.d.ts +8 -0
  742. package/dist/types/libraries/mongo/models/service.model.js +43 -0
  743. package/dist/types/libraries/mongo/models/service.model.js.map +1 -0
  744. package/dist/types/libraries/mongo/models/setting.model.d.ts +51 -0
  745. package/dist/types/libraries/mongo/models/setting.model.js +201 -0
  746. package/dist/types/libraries/mongo/models/setting.model.js.map +1 -0
  747. package/dist/types/libraries/mongo/models/shared/address.model.d.ts +38 -0
  748. package/dist/types/libraries/mongo/models/shared/address.model.js +158 -0
  749. package/dist/types/libraries/mongo/models/shared/address.model.js.map +1 -0
  750. package/dist/types/libraries/mongo/models/shared/duration.model.d.ts +14 -0
  751. package/dist/types/libraries/mongo/models/shared/duration.model.js +59 -0
  752. package/dist/types/libraries/mongo/models/shared/duration.model.js.map +1 -0
  753. package/dist/types/libraries/mongo/models/shared/geo-location.model.d.ts +5 -0
  754. package/dist/types/libraries/mongo/models/shared/geo-location.model.js +28 -0
  755. package/dist/types/libraries/mongo/models/shared/geo-location.model.js.map +1 -0
  756. package/dist/types/libraries/mongo/models/shared/work-hour.model.d.ts +19 -0
  757. package/dist/types/libraries/mongo/models/shared/work-hour.model.js +81 -0
  758. package/dist/types/libraries/mongo/models/shared/work-hour.model.js.map +1 -0
  759. package/dist/types/libraries/mongo/models/shop-access-control.model.d.ts +16 -0
  760. package/dist/types/libraries/mongo/models/shop-access-control.model.js +81 -0
  761. package/dist/types/libraries/mongo/models/shop-access-control.model.js.map +1 -0
  762. package/dist/types/libraries/mongo/models/shop-category.model.d.ts +13 -0
  763. package/dist/types/libraries/mongo/models/shop-category.model.js +64 -0
  764. package/dist/types/libraries/mongo/models/shop-category.model.js.map +1 -0
  765. package/dist/types/libraries/mongo/models/shop-meal-plan.model.d.ts +12 -0
  766. package/dist/types/libraries/mongo/models/shop-meal-plan.model.js +45 -0
  767. package/dist/types/libraries/mongo/models/shop-meal-plan.model.js.map +1 -0
  768. package/dist/types/libraries/mongo/models/shop-section.model.d.ts +18 -0
  769. package/dist/types/libraries/mongo/models/shop-section.model.js +89 -0
  770. package/dist/types/libraries/mongo/models/shop-section.model.js.map +1 -0
  771. package/dist/types/libraries/mongo/models/shop.model.d.ts +65 -0
  772. package/dist/types/libraries/mongo/models/shop.model.js +304 -0
  773. package/dist/types/libraries/mongo/models/shop.model.js.map +1 -0
  774. package/dist/types/libraries/mongo/models/spend-to-get-history.model.d.ts +13 -0
  775. package/dist/types/libraries/mongo/models/spend-to-get-history.model.js +51 -0
  776. package/dist/types/libraries/mongo/models/spend-to-get-history.model.js.map +1 -0
  777. package/dist/types/libraries/mongo/models/subscription.model.d.ts +20 -0
  778. package/dist/types/libraries/mongo/models/subscription.model.js +93 -0
  779. package/dist/types/libraries/mongo/models/subscription.model.js.map +1 -0
  780. package/dist/types/libraries/mongo/models/support-reason.model.d.ts +10 -0
  781. package/dist/types/libraries/mongo/models/support-reason.model.js +61 -0
  782. package/dist/types/libraries/mongo/models/support-reason.model.js.map +1 -0
  783. package/dist/types/libraries/mongo/models/tag.model.d.ts +10 -0
  784. package/dist/types/libraries/mongo/models/tag.model.js +64 -0
  785. package/dist/types/libraries/mongo/models/tag.model.js.map +1 -0
  786. package/dist/types/libraries/mongo/models/terms-and-conditions.model.d.ts +8 -0
  787. package/dist/types/libraries/mongo/models/terms-and-conditions.model.js +51 -0
  788. package/dist/types/libraries/mongo/models/terms-and-conditions.model.js.map +1 -0
  789. package/dist/types/libraries/mongo/models/ticket-action.model.d.ts +4 -0
  790. package/dist/types/libraries/mongo/models/ticket-action.model.js +31 -0
  791. package/dist/types/libraries/mongo/models/ticket-action.model.js.map +1 -0
  792. package/dist/types/libraries/mongo/models/ticket.model.d.ts +35 -0
  793. package/dist/types/libraries/mongo/models/ticket.model.js +144 -0
  794. package/dist/types/libraries/mongo/models/ticket.model.js.map +1 -0
  795. package/dist/types/libraries/mongo/models/tournament-participant.model.d.ts +22 -0
  796. package/dist/types/libraries/mongo/models/tournament-participant.model.js +84 -0
  797. package/dist/types/libraries/mongo/models/tournament-participant.model.js.map +1 -0
  798. package/dist/types/libraries/mongo/models/tournament.model.d.ts +65 -0
  799. package/dist/types/libraries/mongo/models/tournament.model.js +273 -0
  800. package/dist/types/libraries/mongo/models/tournament.model.js.map +1 -0
  801. package/dist/types/libraries/mongo/models/user-action.model.d.ts +29 -0
  802. package/dist/types/libraries/mongo/models/user-action.model.js +113 -0
  803. package/dist/types/libraries/mongo/models/user-action.model.js.map +1 -0
  804. package/dist/types/libraries/mongo/models/user-app-section-setting.model.d.ts +24 -0
  805. package/dist/types/libraries/mongo/models/user-app-section-setting.model.js +103 -0
  806. package/dist/types/libraries/mongo/models/user-app-section-setting.model.js.map +1 -0
  807. package/dist/types/libraries/mongo/models/user.model.d.ts +39 -0
  808. package/dist/types/libraries/mongo/models/user.model.js +150 -0
  809. package/dist/types/libraries/mongo/models/user.model.js.map +1 -0
  810. package/dist/types/libraries/mongo/models/vendor-access-control.model.d.ts +14 -0
  811. package/dist/types/libraries/mongo/models/vendor-access-control.model.js +75 -0
  812. package/dist/types/libraries/mongo/models/vendor-access-control.model.js.map +1 -0
  813. package/dist/types/libraries/mongo/models/vendor-parent.model.d.ts +25 -0
  814. package/dist/types/libraries/mongo/models/vendor-parent.model.js +121 -0
  815. package/dist/types/libraries/mongo/models/vendor-parent.model.js.map +1 -0
  816. package/dist/types/libraries/mongo/models/vendor.model.d.ts +33 -0
  817. package/dist/types/libraries/mongo/models/vendor.model.js +150 -0
  818. package/dist/types/libraries/mongo/models/vendor.model.js.map +1 -0
  819. package/dist/types/libraries/mongo/models/zone-extra-time.d.ts +12 -0
  820. package/dist/types/libraries/mongo/models/zone-extra-time.js +54 -0
  821. package/dist/types/libraries/mongo/models/zone-extra-time.js.map +1 -0
  822. package/dist/types/libraries/mongo/models/zone.model.d.ts +17 -0
  823. package/dist/types/libraries/mongo/models/zone.model.js +80 -0
  824. package/dist/types/libraries/mongo/models/zone.model.js.map +1 -0
  825. package/dist/types/libraries/mongo/plugins/normalize-field.plugin.d.ts +4 -0
  826. package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js +42 -0
  827. package/dist/types/libraries/mongo/plugins/normalize-field.plugin.js.map +1 -0
  828. package/dist/types/libraries/mongo/plugins/soft-delete-plugin.d.ts +32 -0
  829. package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js +145 -0
  830. package/dist/types/libraries/mongo/plugins/soft-delete-plugin.js.map +1 -0
  831. package/dist/types/libraries/mongo/utilities/shop.hooks.d.ts +9 -0
  832. package/dist/types/libraries/mongo/utilities/shop.hooks.js +11 -0
  833. package/dist/types/libraries/mongo/utilities/shop.hooks.js.map +1 -0
  834. package/dist/types/libraries/mongo/utilities/sorting-order.hooks.d.ts +14 -0
  835. package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js +58 -0
  836. package/dist/types/libraries/mongo/utilities/sorting-order.hooks.js.map +1 -0
  837. package/dist/types/libraries/mongo/utilities/unique-id.hooks.d.ts +6 -0
  838. package/dist/types/libraries/mongo/utilities/unique-id.hooks.js +17 -0
  839. package/dist/types/libraries/mongo/utilities/unique-id.hooks.js.map +1 -0
  840. package/dist/types/libraries/notification/firebase-fcm.service.d.ts +7 -0
  841. package/dist/types/libraries/notification/firebase-fcm.service.js +40 -0
  842. package/dist/types/libraries/notification/firebase-fcm.service.js.map +1 -0
  843. package/dist/types/libraries/notification/firebase-message.builder.d.ts +22 -0
  844. package/dist/types/libraries/notification/firebase-message.builder.js +107 -0
  845. package/dist/types/libraries/notification/firebase-message.builder.js.map +1 -0
  846. package/dist/types/libraries/notification/lyxa-fcm-sender.d.ts +19 -0
  847. package/dist/types/libraries/notification/lyxa-fcm-sender.js +127 -0
  848. package/dist/types/libraries/notification/lyxa-fcm-sender.js.map +1 -0
  849. package/dist/types/libraries/notification/lyxa-fcm.service.d.ts +40 -0
  850. package/dist/types/libraries/notification/lyxa-fcm.service.js +177 -0
  851. package/dist/types/libraries/notification/lyxa-fcm.service.js.map +1 -0
  852. package/dist/types/libraries/redis/index.d.ts +25 -0
  853. package/dist/types/libraries/redis/index.js +137 -0
  854. package/dist/types/libraries/redis/index.js.map +1 -0
  855. package/dist/types/libraries/secrets/index.d.ts +10 -0
  856. package/dist/types/libraries/secrets/index.js +64 -0
  857. package/dist/types/libraries/secrets/index.js.map +1 -0
  858. package/dist/types/libraries/socket/BaseSocketEvent.d.ts +27 -0
  859. package/dist/types/libraries/socket/BaseSocketEvent.js +47 -0
  860. package/dist/types/libraries/socket/BaseSocketEvent.js.map +1 -0
  861. package/dist/types/libraries/socket/PushNotificationEvent.d.ts +36 -0
  862. package/dist/types/libraries/socket/PushNotificationEvent.js +45 -0
  863. package/dist/types/libraries/socket/PushNotificationEvent.js.map +1 -0
  864. package/dist/types/libraries/socket/connections/batch.d.ts +12 -0
  865. package/dist/types/libraries/socket/connections/batch.js +58 -0
  866. package/dist/types/libraries/socket/connections/batch.js.map +1 -0
  867. package/dist/types/libraries/socket/connections/cache.d.ts +9 -0
  868. package/dist/types/libraries/socket/connections/cache.js +36 -0
  869. package/dist/types/libraries/socket/connections/cache.js.map +1 -0
  870. package/dist/types/libraries/socket/connections/constants.d.ts +2 -0
  871. package/dist/types/libraries/socket/connections/constants.js +6 -0
  872. package/dist/types/libraries/socket/connections/constants.js.map +1 -0
  873. package/dist/types/libraries/socket/connections/index.d.ts +7 -0
  874. package/dist/types/libraries/socket/connections/index.js +24 -0
  875. package/dist/types/libraries/socket/connections/index.js.map +1 -0
  876. package/dist/types/libraries/socket/connections/instance-disconnect.d.ts +2 -0
  877. package/dist/types/libraries/socket/connections/instance-disconnect.js +43 -0
  878. package/dist/types/libraries/socket/connections/instance-disconnect.js.map +1 -0
  879. package/dist/types/libraries/socket/connections/keys.d.ts +10 -0
  880. package/dist/types/libraries/socket/connections/keys.js +23 -0
  881. package/dist/types/libraries/socket/connections/keys.js.map +1 -0
  882. package/dist/types/libraries/socket/connections/presence.d.ts +6 -0
  883. package/dist/types/libraries/socket/connections/presence.js +39 -0
  884. package/dist/types/libraries/socket/connections/presence.js.map +1 -0
  885. package/dist/types/libraries/socket/connections/redis-helpers.d.ts +2 -0
  886. package/dist/types/libraries/socket/connections/redis-helpers.js +14 -0
  887. package/dist/types/libraries/socket/connections/redis-helpers.js.map +1 -0
  888. package/dist/types/libraries/socket/connections/subscription.d.ts +13 -0
  889. package/dist/types/libraries/socket/connections/subscription.js +73 -0
  890. package/dist/types/libraries/socket/connections/subscription.js.map +1 -0
  891. package/dist/types/libraries/socket/core/index.d.ts +6 -0
  892. package/dist/types/libraries/socket/core/index.js +23 -0
  893. package/dist/types/libraries/socket/core/index.js.map +1 -0
  894. package/dist/types/libraries/socket/core/local-subscription-registry.d.ts +17 -0
  895. package/dist/types/libraries/socket/core/local-subscription-registry.js +60 -0
  896. package/dist/types/libraries/socket/core/local-subscription-registry.js.map +1 -0
  897. package/dist/types/libraries/socket/core/socket-event-consumer.d.ts +1 -0
  898. package/dist/types/libraries/socket/core/socket-event-consumer.js +14 -0
  899. package/dist/types/libraries/socket/core/socket-event-consumer.js.map +1 -0
  900. package/dist/types/libraries/socket/core/socket-event-publisher.d.ts +6 -0
  901. package/dist/types/libraries/socket/core/socket-event-publisher.js +82 -0
  902. package/dist/types/libraries/socket/core/socket-event-publisher.js.map +1 -0
  903. package/dist/types/libraries/socket/core/socket-event-registry.d.ts +12 -0
  904. package/dist/types/libraries/socket/core/socket-event-registry.js +23 -0
  905. package/dist/types/libraries/socket/core/socket-event-registry.js.map +1 -0
  906. package/dist/types/libraries/socket/core/socket-event-registry.map.d.ts +34 -0
  907. package/dist/types/libraries/socket/core/socket-event-registry.map.js +34 -0
  908. package/dist/types/libraries/socket/core/socket-event-registry.map.js.map +1 -0
  909. package/dist/types/libraries/socket/core/zAsyncIterable.d.ts +7 -0
  910. package/dist/types/libraries/socket/core/zAsyncIterable.js +35 -0
  911. package/dist/types/libraries/socket/core/zAsyncIterable.js.map +1 -0
  912. package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.d.ts +153 -0
  913. package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js +44 -0
  914. package/dist/types/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -0
  915. package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.d.ts +286 -0
  916. package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js +96 -0
  917. package/dist/types/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -0
  918. package/dist/types/libraries/socket/events/index.d.ts +7 -0
  919. package/dist/types/libraries/socket/events/index.js +24 -0
  920. package/dist/types/libraries/socket/events/index.js.map +1 -0
  921. package/dist/types/libraries/socket/events/order-actions.socket.event.d.ts +297 -0
  922. package/dist/types/libraries/socket/events/order-actions.socket.event.js +82 -0
  923. package/dist/types/libraries/socket/events/order-actions.socket.event.js.map +1 -0
  924. package/dist/types/libraries/socket/events/rider-connect.socket.event.d.ts +13 -0
  925. package/dist/types/libraries/socket/events/rider-connect.socket.event.js +22 -0
  926. package/dist/types/libraries/socket/events/rider-connect.socket.event.js.map +1 -0
  927. package/dist/types/libraries/socket/events/rider-location-update.socket.event.d.ts +76 -0
  928. package/dist/types/libraries/socket/events/rider-location-update.socket.event.js +39 -0
  929. package/dist/types/libraries/socket/events/rider-location-update.socket.event.js.map +1 -0
  930. package/dist/types/libraries/socket/events/socketNotificationEvent.d.ts +46 -0
  931. package/dist/types/libraries/socket/events/socketNotificationEvent.js +29 -0
  932. package/dist/types/libraries/socket/events/socketNotificationEvent.js.map +1 -0
  933. package/dist/types/libraries/socket/events/ticket-actions.socket.event.d.ts +106 -0
  934. package/dist/types/libraries/socket/events/ticket-actions.socket.event.js +62 -0
  935. package/dist/types/libraries/socket/events/ticket-actions.socket.event.js.map +1 -0
  936. package/dist/types/libraries/socket/events/ticket-assign.socket.event.d.ts +161 -0
  937. package/dist/types/libraries/socket/events/ticket-assign.socket.event.js +42 -0
  938. package/dist/types/libraries/socket/events/ticket-assign.socket.event.js.map +1 -0
  939. package/dist/types/libraries/socket/events/ticket-unassign.socket.event.d.ts +27 -0
  940. package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js +31 -0
  941. package/dist/types/libraries/socket/events/ticket-unassign.socket.event.js.map +1 -0
  942. package/dist/types/libraries/trpc/context.d.ts +37 -0
  943. package/dist/types/libraries/trpc/context.js +43 -0
  944. package/dist/types/libraries/trpc/context.js.map +1 -0
  945. package/dist/types/libraries/trpc/index.d.ts +75 -0
  946. package/dist/types/libraries/trpc/index.js +80 -0
  947. package/dist/types/libraries/trpc/index.js.map +1 -0
  948. package/dist/types/libraries/twilio/index.d.ts +6 -0
  949. package/dist/types/libraries/twilio/index.js +42 -0
  950. package/dist/types/libraries/twilio/index.js.map +1 -0
  951. package/dist/types/libraries/upload/index.d.ts +50 -0
  952. package/dist/types/libraries/upload/index.js +312 -0
  953. package/dist/types/libraries/upload/index.js.map +1 -0
  954. package/dist/types/package.json +1 -1
  955. package/dist/types/utilities/auth-ref.mapper.d.ts +4 -0
  956. package/dist/types/utilities/auth-ref.mapper.js +22 -0
  957. package/dist/types/utilities/auth-ref.mapper.js.map +1 -0
  958. package/dist/types/utilities/dayjs/dayjs.d.ts +14 -0
  959. package/dist/types/utilities/dayjs/dayjs.js +47 -0
  960. package/dist/types/utilities/dayjs/dayjs.js.map +1 -0
  961. package/dist/types/utilities/dayjs/index.d.ts +2 -0
  962. package/dist/types/utilities/dayjs/index.js +9 -0
  963. package/dist/types/utilities/dayjs/index.js.map +1 -0
  964. package/dist/types/utilities/environment/rabbitmq-environments.d.ts +2 -0
  965. package/dist/types/utilities/environment/rabbitmq-environments.js +14 -0
  966. package/dist/types/utilities/environment/rabbitmq-environments.js.map +1 -0
  967. package/dist/types/utilities/environment/redis-environments.d.ts +2 -0
  968. package/dist/types/utilities/environment/redis-environments.js +14 -0
  969. package/dist/types/utilities/environment/redis-environments.js.map +1 -0
  970. package/dist/types/utilities/error-common.d.ts +10 -0
  971. package/dist/types/utilities/error-common.js +76 -0
  972. package/dist/types/utilities/error-common.js.map +1 -0
  973. package/dist/types/utilities/id-generator.d.ts +6 -0
  974. package/dist/types/utilities/id-generator.js +161 -0
  975. package/dist/types/utilities/id-generator.js.map +1 -0
  976. package/dist/types/utilities/instance.utils.d.ts +1 -0
  977. package/dist/types/utilities/instance.utils.js +12 -0
  978. package/dist/types/utilities/instance.utils.js.map +1 -0
  979. package/dist/types/utilities/normalize.d.ts +6 -0
  980. package/dist/types/utilities/normalize.js +51 -0
  981. package/dist/types/utilities/normalize.js.map +1 -0
  982. package/dist/types/utilities/password.d.ts +2 -0
  983. package/dist/types/utilities/password.js +20 -0
  984. package/dist/types/utilities/password.js.map +1 -0
  985. package/dist/types/utilities/projection.d.ts +8 -0
  986. package/dist/types/utilities/projection.js +37 -0
  987. package/dist/types/utilities/projection.js.map +1 -0
  988. package/dist/types/utilities/time.d.ts +13 -0
  989. package/dist/types/utilities/time.js +128 -0
  990. package/dist/types/utilities/time.js.map +1 -0
  991. package/package.json +1 -1
@@ -28,13 +28,11 @@ export declare class ServiceLineItem {
28
28
  price: number;
29
29
  quantity: number;
30
30
  lineItemSnap?: LineItemSnap;
31
- totalPrice?: number;
32
31
  secondaryPrice?: number;
33
- totalSecondaryPrice?: number;
34
- totalDiscountedPrice?: number;
35
- totalSecondaryDiscountedPrice?: number;
36
- totalDiscountAmount?: number;
37
- totalSecondaryDiscountAmount?: number;
32
+ discountedPrice?: number;
33
+ secondaryDiscountedPrice?: number;
34
+ discountAmount?: number;
35
+ secondaryDiscountAmount?: number;
38
36
  promotionSnaps?: PromotionSnap[];
39
37
  discount?: ServicePromotionCut;
40
38
  }
@@ -90,13 +90,11 @@ class ServiceLineItem {
90
90
  price;
91
91
  quantity;
92
92
  lineItemSnap;
93
- totalPrice;
94
93
  secondaryPrice;
95
- totalSecondaryPrice;
96
- totalDiscountedPrice;
97
- totalSecondaryDiscountedPrice;
98
- totalDiscountAmount;
99
- totalSecondaryDiscountAmount;
94
+ discountedPrice;
95
+ secondaryDiscountedPrice;
96
+ discountAmount;
97
+ secondaryDiscountAmount;
100
98
  promotionSnaps;
101
99
  discount;
102
100
  }
@@ -125,10 +123,6 @@ __decorate([
125
123
  (0, typegoose_1.prop)({ type: LineItemSnap, _id: false }),
126
124
  __metadata("design:type", LineItemSnap)
127
125
  ], ServiceLineItem.prototype, "lineItemSnap", void 0);
128
- __decorate([
129
- (0, typegoose_1.prop)({ type: Number }),
130
- __metadata("design:type", Number)
131
- ], ServiceLineItem.prototype, "totalPrice", void 0);
132
126
  __decorate([
133
127
  (0, typegoose_1.prop)({ type: Number }),
134
128
  __metadata("design:type", Number)
@@ -136,23 +130,19 @@ __decorate([
136
130
  __decorate([
137
131
  (0, typegoose_1.prop)({ type: Number }),
138
132
  __metadata("design:type", Number)
139
- ], ServiceLineItem.prototype, "totalSecondaryPrice", void 0);
140
- __decorate([
141
- (0, typegoose_1.prop)({ type: Number }),
142
- __metadata("design:type", Number)
143
- ], ServiceLineItem.prototype, "totalDiscountedPrice", void 0);
133
+ ], ServiceLineItem.prototype, "discountedPrice", void 0);
144
134
  __decorate([
145
135
  (0, typegoose_1.prop)({ type: Number }),
146
136
  __metadata("design:type", Number)
147
- ], ServiceLineItem.prototype, "totalSecondaryDiscountedPrice", void 0);
137
+ ], ServiceLineItem.prototype, "secondaryDiscountedPrice", void 0);
148
138
  __decorate([
149
139
  (0, typegoose_1.prop)({ type: Number }),
150
140
  __metadata("design:type", Number)
151
- ], ServiceLineItem.prototype, "totalDiscountAmount", void 0);
141
+ ], ServiceLineItem.prototype, "discountAmount", void 0);
152
142
  __decorate([
153
143
  (0, typegoose_1.prop)({ type: Number }),
154
144
  __metadata("design:type", Number)
155
- ], ServiceLineItem.prototype, "totalSecondaryDiscountAmount", void 0);
145
+ ], ServiceLineItem.prototype, "secondaryDiscountAmount", void 0);
156
146
  __decorate([
157
147
  (0, typegoose_1.prop)({ type: [PromotionSnap], _id: false }),
158
148
  __metadata("design:type", Array)
@@ -1 +1 @@
1
- {"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAA4E;AAC5E,oEAA0D;AAC1D,gEAAsD;AACtD,iEAAuD;AACvD,wEAA8D;AAC9D,+DAA4D;AAE5D,MAAa,YAAY;IAEjB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,QAAQ,CAAiB;IAGzB,YAAY,CAAU;IAGtB,qBAAqB,CAAU;CACtC;AAlBD,oCAkBC;AAhBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACF;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACD;AAGf;IADN,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CAAC;;4DACa;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEACsB;AAGtC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;;uDACJ;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,yCAAmB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACpC,yCAAmB;iDAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { ServiceLineItemType, ValueType } from '../../../../utilities/enum';\nimport { ServicePackage } from '../service-package.model';\nimport { ServiceAddon } from '../service-addon.model';\nimport { PreparingTime } from './preparing-time.model';\nimport { ServicePromotion } from '../service-promotion.model';\nimport { ServicePromotionCut } from './marketing-cut.model';\n\nexport class LineItemSnap {\n\t@prop({ type: String })\n\tpublic name?: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String })\n\tpublic description?: string;\n\n\t@prop({ type: PreparingTime })\n\tpublic duration?: PreparingTime;\n\n\t@prop({ type: Number })\n\tpublic materialCost?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryMaterialCost?: number;\n}\n\nexport class PromotionSnap {\n\t@prop({ ref: () => ServicePromotion })\n\tpublic servicePromotion?: Ref<ServicePromotion>;\n\n\t@prop({ type: Boolean })\n\tpublic isAppliedByCompany?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMaxDiscountPerOrderEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: String, enum: ValueType, default: ValueType.PERCENTAGE })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n}\n\n/**\n * A single line item in the service cart.\n *\n * Each line item is either a PACKAGE or an ADDON — never both.\n * The `lineItemType` field is the discriminator:\n *\n * - lineItemType = PACKAGE → `servicePackage` + `lineItemSnap` are set; addon field is absent.\n * - lineItemType = ADDON → `addon` + `lineItemSnap` are set; servicePackage field is absent.\n *\n * `price` — unit price of the item (package price or addon price).\n * `quantity` — how many units of this item are being booked.\n */\nexport class ServiceLineItem {\n\t@prop({ required: true, type: String, enum: ServiceLineItemType })\n\tpublic lineItemType!: ServiceLineItemType;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => ServiceAddon })\n\tpublic addon?: Ref<ServiceAddon>;\n\n\t@prop({ required: true, type: Number })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: Number, min: 1 })\n\tpublic quantity!: number;\n\n\t// Add these fields when cart will be submitted\n\t@prop({ type: LineItemSnap, _id: false })\n\tpublic lineItemSnap?: LineItemSnap;\n\n\t@prop({ type: Number })\n\tpublic totalPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic totalSecondaryPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic totalDiscountedPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic totalSecondaryDiscountedPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic totalDiscountAmount?: number;\n\n\t@prop({ type: Number })\n\tpublic totalSecondaryDiscountAmount?: number;\n\n\t@prop({ type: [PromotionSnap], _id: false })\n\tpublic promotionSnaps?: PromotionSnap[];\n\n\t@prop({ type: () => ServicePromotionCut, _id: false })\n\tpublic discount?: ServicePromotionCut;\n}\n"]}
1
+ {"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAA4E;AAC5E,oEAA0D;AAC1D,gEAAsD;AACtD,iEAAuD;AACvD,wEAA8D;AAC9D,+DAA4D;AAE5D,MAAa,YAAY;IAEjB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,W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GlC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDACQ;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gEACiB;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;;uDACJ;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,yCAAmB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACpC,yCAAmB;iDAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { ServiceLineItemType, ValueType } from '../../../../utilities/enum';\nimport { ServicePackage } from '../service-package.model';\nimport { ServiceAddon } from '../service-addon.model';\nimport { PreparingTime } from './preparing-time.model';\nimport { ServicePromotion } from '../service-promotion.model';\nimport { ServicePromotionCut } from './marketing-cut.model';\n\nexport class LineItemSnap {\n\t@prop({ type: String })\n\tpublic name?: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String })\n\tpublic description?: string;\n\n\t@prop({ type: PreparingTime })\n\tpublic duration?: PreparingTime;\n\n\t@prop({ type: Number })\n\tpublic materialCost?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryMaterialCost?: number;\n}\n\nexport class PromotionSnap {\n\t@prop({ ref: () => ServicePromotion })\n\tpublic servicePromotion?: Ref<ServicePromotion>;\n\n\t@prop({ type: Boolean })\n\tpublic isAppliedByCompany?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMaxDiscountPerOrderEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: String, enum: ValueType, default: ValueType.PERCENTAGE })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n}\n\n/**\n * A single line item in the service cart.\n *\n * Each line item is either a PACKAGE or an ADDON — never both.\n * The `lineItemType` field is the discriminator:\n *\n * - lineItemType = PACKAGE → `servicePackage` + `lineItemSnap` are set; addon field is absent.\n * - lineItemType = ADDON → `addon` + `lineItemSnap` are set; servicePackage field is absent.\n *\n * `price` — unit price of the item (package price or addon price).\n * `quantity` — how many units of this item are being booked.\n */\nexport class ServiceLineItem {\n\t@prop({ required: true, type: String, enum: ServiceLineItemType })\n\tpublic lineItemType!: ServiceLineItemType;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => ServiceAddon })\n\tpublic addon?: Ref<ServiceAddon>;\n\n\t@prop({ required: true, type: Number })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: Number, min: 1 })\n\tpublic quantity!: number;\n\n\t// Add these fields when cart will be submitted\n\t@prop({ type: LineItemSnap, _id: false })\n\tpublic lineItemSnap?: LineItemSnap;\n\n\t@prop({ type: Number })\n\tpublic secondaryPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic discountedPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryDiscountedPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic discountAmount?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryDiscountAmount?: number;\n\n\t@prop({ type: [PromotionSnap], _id: false })\n\tpublic promotionSnaps?: PromotionSnap[];\n\n\t@prop({ type: () => ServicePromotionCut, _id: false })\n\tpublic discount?: ServicePromotionCut;\n}\n"]}
@@ -58,7 +58,6 @@ export declare class ServiceBooking extends TimeStamps {
58
58
  isReviewNotificationSent?: boolean;
59
59
  isLowRated?: boolean;
60
60
  servicePromotions?: Ref<ServicePromotion>[];
61
- maxDiscountPerOrder?: number | null;
62
61
  onlinePaymentStatus?: OnlinePaymentStatus;
63
62
  specialInstructions?: string;
64
63
  professionalStartNotificationSentAt?: Date;
@@ -71,7 +71,6 @@ let ServiceBooking = class ServiceBooking extends defaultClasses_1.TimeStamps {
71
71
  isReviewNotificationSent;
72
72
  isLowRated;
73
73
  servicePromotions;
74
- maxDiscountPerOrder;
75
74
  onlinePaymentStatus;
76
75
  specialInstructions;
77
76
  professionalStartNotificationSentAt;
@@ -249,10 +248,6 @@ __decorate([
249
248
  (0, typegoose_1.prop)({ ref: () => service_promotion_model_1.ServicePromotion }),
250
249
  __metadata("design:type", Array)
251
250
  ], ServiceBooking.prototype, "servicePromotions", void 0);
252
- __decorate([
253
- (0, typegoose_1.prop)({ type: Number }),
254
- __metadata("design:type", Object)
255
- ], ServiceBooking.prototype, "maxDiscountPerOrder", void 0);
256
251
  __decorate([
257
252
  (0, typegoose_1.prop)({ type: String, enum: enum_1.OnlinePaymentStatus }),
258
253
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"service-booking.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-booking.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA8E;AAC9E,6CAAoC;AACpC,iDAAwC;AACxC,kDAOiC;AACjC,6DAAoD;AACpD,6DAAmD;AACnD,4FAAiF;AACjF,sHAG+D;AAC/D,4EAAgF;AAChF,wBAAuD;AACvD,uEAA6D;AAC7D,0DAA6D;AAC7D,4DAAyD;AACzD,4EAAqE;AACrE,kHAAsG;AACtG,4HAAgH;AAChH,6DAAmD;AACnD,oDAAiD;AA4B1C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,OAAO,CAAU;IAGjB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,YAAY,CAAqB;IAGjC,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,IAAI,CAAoB;IAGxB,WAAW,CAAuB;IAGlC,SAAS,CAAkB;IAG3B,MAAM,CAAwB;IAG9B,aAAa,CAAuB;IAGpC,uBAAuB,CAAqB;IAG5C,WAAW,CAAQ;IAGnB,QAAQ,CAAQ;IAGhB,SAAS,CAAQ;IAGjB,qBAAqB,CAAQ;IAG7B,4BAA4B,CAAU;IAGtC,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EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE;QAClE,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,eAAG,EAAiB,UAAU,EAAE,KAAK,WAAW,IAAI;QACpD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,KAAK,GAAG,IAAA,aAAK,GAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEvC,MAAM,OAAO,GAAG,MAAM,eAAY,CAAC,gBAAgB,CAClD,EAAE,WAAW,EAAE,kBAAW,CAAC,KAAK,EAAE,EAClC;gBACC;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE;4BACN,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;yBAC/D;wBACD,KAAK,EAAE,KAAK;qBACZ;iBACD;aACD,EACD,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAC3B,CAAC;YAEF,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,cAAc,CA+J1B","sourcesContent":["import { modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport {\n\tServiceBookingStatus,\n\tCounterType,\n\tServiceType,\n\tSubServiceType,\n\tAdjustmentStatus,\n\tOnlinePaymentStatus,\n} from '../../../utilities/enum';\nimport { Professional } from './professional.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ServiceBookingFinance } from './embedded/service-booking-finance.model';\nimport {\n\tServiceBookingCancellationDetails,\n\tServiceBookingEndorseLoss,\n} from './embedded/service-booking-cancellation-details.model';\nimport { ServiceBookingStatusTimeline } from './embedded/status-timeline.model';\nimport { CounterModel, Review, VendorParent } from '.';\nimport { ServicePromotion } from './service-promotion.model';\nimport { RegularOrderAddress } from './shared/address.model';\nimport { OrderSlotRange } from './shared/duration.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceBookingRefundInformation } from './embedded/service-booking-refund-information.model';\nimport { ServiceBookingReplacementInformation } from './embedded/service-booking-replacement-information.model';\nimport { ServiceFlag } from './service-flag.model';\nimport { dayjs } from '../../../utilities/dayjs';\n@modelOptions({\n\tschemaOptions: { collection: 'serviceBookings', timestamps: true },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@pre<ServiceBooking>('validate', async function (next) {\n\tif (this.isNew) {\n\t\tconst today = dayjs().format('DDMMYY');\n\n\t\tconst counter = await CounterModel.findOneAndUpdate(\n\t\t\t{ counterType: CounterType.ORDER },\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t$cond: [{ $eq: ['$today', today] }, { $add: ['$value', 1] }, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoday: today,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ new: true, upsert: true }\n\t\t);\n\n\t\tthis.orderId = `${today}${counter.value.toString().padStart(6, '0')}`;\n\t}\n\tnext();\n})\nexport class ServiceBooking extends TimeStamps {\n\t@prop({ type: String, unique: true })\n\tpublic orderId?: string;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic vendorParent!: Ref<VendorParent>;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, type: () => RegularOrderAddress })\n\tpublic userAddress!: RegularOrderAddress;\n\n\t@prop({ required: true, type: OrderSlotRange, _id: false })\n\tpublic slotRange!: OrderSlotRange;\n\n\t@prop({ type: String, enum: ServiceBookingStatus, default: ServiceBookingStatus.PENDING })\n\tpublic status!: ServiceBookingStatus;\n\n\t@prop({ ref: () => Professional })\n\tpublic professionals?: Ref<Professional>[];\n\n\t@prop({ ref: () => Professional })\n\tpublic responsibleProfessional?: Ref<Professional>;\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic startedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic estimatedCompletionAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic estimatedCompletionInMinutes?: number;\n\n\t@prop({ type: Date })\n\tpublic completedAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic actualCompletionInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgent?: boolean;\n\n\t@prop({ type: Date })\n\tpublic urgentAt?: Date;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic finance!: ServiceBookingFinance;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic adjustedFinance!: ServiceBookingFinance;\n\n\t@prop({ type: () => ServiceBookingCancellationDetails, _id: false })\n\tpublic cancellationDetails?: ServiceBookingCancellationDetails;\n\n\t@prop({ type: Date })\n\tpublic cancelledAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => ServiceBookingEndorseLoss, _id: false })\n\tpublic endorseLossInformation?: ServiceBookingEndorseLoss;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: String, enum: AdjustmentStatus, default: AdjustmentStatus.NONE })\n\tpublic adjustmentStatus?: AdjustmentStatus;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isFlagged?: boolean;\n\n\t@prop({ type: Date })\n\tpublic flaggedAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRefunded?: boolean;\n\n\t@prop({ type: ServiceBookingRefundInformation, _id: false })\n\tpublic refundInformation?: ServiceBookingRefundInformation;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReplacement?: boolean;\n\n\t@prop({ type: () => ServiceBookingReplacementInformation, _id: false })\n\tpublic replacementInformation?: ServiceBookingReplacementInformation;\n\n\t@prop({ ref: () => ServiceBooking })\n\tpublic replacementBooking?: Ref<ServiceBooking>;\n\n\t@prop({ type: () => [ServiceBookingStatusTimeline], default: [] })\n\tpublic statusTimeline?: ServiceBookingStatusTimeline[];\n\n\t@prop({ type: Number })\n\tpublic bufferTime?: number; // minutes\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLowRated?: boolean;\n\n\t@prop({ ref: () => ServicePromotion })\n\tpublic servicePromotions?: Ref<ServicePromotion>[];\n\n\t@prop({ type: Number })\n\tpublic maxDiscountPerOrder?: number | null;\n\n\t@prop({ type: String, enum: OnlinePaymentStatus })\n\tpublic onlinePaymentStatus?: OnlinePaymentStatus;\n\n\t@prop({ type: String })\n\tpublic specialInstructions?: string;\n\n\t@prop({ type: Date, default: null })\n\tpublic professionalStartNotificationSentAt?: Date;\n\n\t@prop({ type: Date, default: null })\n\tpublic professionalEndNotificationSentAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLate?: boolean;\n\n\t// Virtual field\n\t@prop({\n\t\tref: () => ServiceFlag,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic flags?: Ref<ServiceFlag>[];\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews?: Ref<Review>[];\n}\n"]}
1
+ {"version":3,"file":"service-booking.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-booking.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA8E;AAC9E,6CAAoC;AACpC,iDAAwC;AACxC,kDAOiC;AACjC,6DAAoD;AACpD,6DAAmD;AACnD,4FAAiF;AACjF,sHAG+D;AAC/D,4EAAgF;AAChF,wBAAuD;AACvD,uEAA6D;AAC7D,0DAA6D;AAC7D,4DAAyD;AACzD,4EAAqE;AACrE,kHAAsG;AACtG,4HAAgH;AAChH,6DAAmD;AACnD,oDAAiD;AA4B1C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,OAAO,CAAU;IAGjB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,YAAY,CAAqB;IAGjC,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,IAAI,CAAoB;IAGxB,WAAW,CAAuB;IAGlC,SAAS,CAAkB;IAG3B,MAAM,CAAwB;IAG9B,aAAa,CAAuB;IAGpC,uBAAuB,CAAqB;IAG5C,WAAW,CAAQ;IAGnB,QAAQ,CAAQ;IAGhB,SAAS,CAAQ;IAGjB,qBAAqB,CAAQ;IAG7B,4BAA4B,CAAU;IAGtC,WAAW,CAAQ;IAGnB,yBAAyB,CAAU;IAGnC,QAAQ,CAAW;IAGnB,QAAQ,CAAQ;IAGhB,OAAO,CAAyB;IAGhC,eAAe,CAAyB;IAGxC,mBAAmB,CAAqC;IAGxD,WAAW,CAAQ;IAGnB,oBAAoB,CAAW;IAG/B,sBAAsB,CAA6B;IAGnD,UAAU,CAAW;IAGrB,gBAAgB,CAAoB;IAGpC,SAAS,CAAW;IAGpB,SAAS,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AW,EAAE,kBAAW,CAAC,KAAK,EAAE,EAClC;gBACC;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE;4BACN,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;yBAC/D;wBACD,KAAK,EAAE,KAAK;qBACZ;iBACD;aACD,EACD,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAC3B,CAAC;YAEF,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,cAAc,CA4J1B","sourcesContent":["import { modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport {\n\tServiceBookingStatus,\n\tCounterType,\n\tServiceType,\n\tSubServiceType,\n\tAdjustmentStatus,\n\tOnlinePaymentStatus,\n} from '../../../utilities/enum';\nimport { Professional } from './professional.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ServiceBookingFinance } from './embedded/service-booking-finance.model';\nimport {\n\tServiceBookingCancellationDetails,\n\tServiceBookingEndorseLoss,\n} from './embedded/service-booking-cancellation-details.model';\nimport { ServiceBookingStatusTimeline } from './embedded/status-timeline.model';\nimport { CounterModel, Review, VendorParent } from '.';\nimport { ServicePromotion } from './service-promotion.model';\nimport { RegularOrderAddress } from './shared/address.model';\nimport { OrderSlotRange } from './shared/duration.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceBookingRefundInformation } from './embedded/service-booking-refund-information.model';\nimport { ServiceBookingReplacementInformation } from './embedded/service-booking-replacement-information.model';\nimport { ServiceFlag } from './service-flag.model';\nimport { dayjs } from '../../../utilities/dayjs';\n@modelOptions({\n\tschemaOptions: { collection: 'serviceBookings', timestamps: true },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@pre<ServiceBooking>('validate', async function (next) {\n\tif (this.isNew) {\n\t\tconst today = dayjs().format('DDMMYY');\n\n\t\tconst counter = await CounterModel.findOneAndUpdate(\n\t\t\t{ counterType: CounterType.ORDER },\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t$cond: [{ $eq: ['$today', today] }, { $add: ['$value', 1] }, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoday: today,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ new: true, upsert: true }\n\t\t);\n\n\t\tthis.orderId = `${today}${counter.value.toString().padStart(6, '0')}`;\n\t}\n\tnext();\n})\nexport class ServiceBooking extends TimeStamps {\n\t@prop({ type: String, unique: true })\n\tpublic orderId?: string;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic vendorParent!: Ref<VendorParent>;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, type: () => RegularOrderAddress })\n\tpublic userAddress!: RegularOrderAddress;\n\n\t@prop({ required: true, type: OrderSlotRange, _id: false })\n\tpublic slotRange!: OrderSlotRange;\n\n\t@prop({ type: String, enum: ServiceBookingStatus, default: ServiceBookingStatus.PENDING })\n\tpublic status!: ServiceBookingStatus;\n\n\t@prop({ ref: () => Professional })\n\tpublic professionals?: Ref<Professional>[];\n\n\t@prop({ ref: () => Professional })\n\tpublic responsibleProfessional?: Ref<Professional>;\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic startedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic estimatedCompletionAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic estimatedCompletionInMinutes?: number;\n\n\t@prop({ type: Date })\n\tpublic completedAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic actualCompletionInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgent?: boolean;\n\n\t@prop({ type: Date })\n\tpublic urgentAt?: Date;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic finance!: ServiceBookingFinance;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic adjustedFinance!: ServiceBookingFinance;\n\n\t@prop({ type: () => ServiceBookingCancellationDetails, _id: false })\n\tpublic cancellationDetails?: ServiceBookingCancellationDetails;\n\n\t@prop({ type: Date })\n\tpublic cancelledAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => ServiceBookingEndorseLoss, _id: false })\n\tpublic endorseLossInformation?: ServiceBookingEndorseLoss;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: String, enum: AdjustmentStatus, default: AdjustmentStatus.NONE })\n\tpublic adjustmentStatus?: AdjustmentStatus;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isFlagged?: boolean;\n\n\t@prop({ type: Date })\n\tpublic flaggedAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRefunded?: boolean;\n\n\t@prop({ type: ServiceBookingRefundInformation, _id: false })\n\tpublic refundInformation?: ServiceBookingRefundInformation;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReplacement?: boolean;\n\n\t@prop({ type: () => ServiceBookingReplacementInformation, _id: false })\n\tpublic replacementInformation?: ServiceBookingReplacementInformation;\n\n\t@prop({ ref: () => ServiceBooking })\n\tpublic replacementBooking?: Ref<ServiceBooking>;\n\n\t@prop({ type: () => [ServiceBookingStatusTimeline], default: [] })\n\tpublic statusTimeline?: ServiceBookingStatusTimeline[];\n\n\t@prop({ type: Number })\n\tpublic bufferTime?: number; // minutes\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLowRated?: boolean;\n\n\t@prop({ ref: () => ServicePromotion })\n\tpublic servicePromotions?: Ref<ServicePromotion>[];\n\n\t@prop({ type: String, enum: OnlinePaymentStatus })\n\tpublic onlinePaymentStatus?: OnlinePaymentStatus;\n\n\t@prop({ type: String })\n\tpublic specialInstructions?: string;\n\n\t@prop({ type: Date, default: null })\n\tpublic professionalStartNotificationSentAt?: Date;\n\n\t@prop({ type: Date, default: null })\n\tpublic professionalEndNotificationSentAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLate?: boolean;\n\n\t// Virtual field\n\t@prop({\n\t\tref: () => ServiceFlag,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic flags?: Ref<ServiceFlag>[];\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews?: Ref<Review>[];\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.298-alpha.1
25
+ Version: 1.4.298
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;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,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjF,CAAC;AACF,CAAC;AAED,SAAgB,YAAY;IAC3B,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Apply the soft delete plugin globally before any connections or models\nimport { applySoftDeletePlugin } from './libraries/mongo/plugins/soft-delete-plugin';\n\napplySoftDeletePlugin();\n\nimport { LibraryManager } from './libraries';\nimport { Container } from 'typedi';\nimport { ConfigurationOptions, ConfigurationService } from './libraries/configuration';\nimport { LyxaLogger } from './libraries/logger';\nimport { RedisService } from './libraries/redis';\nimport { initGlobalConnection, initLyxaMongoDbConnection } from './libraries/mongo';\nimport { SecretManagerService } from './libraries/secrets';\nimport { MicroServiceDispatcher } from './libraries/dispatcher';\nimport { TwilioService } from './libraries/twilio';\nimport { FirebaseService } from './libraries/firebase';\nimport { initRabbitMQConnection, subscribeToEvent } from './libraries/event';\nimport { SubscriptionRegistry } from './libraries/event/registry/SubscriptionRegistry';\nimport { GoogleMapsService, MapService } from './libraries/map';\nimport { CachedSettingsService } from './libraries/cache/settings';\nimport { FirebaseFcmService } from './libraries/notification/firebase-fcm.service';\nimport { BullMQService } from './libraries/bullmq/bull-mq-service';\nimport { BOBSecrets, BOBService, CashSettlementService } from './libraries/cash-settlement';\nimport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nimport { OsrmMapService } from './libraries/map/providers/osrm';\nimport { RabbitMQUrlMap } from './utilities/environment/rabbitmq-environments';\nimport { disconnectAllEntitiesFromInstance } from './libraries/socket/connections/instance-disconnect';\nimport { LyxaLoggerKit } from './libraries/logger-kit';\nimport { LyxaFcmService } from './libraries/notification/lyxa-fcm.service';\nimport { LyxaFcmSender } from './libraries/notification/lyxa-fcm-sender';\nimport { FirebaseMessageBuilderFactory } from './libraries/notification/firebase-message.builder';\nimport { GoogleTranslateService } from './libraries/google-translate';\nimport { LLMCompletionService, LLMProvider } from './libraries/llm/llm-provider-service';\n\nexport { ConfigurationOptions } from './libraries/configuration';\nexport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nexport { initGlobalConnection } from './libraries/mongo';\nexport * from './libraries/google-translate';\n\nexport async function bootstrapCore(options?: ConfigurationOptions) {\n\ttry {\n\t\tawait registerLibraries(options);\n\t\tgetLibraries().getLogger().logger.info('Successfully bootstrapped lyxa-core.');\n\n\t\tconst gracefulShutdown = async () => {\n\t\t\tgetLibraries().getLogger().logger.info('Received shutdown signal, shutting down gracefully...');\n\t\t\tif (options?.instanceType == 'socket') await disconnectAllEntitiesFromInstance();\n\t\t\tprocess.exit();\n\t\t};\n\n\t\tprocess.on('SIGTERM', gracefulShutdown);\n\t\tprocess.on('SIGINT', gracefulShutdown);\n\t\tprocess.on('uncaughtException', err => {\n\t\t\tconsole.log('err', err);\n\t\t\tgetLibraries().getLogger().logger.error('Uncaught exception, shutting down...', err);\n\t\t\tgracefulShutdown();\n\t\t});\n\t\tprocess.on('exit', code => {\n\t\t\tgetLibraries().getLogger().logger.info(`Exiting with code: ${code}`);\n\t\t});\n\n\t\tconsole.log('Created hooks.');\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n}\n\nexport async function registerLibraries(options?: ConfigurationOptions) {\n\t// Setup configuration.\n\tconst configurationInstance = new ConfigurationService(options);\n\tContainer.set(ConfigurationService, configurationInstance);\n\n\t// Setup redis.\n\tconst redisInstance = new RedisService(configurationInstance.redisURL);\n\tContainer.set(RedisService, redisInstance);\n\n\t// Setup secret\n\tconst secretInstance = new SecretManagerService(configurationInstance, redisInstance);\n\tContainer.set(SecretManagerService, secretInstance);\n\n\t// Setup BullMQ\n\tconst bullMQInstance = new BullMQService(redisInstance);\n\tContainer.set(BullMQService, bullMQInstance);\n\n\tconst mongoUrl = options?.mongoDbUrl\n\t\t? options.mongoDbUrl\n\t\t: await getLibraries().getSecretsService().getKey('MONGO_URL');\n\n\tawait initLyxaMongoDbConnection(mongoUrl!, options);\n\tawait initGlobalConnection(mongoUrl!, options!.environment);\n\n\tconst loggerInstance = new LyxaLogger(options!.instanceType!, mongoUrl!);\n\tContainer.set(LyxaLogger, loggerInstance);\n\n\tconst loggerKit = new LyxaLoggerKit({ instanceType: options!.instanceType! });\n\tContainer.set(LyxaLoggerKit, loggerKit);\n\n\t// Setup firebase\n\tconst firebaseInstance = new FirebaseService(configurationInstance!);\n\tContainer.set(FirebaseService, firebaseInstance);\n\n\t//Setup google translate\n\t// Container.set(GoogleTranslateService, Container.get(GoogleTranslateService));\n\n\t// Setup microservice dispatcher\n\tconst microserviceDispatcherInstance = new MicroServiceDispatcher(secretInstance);\n\tContainer.set(MicroServiceDispatcher, microserviceDispatcherInstance);\n\n\t// Setup twilio\n\tconst twilioServiceInstance = new TwilioService();\n\tContainer.set(TwilioService, twilioServiceInstance);\n\n\t// Setup LLM service\n\tconst llmCompletionService = new LLMCompletionService(LLMProvider.OPENAI);\n\tContainer.set(LLMCompletionService, llmCompletionService);\n\n\t// Setup map service\n\tconst googleMapsKey = await getLibraries().getSecretsService().getKey('GOOGLE_MAPS_API_KEY');\n\tconst googleMapService = new GoogleMapsService(redisInstance, googleMapsKey as string);\n\tconst osrmMapService = new OsrmMapService();\n\tconst mapServiceInstance = new MapService(googleMapService, osrmMapService);\n\tContainer.set(MapService, mapServiceInstance);\n\n\t// Setup cash settlement service\n\tconst bobUsername = await getLibraries().getSecretsService().getKey('BOB_USER_NAME');\n\tconst bobPassword = await getLibraries().getSecretsService().getKey('BOB_PASSWORD');\n\tconst bobURL = await getLibraries().getSecretsService().getKey('BOB_URL');\n\n\tconst bobService = new BOBService({\n\t\tBOB_USER_NAME: bobUsername,\n\t\tBOB_PASSWORD: bobPassword,\n\t\tBOB_URL: bobURL,\n\t} as BOBSecrets);\n\tconst cashSettlementServiceInstance = new CashSettlementService(bobService);\n\tContainer.set(CashSettlementService, cashSettlementServiceInstance);\n\tContainer.set(BOBService, bobService);\n\n\tconst settingsServiceInstance = new CachedSettingsService(redisInstance);\n\tContainer.set(CachedSettingsService, settingsServiceInstance);\n\n\ttry {\n\t\tconst settings = await settingsServiceInstance.getSettings();\n\t\tconst { _setTimezone } = await import('./utilities/dayjs/dayjs');\n\t\t_setTimezone(settings?.timezone || 'Asia/Beirut');\n\t\tconsole.log('Timezone initialized:', settings?.timezone || 'Asia/Beirut');\n\t} catch (error) {\n\t\tconsole.error('Failed to initialize timezone:', error);\n\t}\n\n\t// Setup fcm service\n\tconst fcmService = new FirebaseFcmService();\n\tconst builder = new FirebaseMessageBuilderFactory();\n\tconst lyxaFcmSender = new LyxaFcmSender(fcmService, builder);\n\tconst lyxaFcmService = new LyxaFcmService(lyxaFcmSender);\n\n\tContainer.set(FirebaseFcmService, fcmService);\n\tContainer.set(LyxaFcmService, lyxaFcmService);\n\n\tconsole.log('Initialized everything');\n\n\tawait initRabbitMQConnection(RabbitMQUrlMap[options?.environment ?? EnvironmentConfigurationType.DEV]);\n\n\tconst allSubscriptions = SubscriptionRegistry.getAllSubscriptions();\n\n\tconst instantiatedServices = new Map<Function, any>();\n\n\tfor (const { eventId, targetConstructor, methodName } of allSubscriptions) {\n\t\tlet instance = instantiatedServices.get(targetConstructor);\n\t\tif (!instance) {\n\t\t\tinstance = Container.get(targetConstructor as any);\n\t\t\tinstantiatedServices.set(targetConstructor, instance);\n\t\t}\n\n\t\tawait subscribeToEvent(eventId, async payload => instance[methodName](payload));\n\t}\n}\n\nexport function getLibraries(): LibraryManager {\n\treturn Container.get(LibraryManager);\n}\n"]}
@@ -0,0 +1,77 @@
1
+ import { SignOptions } from 'jsonwebtoken';
2
+ import { EntityContext } from '../trpc/context';
3
+ import { RefreshToken } from './refreshtoken';
4
+ import { ReturnModelType } from '@typegoose/typegoose';
5
+ import { Rider } from '../mongo/models';
6
+ import { AuthEntityType } from '../../utilities/enum';
7
+ export { AuthEntityType };
8
+ export declare enum TokenType {
9
+ ACCESS = "ACCESS",
10
+ REFRESH = "REFRESH"
11
+ }
12
+ export interface RefreshTokenRecord {
13
+ token: string;
14
+ entityId: string;
15
+ entityType: AuthEntityType;
16
+ expiresAt: Date;
17
+ isRevoked: boolean;
18
+ metadata?: Record<string, unknown>;
19
+ }
20
+ export declare function getRefreshTokenModel(): ReturnModelType<typeof RefreshToken>;
21
+ export declare function getRiderModel(): ReturnModelType<typeof Rider>;
22
+ export declare function initializeRefreshTokenModel(globalConnection: any): void;
23
+ export declare function signAccessToken(entity: {
24
+ id: string;
25
+ type: AuthEntityType;
26
+ parameters: Record<string, unknown>;
27
+ }, options?: SignOptions): Promise<string>;
28
+ export declare function generateRefreshToken(entity: {
29
+ id: string;
30
+ type: AuthEntityType;
31
+ parameters?: Record<string, unknown>;
32
+ }, options?: {
33
+ expiresIn?: string | number;
34
+ }): Promise<string>;
35
+ export declare function verifyAccessToken(entityTypes: AuthEntityType[], token: string): Promise<EntityContext | undefined>;
36
+ export declare function validateRefreshToken(token: string): Promise<{
37
+ valid: boolean;
38
+ entity?: {
39
+ id: string;
40
+ type: AuthEntityType;
41
+ parameters?: Record<string, unknown>;
42
+ };
43
+ }>;
44
+ export declare function refreshTokens(refreshToken: string): Promise<{
45
+ accessToken: string;
46
+ refreshToken: string;
47
+ entity: {
48
+ id: string;
49
+ type: AuthEntityType;
50
+ };
51
+ } | null>;
52
+ export declare function revokeRefreshToken(token: string): Promise<boolean>;
53
+ export declare function revokeAllRefreshTokens(entityId: string, entityType: AuthEntityType): Promise<boolean>;
54
+ export declare function signTokenPair(entity: {
55
+ id: string;
56
+ type: AuthEntityType;
57
+ parameters?: Record<string, unknown>;
58
+ }, options?: {
59
+ accessTokenOptions?: SignOptions;
60
+ refreshTokenExpiresIn?: string | number;
61
+ }): Promise<{
62
+ accessToken: string;
63
+ refreshToken: string;
64
+ }>;
65
+ export declare function handleTokenRenewal(refreshToken: string): Promise<{
66
+ success: boolean;
67
+ entity?: {
68
+ id: string;
69
+ type: AuthEntityType;
70
+ parameters: Record<string, unknown>;
71
+ };
72
+ tokenStatus: 'valid' | 'expired' | 'revoked' | 'invalid';
73
+ newTokens?: {
74
+ accessToken: string;
75
+ refreshToken?: string | null;
76
+ };
77
+ }>;
@@ -0,0 +1,270 @@
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.TokenType = exports.AuthEntityType = void 0;
7
+ exports.getRefreshTokenModel = getRefreshTokenModel;
8
+ exports.getRiderModel = getRiderModel;
9
+ exports.initializeRefreshTokenModel = initializeRefreshTokenModel;
10
+ exports.signAccessToken = signAccessToken;
11
+ exports.generateRefreshToken = generateRefreshToken;
12
+ exports.verifyAccessToken = verifyAccessToken;
13
+ exports.validateRefreshToken = validateRefreshToken;
14
+ exports.refreshTokens = refreshTokens;
15
+ exports.revokeRefreshToken = revokeRefreshToken;
16
+ exports.revokeAllRefreshTokens = revokeAllRefreshTokens;
17
+ exports.signTokenPair = signTokenPair;
18
+ exports.handleTokenRenewal = handleTokenRenewal;
19
+ const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
20
+ const crypto_1 = require("crypto");
21
+ const refreshtoken_1 = require("./refreshtoken");
22
+ const index_1 = require("../../index");
23
+ const typegoose_1 = require("@typegoose/typegoose");
24
+ const models_1 = require("../mongo/models");
25
+ const enum_1 = require("../../utilities/enum");
26
+ Object.defineProperty(exports, "AuthEntityType", { enumerable: true, get: function () { return enum_1.AuthEntityType; } });
27
+ var TokenType;
28
+ (function (TokenType) {
29
+ TokenType["ACCESS"] = "ACCESS";
30
+ TokenType["REFRESH"] = "REFRESH";
31
+ })(TokenType || (exports.TokenType = TokenType = {}));
32
+ let actualRefreshTokenModel = null;
33
+ let riderModel = null;
34
+ function getRefreshTokenModel() {
35
+ if (!actualRefreshTokenModel) {
36
+ throw new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');
37
+ }
38
+ return actualRefreshTokenModel;
39
+ }
40
+ function getRiderModel() {
41
+ if (!riderModel) {
42
+ throw new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');
43
+ }
44
+ return riderModel;
45
+ }
46
+ function initializeRefreshTokenModel(globalConnection) {
47
+ actualRefreshTokenModel = (0, typegoose_1.getModelForClass)(refreshtoken_1.RefreshToken, { existingConnection: globalConnection });
48
+ riderModel = (0, typegoose_1.getModelForClass)(models_1.Rider, { existingConnection: globalConnection });
49
+ console.log('✅ RefreshToken model initialized');
50
+ }
51
+ async function signAccessToken(entity, options) {
52
+ if (!entity?.type) {
53
+ throw new Error('Entity type is required to sign token');
54
+ }
55
+ const secret = await (0, index_1.getLibraries)().getSecretsService().getKey(`${entity.type.toUpperCase()}_JWT_TOKEN`);
56
+ if (!secret) {
57
+ throw new Error(`No secret found for entity type ${entity.type}`);
58
+ }
59
+ const payload = {
60
+ id: entity.id,
61
+ type: entity.type,
62
+ parameters: entity.parameters,
63
+ tokenType: TokenType.ACCESS,
64
+ };
65
+ const tokenOptions = {
66
+ ...options,
67
+ expiresIn: options?.expiresIn || '1d',
68
+ };
69
+ return jsonwebtoken_1.default.sign(payload, secret, tokenOptions);
70
+ }
71
+ async function generateRefreshToken(entity, options) {
72
+ const tokenValue = (0, crypto_1.randomBytes)(40).toString('hex');
73
+ const expiresIn = options?.expiresIn || '7d';
74
+ const expiresAt = new Date();
75
+ if (typeof expiresIn === 'string') {
76
+ const match = expiresIn.match(/^(\d+)([smhdwy])$/);
77
+ if (match) {
78
+ const value = parseInt(match[1]);
79
+ const unit = match[2];
80
+ switch (unit) {
81
+ case 's':
82
+ expiresAt.setSeconds(expiresAt.getSeconds() + value);
83
+ break;
84
+ case 'm':
85
+ expiresAt.setMinutes(expiresAt.getMinutes() + value);
86
+ break;
87
+ case 'h':
88
+ expiresAt.setHours(expiresAt.getHours() + value);
89
+ break;
90
+ case 'd':
91
+ expiresAt.setDate(expiresAt.getDate() + value);
92
+ break;
93
+ case 'w':
94
+ expiresAt.setDate(expiresAt.getDate() + value * 7);
95
+ break;
96
+ case 'y':
97
+ expiresAt.setFullYear(expiresAt.getFullYear() + value);
98
+ break;
99
+ }
100
+ }
101
+ else {
102
+ expiresAt.setDate(expiresAt.getDate() + 7);
103
+ }
104
+ }
105
+ else if (typeof expiresIn === 'number') {
106
+ expiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);
107
+ }
108
+ await storeRefreshToken({
109
+ token: tokenValue,
110
+ entityId: entity.id,
111
+ entityType: entity.type,
112
+ expiresAt,
113
+ isRevoked: false,
114
+ metadata: entity.parameters,
115
+ });
116
+ return tokenValue;
117
+ }
118
+ async function storeRefreshToken(tokenRecord) {
119
+ const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
120
+ await tokenRepository.saveRefreshToken(tokenRecord);
121
+ }
122
+ async function verifyAccessToken(entityTypes, token) {
123
+ for (const entityType of entityTypes) {
124
+ const secret = await (0, index_1.getLibraries)()
125
+ .getSecretsService()
126
+ .getKey(entityType.toUpperCase() + '_JWT_TOKEN');
127
+ try {
128
+ const decoded = jsonwebtoken_1.default.verify(token, secret);
129
+ if (decoded.tokenType !== TokenType.ACCESS) {
130
+ continue;
131
+ }
132
+ return decoded;
133
+ }
134
+ catch (err) {
135
+ }
136
+ }
137
+ return undefined;
138
+ }
139
+ async function validateRefreshToken(token) {
140
+ const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
141
+ const storedToken = await tokenRepository.findRefreshToken(token);
142
+ if (storedToken && storedToken?.entityType === enum_1.AuthEntityType.DELIVERY_BOY) {
143
+ const rider = await getRiderModel().findOne({ _id: storedToken.entityId }).lean();
144
+ if (rider && storedToken.metadata && rider.lastLoginDeviceId !== storedToken.metadata.deviceId) {
145
+ return { valid: false };
146
+ }
147
+ }
148
+ if (!storedToken) {
149
+ return { valid: false };
150
+ }
151
+ if (storedToken.expiresAt && new Date() > storedToken.expiresAt) {
152
+ return { valid: false };
153
+ }
154
+ if (storedToken.isRevoked) {
155
+ return { valid: false };
156
+ }
157
+ return {
158
+ valid: true,
159
+ entity: {
160
+ id: storedToken.entityId,
161
+ type: storedToken.entityType,
162
+ parameters: storedToken.metadata,
163
+ },
164
+ };
165
+ }
166
+ async function refreshTokens(refreshToken) {
167
+ const validation = await validateRefreshToken(refreshToken);
168
+ if (!validation.valid || !validation.entity) {
169
+ return null;
170
+ }
171
+ await revokeRefreshToken(refreshToken);
172
+ const entity = validation.entity;
173
+ const newAccessToken = await signAccessToken({
174
+ id: entity.id,
175
+ type: entity.type,
176
+ parameters: entity.parameters || {},
177
+ });
178
+ const newRefreshToken = await generateRefreshToken({
179
+ id: entity.id,
180
+ type: entity.type,
181
+ parameters: entity.parameters,
182
+ });
183
+ return {
184
+ accessToken: newAccessToken,
185
+ refreshToken: newRefreshToken,
186
+ entity: {
187
+ id: entity.id,
188
+ type: entity.type,
189
+ },
190
+ };
191
+ }
192
+ async function revokeRefreshToken(token) {
193
+ const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
194
+ return tokenRepository.revokeRefreshToken(token);
195
+ }
196
+ async function revokeAllRefreshTokens(entityId, entityType) {
197
+ const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
198
+ return tokenRepository.revokeAllRefreshTokensForEntity(entityId, entityType);
199
+ }
200
+ async function signTokenPair(entity, options) {
201
+ const accessToken = await signAccessToken({
202
+ id: entity.id,
203
+ type: entity.type,
204
+ parameters: entity.parameters || {},
205
+ }, options?.accessTokenOptions);
206
+ const refreshToken = await generateRefreshToken({
207
+ id: entity.id,
208
+ type: entity.type,
209
+ parameters: entity.parameters,
210
+ }, { expiresIn: options?.refreshTokenExpiresIn });
211
+ return {
212
+ accessToken,
213
+ refreshToken,
214
+ };
215
+ }
216
+ async function handleTokenRenewal(refreshToken) {
217
+ const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
218
+ const storedToken = await tokenRepository.findRefreshToken(refreshToken);
219
+ if (!storedToken) {
220
+ return {
221
+ success: false,
222
+ tokenStatus: 'invalid',
223
+ };
224
+ }
225
+ const isRevoked = storedToken.isRevoked;
226
+ if (isRevoked) {
227
+ return {
228
+ success: false,
229
+ tokenStatus: 'revoked',
230
+ };
231
+ }
232
+ const isExpired = storedToken.isExpired();
233
+ const entityData = {
234
+ id: storedToken.entityId,
235
+ type: storedToken.entityType,
236
+ parameters: storedToken.metadata || {},
237
+ };
238
+ if (isExpired) {
239
+ const newTokens = await signTokenPair({
240
+ id: storedToken.entityId,
241
+ type: storedToken.entityType,
242
+ parameters: storedToken.metadata || {},
243
+ });
244
+ await tokenRepository.revokeRefreshToken(refreshToken);
245
+ return {
246
+ success: true,
247
+ entity: entityData,
248
+ tokenStatus: 'expired',
249
+ newTokens: {
250
+ accessToken: newTokens.accessToken,
251
+ refreshToken: newTokens.refreshToken,
252
+ },
253
+ };
254
+ }
255
+ const newAccessToken = await signAccessToken({
256
+ id: storedToken.entityId,
257
+ type: storedToken.entityType,
258
+ parameters: storedToken.metadata || {},
259
+ });
260
+ return {
261
+ success: true,
262
+ entity: entityData,
263
+ tokenStatus: 'valid',
264
+ newTokens: {
265
+ accessToken: newAccessToken,
266
+ refreshToken: null,
267
+ },
268
+ };
269
+ }
270
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/auth/index.ts"],"names":[],"mappings":";;;;;;AAgCA,oDAKC;AAGD,sCAKC;AAKD,kEAIC;AAMD,0CA2BC;AAKD,oDAuDC;AAaD,8CAwBC;AAKD,oDAiCE;AAMF,sCAoCC;AAKD,gDAGC;AAKD,wDAGC;AAKD,sCA6BC;AAOD,gDA2EC;AA5YD,gEAA4D;AAE5D,mCAAqC;AACrC,iDAA8C;AAC9C,uCAA2C;AAC3C,oDAAyE;AACzE,4CAAwC;AACxC,+CAAsD;AAE9C,+FAFC,qBAAc,OAED;AAEtB,IAAY,SAGX;AAHD,WAAY,SAAS;IACpB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACpB,CAAC,EAHW,SAAS,yBAAT,SAA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CAAC;IAE1C,MAAM,UAAU,GAAG;QAClB,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC;IAEF,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC;YACrC,EAAE,EAAE,WAAW,CAAC,QAAQ;YACxB,IAAI,EAAE,WAAW,CAAC,UAAU;YAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;SACtC,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QAEvD,OAAO;YACN,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,UAAU;YAClB,WAAW,EAAE,SAAS;YACtB,SAAS,EAAE;gBACV,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,YAAY,EAAE,SAAS,CAAC,YAAY;aACpC;SACD,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC;QAC5C,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC,CAAC;IAEH,OAAO;QACN,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE;YACV,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,IAAI;SAClB;KACD,CAAC;AACH,CAAC","sourcesContent":["import jwt, { SignOptions, JwtPayload } from 'jsonwebtoken';\nimport { EntityContext } from '../trpc/context';\nimport { randomBytes } from 'crypto';\nimport { RefreshToken } from './refreshtoken';\nimport { getLibraries } from '../../index';\nimport { getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { Rider } from '../mongo/models';\nimport { AuthEntityType } from '../../utilities/enum';\n\nexport {AuthEntityType}\n\nexport enum TokenType {\n\tACCESS = 'ACCESS',\n\tREFRESH = 'REFRESH',\n}\n\nexport interface RefreshTokenRecord {\n\ttoken: string;\n\tentityId: string;\n\tentityType: AuthEntityType;\n\texpiresAt: Date;\n\tisRevoked: boolean;\n\tmetadata?: Record<string, unknown>;\n}\n\n// Global model for RefreshToken - will be set after initGlobalConnection()\nlet actualRefreshTokenModel: ReturnModelType<typeof RefreshToken> | null = null;\nlet riderModel: ReturnModelType<typeof Rider> | null = null;\n\n/**\n * Get the RefreshToken model (throws if not initialized)\n */\nexport function getRefreshTokenModel(): ReturnModelType<typeof RefreshToken> {\n\tif (!actualRefreshTokenModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn actualRefreshTokenModel;\n}\n\n\nexport function getRiderModel(): ReturnModelType<typeof Rider> {\n\tif (!riderModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn riderModel;\n}\n\n/**\n * Initialize the RefreshToken model (called from initGlobalConnection)\n */\nexport function initializeRefreshTokenModel(globalConnection: any) {\n\tactualRefreshTokenModel = getModelForClass(RefreshToken, { existingConnection: globalConnection });\n\triderModel = getModelForClass(Rider, { existingConnection: globalConnection })\n\tconsole.log('✅ RefreshToken model initialized');\n}\n\n/**\n * Sign a JWT access token for the given entity (id + type).\n * It will fetch the secret for that entity type and create a token.\n */\nexport async function signAccessToken(\n\tentity: { id: string; type: AuthEntityType; parameters: Record<string, unknown> },\n\toptions?: SignOptions\n): Promise<string> {\n\tif (!entity?.type) {\n\t\tthrow new Error('Entity type is required to sign token');\n\t}\n\n\tconst secret = await getLibraries().getSecretsService().getKey(`${entity.type.toUpperCase()}_JWT_TOKEN`);\n\n\tif (!secret) {\n\t\tthrow new Error(`No secret found for entity type ${entity.type}`);\n\t}\n\n\tconst payload = {\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t\ttokenType: TokenType.ACCESS,\n\t};\n\n\tconst tokenOptions: SignOptions = {\n\t\t...options,\n\t\texpiresIn: options?.expiresIn || '1d',\n\t};\n\n\treturn jwt.sign(payload, secret, tokenOptions);\n}\n\n/**\n * Generate a refresh token for the given entity\n */\nexport async function generateRefreshToken(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { expiresIn?: string | number }\n): Promise<string> {\n\tconst tokenValue = randomBytes(40).toString('hex');\n\n\tconst expiresIn = options?.expiresIn || '7d';\n\tconst expiresAt = new Date();\n\n\tif (typeof expiresIn === 'string') {\n\t\t// Parse duration strings like '7d', '30d', etc.\n\t\tconst match = expiresIn.match(/^(\\d+)([smhdwy])$/);\n\t\tif (match) {\n\t\t\tconst value = parseInt(match[1]);\n\t\t\tconst unit = match[2];\n\n\t\t\tswitch (unit) {\n\t\t\t\tcase 's':\n\t\t\t\t\texpiresAt.setSeconds(expiresAt.getSeconds() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm':\n\t\t\t\t\texpiresAt.setMinutes(expiresAt.getMinutes() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'h':\n\t\t\t\t\texpiresAt.setHours(expiresAt.getHours() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value * 7);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\texpiresAt.setFullYear(expiresAt.getFullYear() + value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t// Default to 7 days if format is invalid\n\t\t\texpiresAt.setDate(expiresAt.getDate() + 7);\n\t\t}\n\t} else if (typeof expiresIn === 'number') {\n\t\t// Interpret number as seconds\n\t\texpiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);\n\t}\n\n\tawait storeRefreshToken({\n\t\ttoken: tokenValue,\n\t\tentityId: entity.id,\n\t\tentityType: entity.type,\n\t\texpiresAt,\n\t\tisRevoked: false,\n\t\tmetadata: entity.parameters,\n\t});\n\n\treturn tokenValue;\n}\n\n/**\n * Store a refresh token in the database\n */\nasync function storeRefreshToken(tokenRecord: RefreshTokenRecord): Promise<void> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tawait tokenRepository.saveRefreshToken(tokenRecord);\n}\n\n/**\n * Verify an access token for the given entity types\n */\nexport async function verifyAccessToken(\n\tentityTypes: AuthEntityType[],\n\ttoken: string\n): Promise<EntityContext | undefined> {\n\tfor (const entityType of entityTypes) {\n\t\tconst secret = await getLibraries()\n\t\t\t.getSecretsService()\n\t\t\t.getKey(entityType.toUpperCase() + '_JWT_TOKEN');\n\n\t\ttry {\n\t\t\tconst decoded = jwt.verify(token, secret!) as EntityContext & { tokenType?: TokenType };\n\n\t\t\t// Verify this is an access token\n\t\t\tif (decoded.tokenType !== TokenType.ACCESS) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn decoded;\n\t\t} catch (err) {\n\t\t\t// Continue to the next entity type\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validate a refresh token and return the associated entity\n */\nexport async function validateRefreshToken(token: string): Promise<{\n\t\tvalid: boolean;\n\t\tentity?: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> };\n\t}> {\n\t\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\t\tconst storedToken = await tokenRepository.findRefreshToken(token);\t\t\n\t\tif (storedToken && storedToken?.entityType === AuthEntityType.DELIVERY_BOY) {\n\t\t\tconst rider = await getRiderModel().findOne({ _id: storedToken.entityId }).lean();\t\t\t\n\t\t\tif (rider && storedToken.metadata && rider.lastLoginDeviceId !== storedToken.metadata.deviceId) {\t\t\t\t\n\t\t\t\treturn { valid: false };\n\t\t\t}\n\t\t}\n\n\t\tif (!storedToken) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\tif (storedToken.expiresAt && new Date() > storedToken.expiresAt) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\tif (storedToken.isRevoked) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\tentity: {\n\t\t\t\tid: storedToken.entityId,\n\t\t\t\ttype: storedToken.entityType,\n\t\t\t\tparameters: storedToken.metadata,\n\t\t\t},\n\t\t};\n\t}\n\n/**\n * Refresh authentication tokens\n * Returns new access and refresh tokens\n */\nexport async function refreshTokens(refreshToken: string): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n\tentity: { id: string; type: AuthEntityType };\n} | null> {\n\t// Validate the refresh token\n\tconst validation = await validateRefreshToken(refreshToken);\n\n\tif (!validation.valid || !validation.entity) {\n\t\treturn null;\n\t}\n\n\tawait revokeRefreshToken(refreshToken);\n\n\t// Create new tokens\n\tconst entity = validation.entity;\n\tconst newAccessToken = await signAccessToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters || {},\n\t});\n\n\tconst newRefreshToken = await generateRefreshToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t});\n\n\treturn {\n\t\taccessToken: newAccessToken,\n\t\trefreshToken: newRefreshToken,\n\t\tentity: {\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t},\n\t};\n}\n\n/**\n * Revoke a refresh token\n */\nexport async function revokeRefreshToken(token: string): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeRefreshToken(token);\n}\n\n/**\n * Revoke all refresh tokens for a specific entity\n */\nexport async function revokeAllRefreshTokens(entityId: string, entityType: AuthEntityType): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeAllRefreshTokensForEntity(entityId, entityType);\n}\n\n/**\n * Sign both access and refresh tokens - utility for initial login/authentication\n */\nexport async function signTokenPair(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { accessTokenOptions?: SignOptions; refreshTokenExpiresIn?: string | number }\n): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n}> {\n\tconst accessToken = await signAccessToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters || {},\n\t\t},\n\t\toptions?.accessTokenOptions\n\t);\n\n\tconst refreshToken = await generateRefreshToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters,\n\t\t},\n\t\t{ expiresIn: options?.refreshTokenExpiresIn }\n\t);\n\n\treturn {\n\t\taccessToken,\n\t\trefreshToken,\n\t};\n}\n\n/**\n * Handle the refresh token validation and renewal logic\n * @param refreshToken The refresh token to validate or renew\n * @returns Result object with token status and renewal information\n */\nexport async function handleTokenRenewal(refreshToken: string): Promise<{\n\tsuccess: boolean;\n\tentity?: {\n\t\tid: string;\n\t\ttype: AuthEntityType;\n\t\tparameters: Record<string, unknown>;\n\t};\n\ttokenStatus: 'valid' | 'expired' | 'revoked' | 'invalid';\n\tnewTokens?: {\n\t\taccessToken: string;\n\t\trefreshToken?: string | null;\n\t};\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\n\tconst storedToken = await tokenRepository.findRefreshToken(refreshToken);\n\n\tif (!storedToken) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'invalid',\n\t\t};\n\t}\n\n\tconst isRevoked = storedToken.isRevoked;\n\tif (isRevoked) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'revoked',\n\t\t};\n\t}\n\n\tconst isExpired = storedToken.isExpired();\n\n\tconst entityData = {\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t};\n\n\tif (isExpired) {\n\t\tconst newTokens = await signTokenPair({\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata || {},\n\t\t});\n\n\t\tawait tokenRepository.revokeRefreshToken(refreshToken);\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tentity: entityData,\n\t\t\ttokenStatus: 'expired',\n\t\t\tnewTokens: {\n\t\t\t\taccessToken: newTokens.accessToken,\n\t\t\t\trefreshToken: newTokens.refreshToken,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst newAccessToken = await signAccessToken({\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t});\n\n\treturn {\n\t\tsuccess: true,\n\t\tentity: entityData,\n\t\ttokenStatus: 'valid',\n\t\tnewTokens: {\n\t\t\taccessToken: newAccessToken,\n\t\t\trefreshToken: null,\n\t\t},\n\t};\n}\n"]}