@pisell/pisellos 2.2.322 → 2.2.324

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 (209) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/inventory/index.d.ts +92 -0
  4. package/dist/inventory/index.js +509 -0
  5. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  6. package/dist/modules/BookingContext/index.d.ts +2 -2
  7. package/dist/modules/BookingContext/index.js +55 -25
  8. package/dist/modules/BookingContext/types.d.ts +2 -0
  9. package/dist/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
  10. package/dist/modules/BookingContext/utils/calendarBooking.js +207 -0
  11. package/dist/modules/BookingContext/utils/index.d.ts +1 -0
  12. package/dist/modules/BookingContext/utils/index.js +1 -0
  13. package/dist/modules/BookingContext/utils/productExtend.d.ts +20 -1
  14. package/dist/modules/BookingContext/utils/productExtend.js +122 -29
  15. package/dist/modules/Date/index.d.ts +1 -1
  16. package/dist/modules/Date/index.js +60 -14
  17. package/dist/modules/Date/types.d.ts +5 -0
  18. package/dist/modules/Discount/index.js +1 -0
  19. package/dist/modules/OpenData/index.d.ts +1 -0
  20. package/dist/modules/OpenData/index.js +1 -0
  21. package/dist/modules/OpenData/salesSettings.d.ts +32 -0
  22. package/dist/modules/OpenData/salesSettings.js +80 -0
  23. package/dist/modules/OpenData/types.d.ts +16 -0
  24. package/dist/modules/OpenData/utils.d.ts +1 -1
  25. package/dist/modules/OpenData/utils.js +3 -2
  26. package/dist/modules/Order/index.d.ts +54 -11
  27. package/dist/modules/Order/index.js +2699 -1411
  28. package/dist/modules/Order/types.d.ts +43 -5
  29. package/dist/modules/Order/types.js +4 -0
  30. package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
  31. package/dist/modules/Order/unpaidAmountGap.js +72 -0
  32. package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
  33. package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
  34. package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
  35. package/dist/modules/Order/utils.d.ts +3 -1
  36. package/dist/modules/Order/utils.js +18 -3
  37. package/dist/modules/Product/index.d.ts +1 -1
  38. package/dist/modules/Product/types.d.ts +5 -0
  39. package/dist/modules/ProductList/clientDataVariants.js +6 -2
  40. package/dist/modules/ProductList/index.d.ts +2 -0
  41. package/dist/modules/ProductList/index.js +161 -51
  42. package/dist/modules/ResourcePlanner/planner.js +58 -2
  43. package/dist/modules/ResourcePlanner/types.d.ts +13 -0
  44. package/dist/modules/Rules/index.d.ts +2 -0
  45. package/dist/modules/Rules/index.js +58 -39
  46. package/dist/modules/Schedule/index.d.ts +7 -1
  47. package/dist/modules/Schedule/index.js +155 -39
  48. package/dist/modules/Schedule/types.d.ts +2 -0
  49. package/dist/modules/bookingReadValidation.d.ts +6 -0
  50. package/dist/modules/bookingReadValidation.js +72 -0
  51. package/dist/plugins/request.d.ts +2 -0
  52. package/dist/server/index.d.ts +5 -0
  53. package/dist/server/index.js +1312 -1154
  54. package/dist/server/modules/order/index.js +2 -1
  55. package/dist/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
  56. package/dist/shared/receipt/customerInvoiceLanguages.js +5 -3
  57. package/dist/shared/receipt/small-ticket.d.ts +4 -0
  58. package/dist/shared/receipt/small-ticket.js +70 -12
  59. package/dist/solution/BaseSales/index.d.ts +40 -5
  60. package/dist/solution/BaseSales/index.js +1939 -1484
  61. package/dist/solution/BaseSales/types.d.ts +4 -0
  62. package/dist/solution/BaseSales/types.js +1 -0
  63. package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  64. package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
  65. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  66. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
  67. package/dist/solution/BookingByStep/index.d.ts +16 -2
  68. package/dist/solution/BookingByStep/index.js +676 -361
  69. package/dist/solution/BookingByStep/utils/resources.d.ts +10 -0
  70. package/dist/solution/BookingByStep/utils/resources.js +117 -76
  71. package/dist/solution/BookingTicket/index.d.ts +2 -2
  72. package/dist/solution/BookingTicket/index.js +249 -135
  73. package/dist/solution/BookingTicket/types.d.ts +14 -2
  74. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
  75. package/dist/solution/BookingTicket/utils/addProductDecision.js +39 -11
  76. package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
  77. package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.js +188 -0
  78. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +8 -0
  79. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +88 -0
  80. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  81. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  82. package/dist/solution/OrderInvoicePreview/index.js +14 -8
  83. package/dist/solution/ScanOrder/index.d.ts +2 -0
  84. package/dist/solution/ScanOrder/index.js +166 -67
  85. package/dist/solution/ScanOrder/menuAvailability.d.ts +24 -0
  86. package/dist/solution/ScanOrder/menuAvailability.js +363 -0
  87. package/dist/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
  88. package/dist/solution/UnifiedBookingSales/catalogQueryBatch.js +202 -0
  89. package/dist/solution/UnifiedBookingSales/index.d.ts +96 -4
  90. package/dist/solution/UnifiedBookingSales/index.js +3391 -1176
  91. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  92. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
  93. package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  94. package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
  95. package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  96. package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
  97. package/dist/solution/UnifiedBookingSales/types.d.ts +71 -2
  98. package/dist/solution/UnifiedBookingSales/types.js +7 -1
  99. package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  100. package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +283 -0
  101. package/dist/utils/platform.d.ts +2 -0
  102. package/dist/utils/platform.js +6 -0
  103. package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
  104. package/dist/utils/pos-receipt-auto-print.js +14 -0
  105. package/lib/index.d.ts +1 -0
  106. package/lib/index.js +12 -0
  107. package/lib/inventory/index.d.ts +92 -0
  108. package/lib/inventory/index.js +287 -0
  109. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  110. package/lib/modules/BookingContext/index.d.ts +2 -2
  111. package/lib/modules/BookingContext/index.js +42 -10
  112. package/lib/modules/BookingContext/types.d.ts +2 -0
  113. package/lib/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
  114. package/lib/modules/BookingContext/utils/calendarBooking.js +156 -0
  115. package/lib/modules/BookingContext/utils/index.d.ts +1 -0
  116. package/lib/modules/BookingContext/utils/index.js +11 -0
  117. package/lib/modules/BookingContext/utils/productExtend.d.ts +20 -1
  118. package/lib/modules/BookingContext/utils/productExtend.js +96 -7
  119. package/lib/modules/Date/index.d.ts +1 -1
  120. package/lib/modules/Date/index.js +28 -5
  121. package/lib/modules/Date/types.d.ts +5 -0
  122. package/lib/modules/Discount/index.js +1 -0
  123. package/lib/modules/OpenData/index.d.ts +1 -0
  124. package/lib/modules/OpenData/index.js +12 -0
  125. package/lib/modules/OpenData/salesSettings.d.ts +32 -0
  126. package/lib/modules/OpenData/salesSettings.js +70 -0
  127. package/lib/modules/OpenData/types.d.ts +16 -0
  128. package/lib/modules/OpenData/utils.d.ts +1 -1
  129. package/lib/modules/OpenData/utils.js +3 -2
  130. package/lib/modules/Order/index.d.ts +54 -11
  131. package/lib/modules/Order/index.js +659 -80
  132. package/lib/modules/Order/types.d.ts +43 -5
  133. package/lib/modules/Order/types.js +2 -0
  134. package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
  135. package/lib/modules/Order/unpaidAmountGap.js +60 -0
  136. package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
  137. package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
  138. package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
  139. package/lib/modules/Order/utils.d.ts +3 -1
  140. package/lib/modules/Order/utils.js +19 -2
  141. package/lib/modules/Product/index.d.ts +1 -1
  142. package/lib/modules/Product/types.d.ts +5 -0
  143. package/lib/modules/ProductList/clientDataVariants.js +6 -2
  144. package/lib/modules/ProductList/index.d.ts +2 -0
  145. package/lib/modules/ProductList/index.js +74 -0
  146. package/lib/modules/ResourcePlanner/planner.js +52 -1
  147. package/lib/modules/ResourcePlanner/types.d.ts +13 -0
  148. package/lib/modules/Rules/index.d.ts +2 -0
  149. package/lib/modules/Rules/index.js +25 -9
  150. package/lib/modules/Schedule/index.d.ts +7 -1
  151. package/lib/modules/Schedule/index.js +68 -4
  152. package/lib/modules/Schedule/types.d.ts +2 -0
  153. package/lib/modules/bookingReadValidation.d.ts +6 -0
  154. package/lib/modules/bookingReadValidation.js +56 -0
  155. package/lib/plugins/request.d.ts +2 -0
  156. package/lib/server/index.d.ts +5 -0
  157. package/lib/server/index.js +124 -16
  158. package/lib/server/modules/order/index.js +2 -1
  159. package/lib/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
  160. package/lib/shared/receipt/customerInvoiceLanguages.js +5 -3
  161. package/lib/shared/receipt/small-ticket.d.ts +4 -0
  162. package/lib/shared/receipt/small-ticket.js +63 -8
  163. package/lib/solution/BaseSales/index.d.ts +40 -5
  164. package/lib/solution/BaseSales/index.js +296 -43
  165. package/lib/solution/BaseSales/types.d.ts +4 -0
  166. package/lib/solution/BaseSales/types.js +1 -0
  167. package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  168. package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
  169. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  170. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
  171. package/lib/solution/BookingByStep/index.d.ts +16 -2
  172. package/lib/solution/BookingByStep/index.js +222 -14
  173. package/lib/solution/BookingByStep/utils/resources.d.ts +10 -0
  174. package/lib/solution/BookingByStep/utils/resources.js +25 -15
  175. package/lib/solution/BookingTicket/index.d.ts +2 -2
  176. package/lib/solution/BookingTicket/index.js +47 -4
  177. package/lib/solution/BookingTicket/types.d.ts +14 -2
  178. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
  179. package/lib/solution/BookingTicket/utils/addProductDecision.js +37 -6
  180. package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
  181. package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.js +136 -0
  182. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +8 -0
  183. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +54 -0
  184. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  185. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  186. package/lib/solution/OrderInvoicePreview/index.js +7 -1
  187. package/lib/solution/ScanOrder/index.d.ts +2 -0
  188. package/lib/solution/ScanOrder/index.js +72 -2
  189. package/lib/solution/ScanOrder/menuAvailability.d.ts +24 -0
  190. package/lib/solution/ScanOrder/menuAvailability.js +203 -0
  191. package/lib/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
  192. package/lib/solution/UnifiedBookingSales/catalogQueryBatch.js +109 -0
  193. package/lib/solution/UnifiedBookingSales/index.d.ts +96 -4
  194. package/lib/solution/UnifiedBookingSales/index.js +1339 -74
  195. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  196. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
  197. package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  198. package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
  199. package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  200. package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
  201. package/lib/solution/UnifiedBookingSales/types.d.ts +71 -2
  202. package/lib/solution/UnifiedBookingSales/types.js +4 -1
  203. package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  204. package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +155 -0
  205. package/lib/utils/platform.d.ts +2 -0
  206. package/lib/utils/platform.js +7 -0
  207. package/lib/utils/pos-receipt-auto-print.d.ts +4 -0
  208. package/lib/utils/pos-receipt-auto-print.js +13 -0
  209. package/package.json +1 -1
