@pisell/pisellos 0.10.90 → 0.10.93

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 (229) hide show
  1. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
  2. package/dist/model/strategy/adapter/itemRule/adapter.js +74 -7
  3. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
  4. package/dist/model/strategy/adapter/itemRule/evaluator.js +13 -0
  5. package/dist/model/strategy/adapter/itemRule/type.d.ts +40 -1
  6. package/dist/model/strategy/adapter/itemRule/type.js +10 -0
  7. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
  8. package/dist/model/strategy/adapter/promotion/evaluator.js +103 -112
  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 +21 -0
  14. package/dist/modules/BookingContext/utils/productExtend.js +132 -33
  15. package/dist/modules/BookingContext/utils/resources.js +1 -1
  16. package/dist/modules/Cart/index.js +4 -3
  17. package/dist/modules/Cart/types.d.ts +2 -0
  18. package/dist/modules/Cart/utils/cartProduct.d.ts +3 -1
  19. package/dist/modules/Cart/utils/cartProduct.js +59 -32
  20. package/dist/modules/Date/index.d.ts +1 -1
  21. package/dist/modules/Date/index.js +60 -14
  22. package/dist/modules/Date/types.d.ts +5 -0
  23. package/dist/modules/OpenData/salesSettings.js +1 -1
  24. package/dist/modules/OpenData/types.d.ts +9 -0
  25. package/dist/modules/OpenData/utils.d.ts +1 -1
  26. package/dist/modules/OpenData/utils.js +3 -2
  27. package/dist/modules/Order/index.d.ts +22 -7
  28. package/dist/modules/Order/index.js +1565 -1161
  29. package/dist/modules/Order/localEftposState.d.ts +13 -0
  30. package/dist/modules/Order/localEftposState.js +39 -0
  31. package/dist/modules/Order/types.d.ts +33 -11
  32. package/dist/modules/Order/types.js +2 -2
  33. package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
  34. package/dist/modules/Order/unpaidAmountGap.js +72 -0
  35. package/dist/modules/Order/utils.d.ts +4 -1
  36. package/dist/modules/Order/utils.js +75 -52
  37. package/dist/modules/Payment/walletpass.js +32 -6
  38. package/dist/modules/Product/index.d.ts +1 -1
  39. package/dist/modules/Product/types.d.ts +16 -0
  40. package/dist/modules/ProductList/index.js +1 -1
  41. package/dist/modules/ResourcePlanner/planner.d.ts +2 -0
  42. package/dist/modules/ResourcePlanner/planner.js +383 -24
  43. package/dist/modules/ResourcePlanner/types.d.ts +42 -0
  44. package/dist/modules/Rules/index.js +86 -54
  45. package/dist/modules/Schedule/index.d.ts +7 -1
  46. package/dist/modules/Schedule/index.js +155 -39
  47. package/dist/modules/Schedule/types.d.ts +2 -0
  48. package/dist/modules/bookingReadValidation.d.ts +6 -0
  49. package/dist/modules/bookingReadValidation.js +72 -0
  50. package/dist/plugins/request.d.ts +2 -0
  51. package/dist/server/index.d.ts +9 -0
  52. package/dist/server/index.js +1928 -1462
  53. package/dist/server/modules/form/index.d.ts +19 -0
  54. package/dist/server/modules/form/index.js +205 -0
  55. package/dist/server/modules/form/types.d.ts +13 -0
  56. package/dist/server/modules/form/types.js +3 -0
  57. package/dist/server/modules/index.d.ts +3 -0
  58. package/dist/server/modules/index.js +4 -0
  59. package/dist/server/modules/order/index.d.ts +21 -0
  60. package/dist/server/modules/order/index.js +1399 -831
  61. package/dist/server/modules/order/types.d.ts +3 -0
  62. package/dist/server/modules/order/utils/filterOrders.js +20 -0
  63. package/dist/server/modules/products/index.d.ts +28 -7
  64. package/dist/server/modules/products/index.js +1295 -769
  65. package/dist/server/modules/products/replication.d.ts +8 -0
  66. package/dist/server/modules/products/replication.js +69 -0
  67. package/dist/server/modules/products/types.d.ts +12 -1
  68. package/dist/server/modules/products/types.js +4 -0
  69. package/dist/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
  70. package/dist/shared/receipt/customerInvoiceLanguages.js +5 -3
  71. package/dist/shared/receipt/small-ticket.d.ts +1 -0
  72. package/dist/shared/receipt/small-ticket.js +58 -26
  73. package/dist/shared/receipt/templateVisibility.d.ts +3 -0
  74. package/dist/shared/receipt/templateVisibility.js +6 -2
  75. package/dist/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
  76. package/dist/solution/BaseSales/fulfillmentItemRules.js +750 -0
  77. package/dist/solution/BaseSales/index.d.ts +22 -6
  78. package/dist/solution/BaseSales/index.js +1881 -1347
  79. package/dist/solution/BaseSales/pickupTiming.d.ts +4 -0
  80. package/dist/solution/BaseSales/pickupTiming.js +35 -8
  81. package/dist/solution/BaseSales/types.d.ts +4 -0
  82. package/dist/solution/BaseSales/types.js +1 -0
  83. package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  84. package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
  85. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  86. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
  87. package/dist/solution/BookingByStep/index.d.ts +20 -4
  88. package/dist/solution/BookingByStep/index.js +681 -361
  89. package/dist/solution/BookingByStep/utils/resources.d.ts +10 -0
  90. package/dist/solution/BookingByStep/utils/resources.js +117 -76
  91. package/dist/solution/BookingTicket/index.d.ts +10 -0
  92. package/dist/solution/BookingTicket/index.js +686 -598
  93. package/dist/solution/BookingTicket/types.d.ts +1 -1
  94. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  95. package/dist/solution/BookingTicket/utils/addProductDecision.js +35 -8
  96. package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
  97. package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
  98. package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.js +188 -0
  99. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +58 -94
  100. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +1 -3
  101. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +33 -62
  102. package/dist/solution/OrderInvoicePreview/index.js +4 -3
  103. package/dist/solution/Sales/index.js +1 -1
  104. package/dist/solution/ScanOrder/index.d.ts +2 -0
  105. package/dist/solution/ScanOrder/index.js +230 -97
  106. package/dist/solution/ScanOrder/menuAvailability.d.ts +24 -0
  107. package/dist/solution/ScanOrder/menuAvailability.js +363 -0
  108. package/dist/solution/ScanOrder/types.d.ts +3 -0
  109. package/dist/solution/UnifiedBookingSales/index.d.ts +42 -10
  110. package/dist/solution/UnifiedBookingSales/index.js +2493 -1496
  111. package/dist/solution/UnifiedBookingSales/salesSettings.js +1 -1
  112. package/dist/solution/UnifiedBookingSales/types.d.ts +20 -5
  113. package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
  114. package/dist/utils/pos-receipt-auto-print.js +14 -0
  115. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
  116. package/lib/model/strategy/adapter/itemRule/adapter.js +54 -4
  117. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
  118. package/lib/model/strategy/adapter/itemRule/evaluator.js +9 -0
  119. package/lib/model/strategy/adapter/itemRule/type.d.ts +40 -1
  120. package/lib/model/strategy/adapter/itemRule/type.js +10 -0
  121. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
  122. package/lib/model/strategy/adapter/promotion/evaluator.js +22 -21
  123. package/lib/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
  124. package/lib/modules/BookingContext/utils/calendarBooking.js +156 -0
  125. package/lib/modules/BookingContext/utils/index.d.ts +1 -0
  126. package/lib/modules/BookingContext/utils/index.js +11 -0
  127. package/lib/modules/BookingContext/utils/productExtend.d.ts +21 -0
  128. package/lib/modules/BookingContext/utils/productExtend.js +104 -5
  129. package/lib/modules/BookingContext/utils/resources.js +1 -1
  130. package/lib/modules/Cart/index.js +4 -2
  131. package/lib/modules/Cart/types.d.ts +2 -0
  132. package/lib/modules/Cart/utils/cartProduct.d.ts +3 -1
  133. package/lib/modules/Cart/utils/cartProduct.js +39 -20
  134. package/lib/modules/Date/index.d.ts +1 -1
  135. package/lib/modules/Date/index.js +28 -5
  136. package/lib/modules/Date/types.d.ts +5 -0
  137. package/lib/modules/OpenData/salesSettings.js +1 -1
  138. package/lib/modules/OpenData/types.d.ts +9 -0
  139. package/lib/modules/OpenData/utils.d.ts +1 -1
  140. package/lib/modules/OpenData/utils.js +3 -2
  141. package/lib/modules/Order/index.d.ts +22 -7
  142. package/lib/modules/Order/index.js +457 -174
  143. package/lib/modules/Order/localEftposState.d.ts +13 -0
  144. package/lib/modules/Order/localEftposState.js +44 -0
  145. package/lib/modules/Order/types.d.ts +33 -11
  146. package/lib/modules/Order/types.js +2 -2
  147. package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
  148. package/lib/modules/Order/unpaidAmountGap.js +60 -0
  149. package/lib/modules/Order/utils.d.ts +4 -1
  150. package/lib/modules/Order/utils.js +29 -3
  151. package/lib/modules/Payment/walletpass.js +23 -1
  152. package/lib/modules/Product/index.d.ts +1 -1
  153. package/lib/modules/Product/types.d.ts +16 -0
  154. package/lib/modules/ProductList/index.js +1 -1
  155. package/lib/modules/ResourcePlanner/planner.d.ts +2 -0
  156. package/lib/modules/ResourcePlanner/planner.js +299 -9
  157. package/lib/modules/ResourcePlanner/types.d.ts +42 -0
  158. package/lib/modules/Rules/index.js +32 -3
  159. package/lib/modules/Schedule/index.d.ts +7 -1
  160. package/lib/modules/Schedule/index.js +68 -4
  161. package/lib/modules/Schedule/types.d.ts +2 -0
  162. package/lib/modules/bookingReadValidation.d.ts +6 -0
  163. package/lib/modules/bookingReadValidation.js +56 -0
  164. package/lib/plugins/request.d.ts +2 -0
  165. package/lib/server/index.d.ts +9 -0
  166. package/lib/server/index.js +279 -30
  167. package/lib/server/modules/form/index.d.ts +19 -0
  168. package/lib/server/modules/form/index.js +73 -0
  169. package/lib/server/modules/form/types.d.ts +13 -0
  170. package/lib/server/modules/form/types.js +9 -0
  171. package/lib/server/modules/index.d.ts +3 -0
  172. package/lib/server/modules/index.js +15 -1
  173. package/lib/server/modules/order/index.d.ts +21 -0
  174. package/lib/server/modules/order/index.js +344 -35
  175. package/lib/server/modules/order/types.d.ts +3 -0
  176. package/lib/server/modules/order/utils/filterOrders.js +18 -0
  177. package/lib/server/modules/products/index.d.ts +28 -7
  178. package/lib/server/modules/products/index.js +224 -62
  179. package/lib/server/modules/products/replication.d.ts +8 -0
  180. package/lib/server/modules/products/replication.js +30 -0
  181. package/lib/server/modules/products/types.d.ts +12 -1
  182. package/lib/server/modules/products/types.js +3 -0
  183. package/lib/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
  184. package/lib/shared/receipt/customerInvoiceLanguages.js +5 -3
  185. package/lib/shared/receipt/small-ticket.d.ts +1 -0
  186. package/lib/shared/receipt/small-ticket.js +53 -25
  187. package/lib/shared/receipt/templateVisibility.d.ts +3 -0
  188. package/lib/shared/receipt/templateVisibility.js +6 -2
  189. package/lib/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
  190. package/lib/solution/BaseSales/fulfillmentItemRules.js +259 -0
  191. package/lib/solution/BaseSales/index.d.ts +22 -6
  192. package/lib/solution/BaseSales/index.js +347 -59
  193. package/lib/solution/BaseSales/pickupTiming.d.ts +4 -0
  194. package/lib/solution/BaseSales/pickupTiming.js +24 -3
  195. package/lib/solution/BaseSales/types.d.ts +4 -0
  196. package/lib/solution/BaseSales/types.js +1 -0
  197. package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  198. package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
  199. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  200. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
  201. package/lib/solution/BookingByStep/index.d.ts +20 -4
  202. package/lib/solution/BookingByStep/index.js +229 -17
  203. package/lib/solution/BookingByStep/utils/resources.d.ts +10 -0
  204. package/lib/solution/BookingByStep/utils/resources.js +25 -15
  205. package/lib/solution/BookingTicket/index.d.ts +10 -0
  206. package/lib/solution/BookingTicket/index.js +57 -6
  207. package/lib/solution/BookingTicket/types.d.ts +1 -1
  208. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  209. package/lib/solution/BookingTicket/utils/addProductDecision.js +34 -4
  210. package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
  211. package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
  212. package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.js +136 -0
  213. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -14
  214. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +1 -3
  215. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +17 -34
  216. package/lib/solution/OrderInvoicePreview/index.js +1 -0
  217. package/lib/solution/Sales/index.js +1 -1
  218. package/lib/solution/ScanOrder/index.d.ts +2 -0
  219. package/lib/solution/ScanOrder/index.js +131 -22
  220. package/lib/solution/ScanOrder/menuAvailability.d.ts +24 -0
  221. package/lib/solution/ScanOrder/menuAvailability.js +203 -0
  222. package/lib/solution/ScanOrder/types.d.ts +3 -0
  223. package/lib/solution/UnifiedBookingSales/index.d.ts +42 -10
  224. package/lib/solution/UnifiedBookingSales/index.js +717 -144
  225. package/lib/solution/UnifiedBookingSales/salesSettings.js +1 -1
  226. package/lib/solution/UnifiedBookingSales/types.d.ts +20 -5
  227. package/lib/utils/pos-receipt-auto-print.d.ts +4 -0
  228. package/lib/utils/pos-receipt-auto-print.js +13 -0
  229. package/package.json +1 -1
