@pisell/pisellos 2.2.243 → 2.2.244

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 (315) hide show
  1. package/dist/model/strategy/adapter/promotion/evaluator.js +2 -3
  2. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  3. package/dist/model/strategy/adapter/walletPass/utils.js +4 -7
  4. package/dist/modules/Cart/utils/cartProduct.js +3 -24
  5. package/dist/modules/Cart/utils/changePrice.js +11 -11
  6. package/dist/modules/Customer/index.d.ts +0 -20
  7. package/dist/modules/Customer/index.js +83 -172
  8. package/dist/modules/Customer/types.d.ts +0 -2
  9. package/dist/modules/Discount/index.js +3 -4
  10. package/dist/modules/Discount/types.d.ts +0 -1
  11. package/dist/modules/OpenData/index.d.ts +0 -8
  12. package/dist/modules/OpenData/index.js +17 -37
  13. package/dist/modules/Order/index.d.ts +18 -268
  14. package/dist/modules/Order/index.js +757 -3306
  15. package/dist/modules/Order/types.d.ts +31 -279
  16. package/dist/modules/Order/types.js +0 -38
  17. package/dist/modules/Order/utils.d.ts +5 -147
  18. package/dist/modules/Order/utils.js +103 -746
  19. package/dist/modules/Payment/index.d.ts +13 -10
  20. package/dist/modules/Payment/index.js +837 -467
  21. package/dist/modules/Payment/types.d.ts +0 -2
  22. package/dist/modules/Payment/utils.js +1 -2
  23. package/dist/modules/Payment/walletpass.js +7 -14
  24. package/dist/modules/ProductList/index.d.ts +12 -16
  25. package/dist/modules/ProductList/index.js +59 -133
  26. package/dist/modules/ProductList/types.d.ts +0 -14
  27. package/dist/modules/Quotation/index.d.ts +1 -0
  28. package/dist/modules/Quotation/index.js +22 -25
  29. package/dist/modules/Rules/index.d.ts +0 -4
  30. package/dist/modules/Rules/index.js +69 -93
  31. package/dist/modules/Rules/types.d.ts +0 -1
  32. package/dist/modules/SalesSummary/index.d.ts +25 -8
  33. package/dist/modules/SalesSummary/index.js +35 -86
  34. package/dist/modules/SalesSummary/types.d.ts +1 -4
  35. package/dist/modules/SalesSummary/utils.d.ts +25 -2
  36. package/dist/modules/SalesSummary/utils.js +162 -794
  37. package/dist/modules/Schedule/index.d.ts +0 -7
  38. package/dist/modules/Schedule/index.js +2 -24
  39. package/dist/modules/Summary/index.js +3 -4
  40. package/dist/modules/index.d.ts +0 -2
  41. package/dist/modules/index.js +1 -3
  42. package/dist/plugins/request.d.ts +0 -1
  43. package/dist/server/index.d.ts +1 -204
  44. package/dist/server/index.js +928 -3658
  45. package/dist/server/modules/index.d.ts +0 -2
  46. package/dist/server/modules/index.js +0 -2
  47. package/dist/server/modules/order/index.d.ts +4 -120
  48. package/dist/server/modules/order/index.js +483 -1779
  49. package/dist/server/modules/order/types.d.ts +3 -32
  50. package/dist/server/modules/order/types.js +0 -8
  51. package/dist/server/modules/order/utils/filterBookings.js +3 -26
  52. package/dist/server/modules/order/utils/filterOrders.js +8 -23
  53. package/dist/server/modules/products/index.d.ts +7 -34
  54. package/dist/server/modules/products/index.js +317 -631
  55. package/dist/server/modules/resource/index.d.ts +0 -2
  56. package/dist/server/modules/resource/index.js +3 -29
  57. package/dist/server/modules/schedule/index.d.ts +4 -4
  58. package/dist/server/modules/schedule/index.js +88 -111
  59. package/dist/solution/BaseSales/index.d.ts +9 -131
  60. package/dist/solution/BaseSales/index.js +447 -1944
  61. package/dist/solution/BaseSales/types.d.ts +6 -76
  62. package/dist/solution/BaseSales/types.js +4 -5
  63. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
  64. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -105
  65. package/dist/solution/BaseSales/utils.d.ts +1 -1
  66. package/dist/solution/BaseSales/utils.js +21 -62
  67. package/dist/solution/BookingByStep/index.d.ts +1 -1
  68. package/dist/solution/BookingTicket/index.d.ts +10 -270
  69. package/dist/solution/BookingTicket/index.js +237 -1772
  70. package/dist/solution/BookingTicket/types.d.ts +1 -118
  71. package/dist/solution/BookingTicket/types.js +2 -41
  72. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
  73. package/dist/solution/BookingTicket/utils/bookingStatus.js +0 -70
  74. package/dist/solution/BookingTicket/utils/cartView.d.ts +1 -9
  75. package/dist/solution/BookingTicket/utils/cartView.js +7 -94
  76. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -5
  77. package/dist/solution/BookingTicket/utils/scan/index.js +8 -20
  78. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  79. package/dist/solution/Checkout/index.d.ts +0 -1
  80. package/dist/solution/Checkout/index.js +9 -10
  81. package/dist/solution/RegisterAndLogin/config.js +10 -2
  82. package/dist/solution/ScanOrder/index.d.ts +3 -9
  83. package/dist/solution/ScanOrder/index.js +134 -241
  84. package/dist/solution/ScanOrder/types.d.ts +5 -9
  85. package/dist/solution/ScanOrder/types.js +3 -2
  86. package/dist/solution/ScanOrder/utils.d.ts +1 -1
  87. package/dist/solution/ScanOrder/utils.js +22 -84
  88. package/dist/solution/VenueBooking/index.d.ts +2 -5
  89. package/dist/solution/VenueBooking/index.js +59 -110
  90. package/dist/solution/VenueBooking/sales-section-4-annotated.json +2 -0
  91. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  92. package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
  93. package/dist/types/index.d.ts +0 -10
  94. package/lib/model/strategy/adapter/promotion/evaluator.js +1 -2
  95. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  96. package/lib/model/strategy/adapter/walletPass/utils.js +2 -3
  97. package/lib/modules/Cart/utils/cartProduct.js +3 -20
  98. package/lib/modules/Cart/utils/changePrice.js +20 -12
  99. package/lib/modules/Customer/index.d.ts +0 -20
  100. package/lib/modules/Customer/index.js +11 -64
  101. package/lib/modules/Customer/types.d.ts +0 -2
  102. package/lib/modules/Discount/index.js +1 -5
  103. package/lib/modules/Discount/types.d.ts +0 -1
  104. package/lib/modules/OpenData/index.d.ts +0 -8
  105. package/lib/modules/OpenData/index.js +5 -19
  106. package/lib/modules/Order/index.d.ts +18 -268
  107. package/lib/modules/Order/index.js +344 -2149
  108. package/lib/modules/Order/types.d.ts +31 -279
  109. package/lib/modules/Order/types.js +0 -1
  110. package/lib/modules/Order/utils.d.ts +5 -147
  111. package/lib/modules/Order/utils.js +46 -614
  112. package/lib/modules/Payment/index.d.ts +13 -10
  113. package/lib/modules/Payment/index.js +150 -18
  114. package/lib/modules/Payment/types.d.ts +0 -2
  115. package/lib/modules/Payment/utils.js +1 -2
  116. package/lib/modules/Payment/walletpass.js +3 -7
  117. package/lib/modules/ProductList/index.d.ts +12 -16
  118. package/lib/modules/ProductList/index.js +4 -41
  119. package/lib/modules/ProductList/types.d.ts +0 -14
  120. package/lib/modules/Quotation/index.d.ts +1 -0
  121. package/lib/modules/Quotation/index.js +16 -19
  122. package/lib/modules/Rules/index.d.ts +0 -4
  123. package/lib/modules/Rules/index.js +120 -136
  124. package/lib/modules/Rules/types.d.ts +0 -1
  125. package/lib/modules/SalesSummary/index.d.ts +25 -8
  126. package/lib/modules/SalesSummary/index.js +4 -30
  127. package/lib/modules/SalesSummary/types.d.ts +1 -4
  128. package/lib/modules/SalesSummary/utils.d.ts +25 -2
  129. package/lib/modules/SalesSummary/utils.js +91 -645
  130. package/lib/modules/Schedule/index.d.ts +0 -7
  131. package/lib/modules/Schedule/index.js +1 -17
  132. package/lib/modules/Summary/index.js +4 -5
  133. package/lib/modules/index.d.ts +0 -2
  134. package/lib/modules/index.js +1 -5
  135. package/lib/plugins/request.d.ts +0 -1
  136. package/lib/server/index.d.ts +1 -204
  137. package/lib/server/index.js +57 -1888
  138. package/lib/server/modules/index.d.ts +0 -2
  139. package/lib/server/modules/index.js +0 -3
  140. package/lib/server/modules/order/index.d.ts +4 -120
  141. package/lib/server/modules/order/index.js +142 -919
  142. package/lib/server/modules/order/types.d.ts +3 -32
  143. package/lib/server/modules/order/utils/filterBookings.js +5 -24
  144. package/lib/server/modules/order/utils/filterOrders.js +6 -15
  145. package/lib/server/modules/products/index.d.ts +7 -34
  146. package/lib/server/modules/products/index.js +54 -189
  147. package/lib/server/modules/resource/index.d.ts +0 -2
  148. package/lib/server/modules/resource/index.js +3 -27
  149. package/lib/server/modules/schedule/index.d.ts +4 -4
  150. package/lib/server/modules/schedule/index.js +40 -47
  151. package/lib/solution/BaseSales/index.d.ts +9 -131
  152. package/lib/solution/BaseSales/index.js +63 -1106
  153. package/lib/solution/BaseSales/types.d.ts +6 -76
  154. package/lib/solution/BaseSales/types.js +1 -3
  155. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
  156. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +18 -106
  157. package/lib/solution/BaseSales/utils.d.ts +1 -1
  158. package/lib/solution/BaseSales/utils.js +10 -54
  159. package/lib/solution/BookingByStep/index.d.ts +1 -1
  160. package/lib/solution/BookingTicket/index.d.ts +10 -270
  161. package/lib/solution/BookingTicket/index.js +29 -922
  162. package/lib/solution/BookingTicket/types.d.ts +1 -118
  163. package/lib/solution/BookingTicket/types.js +0 -11
  164. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
  165. package/lib/solution/BookingTicket/utils/bookingStatus.js +2 -44
  166. package/lib/solution/BookingTicket/utils/cartView.d.ts +1 -9
  167. package/lib/solution/BookingTicket/utils/cartView.js +6 -61
  168. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -5
  169. package/lib/solution/BookingTicket/utils/scan/index.js +3 -17
  170. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  171. package/lib/solution/Checkout/index.d.ts +0 -1
  172. package/lib/solution/Checkout/index.js +2 -1
  173. package/lib/solution/RegisterAndLogin/config.js +10 -2
  174. package/lib/solution/ScanOrder/index.d.ts +3 -9
  175. package/lib/solution/ScanOrder/index.js +70 -153
  176. package/lib/solution/ScanOrder/types.d.ts +5 -9
  177. package/lib/solution/ScanOrder/utils.d.ts +1 -1
  178. package/lib/solution/ScanOrder/utils.js +17 -83
  179. package/lib/solution/VenueBooking/index.d.ts +2 -5
  180. package/lib/solution/VenueBooking/index.js +17 -54
  181. package/lib/solution/VenueBooking/sales-section-4-annotated.json +2 -0
  182. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  183. package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
  184. package/lib/types/index.d.ts +0 -10
  185. package/package.json +1 -1
  186. package/dist/modules/BookingContext/index.d.ts +0 -48
  187. package/dist/modules/BookingContext/index.js +0 -566
  188. package/dist/modules/BookingContext/types.d.ts +0 -102
  189. package/dist/modules/BookingContext/types.js +0 -51
  190. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  191. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -284
  192. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  193. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -145
  194. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  195. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -218
  196. package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
  197. package/dist/modules/BookingContext/utils/flexible.js +0 -56
  198. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  199. package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
  200. package/dist/modules/BookingContext/utils/index.d.ts +0 -11
  201. package/dist/modules/BookingContext/utils/index.js +0 -11
  202. package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
  203. package/dist/modules/BookingContext/utils/noResource.js +0 -77
  204. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  205. package/dist/modules/BookingContext/utils/orderLineDisplay.js +0 -36
  206. package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
  207. package/dist/modules/BookingContext/utils/productExtend.js +0 -339
  208. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  209. package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
  210. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  211. package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
  212. package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
  213. package/dist/modules/BookingContext/utils/resources.js +0 -486
  214. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  215. package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
  216. package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  217. package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
  218. package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  219. package/dist/modules/Order/utils/manualProductDiscount.js +0 -210
  220. package/dist/modules/SurchargeList/index.d.ts +0 -16
  221. package/dist/modules/SurchargeList/index.js +0 -162
  222. package/dist/modules/SurchargeList/types.d.ts +0 -11
  223. package/dist/modules/SurchargeList/types.js +0 -1
  224. package/dist/server/modules/payment/index.d.ts +0 -28
  225. package/dist/server/modules/payment/index.js +0 -305
  226. package/dist/server/modules/payment/types.d.ts +0 -9
  227. package/dist/server/modules/payment/types.js +0 -1
  228. package/dist/server/test.json +0 -713
  229. package/dist/server/utils/small-ticket.d.ts +0 -71
  230. package/dist/server/utils/small-ticket.js +0 -830
  231. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
  232. package/dist/solution/BaseSales/utils/cartPromotion.js +0 -1438
  233. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  234. package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
  235. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
  236. package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
  237. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
  238. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +0 -95
  239. package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  240. package/dist/solution/BookingTicket/utils/exampleData.js +0 -183
  241. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  242. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -438
  243. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
  244. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -399
  245. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
  246. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -56
  247. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  248. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +0 -150
  249. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
  250. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +0 -78
  251. package/lib/modules/BookingContext/index.d.ts +0 -48
  252. package/lib/modules/BookingContext/index.js +0 -368
  253. package/lib/modules/BookingContext/types.d.ts +0 -102
  254. package/lib/modules/BookingContext/types.js +0 -34
  255. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  256. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -276
  257. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  258. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -151
  259. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  260. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -201
  261. package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
  262. package/lib/modules/BookingContext/utils/flexible.js +0 -80
  263. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  264. package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
  265. package/lib/modules/BookingContext/utils/index.d.ts +0 -11
  266. package/lib/modules/BookingContext/utils/index.js +0 -43
  267. package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
  268. package/lib/modules/BookingContext/utils/noResource.js +0 -90
  269. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  270. package/lib/modules/BookingContext/utils/orderLineDisplay.js +0 -56
  271. package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
  272. package/lib/modules/BookingContext/utils/productExtend.js +0 -283
  273. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  274. package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
  275. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  276. package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
  277. package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
  278. package/lib/modules/BookingContext/utils/resources.js +0 -377
  279. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  280. package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
  281. package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  282. package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
  283. package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  284. package/lib/modules/Order/utils/manualProductDiscount.js +0 -206
  285. package/lib/modules/SurchargeList/index.d.ts +0 -16
  286. package/lib/modules/SurchargeList/index.js +0 -89
  287. package/lib/modules/SurchargeList/types.d.ts +0 -11
  288. package/lib/modules/SurchargeList/types.js +0 -17
  289. package/lib/server/modules/payment/index.d.ts +0 -28
  290. package/lib/server/modules/payment/index.js +0 -192
  291. package/lib/server/modules/payment/types.d.ts +0 -9
  292. package/lib/server/modules/payment/types.js +0 -17
  293. package/lib/server/test.json +0 -713
  294. package/lib/server/utils/small-ticket.d.ts +0 -71
  295. package/lib/server/utils/small-ticket.js +0 -781
  296. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
  297. package/lib/solution/BaseSales/utils/cartPromotion.js +0 -992
  298. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  299. package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
  300. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
  301. package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
  302. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
  303. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +0 -125
  304. package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  305. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  306. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  307. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -254
  308. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
  309. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -168
  310. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
  311. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -51
  312. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  313. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +0 -127
  314. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
  315. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +0 -85
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
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
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/modules/Cart/utils/changePrice.ts
@@ -22,7 +32,7 @@ __export(changePrice_exports, {
22
32
  updateAllCartItemPrice: () => updateAllCartItemPrice
23
33
  });
