@pisell/pisellos 2.2.244 → 2.2.246

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 (316) hide show
  1. package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
  2. package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
  3. package/dist/modules/BookingContext/index.d.ts +48 -0
  4. package/dist/modules/BookingContext/index.js +566 -0
  5. package/dist/modules/BookingContext/types.d.ts +102 -0
  6. package/dist/modules/BookingContext/types.js +51 -0
  7. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  8. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +284 -0
  9. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  10. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
  11. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  12. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +218 -0
  13. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  14. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  15. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  16. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  17. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  18. package/dist/modules/BookingContext/utils/index.js +11 -0
  19. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  20. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  21. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  22. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  23. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  24. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  25. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  26. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  27. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  28. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  29. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  30. package/dist/modules/BookingContext/utils/resources.js +486 -0
  31. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  32. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  33. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  34. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  35. package/dist/modules/Cart/utils/cartProduct.js +24 -3
  36. package/dist/modules/Cart/utils/changePrice.js +11 -11
  37. package/dist/modules/Customer/index.d.ts +20 -0
  38. package/dist/modules/Customer/index.js +172 -83
  39. package/dist/modules/Customer/types.d.ts +2 -0
  40. package/dist/modules/Discount/index.d.ts +1 -1
  41. package/dist/modules/Discount/index.js +13 -6
  42. package/dist/modules/Discount/types.d.ts +1 -0
  43. package/dist/modules/OpenData/index.d.ts +8 -0
  44. package/dist/modules/OpenData/index.js +37 -17
  45. package/dist/modules/Order/index.d.ts +277 -18
  46. package/dist/modules/Order/index.js +3581 -779
  47. package/dist/modules/Order/types.d.ts +286 -31
  48. package/dist/modules/Order/types.js +38 -0
  49. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  50. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  51. package/dist/modules/Order/utils.d.ts +147 -5
  52. package/dist/modules/Order/utils.js +750 -104
  53. package/dist/modules/Payment/index.d.ts +10 -13
  54. package/dist/modules/Payment/index.js +467 -837
  55. package/dist/modules/Payment/types.d.ts +2 -0
  56. package/dist/modules/Payment/utils.js +2 -1
  57. package/dist/modules/Payment/walletpass.js +41 -25
  58. package/dist/modules/ProductList/index.d.ts +16 -12
  59. package/dist/modules/ProductList/index.js +133 -59
  60. package/dist/modules/ProductList/types.d.ts +14 -0
  61. package/dist/modules/Quotation/index.d.ts +0 -1
  62. package/dist/modules/Quotation/index.js +25 -22
  63. package/dist/modules/Rules/index.d.ts +4 -0
  64. package/dist/modules/Rules/index.js +97 -70
  65. package/dist/modules/Rules/types.d.ts +1 -0
  66. package/dist/modules/SalesSummary/index.d.ts +8 -25
  67. package/dist/modules/SalesSummary/index.js +86 -35
  68. package/dist/modules/SalesSummary/types.d.ts +4 -1
  69. package/dist/modules/SalesSummary/utils.d.ts +2 -25
  70. package/dist/modules/SalesSummary/utils.js +794 -162
  71. package/dist/modules/Schedule/index.d.ts +7 -0
  72. package/dist/modules/Schedule/index.js +24 -2
  73. package/dist/modules/Summary/index.js +4 -3
  74. package/dist/modules/SurchargeList/index.d.ts +16 -0
  75. package/dist/modules/SurchargeList/index.js +162 -0
  76. package/dist/modules/SurchargeList/types.d.ts +11 -0
  77. package/dist/modules/SurchargeList/types.js +1 -0
  78. package/dist/modules/index.d.ts +2 -0
  79. package/dist/modules/index.js +3 -1
  80. package/dist/plugins/request.d.ts +1 -0
  81. package/dist/server/index.d.ts +204 -1
  82. package/dist/server/index.js +3654 -922
  83. package/dist/server/modules/index.d.ts +2 -0
  84. package/dist/server/modules/index.js +2 -0
  85. package/dist/server/modules/order/index.d.ts +120 -3
  86. package/dist/server/modules/order/index.js +1762 -448
  87. package/dist/server/modules/order/types.d.ts +32 -3
  88. package/dist/server/modules/order/types.js +8 -0
  89. package/dist/server/modules/order/utils/filterBookings.js +26 -3
  90. package/dist/server/modules/order/utils/filterOrders.js +23 -8
  91. package/dist/server/modules/payment/index.d.ts +28 -0
  92. package/dist/server/modules/payment/index.js +305 -0
  93. package/dist/server/modules/payment/types.d.ts +9 -0
  94. package/dist/server/modules/payment/types.js +1 -0
  95. package/dist/server/modules/products/index.d.ts +34 -7
  96. package/dist/server/modules/products/index.js +631 -317
  97. package/dist/server/modules/resource/index.d.ts +2 -0
  98. package/dist/server/modules/resource/index.js +29 -3
  99. package/dist/server/modules/schedule/index.d.ts +4 -4
  100. package/dist/server/modules/schedule/index.js +111 -88
  101. package/dist/server/test.json +713 -0
  102. package/dist/server/utils/small-ticket.d.ts +71 -0
  103. package/dist/server/utils/small-ticket.js +840 -0
  104. package/dist/solution/BaseSales/index.d.ts +133 -10
  105. package/dist/solution/BaseSales/index.js +1950 -447
  106. package/dist/solution/BaseSales/types.d.ts +82 -6
  107. package/dist/solution/BaseSales/types.js +5 -4
  108. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  109. package/dist/solution/BaseSales/utils/cartPromotion.js +1438 -0
  110. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  111. package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
  112. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  113. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +105 -24
  114. package/dist/solution/BaseSales/utils.d.ts +1 -1
  115. package/dist/solution/BaseSales/utils.js +62 -21
  116. package/dist/solution/BookingByStep/index.d.ts +1 -1
  117. package/dist/solution/BookingTicket/index.d.ts +271 -11
  118. package/dist/solution/BookingTicket/index.js +1777 -242
  119. package/dist/solution/BookingTicket/types.d.ts +118 -1
  120. package/dist/solution/BookingTicket/types.js +41 -2
  121. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  122. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  123. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  124. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  125. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  126. package/dist/solution/BookingTicket/utils/bookingStatus.js +70 -0
  127. package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
  128. package/dist/solution/BookingTicket/utils/cartView.js +94 -7
  129. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  130. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  131. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  132. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  133. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  134. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  135. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  136. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  137. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  138. package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
  139. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  140. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  141. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  142. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  143. package/dist/solution/Checkout/index.d.ts +1 -0
  144. package/dist/solution/Checkout/index.js +10 -9
  145. package/dist/solution/RegisterAndLogin/config.js +2 -10
  146. package/dist/solution/ScanOrder/index.d.ts +9 -3
  147. package/dist/solution/ScanOrder/index.js +241 -134
  148. package/dist/solution/ScanOrder/types.d.ts +9 -5
  149. package/dist/solution/ScanOrder/types.js +2 -3
  150. package/dist/solution/ScanOrder/utils.d.ts +1 -1
  151. package/dist/solution/ScanOrder/utils.js +84 -22
  152. package/dist/solution/VenueBooking/index.d.ts +5 -2
  153. package/dist/solution/VenueBooking/index.js +110 -59
  154. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  155. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  156. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
  157. package/dist/types/index.d.ts +10 -0
  158. package/lib/model/strategy/adapter/promotion/evaluator.js +2 -1
  159. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  160. package/lib/model/strategy/adapter/walletPass/utils.js +3 -2
  161. package/lib/modules/BookingContext/index.d.ts +48 -0
  162. package/lib/modules/BookingContext/index.js +368 -0
  163. package/lib/modules/BookingContext/types.d.ts +102 -0
  164. package/lib/modules/BookingContext/types.js +34 -0
  165. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  166. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
  167. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  168. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +154 -0
  169. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  170. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +201 -0
  171. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  172. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  173. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  174. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  175. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  176. package/lib/modules/BookingContext/utils/index.js +43 -0
  177. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  178. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  179. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  180. package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
  181. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  182. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  183. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  184. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  185. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  186. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  187. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  188. package/lib/modules/BookingContext/utils/resources.js +377 -0
  189. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  190. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  191. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  192. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  193. package/lib/modules/Cart/utils/cartProduct.js +20 -3
  194. package/lib/modules/Cart/utils/changePrice.js +12 -20
  195. package/lib/modules/Customer/index.d.ts +20 -0
  196. package/lib/modules/Customer/index.js +64 -11
  197. package/lib/modules/Customer/types.d.ts +2 -0
  198. package/lib/modules/Discount/index.d.ts +1 -1
  199. package/lib/modules/Discount/index.js +9 -1
  200. package/lib/modules/Discount/types.d.ts +1 -0
  201. package/lib/modules/OpenData/index.d.ts +8 -0
  202. package/lib/modules/OpenData/index.js +19 -5
  203. package/lib/modules/Order/index.d.ts +277 -18
  204. package/lib/modules/Order/index.js +2317 -337
  205. package/lib/modules/Order/types.d.ts +286 -31
  206. package/lib/modules/Order/types.js +1 -0
  207. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  208. package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
  209. package/lib/modules/Order/utils.d.ts +147 -5
  210. package/lib/modules/Order/utils.js +615 -46
  211. package/lib/modules/Payment/index.d.ts +10 -13
  212. package/lib/modules/Payment/index.js +18 -150
  213. package/lib/modules/Payment/types.d.ts +2 -0
  214. package/lib/modules/Payment/utils.js +2 -1
  215. package/lib/modules/Payment/walletpass.js +16 -3
  216. package/lib/modules/ProductList/index.d.ts +16 -12
  217. package/lib/modules/ProductList/index.js +41 -4
  218. package/lib/modules/ProductList/types.d.ts +14 -0
  219. package/lib/modules/Quotation/index.d.ts +0 -1
  220. package/lib/modules/Quotation/index.js +19 -16
  221. package/lib/modules/Rules/index.d.ts +4 -0
  222. package/lib/modules/Rules/index.js +137 -120
  223. package/lib/modules/Rules/types.d.ts +1 -0
  224. package/lib/modules/SalesSummary/index.d.ts +8 -25
  225. package/lib/modules/SalesSummary/index.js +30 -4
  226. package/lib/modules/SalesSummary/types.d.ts +4 -1
  227. package/lib/modules/SalesSummary/utils.d.ts +2 -25
  228. package/lib/modules/SalesSummary/utils.js +645 -91
  229. package/lib/modules/Schedule/index.d.ts +7 -0
  230. package/lib/modules/Schedule/index.js +17 -1
  231. package/lib/modules/Summary/index.js +5 -4
  232. package/lib/modules/SurchargeList/index.d.ts +16 -0
  233. package/lib/modules/SurchargeList/index.js +89 -0
  234. package/lib/modules/SurchargeList/types.d.ts +11 -0
  235. package/lib/modules/SurchargeList/types.js +17 -0
  236. package/lib/modules/index.d.ts +2 -0
  237. package/lib/modules/index.js +5 -1
  238. package/lib/plugins/request.d.ts +1 -0
  239. package/lib/server/index.d.ts +204 -1
  240. package/lib/server/index.js +1891 -59
  241. package/lib/server/modules/index.d.ts +2 -0
  242. package/lib/server/modules/index.js +3 -0
  243. package/lib/server/modules/order/index.d.ts +120 -3
  244. package/lib/server/modules/order/index.js +887 -94
  245. package/lib/server/modules/order/types.d.ts +32 -3
  246. package/lib/server/modules/order/utils/filterBookings.js +24 -5
  247. package/lib/server/modules/order/utils/filterOrders.js +15 -6
  248. package/lib/server/modules/payment/index.d.ts +28 -0
  249. package/lib/server/modules/payment/index.js +192 -0
  250. package/lib/server/modules/payment/types.d.ts +9 -0
  251. package/lib/server/modules/payment/types.js +17 -0
  252. package/lib/server/modules/products/index.d.ts +34 -7
  253. package/lib/server/modules/products/index.js +189 -54
  254. package/lib/server/modules/resource/index.d.ts +2 -0
  255. package/lib/server/modules/resource/index.js +27 -3
  256. package/lib/server/modules/schedule/index.d.ts +4 -4
  257. package/lib/server/modules/schedule/index.js +47 -40
  258. package/lib/server/test.json +713 -0
  259. package/lib/server/utils/small-ticket.d.ts +71 -0
  260. package/lib/server/utils/small-ticket.js +800 -0
  261. package/lib/solution/BaseSales/index.d.ts +133 -10
  262. package/lib/solution/BaseSales/index.js +1111 -63
  263. package/lib/solution/BaseSales/types.d.ts +82 -6
  264. package/lib/solution/BaseSales/types.js +3 -1
  265. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  266. package/lib/solution/BaseSales/utils/cartPromotion.js +992 -0
  267. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  268. package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
  269. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  270. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +106 -18
  271. package/lib/solution/BaseSales/utils.d.ts +1 -1
  272. package/lib/solution/BaseSales/utils.js +54 -10
  273. package/lib/solution/BookingByStep/index.d.ts +1 -1
  274. package/lib/solution/BookingTicket/index.d.ts +271 -11
  275. package/lib/solution/BookingTicket/index.js +922 -29
  276. package/lib/solution/BookingTicket/types.d.ts +118 -1
  277. package/lib/solution/BookingTicket/types.js +11 -0
  278. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  279. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  280. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  281. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
  282. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  283. package/lib/solution/BookingTicket/utils/bookingStatus.js +44 -2
  284. package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
  285. package/lib/solution/BookingTicket/utils/cartView.js +61 -6
  286. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  287. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  288. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  289. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
  290. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  291. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
  292. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  293. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
  294. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  295. package/lib/solution/BookingTicket/utils/scan/index.js +17 -3
  296. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  297. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
  298. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  299. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
  300. package/lib/solution/Checkout/index.d.ts +1 -0
  301. package/lib/solution/Checkout/index.js +1 -2
  302. package/lib/solution/RegisterAndLogin/config.js +2 -10
  303. package/lib/solution/ScanOrder/index.d.ts +9 -3
  304. package/lib/solution/ScanOrder/index.js +153 -70
  305. package/lib/solution/ScanOrder/types.d.ts +9 -5
  306. package/lib/solution/ScanOrder/utils.d.ts +1 -1
  307. package/lib/solution/ScanOrder/utils.js +83 -17
  308. package/lib/solution/VenueBooking/index.d.ts +5 -2
  309. package/lib/solution/VenueBooking/index.js +54 -17
  310. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  311. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  312. package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
  313. package/lib/types/index.d.ts +10 -0
  314. package/package.json +1 -1
  315. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  316. package/lib/solution/Checkout/appointmentDemo.json +0 -1