@@ -210,7 +210,7 @@ export function applyGlobalScan(_x14, _x15, _x16) {
210
210
  }
211
211
  function _applyGlobalScan() {
212
212
  _applyGlobalScan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(host, formatted, bridge) {
213
- var searchType, data, scanCode, formattedCustomerId, isCrossShopWallet, isWalletPassUnavailableAtStore, _getRealCustomerId, _bridge$onNotify5, currentCustomer, currentCustomerId, _customer, sourceCustomerId, _bridge$onNotify, _bridge$onNotify2, _customerId, _bridge$onNotify3, orderCustomer, switched, _bridge$onNotify4, _collectionPromotion$, _promotionResult$isAc, _bridge$onNotify6, snapshot, activeCustomer, bindWalletPassCustomer, trySelectWalletAsset, bindResult, collectionPromotion, walletSelection, promotionCustomerId, promotionResult, list, _bridge$onNotify12, addedCount, _iterator, _step, _item, outcome, _bridge$onNotify13, _data$order_id, _data$business_code, orderId, _bridge$onNotify14;
213
+ var searchType, data, scanCode, formattedCustomerId, isCrossShopWallet, isWalletPassUnavailableAtStore, _getRealCustomerId, _bridge$onNotify5, currentCustomer, currentCustomerId, _customer, sourceCustomerId, _bridge$onNotify, _bridge$onNotify2, _customerId, _bridge$onNotify3, orderCustomer, switched, _bridge$onNotify4, _promotionResult$isAc, _bridge$onNotify6, snapshot, activeCustomer, bindWalletPassCustomer, trySelectWalletAsset, bindResult, walletSelection, promotionCustomerId, promotionResult, list, _bridge$onNotify12, addedCount, _iterator, _step, _item, outcome, _bridge$onNotify13, _data$order_id, _data$business_code, orderId, _bridge$onNotify14;
214
214
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
215
215
  while (1) switch (_context6.prev = _context6.next) {
216
216
  case 0:
@@ -321,7 +321,7 @@ function _applyGlobalScan() {
321
321
  });
322
322
  case 44:
323
323
  if (!(searchType === 'walletPass')) {
324
- _context6.next = 93;
324
+ _context6.next = 78;
325
325
  break;
326
326
  }
327
327
  if (!isWalletPassUnavailableAtStore) {
@@ -495,111 +495,75 @@ function _applyGlobalScan() {
495
495
  return bindWalletPassCustomer();
496
496
  case 54:
497
497
  bindResult = _context6.sent;
498
- if (!((bridge === null || bridge === void 0 ? void 0 : bridge.scanScope) === 'product-voucher-collection' && bridge.applyPromotionCode)) {
499
- _context6.next = 61;
500
- break;
501
- }
502
- _context6.next = 58;
503
- return bridge.applyPromotionCode(scanCode, getRealCustomerId(activeCustomer), {
504
- suppressFailureNotification: true,
505
- productVouchersOnly: true
506
- });
507
- case 58:
508
- _context6.t2 = _context6.sent;
509
- _context6.next = 62;
510
- break;
511
- case 61:
512
- _context6.t2 = undefined;
513
- case 62:
514
- collectionPromotion = _context6.t2;
515
- if (!((_collectionPromotion$ = collectionPromotion === null || collectionPromotion === void 0 ? void 0 : collectionPromotion.isAccepted) !== null && _collectionPromotion$ !== void 0 ? _collectionPromotion$ : collectionPromotion === null || collectionPromotion === void 0 ? void 0 : collectionPromotion.isAvailable)) {
516
- _context6.next = 65;
517
- break;
518
- }
519
- return _context6.abrupt("return", {
520
- status: 'success',
521
- kind: 'promotion'
522
- });
523
- case 65:
524
- _context6.next = 67;
498
+ _context6.next = 57;
525
499
  return trySelectWalletAsset();
526
- case 67:
500
+ case 57:
527
501
  walletSelection = _context6.sent;
528
502
  if (!walletSelection) {
529
- _context6.next = 70;
503
+ _context6.next = 60;
530
504
  break;
531
505
  }
532
506
  return _context6.abrupt("return", walletSelection);
533
- case 70:
507
+ case 60:
534
508
  if (bridge !== null && bridge !== void 0 && bridge.applyPromotionCode) {
535
- _context6.next = 72;
509
+ _context6.next = 62;
536
510
  break;
537
511
  }
538
512
  return _context6.abrupt("return", {
539
513
  status: 'failed',
540
514
  reason: 'no_bridge'
541
515
  });
542
- case 72:
516
+ case 62:
543
517
  promotionCustomerId = getRealCustomerId(activeCustomer);
544
- if (!(collectionPromotion !== null && collectionPromotion !== void 0)) {
545
- _context6.next = 77;
546
- break;
547
- }
548
- _context6.t3 = collectionPromotion;
549
- _context6.next = 87;
550
- break;
551
- case 77:
552
518
  if (!bindResult.customerBound) {
553
- _context6.next = 83;
519
+ _context6.next = 69;
554
520
  break;
555
521
  }
556
- _context6.next = 80;
522
+ _context6.next = 66;
557
523
  return bridge.applyPromotionCode(scanCode, promotionCustomerId, {
558
524
  suppressFailureNotification: true
559
525
  });
560
- case 80:
561
- _context6.t4 = _context6.sent;
562
- _context6.next = 86;
526
+ case 66:
527
+ _context6.t2 = _context6.sent;
528
+ _context6.next = 72;
563
529
  break;
564
- case 83:
565
- _context6.next = 85;
530
+ case 69:
531
+ _context6.next = 71;
566
532
  return bridge.applyPromotionCode(scanCode, promotionCustomerId);
567
- case 85:
568
- _context6.t4 = _context6.sent;
569
- case 86:
570
- _context6.t3 = _context6.t4;
571
- case 87:
572
- promotionResult = _context6.t3;
533
+ case 71:
534
+ _context6.t2 = _context6.sent;
535
+ case 72:
536
+ promotionResult = _context6.t2;
573
537
  if (!((_promotionResult$isAc = promotionResult === null || promotionResult === void 0 ? void 0 : promotionResult.isAccepted) !== null && _promotionResult$isAc !== void 0 ? _promotionResult$isAc : promotionResult === null || promotionResult === void 0 ? void 0 : promotionResult.isAvailable)) {
574
- _context6.next = 90;
538
+ _context6.next = 75;
575
539
  break;
576
540
  }
577
541
  return _context6.abrupt("return", {
578
542
  status: 'success',
579
543
  kind: 'promotion'
580
544
  });
581
- case 90:
545
+ case 75:
582
546
  if (!bindResult.customerBound) {
583
- _context6.next = 92;
547
+ _context6.next = 77;
584
548
  break;
585
549
  }
586
550
  return _context6.abrupt("return", {
587
551
  status: 'success',
588
552
  kind: 'customer'
589
553
  });
590
- case 92:
554
+ case 77:
591
555
  return _context6.abrupt("return", {
592
556
  status: 'failed',
593
557
  reason: 'invalid_data'
594
558
  });
595
- case 93:
559
+ case 78:
596
560
  if (!(searchType === 'product' || searchType === 'local_product')) {
597
- _context6.next = 126;
561
+ _context6.next = 111;
598
562
  break;
599
563
  }
600
564
  list = data === null || data === void 0 ? void 0 : data.list;
601
565
  if (!(!Array.isArray(list) || list.length === 0)) {
602
- _context6.next = 98;
566
+ _context6.next = 83;
603
567
  break;
604
568
  }
605
569
  bridge === null || bridge === void 0 || (_bridge$onNotify12 = bridge.onNotify) === null || _bridge$onNotify12 === void 0 || _bridge$onNotify12.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
@@ -607,57 +571,57 @@ function _applyGlobalScan() {
607
571
  status: 'failed',
608
572
  reason: 'invalid_data'
609
573
  });
610
- case 98:
574
+ case 83:
611
575
  addedCount = 0;
612
576
  _iterator = _createForOfIteratorHelper(list);
613
- _context6.prev = 100;
577
+ _context6.prev = 85;
614
578
  _iterator.s();
615
- case 102:
579
+ case 87:
616
580
  if ((_step = _iterator.n()).done) {
617
- _context6.next = 114;
581
+ _context6.next = 99;
618
582
  break;
619
583
  }
620
584
  _item = _step.value;
621
- _context6.next = 106;
585
+ _context6.next = 91;
622
586
  return processScannedProductItem(host, _item, scanCode, bridge);
623
- case 106:
587
+ case 91:
624
588
  outcome = _context6.sent;
625
589
  if (outcome === 'added') {
626
590
  addedCount += 1;
627
591
  }
628
592
  if (!(outcome === 'cancelled')) {
629
- _context6.next = 110;
593
+ _context6.next = 95;
630
594
  break;
631
595
  }
632
596
  return _context6.abrupt("return", {
633
597
  status: 'cancelled'
634
598
  });
635
- case 110:
599
+ case 95:
636
600
  if (!(outcome === 'pending')) {
637
- _context6.next = 112;
601
+ _context6.next = 97;
638
602
  break;
639
603
  }
640
604
  return _context6.abrupt("return", {
641
605
  status: 'pending',
642
606
  kind: 'requiresDetail'
643
607
  });
644
- case 112:
645
- _context6.next = 102;
608
+ case 97:
609
+ _context6.next = 87;
646
610
  break;
647
- case 114:
648
- _context6.next = 119;
611
+ case 99:
612
+ _context6.next = 104;
649
613
  break;
650
- case 116:
651
- _context6.prev = 116;
652
- _context6.t5 = _context6["catch"](100);
653
- _iterator.e(_context6.t5);
654
- case 119:
655
- _context6.prev = 119;
614
+ case 101:
615
+ _context6.prev = 101;
616
+ _context6.t3 = _context6["catch"](85);
617
+ _iterator.e(_context6.t3);
618
+ case 104:
619
+ _context6.prev = 104;
656
620
  _iterator.f();
657
- return _context6.finish(119);
658
- case 122:
621
+ return _context6.finish(104);
622
+ case 107:
659
623
  if (!(addedCount > 0)) {
660
- _context6.next = 125;
624
+ _context6.next = 110;
661
625
  break;
662
626
  }
663
627
  bridge === null || bridge === void 0 || (_bridge$onNotify13 = bridge.onNotify) === null || _bridge$onNotify13 === void 0 || _bridge$onNotify13.call(bridge, 'success');
@@ -668,19 +632,19 @@ function _applyGlobalScan() {
668
632
  count: addedCount
669
633
  }
670
634
  });
671
- case 125:
635
+ case 110:
672
636
  return _context6.abrupt("return", {
673
637
  status: 'failed',
674
638
  reason: 'no_bridge'
675
639
  });
676
- case 126:
640
+ case 111:
677
641
  if (!(searchType === 'order')) {
678
- _context6.next = 135;
642
+ _context6.next = 120;
679
643
  break;
680
644
  }
681
645
  orderId = (_data$order_id = data === null || data === void 0 ? void 0 : data.order_id) !== null && _data$order_id !== void 0 ? _data$order_id : data === null || data === void 0 ? void 0 : data.id;
682
646
  if (orderId) {
683
- _context6.next = 131;
647
+ _context6.next = 116;
684
648
  break;
685
649
  }
686
650
  bridge === null || bridge === void 0 || (_bridge$onNotify14 = bridge.onNotify) === null || _bridge$onNotify14 === void 0 || _bridge$onNotify14.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
@@ -688,16 +652,16 @@ function _applyGlobalScan() {
688
652
  status: 'failed',
689
653
  reason: 'invalid_data'
690
654
  });