24
34
  module.exports = __toCommonJS(changePrice_exports);
25
- var import_utils = require("../../Order/utils");
35
+ var import_decimal = __toESM(require("decimal.js"));
26
36
  async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCart, updateItemInitInfo) {
27
37
  var _a, _b;
28
38
  for (const item of cartItems) {
@@ -47,20 +57,18 @@ async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCa
47
57
  const targetBundleItem = targetBundle.bundle_item.find(
48
58
  (m) => m.id === n.id
49
59
  );
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
+ }
50
68
  if (targetBundleItem) {
51
- const normalizedBundle = {
52
- ...n,
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
69
  return {
60
70
  ...n,
61
- custom_price: targetBundleItem.price,
62
- price: targetBundleItem.price_type === "markdown" ? bundleSellingPrice : targetBundleItem.price,
63
- bundle_selling_price: bundleSellingPrice,
71
+ price: targetBundleItem.price,
64
72
  base_price: targetBundleItem.base_price
65
73
  };
66
74
  }
@@ -7,25 +7,11 @@ 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;
17
10
  private openCache;
18
11
  private fatherModule;
19
12
  private otherParams;
20
13
  constructor(name?: string, version?: string);
21
14
  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;
29
15
  /**
30
16
  * 获取客户列表数据(内部方法)
31
17
  * @param params 查询参数
@@ -38,12 +24,6 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
38
24
  * @param operation 操作名称
39
25
  */
40
26
  private handleCustomerListError;
41
- /**
42
- * 查询客户列表但不写入 customerList / pagination 状态。
43
- *
44
- * 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
45
- */
46
- queryCustomerList(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
47
27
  /**
48
28
  * 获取客户列表
49
29
  * @param params 查询参数
@@ -48,29 +48,6 @@ 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
- }
74
51
  async initialize(core, options) {
75
52
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
76
53
  this.core = core;
@@ -98,7 +75,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
98
75
  } else {
99
76
  this.store.currentPage = 1;
100
77
  }
101
- if (typeof ((_e = options == null ? void 0 : options.initialState) == null ? void 0 : _e.pageSize) === "number" && options.initialState.pageSize > 1) {
78
+ if (typeof ((_e = options == null ? void 0 : options.initialState) == null ? void 0 : _e.pageSize) === "number") {
102
79
  this.store.pageSize = options.initialState.pageSize;
103
80
  } else {
104
81
  this.store.pageSize = import_constants.DEFAULT_PAGE_SIZE;
@@ -114,18 +91,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
114
91
  this.fatherModule = options.otherParams.fatherModule;
115
92
  }
116
93
  }
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
- }
129
94
  /**
130
95
  * 获取客户列表数据(内部方法)
131
96
  * @param params 查询参数
@@ -187,20 +152,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
187
152
  this.store.error
188
153
  );
189
154
  }
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
- }
204
155
  /**
205
156
  * 获取客户列表
206
157
  * @param params 查询参数
@@ -218,6 +169,10 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
218
169
  this.store.total = total;
219
170
  this.store.hasMore = page * pageSize < total;
220
171
  this.store.customerList = (0, import_lodash_es.cloneDeep)(customerList);
172
+ await this.core.effects.emit(
173
+ `${this.name}:onCustomerListUpdate`,
174
+ this.store
175
+ );
221
176
  this.triggerPaginationChange({
222
177
  page,
223
178
  pageSize,
@@ -237,10 +192,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
237
192
  } finally {
238
193
  this.store.loading = false;
239
194
  this.storeChange();
240
- await this.core.effects.emit(
241
- `${this.name}:onCustomerListUpdate`,
242
- this.store
243
- );
244
195
  }
245
196
  }
246
197
  /**
@@ -260,9 +211,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
260
211
  * @param customer 选择的客户
261
212
  */
262
213
  setSelectedCustomer(customer) {
263
- if (this.isSameSelectedCustomer(this.store.selectedCustomer, customer)) {
264
- return;
265
- }
266
214
  this.store.selectedCustomer = !customer ? import_constants.DEFAULT_CUSTOMER : (0, import_lodash_es.cloneDeep)(customer);
267
215
  this.core.effects.emit(
268
216
  `${this.name}:onCustomerSelected`,
@@ -404,13 +352,12 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
404
352
  try {
405
353
  this.store.loadingMore = true;
406
354
  this.store.error = null;
407
- const loadMoreParams = {
355
+ const { customerList: newCustomers, total, page, pageSize } = await this.fetchCustomerListData({
408
356
  skip: nextPage,
409
357
  num: this.store.pageSize,
410
358
  ...this.store.searchParams
411
359
  // 使用存储的搜索条件
412
- };
413
- const { customerList: newCustomers, total, page, pageSize } = await this.fetchCustomerListData(loadMoreParams);
360
+ });
414
361
  const updatedCustomerList = [...this.store.customerList, ...(0, import_lodash_es.cloneDeep)(newCustomers)];
415
362
  this.store.customerList = updatedCustomerList;
416
363
  this.store.currentPage = page;
@@ -425,6 +372,10 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
425
372
  hasMore: this.store.hasMore
426
373
  }
427
374
  );
375
+ await this.core.effects.emit(
376
+ `${this.name}:onCustomerListUpdate`,
377
+ this.store
378
+ );
428
379
  this.triggerPaginationChange({
429
380
  page,
430
381
  pageSize,
@@ -445,10 +396,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
445
396
  } finally {
446
397
  this.store.loadingMore = false;
447
398
  this.storeChange();
448
- await this.core.effects.emit(
449
- `${this.name}:onCustomerListUpdate`,
450
- this.store
451
- );
452
399
  }
453
400
  }
454
401
  /**
@@ -110,8 +110,6 @@ export interface CustomerState {
110
110
  export interface CustomerModuleAPI {
111
111
  /** 获取客户列表 */
112
112
  getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
113
- /** 查询客户列表但不更新列表分页状态 */
114
- queryCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
115
113
  /** 设置客户列表 */
116
114
  setCustomerList: (customers: ShopCustomer[], total?: number) => void;
117
115
  /** 设置当前选择的客户 */
@@ -97,12 +97,8 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
97
97
  `/order/prepare/config`,
98
98
  params
99
99
  );
100
- const rawDiscountList = [
101
- ...((_a = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _a.good_pass_list) || [],
102
- ...((_b = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _b.discount_card_list) || []
103
- ];
104
100
  const goodPassList = this.filterEnabledDiscountList(
105
- rawDiscountList
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) || []]
106
102
  ) || [];
107
103
  return goodPassList;
108
104
  }
@@ -140,7 +140,6 @@ export interface Discount {
140
140
  appliedProductDetails: ApplicableProductDetails[];
141
141
  isDisabledForProductUsed?: boolean;
142
142
  amount?: number;
143
- customer_id?: number | string | null;
144
143
  extension_data?: ExtensionData[];
145
144
  total_order_behavior_count?: number;
146
145
  today_order_behavior_count?: number;
@@ -9,7 +9,6 @@ export declare class OpenDataModule extends BaseModule implements Module {
9
9
  protected defaultVersion: string;
10
10
  private request;
11
11
  private window;
12
- private appPlugin;
13
12
  private store;
14
13
  private cacheId;
15
14
  private openCache;
@@ -17,13 +16,6 @@ export declare class OpenDataModule extends BaseModule implements Module {
17
16
  private otherParams;
18
17
  constructor(name?: string, version?: string);
19
18
  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;
27
19
  fetchOpenData(params: OpenDataFetchParams): Promise<OpenDataConfig>;
28
20
  getOpenData(): OpenDataConfig | null;
29
21
  getLastFetchedAt(): number | null;
@@ -52,32 +52,18 @@ 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");
56
55
  if (!this.request)
57
56
  throw new Error("OpenDataModule 需要 request 插件支持");
58
57
  if (!this.window)
59
58
  throw new Error("OpenDataModule 需要 window 插件支持");
60
59
  console.log("[OpenDataModule] 初始化完成");
61
60
  }
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
- }
74
61
  async fetchOpenData(params) {
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");
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");
78
64
  if (!shopId)
79
65
  throw new Error("[OpenDataModule] 无法获取 shop_id");
80
- const tenantId = getData == null ? void 0 : getData("tenant_id");
66
+ const tenantId = (_d = (_c = this.otherParams) == null ? void 0 : _c.getStateData) == null ? void 0 : _d.call(_c, "tenant_id");
81
67
  const headers = {};
82
68
  if (tenantId)
83
69
  headers["Tenant-Id"] = String(tenantId);
@@ -88,7 +74,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
88
74
  target: params.target,
89
75
  section_code: params.section_code
90
76
  },
91
- { pisell2: true, isPisell2: true, prefix: false, headers }
77
+ { pisell2: true, headers }
92
78
  );
93
79
  if ((response == null ? void 0 : response.status) === false) {
94
80
  throw new Error((response == null ? void 0 : response.message) || "获取 OpenData 配置失败");
@@ -106,7 +92,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
106
92
  }
107
93
  checkAvailability(scheduleModule) {
108
94
  var _a;
109
- const scheduleList = scheduleModule ? scheduleModule == null ? void 0 : scheduleModule.getScheduleListByIds(
95
+ const scheduleList = scheduleModule ? scheduleModule.getScheduleListByIds(
110
96
  ((_a = this.store.data) == null ? void 0 : _a["availability.operating_hours"]) || []
111
97
  ) : void 0;
112
98
  return (0, import_utils.computeAvailability)({