@@ -42,6 +42,7 @@ import { handleGlobalScan, handleCustomerScan, handleUniversalScan } from "./uti
42
42
  import scanCache from "./utils/scan/scanCache";
43
43
  import { formatGlobalScanResult } from "./utils/scan/formatGlobalScan";
44
44
  import { applyGlobalScan } from "./utils/scan/applyGlobalScan";
45
+ import { applyProductVoucherCollectionScan } from "./utils/scan/applyProductVoucherCollectionScan";
45
46
  import { buildCartView, isWalkInCustomer } from "./utils/cartView";
46
47
  import { buildCacheItemFromCartDetail, buildCacheItemFromDetail, buildRequiresDetailPayload as _buildRequiresDetailPayload, decideAddProduct as decideAddProductUtil, decideAfterDetail as decideAfterDetailUtil, decideAutoClose as decideAutoCloseUtil, getIsEject as getIsEjectUtil, getIsOnlySession as getIsOnlySessionUtil, transformDetailToProductAndBooking as transformDetailToProductAndBookingUtil } from "./utils/addProductDecision";
47
48
  import { buildCacheItemFromOrderLine as buildCacheItemFromOrderLineUtil } from "../../modules/BookingContext/utils/buildCacheItemFromOrderLine";
@@ -2736,16 +2737,26 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2736
2737
  }, {
2737
2738
  key: "buildBookingCalcContext",
2738
2739
  value: function buildBookingCalcContext(extra) {
2739
- var _extra$date, _extra$presetStartTim;
2740
+ var _extra$date,
2741
+ _extra$presetStartTim,
2742
+ _this$getOrderSession,
2743
+ _this8 = this,
2744
+ _this$otherParams9;
2740
2745
  var state = this.store.bookingContext.getState();
2741
2746
  var date = (_extra$date = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date !== void 0 ? _extra$date : state.date;
2742
- return _objectSpread({
2747
+ return _objectSpread(_objectSpread({
2743
2748
  bookingConfig: state.bookingConfig,
2744
2749
  resourcesOrigin: state.resourcesOrigin,
2745
2750
  resourcesOriginMap: state.resourcesOriginMap,
2746
2751
  date: date,
2747
2752
  presetStartTime: (_extra$presetStartTim = extra === null || extra === void 0 ? void 0 : extra.presetStartTime) !== null && _extra$presetStartTim !== void 0 ? _extra$presetStartTim : derivePresetStartTimeFromDate(date)
2748
- }, extra || {});
2753
+ }, extra || {}), {}, {
2754
+ orderSessionId: (_this$getOrderSession = this.getOrderSessionId()) !== null && _this$getOrderSession !== void 0 ? _this$getOrderSession : undefined,
2755
+ isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
2756
+ return _this8.isOrderSessionCurrent(sessionId);
2757
+ },
2758
+ platform: String(((_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.platform) || '').trim().toLowerCase()
2759
+ });
2749
2760
  }
2750
2761
 
2751
2762
  /**
@@ -2839,7 +2850,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2839
2850
  }, {
2840
2851
  key: "buildAddProductCtx",
2841
2852
  value: function buildAddProductCtx(extra) {
2842
- var _extra$date2, _ref14, _this$getOrderCustome4, _this$getOrderCustome5, _this$store$order$get5, _extra$presetStartTim2;
2853
+ var _extra$date2,
2854
+ _ref14,
2855
+ _this$getOrderCustome4,
2856
+ _this$getOrderCustome5,
2857
+ _this$store$order$get5,
2858
+ _extra$presetStartTim2,
2859
+ _this$getOrderSession2,
2860
+ _this9 = this,
2861
+ _this$otherParams10;
2843
2862
  var bookingContextState = this.store.bookingContext.getState();
2844
2863
  var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
2845
2864
  var orderCustomerId = (_ref14 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$get5 = this.store.order.getTempOrder()) === null || _this$store$order$get5 === void 0 ? void 0 : _this$store$order$get5.customer_id) !== null && _ref14 !== void 0 ? _ref14 : undefined;
@@ -2851,7 +2870,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2851
2870
  presetStartTime: (_extra$presetStartTim2 = extra === null || extra === void 0 ? void 0 : extra.presetStartTime) !== null && _extra$presetStartTim2 !== void 0 ? _extra$presetStartTim2 : derivePresetStartTimeFromDate(date),
2852
2871
  customerId: orderCustomerId
2853
2872
  }, extra || {}), {}, {
2854
- channel: this.getSubmitOrderSalesChannel()
2873
+ channel: this.getSubmitOrderSalesChannel(),
2874
+ orderSessionId: (_this$getOrderSession2 = this.getOrderSessionId()) !== null && _this$getOrderSession2 !== void 0 ? _this$getOrderSession2 : undefined,
2875
+ isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
2876
+ return _this9.isOrderSessionCurrent(sessionId);
2877
+ },
2878
+ platform: String(((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.platform) || '').trim().toLowerCase()
2855
2879
  });
2856
2880
  }
2857
2881
 
@@ -2986,24 +3010,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2986
3010
  }, {
2987
3011
  key: "handleGlobalScanCode",
2988
3012
  value: (function () {
2989
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(code, bridge) {
2990
- var _this8 = this;
2991
- var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result8, _bridge$onNotify3;
2992
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
2993
- while (1) switch (_context39.prev = _context39.next) {
3013
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(code, bridge) {
3014
+ var _this10 = this;
3015
+ var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, _promotion$isAccepted, promotion, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, host, _result8, _bridge$onNotify3, _bridge$isCurrent;
3016
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3017
+ while (1) switch (_context40.prev = _context40.next) {
2994
3018
  case 0:
2995
3019
  trimmed = typeof code === 'string' ? code.trim() : '';
2996
3020
  if (trimmed) {
2997
- _context39.next = 4;
3021
+ _context40.next = 4;
2998
3022
  break;
2999
3023
  }
3000
3024
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3001
- return _context39.abrupt("return", {
3025
+ return _context40.abrupt("return", {
3002
3026
  status: 'failed',
3003
3027
  reason: 'empty_code'
3004
3028
  });
3005
3029
  case 4:
3006
- _context39.prev = 4;
3030
+ _context40.prev = 4;
3007
3031
  // Capture before lookup/UI awaits, so a result cannot land in a new cart.
3008
3032
  // Unscoped POS Order modules return a no-op guard.
3009
3033
  beforeScanCommit = this.store.order.createCartIntentCommitGuard('add_product');
@@ -3029,86 +3053,174 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3029
3053
  return bridge.openBookingEdit(payload);
3030
3054
  } : undefined
3031
3055
  }) : undefined;
3056
+ if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
3057
+ _context40.next = 16;
3058
+ break;
3059
+ }
3060
+ if (guardedBridge.applyPromotionCode) {
3061
+ _context40.next = 12;
3062
+ break;
3063
+ }
3064
+ return _context40.abrupt("return", {
3065
+ status: 'failed',
3066
+ reason: 'no_bridge'
3067
+ });
3068
+ case 12:
3069
+ _context40.next = 14;
3070
+ return guardedBridge.applyPromotionCode(trimmed);
3071
+ case 14:
3072
+ promotion = _context40.sent;
3073
+ return _context40.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
3074
+ status: 'success',
3075
+ kind: 'promotion'
3076
+ } : {
3077
+ status: 'failed',
3078
+ reason: 'not_found'
3079
+ });
3080
+ case 16:
3032
3081
  localSearch = function localSearch(v) {
3033
- return _this8.store.products.findProductsByCodeOrBarcode(v);
3082
+ return _this10.store.products.findProductsByCodeOrBarcode(v);
3034
3083
  };
3035
3084
  scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
3036
- _context39.next = 13;
3085
+ _context40.next = 20;
3037
3086
  return scanCallback({
3038
3087
  type: 'nativeScanner',
3039
3088
  value: trimmed
3040
3089
  });
3041
- case 13:
3042
- raw = _context39.sent;
3090
+ case 20:
3091
+ raw = _context40.sent;
3043
3092
  formatted = formatGlobalScanResult(raw, trimmed);
3044
3093
  if (formatted) {
3045
- _context39.next = 18;
3094
+ _context40.next = 25;
3046
3095
  break;
3047
3096
  }
3048
3097
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3049
- return _context39.abrupt("return", {
3098
+ return _context40.abrupt("return", {
3050
3099
  status: 'failed',
3051
3100
  reason: 'not_found'
3052
3101
  });
3053
- case 18:
3054
- _context39.next = 20;
3055
- return applyGlobalScan({
3102
+ case 25:
3103
+ host = {
3056
3104
  setOrderCustomer: function setOrderCustomer(customer) {
3057
3105
  beforeScanCommit();
3058
- _this8.setOrderCustomer(customer);
3106
+ _this10.setOrderCustomer(customer);
3059
3107
  },
3060
3108
  getOrderCustomerSnapshot: function getOrderCustomerSnapshot() {
3061
- return _this8.getOrderCustomerSnapshot();
3109
+ return _this10.getOrderCustomerSnapshot();
3062
3110
  },
3063
3111
  resolveCustomerById: function resolveCustomerById(customerId) {
3064
- return _this8.resolveCustomerById(customerId);
3112
+ return _this10.resolveCustomerById(customerId);
3065
3113
  },
3066
3114
  getBusinessCode: function getBusinessCode() {
3067
- var _this8$otherParams;
3068
- return (_this8$otherParams = _this8.otherParams) === null || _this8$otherParams === void 0 ? void 0 : _this8$otherParams.businessCode;
3115
+ var _this10$otherParams;
3116
+ return (_this10$otherParams = _this10.otherParams) === null || _this10$otherParams === void 0 ? void 0 : _this10$otherParams.businessCode;
3069
3117
  },
3070
3118
  buildAddProductCtx: function buildAddProductCtx(extra) {
3071
- return _this8.buildAddProductCtx(extra);
3119
+ return _this10.buildAddProductCtx(extra);
3072
3120
  },
3073
3121
  decideAddProduct: function decideAddProduct(item, options) {
3074
- return _this8.decideAddProduct(item, options);
3122
+ return _this10.decideAddProduct(item, options);
3075
3123
  },
3076
3124
  decideAfterDetail: function decideAfterDetail(cacheItem, options) {
3077
- return _this8.decideAfterDetail(cacheItem, options);
3125
+ return _this10.decideAfterDetail(cacheItem, options);
3078
3126
  },
3079
3127
  transformDetailToProductAndBooking: function transformDetailToProductAndBooking(input) {
3080
- return _this8.transformDetailToProductAndBooking(input);
3128
+ return _this10.transformDetailToProductAndBooking(input);
3081
3129
  },
3082
3130
  addProductToOrder: function addProductToOrder(product, booking) {
3083
3131
  beforeScanCommit();
3084
- return _this8.addProductToOrder(product, booking);
3132
+ return _this10.addProductToOrder(product, booking);
3085
3133
  },
3086
3134
  refreshWalletAssets: function refreshWalletAssets(params) {
3087
- return _this8.refreshWalletAssets(params);
3135
+ return _this10.refreshWalletAssets(params);
3088
3136
  },
3089
3137
  scanWalletAsset: function scanWalletAsset(scanCode) {
3090
3138
  beforeScanCommit();
3091
- return _this8.scanWalletAsset(scanCode);
3139
+ return _this10.scanWalletAsset(scanCode);
3092
3140
  }
3093
- }, formatted, guardedBridge);
3094
- case 20:
3095
- _result8 = _context39.sent;
3141
+ };
3142
+ if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher-collection')) {
3143
+ _context40.next = 32;
3144
+ break;
3145
+ }
3146
+ _context40.next = 29;
3147
+ return applyProductVoucherCollectionScan(_objectSpread(_objectSpread({}, host), {}, {
3148
+ loadCustomerDiscounts: function () {
3149
+ var _loadCustomerDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3150
+ var _this10$getOrderCusto;
3151
+ var customerId;
3152
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3153
+ while (1) switch (_context39.prev = _context39.next) {
3154
+ case 0:
3155
+ beforeScanCommit();
3156
+ customerId = Number(((_this10$getOrderCusto = _this10.getOrderCustomer()) === null || _this10$getOrderCusto === void 0 ? void 0 : _this10$getOrderCusto.customer_id) || 0);
3157
+ if (!(customerId <= 1)) {
3158
+ _context39.next = 4;
3159
+ break;
3160
+ }
3161
+ return _context39.abrupt("return", []);
3162
+ case 4:
3163
+ _context39.next = 6;
3164
+ return _this10.refreshDiscountConfigAfterOrderCustomerChange(customerId);
3165
+ case 6:
3166
+ beforeScanCommit();
3167
+ return _context39.abrupt("return", _this10.getDiscountList());
3168
+ case 8:
3169
+ case "end":
3170
+ return _context39.stop();
3171
+ }
3172
+ }, _callee39);
3173
+ }));
3174
+ function loadCustomerDiscounts() {
3175
+ return _loadCustomerDiscounts.apply(this, arguments);
3176
+ }
3177
+ return loadCustomerDiscounts;
3178
+ }()
3179
+ }), formatted, guardedBridge);
3180
+ case 29:
3181
+ _context40.t0 = _context40.sent;
3182
+ _context40.next = 35;
3183
+ break;
3184
+ case 32:
3185
+ _context40.next = 34;
3186
+ return applyGlobalScan(host, formatted, guardedBridge);
3187
+ case 34:
3188
+ _context40.t0 = _context40.sent;
3189
+ case 35:
3190
+ _result8 = _context40.t0;
3096
3191
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
3097
- return _context39.abrupt("return", _result8);
3098
- case 25:
3099
- _context39.prev = 25;
3100
- _context39.t0 = _context39["catch"](4);
3101
- console.error('[BookingTicket] handleGlobalScanCode failed', _context39.t0);
3192
+ return _context40.abrupt("return", _result8);
3193
+ case 40:
3194
+ _context40.prev = 40;
3195
+ _context40.t1 = _context40["catch"](4);
3196
+ if (!((bridge === null || bridge === void 0 ? void 0 : bridge.scanScope) === 'product-voucher-collection')) {
3197
+ _context40.next = 46;
3198
+ break;
3199
+ }
3200
+ if (!(((_bridge$isCurrent = bridge.isCurrent) === null || _bridge$isCurrent === void 0 ? void 0 : _bridge$isCurrent.call(bridge)) === false)) {
3201
+ _context40.next = 45;
3202
+ break;
3203
+ }
3204
+ return _context40.abrupt("return", {
3205
+ status: 'cancelled'
3206
+ });
3207
+ case 45:
3208
+ return _context40.abrupt("return", {
3209
+ status: 'failed',
3210
+ reason: 'entry_resolution_failed'
3211
+ });
3212
+ case 46:
3213
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context40.t1);
3102
3214
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3103
- return _context39.abrupt("return", {
3215
+ return _context40.abrupt("return", {
3104
3216
  status: 'failed',
3105
3217
  reason: 'not_found'
3106
3218
  });
3107
- case 30:
3219
+ case 49:
3108
3220
  case "end":
3109
- return _context39.stop();
3221
+ return _context40.stop();
3110
3222
  }
3111
- }, _callee39, this, [[4, 25]]);
3223
+ }, _callee40, this, [[4, 40]]);
3112
3224
  }));
3113
3225
  function handleGlobalScanCode(_x23, _x24) {
3114
3226
  return _handleGlobalScanCode.apply(this, arguments);
@@ -3118,37 +3230,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3118
3230
  }, {
3119
3231
  key: "getGlobalScanCodeType",
3120
3232
  value: (function () {
3121
- var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(code) {
3122
- var _this9 = this,
3233
+ var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(code) {
3234
+ var _this11 = this,
3123
3235
  _formatGlobalScanResu,
3124
3236
  _formatGlobalScanResu2;
3125
3237
  var trimmed, scan, raw;
3126
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3127
- while (1) switch (_context40.prev = _context40.next) {
3238
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3239
+ while (1) switch (_context41.prev = _context41.next) {
3128
3240
  case 0:
3129
3241
  trimmed = typeof code === 'string' ? code.trim() : '';
3130
3242
  if (trimmed) {
3131
- _context40.next = 3;
3243
+ _context41.next = 3;
3132
3244
  break;
3133
3245
  }
3134
- return _context40.abrupt("return", null);
3246
+ return _context41.abrupt("return", null);
3135
3247
  case 3:
3136
3248
  scan = handleGlobalScan(this.request, function (value) {
3137
- return _this9.store.products.findProductsByCodeOrBarcode(value);
3249
+ return _this11.store.products.findProductsByCodeOrBarcode(value);
3138
3250
  }, this.getSubmitOrderSalesChannel());
3139
- _context40.next = 6;
3251
+ _context41.next = 6;
3140
3252
  return scan({
3141
3253
  type: 'nativeScanner',
3142
3254
  value: trimmed
3143
3255
  });
3144
3256
  case 6:
3145
- raw = _context40.sent;
3146
- return _context40.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
3257
+ raw = _context41.sent;
3258
+ return _context41.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
3147
3259
  case 8:
3148
3260
  case "end":
3149
- return _context40.stop();
3261
+ return _context41.stop();
3150
3262
  }
3151
- }, _callee40, this);
3263
+ }, _callee41, this);
3152
3264
  }));
3153
3265
  function getGlobalScanCodeType(_x25) {
3154
3266
  return _getGlobalScanCodeType.apply(this, arguments);
@@ -3232,11 +3344,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3232
3344
  }, {
3233
3345
  key: "addAddTimeProductToBooking",
3234
3346
  value: (function () {
3235
- var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(input) {
3236
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3237
- while (1) switch (_context41.prev = _context41.next) {
3347
+ var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(input) {
3348
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3349
+ while (1) switch (_context42.prev = _context42.next) {
3238
3350
  case 0:
3239
- return _context41.abrupt("return", this.addAddTimeProductsToBooking({
3351
+ return _context42.abrupt("return", this.addAddTimeProductsToBooking({
3240
3352
  booking: input.booking,
3241
3353
  products: [input],
3242
3354
  coveredMinutes: input.coveredMinutes,
@@ -3244,9 +3356,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3244
3356
  }));
3245
3357
  case 1:
3246
3358
  case "end":
3247
- return _context41.stop();
3359
+ return _context42.stop();
3248
3360
  }
3249
- }, _callee41, this);
3361
+ }, _callee42, this);
3250
3362
  }));
3251
3363
  function addAddTimeProductToBooking(_x26) {
3252
3364
  return _addAddTimeProductToBooking.apply(this, arguments);
@@ -3266,27 +3378,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3266
3378
  }, {
3267
3379
  key: "addAddTimeProductsToBooking",
3268
3380
  value: (function () {
3269
- var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(input) {
3270
- var _this10 = this,
3381
+ var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(input) {
3382
+ var _this12 = this,
3271
3383
  _input$bookingPatch;
3272
3384
  var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
3273
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3274
- while (1) switch (_context42.prev = _context42.next) {
3385
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3386
+ while (1) switch (_context43.prev = _context43.next) {
3275
3387
  case 0:
3276
3388
  bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
3277
3389
  if (bookingUid) {
3278
- _context42.next = 3;
3390
+ _context43.next = 3;
3279
3391
  break;
3280
3392
  }
3281
3393
  throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
3282
3394
  case 3:
3283
3395
  orderLines = (input.products || []).map(function (line) {
3284
3396
  return {
3285
- product: _this10.buildAddTimeOrderLine(line, bookingUid)
3397
+ product: _this12.buildAddTimeOrderLine(line, bookingUid)
3286
3398
  };
3287
3399
  });
3288
3400
  if (this.store.order) {
3289
- _context42.next = 6;
3401
+ _context43.next = 6;
3290
3402
  break;
3291
3403
  }
3292
3404
  throw new Error('order 模块未初始化');
@@ -3300,53 +3412,53 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3300
3412
  });
3301
3413
  }
3302
3414
  if (!(typeof this.store.order.addProductsToOrder === 'function')) {
3303
- _context42.next = 11;
3415
+ _context43.next = 11;
3304
3416
  break;
3305
3417
  }
3306
- return _context42.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3418
+ return _context43.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3307
3419
  case 11:
3308
3420
  result = [];
3309
3421
  _iterator2 = _createForOfIteratorHelper(orderLines);
3310
- _context42.prev = 13;
3422
+ _context43.prev = 13;
3311
3423
  _iterator2.s();
3312
3424
  case 15:
3313
3425
  if ((_step2 = _iterator2.n()).done) {
3314
- _context42.next = 29;
3426
+ _context43.next = 29;
3315
3427
  break;
3316
3428
  }
3317
3429
  line = _step2.value;
3318
- _context42.t0 = result.splice;
3319
- _context42.t1 = result;
3320
- _context42.t2 = [0, result.length];
3321
- _context42.t3 = _toConsumableArray;
3322
- _context42.next = 23;
3430
+ _context43.t0 = result.splice;
3431
+ _context43.t1 = result;
3432
+ _context43.t2 = [0, result.length];
3433
+ _context43.t3 = _toConsumableArray;
3434
+ _context43.next = 23;
3323
3435
  return this.addProductToOrder(line.product);
3324
3436
  case 23:
3325
- _context42.t4 = _context42.sent;
3326
- _context42.t5 = (0, _context42.t3)(_context42.t4);
3327
- _context42.t6 = _context42.t2.concat.call(_context42.t2, _context42.t5);
3328
- _context42.t0.apply.call(_context42.t0, _context42.t1, _context42.t6);
3437
+ _context43.t4 = _context43.sent;
3438
+ _context43.t5 = (0, _context43.t3)(_context43.t4);
3439
+ _context43.t6 = _context43.t2.concat.call(_context43.t2, _context43.t5);
3440
+ _context43.t0.apply.call(_context43.t0, _context43.t1, _context43.t6);
3329
3441
  case 27:
3330
- _context42.next = 15;
3442
+ _context43.next = 15;
3331
3443
  break;
3332
3444
  case 29:
3333
- _context42.next = 34;
3445
+ _context43.next = 34;
3334
3446
  break;
3335
3447
  case 31:
3336
- _context42.prev = 31;
3337
- _context42.t7 = _context42["catch"](13);
3338
- _iterator2.e(_context42.t7);
3448
+ _context43.prev = 31;
3449
+ _context43.t7 = _context43["catch"](13);
3450
+ _iterator2.e(_context43.t7);
3339
3451
  case 34:
3340
- _context42.prev = 34;
3452
+ _context43.prev = 34;
3341
3453
  _iterator2.f();
3342
- return _context42.finish(34);
3454
+ return _context43.finish(34);
3343
3455
  case 37:
3344
- return _context42.abrupt("return", result);
3456
+ return _context43.abrupt("return", result);
3345
3457
  case 38:
3346
3458
  case "end":
3347
- return _context42.stop();
3459
+ return _context43.stop();
3348
3460
  }
3349
- }, _callee42, this, [[13, 31, 34, 37]]);
3461
+ }, _callee43, this, [[13, 31, 34, 37]]);
3350
3462
  }));
3351
3463
  function addAddTimeProductsToBooking(_x27) {
3352
3464
  return _addAddTimeProductsToBooking.apply(this, arguments);
@@ -3356,47 +3468,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3356
3468
  }, {
3357
3469
  key: "setOtherParams",
3358
3470
  value: function () {
3359
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3360
- var _this11 = this;
3471
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
3472
+ var _this13 = this;
3361
3473
  var _ref21,
3362
3474
  _ref21$cover,
3363
3475
  cover,
3364
3476
  nextParams,
3365
3477
  invoiceContextChanged,
3366
- _args43 = arguments;
3367
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3368
- while (1) switch (_context43.prev = _context43.next) {
3478
+ _args44 = arguments;
3479
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3480
+ while (1) switch (_context44.prev = _context44.next) {
3369
3481
  case 0:
3370
- _ref21 = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
3482
+ _ref21 = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
3371
3483
  nextParams = cover ? params : _objectSpread(_objectSpread({}, this.otherParams), params);
3372
3484
  if (['businessCode', 'business_code', 'channel', 'platform', 'shop_id', 'tenantId', 'cacheId'].some(function (key) {
3373
- var _this11$otherParams;
3374
- return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((_this11$otherParams = _this11.otherParams) === null || _this11$otherParams === void 0 ? void 0 : _this11$otherParams[key]);
3485
+ var _this13$otherParams;
3486
+ return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((_this13$otherParams = _this13.otherParams) === null || _this13$otherParams === void 0 ? void 0 : _this13$otherParams[key]);
3375
3487
  })) this.orderCustomerContactRequest = null;
3376
- _context43.next = 5;
3488
+ _context44.next = 5;
3377
3489
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
3378
3490
  cover: cover
3379
3491
  });
3380
3492
  case 5:
3381
3493
  invoiceContextChanged = (params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || (params === null || params === void 0 ? void 0 : params.channel) !== undefined || (params === null || params === void 0 ? void 0 : params.platform) !== undefined || Object.prototype.hasOwnProperty.call(params, 'openData');
3382
3494
  if (!invoiceContextChanged) {
3383
- _context43.next = 9;
3495
+ _context44.next = 9;
3384
3496
  break;
3385
3497
  }
3386
- _context43.next = 9;
3498
+ _context44.next = 9;
3387
3499
  return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
3388
3500
  case 9:
3389
3501
  if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
3390
- _context43.next = 12;
3502
+ _context44.next = 12;
3391
3503
  break;
3392
3504
  }
3393
- _context43.next = 12;
3505
+ _context44.next = 12;
3394
3506
  return this.configureIdGeneratorFromOpenData();
3395
3507
  case 12:
3396
3508
  case "end":
3397
- return _context43.stop();
3509
+ return _context44.stop();
3398
3510
  }
3399
- }, _callee43, this);
3511
+ }, _callee44, this);
3400
3512
  }));
3401
3513
  function setOtherParams(_x28) {
3402
3514
  return _setOtherParams.apply(this, arguments);
@@ -3415,15 +3527,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3415
3527
  }, {
3416
3528
  key: "handlePrintWristband",
3417
3529
  value: function () {
3418
- var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
3530
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3419
3531
  var _this$getOrderIdentit2;
3420
3532
  var deviceTask, deviceId, idempotencyKey;
3421
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3422
- while (1) switch (_context44.prev = _context44.next) {
3533
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3534
+ while (1) switch (_context45.prev = _context45.next) {
3423
3535
  case 0:
3424
3536
  deviceTask = this.getDeviceTaskPlugin();
3425
3537
  if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
3426
- _context44.next = 4;
3538
+ _context45.next = 4;
3427
3539
  break;
3428
3540
  }
3429
3541
  this.logger.addLog({
@@ -3433,7 +3545,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3433
3545
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3434
3546
  }
3435
3547
  });
3436
- return _context44.abrupt("return");
3548
+ return _context45.abrupt("return");
3437
3549
  case 4:
3438
3550
  this.logger.addLog({
3439
3551
  type: 'info',
@@ -3442,10 +3554,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3442
3554
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3443
3555
  }
3444
3556
  });
3445
- _context44.next = 7;
3557
+ _context45.next = 7;
3446
3558
  return this.getShortNumberOrDeviceId();
3447
3559
  case 7:
3448
- deviceId = _context44.sent;
3560
+ deviceId = _context45.sent;
3449
3561
  idempotencyKey = createUuidV4();
3450
3562
  deviceTask.dispatch({
3451
3563
  action: 'print_all',
@@ -3465,9 +3577,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3465
3577
  });
3466
3578
  case 10:
3467
3579
  case "end":
3468
- return _context44.stop();
3580
+ return _context45.stop();
3469
3581
  }
3470
- }, _callee44, this);
3582
+ }, _callee45, this);
3471
3583
  }));
3472
3584
  function handlePrintWristband(_x29) {
3473
3585
  return _handlePrintWristband.apply(this, arguments);
@@ -3477,11 +3589,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3477
3589
  }, {
3478
3590
  key: "handleRedeem",
3479
3591
  value: function () {
3480
- var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3592
+ var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(params) {
3481
3593
  var _this$store$order8, _this$store$order8$ge, _this$store$order9, _ref22, _tempOrder$order_id2;
3482
3594
  var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
3483
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3484
- while (1) switch (_context45.prev = _context45.next) {
3595
+ return _regeneratorRuntime().wrap(function _callee46$(_context46) {
3596
+ while (1) switch (_context46.prev = _context46.next) {
3485
3597
  case 0:
3486
3598
  voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
3487
3599
  status = params.is_checkin ? 'used' : 'unused';
@@ -3505,20 +3617,22 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3505
3617
  });
3506
3618
  });
3507
3619
  if (!(tempOrder && hasUpdatedVoucher)) {
3508
- _context45.next = 11;
3620
+ _context46.next = 11;
3509
3621
  break;
3510
3622
  }
3511
- _context45.next = 11;
3623
+ _context46.next = 11;
3512
3624
  return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
3513
3625
  vouchers: nextVouchers
3514
- }));
3626
+ }), {
3627
+ preserveOrderSessionId: this.getOrderSessionId() || undefined
3628
+ });
3515
3629
  case 11:
3516
3630
  this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
3517
3631
  if (!(voucherIds.length === 0)) {
3518
- _context45.next = 14;
3632
+ _context46.next = 14;
3519
3633
  break;
3520
3634
  }
3521
- return _context45.abrupt("return", {
3635
+ return _context46.abrupt("return", {
3522
3636
  code: 200,
3523
3637
  status: true,
3524
3638
  message: '',
@@ -3529,7 +3643,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3529
3643
  externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
3530
3644
  orderId = (_ref22 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref22 !== void 0 ? _ref22 : undefined;
3531
3645
  orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
3532
- return _context45.abrupt("return", this.request.post('/machinecode/batch', {
3646
+ return _context46.abrupt("return", this.request.post('/machinecode/batch', {
3533
3647
  ids: voucherIds,
3534
3648
  status: status,
3535
3649
  order_lookup: orderLookup,
@@ -3540,9 +3654,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3540
3654
  }));
3541
3655
  case 19:
3542
3656
  case "end":
3543
- return _context45.stop();
3657
+ return _context46.stop();
3544
3658
  }
3545
- }, _callee45, this);
3659
+ }, _callee46, this);
3546
3660
  }));
3547
3661
  function handleRedeem(_x30) {
3548
3662
  return _handleRedeem.apply(this, arguments);
@@ -3556,13 +3670,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3556
3670
  }, {
3557
3671
  key: "destroy",
3558
3672
  value: (function () {
3559
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46() {
3673
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
3560
3674
  var _this$scan;
3561
- return _regeneratorRuntime().wrap(function _callee46$(_context46) {
3562
- while (1) switch (_context46.prev = _context46.next) {
3675
+ return _regeneratorRuntime().wrap(function _callee47$(_context47) {
3676
+ while (1) switch (_context47.prev = _context47.next) {
3563
3677
  case 0:
3564
3678
  this.orderCustomerContactRequest = null;
3565
- _context46.next = 3;
3679
+ _context47.next = 3;
3566
3680
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
3567
3681
  case 3:
3568
3682
  try {
@@ -3573,9 +3687,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3573
3687
  scanCache.clear();
3574
3688
  case 5:
3575
3689
  case "end":
3576
- return _context46.stop();
3690
+ return _context47.stop();
3577
3691
  }
3578
- }, _callee46, this);
3692
+ }, _callee47, this);
3579
3693
  }));
3580
3694
  function destroy() {
3581
3695
  return _destroy.apply(this, arguments);