691
- case 131:
655
+ case 116:
692
656
  if (bridge !== null && bridge !== void 0 && bridge.openOrder) {
693
- _context6.next = 133;
657
+ _context6.next = 118;
694
658
  break;
695
659
  }
696
660
  return _context6.abrupt("return", {
697
661
  status: 'pending',
698
662
  kind: 'openOrder'
699
663
  });
700
- case 133:
664
+ case 118:
701
665
  bridge.openOrder({
702
666
  order_id: Number(orderId),
703
667
  business_code: (_data$business_code = data === null || data === void 0 ? void 0 : data.business_code) !== null && _data$business_code !== void 0 ? _data$business_code : host.getBusinessCode()
@@ -706,16 +670,16 @@ function _applyGlobalScan() {
706
670
  status: 'pending',
707
671
  kind: 'openOrder'
708
672
  });
709
- case 135:
673
+ case 120:
710
674
  return _context6.abrupt("return", {
711
675
  status: 'failed',
712
676
  reason: 'invalid_data'
713
677
  });
714
- case 136:
678
+ case 121:
715
679
  case "end":
716
680
  return _context6.stop();
717
681
  }
718
- }, _callee6, null, [[10, 16], [30, 37], [100, 116, 119, 122]]);
682
+ }, _callee6, null, [[10, 16], [30, 37], [85, 101, 104, 107]]);
719
683
  }));