@@ -0,0 +1,124 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/modules/BookingContext/utils/timeSlices.ts
30
+ var timeSlices_exports = {};
31
+ __export(timeSlices_exports, {
32
+ findNextDuration: () => findNextDuration,
33
+ findNextSlice: () => findNextSlice,
34
+ getDurationValue: () => import_flexible.getDurationValue,
35
+ getEndDate: () => getEndDate,
36
+ sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
37
+ });
38
+ module.exports = __toCommonJS(timeSlices_exports);
39
+ var import_dayjs = __toESM(require("dayjs"));
40
+ var import_flexible = require("./flexible");
41
+ function sliceDayIntoFiveMinutes(config, isDay) {
42
+ const startTime = (0, import_dayjs.default)().startOf("day");
43
+ const endTime = (0, import_dayjs.default)().endOf("day");
44
+ const timeSlice = config && config.value || 5;
45
+ const timeSlices = [];
46
+ const durationSlicesBasedOnTime = [];
47
+ let currentTime = startTime;
48
+ if (isDay) {
49
+ let currentDay = 1;
50
+ while (currentDay <= 30) {
51
+ timeSlices.push({
52
+ label: currentTime.format("hh:mm A"),
53
+ value: currentTime.format("HH:mm")
54
+ });
55
+ durationSlicesBasedOnTime.push({
56
+ label: String(currentDay),
57
+ value: currentDay
58
+ });
59
+ currentDay += 1;
60
+ }
61
+ return { timeSlices, durationSlicesBasedOnTime };
62
+ }
63
+ while (currentTime.isBefore(endTime)) {
64
+ timeSlices.push({
65
+ label: currentTime.format("hh:mm A"),
66
+ value: currentTime.format("HH:mm")
67
+ });
68
+ const nextTime = currentTime.add(timeSlice, "minute");
69
+ const durationValue = nextTime.diff(startTime, "minute");
70
+ durationSlicesBasedOnTime.push({
71
+ label: String(durationValue),
72
+ value: durationValue
73
+ });
74
+ currentTime = nextTime;
75
+ }
76
+ return { timeSlices, durationSlicesBasedOnTime };
77
+ }
78
+ function findNextDuration(current, array, defaultValue) {
79
+ if (defaultValue !== void 0 && defaultValue !== null)
80
+ return defaultValue;
81
+ if (!array || array.length === 0)
82
+ return void 0;
83
+ for (let i = 0; i < array.length; i += 1) {
84
+ if (array[i].value === (current == null ? void 0 : current.value))
85
+ return array[i].value;
86
+ }
87
+ return array[0].value;
88
+ }
89
+ function findNextSlice(params) {
90
+ var _a;
91
+ const { timeSlices, index = 0, date = "" } = params;
92
+ const currentTimeValue = date || (0, import_dayjs.default)().format("HH:mm");
93
+ for (let i = 0; i < timeSlices.length; i += 1) {
94
+ if (timeSlices[i].value !== "now" && timeSlices[i].value >= currentTimeValue) {
95
+ return timeSlices[i].value;
96
+ }
97
+ }
98
+ return (_a = timeSlices[index]) == null ? void 0 : _a.value;
99
+ }
100
+ function getEndDate(startDate, duration, endDate, shopOpeningHours) {
101
+ if (duration === "flexible") {
102
+ let openingDate = (0, import_dayjs.default)(
103
+ `${startDate.format("YYYY-MM-DD")} ${shopOpeningHours || "23:59"}`
104
+ );
105
+ if ((0, import_dayjs.default)(startDate).isAfter(openingDate)) {
106
+ openingDate = openingDate.add(1, "day");
107
+ }
108
+ if (!endDate)
109
+ return openingDate;
110
+ const endDateObj = (0, import_dayjs.default)(endDate);
111
+ if (endDateObj.isAfter(openingDate))
112
+ return openingDate;
113
+ return endDateObj;
114
+ }
115
+ return startDate.add(Number(duration), "minute");
116
+ }
117
+ // Annotate the CommonJS export names for ESM import in node:
118
+ 0 && (module.exports = {
119
+ findNextDuration,
120
+ findNextSlice,
121
+ getDurationValue,
122
+ getEndDate,
123
+ sliceDayIntoFiveMinutes
124
+ });
@@ -46,6 +46,7 @@ var import_decimal = __toESM(require("decimal.js"));
46
46
  var import_utils = require("../../Product/utils");