720
684
  return _applyGlobalScan.apply(this, arguments);
721
685
  }
@@ -2,9 +2,7 @@ import type { GlobalScanHandleResult, GlobalScanHostBridge } from '../../types';
2
2
  import { type GlobalScanApplyHost } from './applyGlobalScan';
3
3
  import type { GlobalScanFormattedResult } from './formatGlobalScan';
4
4
  export interface ProductVoucherCollectionScanHost extends GlobalScanApplyHost {
5
- waitForCustomerDiscounts(): Promise<void>;
6
5
  loadCustomerDiscounts(): Promise<Record<string, any>[]>;
7
6
  }
8
- /** Collect voucher candidates after customer binding and coupon loading finish.
9
- * Never expand a wristband's result to other orders of the same customer. */
7
+ /** Resolve the scanned account, then collect all of that customer's vouchers. */
10
8
  export declare function applyProductVoucherCollectionScan(host: ProductVoucherCollectionScanHost, formatted: GlobalScanFormattedResult, bridge: GlobalScanHostBridge): Promise<GlobalScanHandleResult>;
@@ -8,14 +8,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
8
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
9
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
10
  import { applyGlobalScan } from "./applyGlobalScan";
11
- /** Collect voucher candidates after customer binding and coupon loading finish.
12
- * Never expand a wristband's result to other orders of the same customer. */
11
+ /** Resolve the scanned account, then collect all of that customer's vouchers. */
13
12
  export function applyProductVoucherCollectionScan(_x, _x2, _x3) {
14
13
  return _applyProductVoucherCollectionScan.apply(this, arguments);
15
14
  }
16
15
  function _applyProductVoucherCollectionScan() {
17
16
  _applyProductVoucherCollectionScan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(host, formatted, bridge) {
18
- var assertCurrent, vouchers, result;
17
+ var _ref, _formatted$customerId, _formatted$data, _formatted$data2, _bridge$requestCustom;
18
+ var assertCurrent, isPass, customerScan, result, vouchers;
19
19
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
20
20
  while (1) switch (_context2.prev = _context2.next) {
21
21
  case 0:
@@ -25,9 +25,16 @@ function _applyProductVoucherCollectionScan() {
25
25
  throw new DOMException('Scan session ended', 'AbortError');
26
26
  }
27
27
  };
28
- vouchers = [];
28
+ isPass = formatted.searchType === 'walletPass'; // Order numbers and wristbands resolve through batch-search. Their returned
29
+ // passes identify the customer; they are not the collection's voucher list.
30
+ // Resolve source-shop IDs before reusing the wallet customer-binding flow.
31
+ customerScan = isPass ? _objectSpread(_objectSpread({}, formatted), {}, {
32
+ searchType: 'wallet',
33
+ customerId: (_ref = (_formatted$customerId = formatted.customerId) !== null && _formatted$customerId !== void 0 ? _formatted$customerId : (_formatted$data = formatted.data) === null || _formatted$data === void 0 ? void 0 : _formatted$data.id) !== null && _ref !== void 0 ? _ref : (_formatted$data2 = formatted.data) === null || _formatted$data2 === void 0 ? void 0 : _formatted$data2.customer_id,
34
+ isCrossShopWallet: true
35
+ }) : formatted;
29
36
  assertCurrent();
30
- _context2.next = 5;
37
+ _context2.next = 6;
31
38
  return applyGlobalScan(_objectSpread(_objectSpread({}, host), {}, {
32
39
  setOrderCustomer: function setOrderCustomer(customer) {
33
40
  assertCurrent();
@@ -37,77 +44,41 @@ function _applyProductVoucherCollectionScan() {
37
44
  assertCurrent();
38
45
  return host.addProductToOrder(product, booking);
39
46
  }
40
- }), formatted, _objectSpread(_objectSpread({}, bridge), {}, {
41
- applyPromotionCode: bridge.applyPromotionCode && ( /*#__PURE__*/function () {
42
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, customerId, options) {
43
- var promotion;
44
- return _regeneratorRuntime().wrap(function _callee$(_context) {
45
- while (1) switch (_context.prev = _context.next) {
46
- case 0:
47
- _context.next = 2;
48
- return host.waitForCustomerDiscounts();
49
- case 2:
50
- assertCurrent();
51
- _context.next = 5;
52
- return bridge.applyPromotionCode(code, customerId, _objectSpread(_objectSpread({}, options), {}, {
53
- productVouchersOnly: true,
54
- suppressFailureNotification: true
55
- }));
56
- case 5:
57
- promotion = _context.sent;
58
- assertCurrent();
59
- // An empty successful search is different from a swallowed request error.
60
- if (Array.isArray(promotion.scannedDiscountList)) {
61
- _context.next = 9;
62
- break;
63
- }
64
- throw new Error('Could not resolve scanned vouchers');
65
- case 9:
66
- vouchers = promotion.scannedDiscountList;
67
- return _context.abrupt("return", promotion);
68
- case 11:
69
- case "end":
70
- return _context.stop();
71
- }
72
- }, _callee);
73
- }));
74
- return function (_x4, _x5, _x6) {
75
- return _ref.apply(this, arguments);
76
- };
77
- }())
47
+ }), customerScan, _objectSpread(_objectSpread({}, bridge), {}, {
48
+ // Without a switch bridge, do not return the previous customer's vouchers.
49
+ requestCustomerSwitch: (_bridge$requestCustom = bridge.requestCustomerSwitch) !== null && _bridge$requestCustom !== void 0 ? _bridge$requestCustom : /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
50
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
51
+ while (1) switch (_context.prev = _context.next) {
52
+ case 0:
53
+ return _context.abrupt("return", false);
54
+ case 1:
55
+ case "end":
56
+ return _context.stop();
57
+ }
58
+ }, _callee);
59
+ }))
78
60
  }));