47
47
  var import_utils2 = require("../../../solution/ShopDiscount/utils");
48
48
  var import_utils3 = require("../../Summary/utils");
49
+ var import_utils4 = require("../../Order/utils");
49
50
  var toDiscountPayload = (discountItem) => {
50
51
  var _a, _b;
51
52
  return {
@@ -185,7 +186,7 @@ var formatProductToCartItemOrigin = (params) => {
185
186
  product_id: product.id,
186
187
  product_variant_id: product_variant_id || 0,
187
188
  product_bundle: ((_b = origin.product) == null ? void 0 : _b.product_bundle) || [],
188
- product_option_item: ((_c = origin.product) == null ? void 0 : _c.product_option_item) || [],
189
+ product_sku: ((_c = origin.product) == null ? void 0 : _c.product_sku) || { option: [] },
189
190
  metadata: {
190
191
  product_discount_difference
191
192
  }
@@ -196,7 +197,14 @@ var formatProductToCartItemOrigin = (params) => {
196
197
  origin.product.product_bundle = formatBundleToOrigin(bundle);
197
198
  }
198
199
  if (options == null ? void 0 : options.length) {
199
- origin.product.product_option_item = formatOptionsToOrigin(options);
200
+ origin.product.product_sku = {
201
+ ...origin.product.product_sku || {},
202
+ option: formatOptionsToOrigin(options).map((option) => {
203
+ const next = { ...option, add_price: option.add_price ?? option.price };
204
+ delete next.price;
205
+ return next;
206
+ })
207
+ };
200
208
  }
201
209
  }
202
210
  return origin;
@@ -330,6 +338,15 @@ var formatBundleToOrigin = (bundle) => {
330
338
  var _a;
331
339
  return pre + (((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0);
332
340
  }, 0);
341
+ const normalizedBundle = {
342
+ ...d,
343
+ // 计算 markdown 净额时只传真实毛价;若仅有 bundle_selling_price,则由 helper 当历史净额兜底。
344
+ price: (d == null ? void 0 : d.price) ?? (d == null ? void 0 : d.custom_price),
345
+ bundle_selling_price: d == null ? void 0 : d.bundle_selling_price,
346
+ price_type: (d == null ? void 0 : d.price_type) ?? (d == null ? void 0 : d.custom_price_type),
347
+ price_type_ext: (d == null ? void 0 : d.price_type_ext) ?? (d == null ? void 0 : d.custom_price_type_ext),
348
+ option: getBundleValueByKey("option")
349
+ };
333
350
  return {
334
351
  bundle_group_id: getBundleValueByKey("group_id"),
335
352
  bundle_id: d.id,
@@ -340,7 +357,7 @@ var formatBundleToOrigin = (bundle) => {
340
357
  extension_type: getBundleValueByKey("extension_type"),
341
358
  option: formatOptionsToOrigin(getBundleValueByKey("option")),
342
359
  discount_list: d.discount_list,
343
- "bundle_selling_price": d == null ? void 0 : d.price,
360
+ "bundle_selling_price": (0, import_utils4.getBundleSellingMagnitude)(normalizedBundle).toFixed(2),
344
361
  "custom_price": d == null ? void 0 : d.price,
345
362
  metadata: {
346
363
  custom_product_bundle_map_id: d._id,
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/modules/Cart/utils/changePrice.ts
@@ -32,7 +22,7 @@ __export(changePrice_exports, {
32
22
  updateAllCartItemPrice: () => updateAllCartItemPrice
33
23
  });
34
24
  module.exports = __toCommonJS(changePrice_exports);
35
- var import_decimal = __toESM(require("decimal.js"));
25
+ var import_utils = require("../../Order/utils");
36
26
  async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCart, updateItemInitInfo) {
37
27
  var _a, _b;
38
28
  for (const item of cartItems) {
@@ -57,18 +47,20 @@ async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCa
57
47
  const targetBundleItem = targetBundle.bundle_item.find(
58
48
  (m) => m.id === n.id
59
49
  );
60
- if (targetBundleItem.price_type === "markdown") {
61
- targetBundleItem.price = new import_decimal.default(targetBundleItem.price || 0).mul(-1).toNumber();
62
- }
63
- if (n.option) {
64
- targetBundleItem.price = new import_decimal.default(targetBundleItem.price || 0).add(n.option.reduce((pre, cur) => {
65
- return pre + new import_decimal.default(cur.price || 0).mul(cur.num || 1).toNumber();
66
- }, 0)).toNumber();
67
- }
68
50
  if (targetBundleItem) {
69
- return {
51
+ const normalizedBundle = {
70
52
  ...n,
71
53
  price: targetBundleItem.price,
54
+ custom_price: targetBundleItem.price,
55
+ price_type: targetBundleItem.price_type,
56
+ price_type_ext: targetBundleItem.price_type_ext
57
+ };
58
+ const bundleSellingPrice = (0, import_utils.getBundleSellingMagnitude)(normalizedBundle).toFixed(2);
59
+ return {
60
+ ...n,
61
+ custom_price: targetBundleItem.price,
62
+ price: targetBundleItem.price_type === "markdown" ? bundleSellingPrice : targetBundleItem.price,
63
+ bundle_selling_price: bundleSellingPrice,
72
64
  base_price: targetBundleItem.base_price
73
65
  };
74
66
  }
@@ -7,11 +7,25 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
7
7
  private store;
8
8
  private request;
9
9
  private cacheId;
10
+ /**
11
+ * 判断两份选中客户的核心展示字段是否一致,用于避免重复 clone / emit。
12
+ *
13
+ * @example
14
+ * this.isSameSelectedCustomer(currentCustomer, nextCustomer);
15
+ */
16
+ private isSameSelectedCustomer;
10
17
  private openCache;
11
18
  private fatherModule;
12
19
  private otherParams;
13
20
  constructor(name?: string, version?: string);
14
21
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
22
+ /**
23
+ * 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
24
+ *
25
+ * @example
26
+ * customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
27
+ */
28
+ updateOtherParams(params: Record<string, any>): void;
15
29
  /**
16
30
  * 获取客户列表数据(内部方法)
17
31
  * @param params 查询参数
@@ -24,6 +38,12 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
24
38
  * @param operation 操作名称
25
39
  */
26
40
  private handleCustomerListError;
41
+ /**
42
+ * 查询客户列表但不写入 customerList / pagination 状态。
43
+ *
44
+ * 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
45
+ */
46
+ queryCustomerList(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
27
47
  /**
28
48
  * 获取客户列表
29
49
  * @param params 查询参数
@@ -48,6 +48,29 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
48
48
  this.openCache = false;
49
49
  this.otherParams = {};
50
50
  }
51
+ /**
52
+ * 判断两份选中客户的核心展示字段是否一致,用于避免重复 clone / emit。
53
+ *
54
+ * @example
55
+ * this.isSameSelectedCustomer(currentCustomer, nextCustomer);
56
+ */
57
+ isSameSelectedCustomer(current, next) {
58
+ const normalizedNext = !next ? import_constants.DEFAULT_CUSTOMER : next;
59
+ const normalizedCurrent = current || null;
60
+ if (!normalizedCurrent)
61
+ return false;
62
+ if (String((normalizedCurrent == null ? void 0 : normalizedCurrent.id) ?? "") === "1" && String((normalizedNext == null ? void 0 : normalizedNext.id) ?? "") === "1") {
63
+ return true;
64
+ }
65
+ const keys = [
66
+ "id",
67
+ "name",
68
+ "phone",
69
+ "email",
70
+ "country_calling_code"
71
+ ];
72
+ return keys.every((key) => String((normalizedCurrent == null ? void 0 : normalizedCurrent[key]) ?? "") === String((normalizedNext == null ? void 0 : normalizedNext[key]) ?? ""));
73
+ }
51
74
  async initialize(core, options) {
52
75
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
53
76
  this.core = core;
@@ -75,7 +98,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
75
98
  } else {
76
99
  this.store.currentPage = 1;
77
100
  }
78
- if (typeof ((_e = options == null ? void 0 : options.initialState) == null ? void 0 : _e.pageSize) === "number") {
101
+ if (typeof ((_e = options == null ? void 0 : options.initialState) == null ? void 0 : _e.pageSize) === "number" && options.initialState.pageSize > 1) {
79
102
  this.store.pageSize = options.initialState.pageSize;
80
103
  } else {
81
104
  this.store.pageSize = import_constants.DEFAULT_PAGE_SIZE;
@@ -91,6 +114,18 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
91
114
  this.fatherModule = options.otherParams.fatherModule;
92
115
  }
93
116
  }
117
+ /**
118
+ * 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
119
+ *
120
+ * @example
121
+ * customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
122
+ */
123
+ updateOtherParams(params) {
124
+ this.otherParams = params || {};
125
+ this.openCache = this.otherParams.openCache ?? false;
126
+ this.cacheId = this.otherParams.cacheId;
127
+ this.fatherModule = this.otherParams.fatherModule;
128
+ }
94
129
  /**
95
130
  * 获取客户列表数据(内部方法)
96
131
  * @param params 查询参数
@@ -152,6 +187,20 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
152
187
  this.store.error
153
188
  );
154
189
  }
190
+ /**
191
+ * 查询客户列表但不写入 customerList / pagination 状态。
192
+ *
193
+ * 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
194
+ */
195
+ async queryCustomerList(params = {}) {
196
+ const { customerList, total, page, pageSize } = await this.fetchCustomerListData(params);
197
+ return {
198
+ list: customerList,
199
+ total,
200
+ page,
201
+ pageSize
202
+ };
203
+ }
155
204
  /**
156
205
  * 获取客户列表
157
206
  * @param params 查询参数
@@ -169,10 +218,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
169
218
  this.store.total = total;
170
219
  this.store.hasMore = page * pageSize < total;
171
220
  this.store.customerList = (0, import_lodash_es.cloneDeep)(customerList);
172
- await this.core.effects.emit(
173
- `${this.name}:onCustomerListUpdate`,
174
- this.store
175
- );
176
221
  this.triggerPaginationChange({
177
222
  page,
178
223
  pageSize,
@@ -192,6 +237,10 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
192
237
  } finally {
193
238
  this.store.loading = false;
194
239
  this.storeChange();
240
+ await this.core.effects.emit(
241
+ `${this.name}:onCustomerListUpdate`,
242
+ this.store
243
+ );
195
244
  }
196
245
  }
197
246
  /**
@@ -211,6 +260,9 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
211
260
  * @param customer 选择的客户
212
261
  */
213
262
  setSelectedCustomer(customer) {
263
+ if (this.isSameSelectedCustomer(this.store.selectedCustomer, customer)) {
264
+ return;
265
+ }
214
266
  this.store.selectedCustomer = !customer ? import_constants.DEFAULT_CUSTOMER : (0, import_lodash_es.cloneDeep)(customer);
215
267
  this.core.effects.emit(
216
268
  `${this.name}:onCustomerSelected`,
@@ -352,12 +404,13 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
352
404
  try {
353
405
  this.store.loadingMore = true;
354
406
  this.store.error = null;
355
- const { customerList: newCustomers, total, page, pageSize } = await this.fetchCustomerListData({
407
+ const loadMoreParams = {
356
408
  skip: nextPage,
357
409
  num: this.store.pageSize,
358
410
  ...this.store.searchParams
359
411
  // 使用存储的搜索条件
360
- });
412
+ };
413
+ const { customerList: newCustomers, total, page, pageSize } = await this.fetchCustomerListData(loadMoreParams);
361
414
  const updatedCustomerList = [...this.store.customerList, ...(0, import_lodash_es.cloneDeep)(newCustomers)];
362
415
  this.store.customerList = updatedCustomerList;
363
416
  this.store.currentPage = page;
@@ -372,10 +425,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
372
425
  hasMore: this.store.hasMore
373
426
  }
374
427
  );
375
- await this.core.effects.emit(
376
- `${this.name}:onCustomerListUpdate`,
377
- this.store
378
- );
379
428
  this.triggerPaginationChange({
380
429
  page,
381
430
  pageSize,
@@ -396,6 +445,10 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
396
445
  } finally {
397
446
  this.store.loadingMore = false;
398
447
  this.storeChange();
448
+ await this.core.effects.emit(
449
+ `${this.name}:onCustomerListUpdate`,
450
+ this.store
451
+ );
399
452
  }
400
453
  }
401
454
  /**
@@ -110,6 +110,8 @@ export interface CustomerState {
110
110
  export interface CustomerModuleAPI {
111
111
  /** 获取客户列表 */
112
112
  getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
113
+ /** 查询客户列表但不更新列表分页状态 */
114
+ queryCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
113
115
  /** 设置客户列表 */
114
116
  setCustomerList: (customers: ShopCustomer[], total?: number) => void;
115
117
  /** 设置当前选择的客户 */
@@ -23,7 +23,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
23
23
  customer_id: number;
24
24
  with_wallet_pass_holder: 0 | 1;
25
25
  request_timezone: string;
26
- order_id?: number;
26
+ order_id?: number | string;
27
27
  }): Promise<Discount[]>;
28
28
  batchSearch(code: string, options?: {
29
29
  customerId?: number;
@@ -93,12 +93,19 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
93
93
  }
94
94
  async loadPrepareConfig(params) {
95
95
  var _a, _b;
96
+ if (typeof params.order_id === "string" && params.order_id.startsWith("LOCAL_")) {
97
+ params.order_id = void 0;
98
+ }
96
99
  const prepareConfig = await this.request.post(
97
100
  `/order/prepare/config`,
98
101
  params
99
102
  );
103
+ const rawDiscountList = [
104
+ ...((_a = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _a.good_pass_list) || [],
105
+ ...((_b = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _b.discount_card_list) || []
106
+ ];
100
107
  const goodPassList = this.filterEnabledDiscountList(
101
- [...((_a = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _a.good_pass_list) || [], ...((_b = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _b.discount_card_list) || []]
108
+ rawDiscountList
102
109
  ) || [];
103
110
  return goodPassList;
104
111
  }
@@ -249,6 +256,7 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
249
256
  this.core.effects.offByModuleDestroy(this.name);
250
257
  await this.core.effects.emit(`${this.name}:onDestroy`, {});
251
258
  console.log("[Discount] 已销毁");
259
+ super.destroy();
252
260
  }
253
261
  async clear() {
254
262
  this.store.discountList = [];
@@ -140,6 +140,7 @@ export interface Discount {
140
140
  appliedProductDetails: ApplicableProductDetails[];
141
141
  isDisabledForProductUsed?: boolean;
142
142
  amount?: number;
143
+ customer_id?: number | string | null;
143
144
  extension_data?: ExtensionData[];
144
145
  total_order_behavior_count?: number;
145
146
  today_order_behavior_count?: number;
@@ -9,6 +9,7 @@ export declare class OpenDataModule extends BaseModule implements Module {
9
9
  protected defaultVersion: string;
10
10
  private request;
11
11
  private window;
12
+ private appPlugin;
12
13
  private store;
13
14
  private cacheId;
14
15
  private openCache;
@@ -16,6 +17,13 @@ export declare class OpenDataModule extends BaseModule implements Module {
16
17
  private otherParams;
17
18
  constructor(name?: string, version?: string);
18
19
  initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
20
+ /**
21
+ * 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
22
+ *
23
+ * @example
24
+ * openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
25
+ */
26
+ updateOtherParams(params: Record<string, any>): void;
19
27
  fetchOpenData(params: OpenDataFetchParams): Promise<OpenDataConfig>;
20
28
  getOpenData(): OpenDataConfig | null;
21
29
  getLastFetchedAt(): number | null;
@@ -52,18 +52,32 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
52
52
  }
53
53
  this.request = core.getPlugin("request");
54
54
  this.window = core.getPlugin("window");
55
+ this.appPlugin = core.getPlugin("app");
55
56
  if (!this.request)
56
57
  throw new Error("OpenDataModule 需要 request 插件支持");
57
58
  if (!this.window)
58
59
  throw new Error("OpenDataModule 需要 window 插件支持");
59
60
  console.log("[OpenDataModule] 初始化完成");
60
61
  }
62
+ /**
63
+ * 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
64
+ *
65
+ * @example
66
+ * openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
67
+ */
68
+ updateOtherParams(params) {
69
+ this.otherParams = params || {};
70
+ this.openCache = this.otherParams.openCache ?? false;
71
+ this.cacheId = this.otherParams.cacheId;
72
+ this.fatherModule = this.otherParams.fatherModule;
73
+ }
61
74
  async fetchOpenData(params) {
62
- var _a, _b, _c, _d;
63
- const shopId = (_b = (_a = this.otherParams) == null ? void 0 : _a.getStateData) == null ? void 0 : _b.call(_a, "shop_id");
75
+ var _a, _b;
76
+ const getData = (_b = (_a = this.appPlugin).getData) == null ? void 0 : _b.call(_a);
77
+ const shopId = getData == null ? void 0 : getData("shop_id");
64
78
  if (!shopId)
65
79
  throw new Error("[OpenDataModule] 无法获取 shop_id");
66
- const tenantId = (_d = (_c = this.otherParams) == null ? void 0 : _c.getStateData) == null ? void 0 : _d.call(_c, "tenant_id");
80
+ const tenantId = getData == null ? void 0 : getData("tenant_id");
67
81
  const headers = {};
68
82
  if (tenantId)
69
83
  headers["Tenant-Id"] = String(tenantId);
@@ -74,7 +88,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
74
88
  target: params.target,
75
89
  section_code: params.section_code
76
90
  },
77
- { pisell2: true, headers }
91
+ { pisell2: true, isPisell2: true, prefix: false, headers }
78
92
  );
79
93
  if ((response == null ? void 0 : response.status) === false) {
80
94
  throw new Error((response == null ? void 0 : response.message) || "获取 OpenData 配置失败");
@@ -92,7 +106,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
92
106
  }
93
107
  checkAvailability(scheduleModule) {
94
108
  var _a;
95
- const scheduleList = scheduleModule ? scheduleModule.getScheduleListByIds(
109
+ const scheduleList = scheduleModule ? scheduleModule == null ? void 0 : scheduleModule.getScheduleListByIds(
96
110
  ((_a = this.store.data) == null ? void 0 : _a["availability.operating_hours"]) || []
97
111
  ) : void 0;
98
112
  return (0, import_utils.computeAvailability)({