79
- case 5:
61
+ case 6:
80
62
  result = _context2.sent;
81
63
  assertCurrent();
82
- if (!(formatted.searchType === 'wallet' && result.status === 'success')) {
83
- _context2.next = 13;
64
+ if (!(customerScan.searchType === 'wallet' && result.status === 'success')) {
65
+ _context2.next = 14;
84
66
  break;
85
67
  }
86
- _context2.next = 10;
68
+ _context2.next = 11;
87
69
  return host.loadCustomerDiscounts();
88
- case 10:
70
+ case 11:
89
71
  vouchers = _context2.sent;
90
72
  assertCurrent();
91
73
  return _context2.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
92
74
  redemption: {
93
- source: 'wallet',
75
+ source: isPass ? 'scan' : 'wallet',
94
76
  vouchers: vouchers
95
77
  }
96
78
  }));
97
- case 13:
98
- if (!(formatted.searchType === 'walletPass')) {
99
- _context2.next = 15;
100
- break;
101
- }
102
- return _context2.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
103
- redemption: {
104
- source: 'scan',
105
- vouchers: vouchers
106
- }
107
- }));
108
- case 15:
79
+ case 14:
109
80
  return _context2.abrupt("return", result);
110
- case 16:
81
+ case 15:
111
82
  case "end":
112
83
  return _context2.stop();
113
84
  }
@@ -216,13 +216,14 @@ export var OrderInvoicePreviewImpl = /*#__PURE__*/function (_BaseModule) {
216
216
  tax_country_code: getData('tax_country_code')
217
217
  } : {});
218
218
  shop.default_domain || (shop.default_domain = shopCore.default_domain);
219
+ shop.private_domain || (shop.private_domain = shopCore.private_domain);
219
220
  shop.private_domain_protocol || (shop.private_domain_protocol = shopCore.private_domain_protocol);
220
221
  if (!(generation !== _this3.generation || _this3.disposed)) {
221
- _context.next = 20;
222
+ _context.next = 21;
222
223
  break;
223
224
  }
224
225
  throw new Error('Invoice request superseded');
225
- case 20:
226
+ case 21:
226
227
  languageOptions = resolveCustomerInvoiceLanguages(template.language, input.locale);
227
228
  remembered = (_this3$languageSelect = _this3.languageSelection) === null || _this3$languageSelect === void 0 ? void 0 : _this3$languageSelect.code;
228
229
  selected = languageOptions.find(function (option) {
@@ -259,7 +260,7 @@ export var OrderInvoicePreviewImpl = /*#__PURE__*/function (_BaseModule) {
259
260
  error: null
260
261
  });
261
262
  return _context.abrupt("return", result);
262
- case 27:
263
+ case 28:
263
264
  case "end":
264
265
  return _context.stop();
265
266
  }
@@ -442,7 +442,7 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
442
442
  } : {
443
443
  external_sale_number: normalizedLookup
444
444
  };
445
- return _context6.abrupt("return", this.request.post('/local/print-order', _objectSpread(_objectSpread({}, lookupPayload), {}, {
445
+ return _context6.abrupt("return", this.request.post('/shop/local/print-order', _objectSpread(_objectSpread({}, lookupPayload), {}, {
446
446
  lookup_order_from_db: 1,
447
447
  small_ticket_data_flag: 1,
448
448
  business_code: businessCode,
@@ -100,6 +100,8 @@ export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
100
100
  private buildSubmitPayloadEnhancer;
101
101
  private isScanOrderMoreMode;
102
102
  private submitScanOrderMore;
103
+ /** Read both current and legacy cart snapshots without changing the product catalog. */
104
+ private getMenuAvailabilityProductSources;
103
105
  submitScanOrder<T = any>(): Promise<T>;
104
106
  addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
105
107
  updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;