@pisell/pisellos 2.3.128 → 2.3.130

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 (160) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +3 -1
  3. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  4. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  5. package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -2
  6. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +58 -19
  7. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +24 -12
  8. package/dist/modules/Customer/index.js +6 -3
  9. package/dist/modules/Customer/types.d.ts +2 -0
  10. package/dist/modules/Discount/availability.d.ts +7 -0
  11. package/dist/modules/Discount/availability.js +49 -0
  12. package/dist/modules/Discount/entitlementPass.d.ts +34 -0
  13. package/dist/modules/Discount/entitlementPass.js +147 -0
  14. package/dist/modules/Discount/index.d.ts +2 -2
  15. package/dist/modules/Discount/index.js +37 -151
  16. package/dist/modules/Discount/types.d.ts +36 -5
  17. package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
  18. package/dist/modules/FulfillmentTiming/index.js +407 -0
  19. package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
  20. package/dist/modules/FulfillmentTiming/types.js +1 -0
  21. package/dist/modules/OpenData/types.d.ts +6 -0
  22. package/dist/modules/Order/index.d.ts +12 -0
  23. package/dist/modules/Order/index.js +498 -247
  24. package/dist/modules/Order/pickupTiming.d.ts +46 -0
  25. package/dist/modules/Order/pickupTiming.js +53 -0
  26. package/dist/modules/Order/types.d.ts +5 -1
  27. package/dist/modules/Order/utils/orderCollectionIdentity.js +16 -12
  28. package/dist/modules/Order/utils.d.ts +1 -1
  29. package/dist/modules/Order/utils.js +117 -66
  30. package/dist/modules/Payment/index.js +9 -10
  31. package/dist/modules/Payment/types.d.ts +21 -1
  32. package/dist/modules/Payment/types.js +2 -0
  33. package/dist/modules/Payment/walletpass.d.ts +1 -1
  34. package/dist/modules/Payment/walletpass.js +80 -47
  35. package/dist/modules/Rules/index.d.ts +2 -2
  36. package/dist/modules/Rules/index.js +480 -186
  37. package/dist/modules/Rules/types.d.ts +4 -0
  38. package/dist/modules/Schedule/index.d.ts +8 -0
  39. package/dist/modules/Schedule/index.js +141 -39
  40. package/dist/modules/index.d.ts +1 -0
  41. package/dist/modules/index.js +1 -0
  42. package/dist/plugins/request.d.ts +7 -0
  43. package/dist/server/modules/order/types.d.ts +2 -0
  44. package/dist/server/utils/small-ticket.d.ts +1 -85
  45. package/dist/server/utils/small-ticket.js +2 -2542
  46. package/dist/shared/payment/loadPaymentMethods.d.ts +9 -0
  47. package/dist/shared/payment/loadPaymentMethods.js +66 -0
  48. package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts +22 -0
  49. package/dist/shared/receipt/loadCustomerInvoiceLayout.js +142 -0
  50. package/dist/shared/receipt/small-ticket.d.ts +85 -0
  51. package/dist/shared/receipt/small-ticket.js +2576 -0
  52. package/dist/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
  53. package/dist/shared/sales/loadSalesOrderSnapshot.js +21 -0
  54. package/dist/solution/BaseSales/index.d.ts +25 -0
  55. package/dist/solution/BaseSales/index.js +1226 -1040
  56. package/dist/solution/BaseSales/pickupTiming.d.ts +43 -0
  57. package/dist/solution/BaseSales/pickupTiming.js +589 -0
  58. package/dist/solution/BaseSales/types.d.ts +2 -2
  59. package/dist/solution/BaseSales/utils/cartPromotion.js +141 -126
  60. package/dist/solution/BaseSales/utils/parseSalesResponse.js +3 -0
  61. package/dist/solution/BookingByStep/index.d.ts +1 -1
  62. package/dist/solution/BookingTicket/index.d.ts +4 -5
  63. package/dist/solution/BookingTicket/index.js +60 -63
  64. package/dist/solution/BookingTicket/types.d.ts +5 -1
  65. package/dist/solution/BookingTicket/utils/cartView.js +3 -1
  66. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
  67. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +338 -147
  68. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
  69. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
  70. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +19 -6
  71. package/dist/solution/OrderInvoicePreview/index.d.ts +56 -0
  72. package/dist/solution/OrderInvoicePreview/index.js +269 -0
  73. package/dist/solution/ShopDiscount/index.d.ts +2 -0
  74. package/dist/solution/ShopDiscount/index.js +99 -42
  75. package/dist/solution/ShopDiscount/utils.d.ts +4 -2
  76. package/dist/solution/ShopDiscount/utils.js +43 -23
  77. package/dist/solution/UnifiedBookingSales/index.d.ts +13 -4
  78. package/dist/solution/UnifiedBookingSales/index.js +874 -709
  79. package/dist/solution/index.d.ts +1 -0
  80. package/dist/solution/index.js +2 -1
  81. package/lib/index.d.ts +2 -0
  82. package/lib/index.js +21 -1
  83. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  84. package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -0
  85. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +35 -6
  86. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +13 -6
  87. package/lib/modules/Customer/index.js +5 -1
  88. package/lib/modules/Customer/types.d.ts +2 -0
  89. package/lib/modules/Discount/availability.d.ts +7 -0
  90. package/lib/modules/Discount/availability.js +43 -0
  91. package/lib/modules/Discount/entitlementPass.d.ts +34 -0
  92. package/lib/modules/Discount/entitlementPass.js +141 -0
  93. package/lib/modules/Discount/index.d.ts +2 -2
  94. package/lib/modules/Discount/index.js +23 -129
  95. package/lib/modules/Discount/types.d.ts +36 -5
  96. package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
  97. package/lib/modules/FulfillmentTiming/index.js +359 -0
  98. package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
  99. package/lib/modules/FulfillmentTiming/types.js +5 -0
  100. package/lib/modules/OpenData/types.d.ts +6 -0
  101. package/lib/modules/Order/index.d.ts +12 -0
  102. package/lib/modules/Order/index.js +252 -48
  103. package/lib/modules/Order/pickupTiming.d.ts +46 -0
  104. package/lib/modules/Order/pickupTiming.js +61 -0
  105. package/lib/modules/Order/types.d.ts +5 -1
  106. package/lib/modules/Order/utils/orderCollectionIdentity.js +14 -11
  107. package/lib/modules/Order/utils.d.ts +1 -1
  108. package/lib/modules/Order/utils.js +51 -7
  109. package/lib/modules/Payment/index.js +3 -4
  110. package/lib/modules/Payment/types.d.ts +21 -1
  111. package/lib/modules/Payment/types.js +1 -0
  112. package/lib/modules/Payment/walletpass.d.ts +1 -1
  113. package/lib/modules/Payment/walletpass.js +29 -9
  114. package/lib/modules/Rules/index.d.ts +2 -2
  115. package/lib/modules/Rules/index.js +357 -110
  116. package/lib/modules/Rules/types.d.ts +4 -0
  117. package/lib/modules/Schedule/index.d.ts +8 -0
  118. package/lib/modules/Schedule/index.js +68 -12
  119. package/lib/modules/index.d.ts +1 -0
  120. package/lib/modules/index.js +11 -0
  121. package/lib/plugins/request.d.ts +7 -0
  122. package/lib/server/modules/order/types.d.ts +2 -0
  123. package/lib/server/utils/small-ticket.d.ts +1 -85
  124. package/lib/server/utils/small-ticket.js +9 -2305
  125. package/lib/shared/payment/loadPaymentMethods.d.ts +9 -0
  126. package/lib/shared/payment/loadPaymentMethods.js +40 -0
  127. package/lib/shared/receipt/loadCustomerInvoiceLayout.d.ts +22 -0
  128. package/lib/shared/receipt/loadCustomerInvoiceLayout.js +86 -0
  129. package/lib/shared/receipt/small-ticket.d.ts +85 -0
  130. package/lib/shared/receipt/small-ticket.js +2342 -0
  131. package/lib/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
  132. package/lib/shared/sales/loadSalesOrderSnapshot.js +22 -0
  133. package/lib/solution/BaseSales/index.d.ts +25 -0
  134. package/lib/solution/BaseSales/index.js +102 -3
  135. package/lib/solution/BaseSales/pickupTiming.d.ts +43 -0
  136. package/lib/solution/BaseSales/pickupTiming.js +269 -0
  137. package/lib/solution/BaseSales/types.d.ts +2 -2
  138. package/lib/solution/BaseSales/utils/cartPromotion.js +12 -4
  139. package/lib/solution/BaseSales/utils/parseSalesResponse.js +3 -0
  140. package/lib/solution/BookingByStep/index.d.ts +1 -1
  141. package/lib/solution/BookingTicket/index.d.ts +4 -5
  142. package/lib/solution/BookingTicket/index.js +36 -33
  143. package/lib/solution/BookingTicket/types.d.ts +5 -1
  144. package/lib/solution/BookingTicket/utils/cartView.js +3 -1
  145. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
  146. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +174 -42
  147. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
  148. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
  149. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +11 -3
  150. package/lib/solution/OrderInvoicePreview/index.d.ts +56 -0
  151. package/lib/solution/OrderInvoicePreview/index.js +192 -0
  152. package/lib/solution/ShopDiscount/index.d.ts +2 -0
  153. package/lib/solution/ShopDiscount/index.js +55 -9
  154. package/lib/solution/ShopDiscount/utils.d.ts +4 -2
  155. package/lib/solution/ShopDiscount/utils.js +42 -25
  156. package/lib/solution/UnifiedBookingSales/index.d.ts +13 -4
  157. package/lib/solution/UnifiedBookingSales/index.js +132 -48
  158. package/lib/solution/index.d.ts +1 -0
  159. package/lib/solution/index.js +11 -0
  160. package/package.json +1 -1
@@ -182,6 +182,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
182
182
  _defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshCustomerId", null);
183
183
  _defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshTarget", null);
184
184
  _defineProperty(_assertThisInitialized(_this), "orderCustomerPromotionRefreshInFlight", null);
185
+ _defineProperty(_assertThisInitialized(_this), "customerResolveRequests", new Map());
185
186
  _defineProperty(_assertThisInitialized(_this), "loadOpenDataInFlight", null);
186
187
  _defineProperty(_assertThisInitialized(_this), "loadOpenDataInFlightTarget", null);
187
188
  _defineProperty(_assertThisInitialized(_this), "openDataTarget", null);
@@ -756,31 +757,43 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
756
757
  hasOrderCustomer = Boolean(this.store.order.getOrderCustomer());
757
758
  isUserPlatform = USER_PLATFORM.includes(this.otherParams.platform); // 缺 Holder 等场景 isAvailable=false,但仍需把 Pass 归属客户带入订单,供 Holder 弹窗使用。
758
759
  if (!(!hasOrderCustomer && extractedCustomerId && !isUserPlatform)) {
759
- _context10.next = 12;
760
+ _context10.next = 18;
760
761
  break;
761
762
  }
762
- _context10.next = 12;
763
+ _context10.prev = 10;
764
+ _context10.next = 13;
763
765
  return this.hydrateOrderCustomerFromScanDiscounts(scannedList);
764
- case 12:
766
+ case 13:
767
+ _context10.next = 18;
768
+ break;
769
+ case 15:
770
+ _context10.prev = 15;
771
+ _context10.t0 = _context10["catch"](10);
772
+ // 客户映射失败不能阻断原有 Pass 的可用性、展示或优惠处理。
773
+ console.warn('[BookingTicket] scan discount customer resolve failed', {
774
+ customerId: extractedCustomerId,
775
+ error: _context10.t0
776
+ });
777
+ case 18:
765
778
  if (!raw.isAvailable) {
766
- _context10.next = 19;
779
+ _context10.next = 25;
767
780
  break;
768
781
  }
769
- _context10.next = 15;
782
+ _context10.next = 21;
770
783
  return this.store.order.recalculateSummary({
771
784
  createIfMissing: true
772
785
  });
773
- case 15:
786
+ case 21:
774
787
  this.store.order.persistTempOrder();
775
788
  tempOrder = this.store.order.ensureTempOrder();
776
- _context10.next = 19;
789
+ _context10.next = 25;
777
790
  return this.effectsEmit('onDiscountApplied', {
778
791
  productList: tempOrder.products || [],
779
792
  discountList: this.store.order.getDiscountList(),
780
793
  selectedDiscountList: tempOrder.discount_list || [],
781
794
  tempOrder: tempOrder
782
795
  });
783
- case 19:
796
+ case 25:
784
797
  return _context10.abrupt("return", _objectSpread(_objectSpread({
785
798
  isAvailable: raw.isAvailable
786
799
  }, raw.isAccepted !== undefined ? {
@@ -790,11 +803,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
790
803
  unavailableReason: raw.unavailableReason,
791
804
  scannedDiscountList: raw.scannedDiscountList
792
805
  }));
793
- case 20:
806
+ case 26:
794
807
  case "end":
795
808
  return _context10.stop();
796
809
  }
797
- }, _callee10, this);
810
+ }, _callee10, this, [[10, 15]]);
798
811
  }));
799
812
  function scanPromotionCode(_x4, _x5) {
800
813
  return _scanPromotionCode.apply(this, arguments);
@@ -876,54 +889,51 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
876
889
  key: "resolveCustomerById",
877
890
  value: function () {
878
891
  var _resolveCustomerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(customerId) {
879
- var _result$list;
880
- var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer, detailCustomer;
892
+ var _this2 = this;
893
+ var rawCustomerId, numericCustomerId, normalizedCustomerId, existingRequest, request;
881
894
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
882
895
  while (1) switch (_context12.prev = _context12.next) {
883
896
  case 0:
884
- localCustomers = this.store.customer.getCustomers();
885
- localCustomer = this.findCustomerById(localCustomers, customerId);
886
- normalizedLocalCustomer = localCustomer ? this.normalizeCustomer(localCustomer) : null;
887
- if (!(normalizedLocalCustomer && this.hasUsableCustomerDetails(normalizedLocalCustomer))) {
888
- _context12.next = 5;
897
+ rawCustomerId = String(customerId !== null && customerId !== void 0 ? customerId : '').trim();
898
+ numericCustomerId = Number(rawCustomerId);
899
+ if (!(!rawCustomerId || !Number.isInteger(numericCustomerId) || numericCustomerId <= 1)) {
900
+ _context12.next = 4;
889
901
  break;
890
902
  }
891
- return _context12.abrupt("return", normalizedLocalCustomer);
892
- case 5:
893
- _context12.next = 7;
894
- return this.store.customer.queryCustomerList({
895
- ids: [customerId],
896
- skip: 1,
897
- num: 1
898
- });
899
- case 7:
900
- result = _context12.sent;
901
- remoteCustomer = this.findCustomerById((result === null || result === void 0 ? void 0 : result.list) || [], customerId) || (result === null || result === void 0 || (_result$list = result.list) === null || _result$list === void 0 ? void 0 : _result$list[0]) || null;
902
- if (!remoteCustomer) {
903
- _context12.next = 11;
903
+ return _context12.abrupt("return", null);
904
+ case 4:
905
+ normalizedCustomerId = String(numericCustomerId);
906
+ existingRequest = this.customerResolveRequests.get(normalizedCustomerId);
907
+ if (!existingRequest) {
908
+ _context12.next = 8;
904
909
  break;
905
910
  }
906
- return _context12.abrupt("return", this.normalizeCustomer(remoteCustomer));
907
- case 11:
908
- _context12.prev = 11;
909
- _context12.next = 14;
910
- return this.store.customer.queryCustomerDetail(customerId);
911
- case 14:
912
- detailCustomer = _context12.sent;
913
- return _context12.abrupt("return", detailCustomer ? this.normalizeCustomer(detailCustomer) : null);
914
- case 18:
915
- _context12.prev = 18;
916
- _context12.t0 = _context12["catch"](11);
917
- console.warn('[BookingTicket] resolveCustomerById detail request failed', {
918
- customerId: customerId,
919
- error: _context12.t0
911
+ return _context12.abrupt("return", existingRequest);
912
+ case 8:
913
+ request = this.request.post("/customer/resolve/".concat(encodeURIComponent(normalizedCustomerId)), {
914
+ with_franchisor_data: 1,
915
+ with: ['latestWalletDetail.wallet', 'contactsInfo', 'formRecord']
916
+ }).then(function (result) {
917
+ var customer = result === null || result === void 0 ? void 0 : result.data;
918
+ var resolvedCustomerId = Number(customer && _typeof(customer) === 'object' && !Array.isArray(customer) ? _this2.getRawCustomerId(customer) : NaN);
919
+ if ((result === null || result === void 0 ? void 0 : result.status) !== true || (result === null || result === void 0 ? void 0 : result.code) !== 200 || !customer || _typeof(customer) !== 'object' || Array.isArray(customer) || !Number.isInteger(resolvedCustomerId) || resolvedCustomerId <= 1) {
920
+ var error = new Error((result === null || result === void 0 ? void 0 : result.message) || 'Customer resolve failed');
921
+ error.code = result === null || result === void 0 ? void 0 : result.code;
922
+ throw error;
923
+ }
924
+ return _this2.normalizeCustomer(customer);
925
+ }).finally(function () {
926
+ if (_this2.customerResolveRequests.get(normalizedCustomerId) === request) {
927
+ _this2.customerResolveRequests.delete(normalizedCustomerId);
928
+ }
920
929
  });
921
- return _context12.abrupt("return", null);
922
- case 22:
930
+ this.customerResolveRequests.set(normalizedCustomerId, request);
931
+ return _context12.abrupt("return", request);
932
+ case 11:
923
933
  case "end":
924
934
  return _context12.stop();
925
935
  }
926
- }, _callee12, this, [[11, 18]]);
936
+ }, _callee12, this);
927
937
  }));
928
938
  function resolveCustomerById(_x7) {
929
939
  return _resolveCustomerById.apply(this, arguments);
@@ -935,17 +945,6 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
935
945
  value: function resolveCustomerByDiscountCustomerId(customerId) {
936
946
  return this.resolveCustomerById(customerId);
937
947
  }
938
- }, {
939
- key: "findCustomerById",
940
- value: function findCustomerById() {
941
- var _this2 = this;
942
- var customers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
943
- var customerId = arguments.length > 1 ? arguments[1] : undefined;
944
- return customers.find(function (customer) {
945
- var rawId = _this2.getRawCustomerId(customer);
946
- return rawId !== null && String(rawId) === String(customerId);
947
- }) || null;
948
- }
949
948
  }, {
950
949
  key: "normalizeCustomer",
951
950
  value: function normalizeCustomer(customer) {
@@ -968,11 +967,6 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
968
967
  var raw = customer;
969
968
  return (_ref9 = (_ref10 = (_customer$id = customer.id) !== null && _customer$id !== void 0 ? _customer$id : raw.customer_id) !== null && _ref10 !== void 0 ? _ref10 : raw.customerId) !== null && _ref9 !== void 0 ? _ref9 : null;
970
969
  }
971
- }, {
972
- key: "hasUsableCustomerDetails",
973
- value: function hasUsableCustomerDetails(customer) {
974
- return !!(customer.name || customer.phone || customer.email || customer.display_name || customer.customer_name);
975
- }
976
970
 
977
971
  /**
978
972
  * 更新当前预约的 appointment_status。
@@ -2716,6 +2710,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2716
2710
  getOrderCustomerSnapshot: function getOrderCustomerSnapshot() {
2717
2711
  return _this7.getOrderCustomerSnapshot();
2718
2712
  },
2713
+ resolveCustomerById: function resolveCustomerById(customerId) {
2714
+ return _this7.resolveCustomerById(customerId);
2715
+ },
2719
2716
  getBusinessCode: function getBusinessCode() {
2720
2717
  var _this7$otherParams;
2721
2718
  return (_this7$otherParams = _this7.otherParams) === null || _this7$otherParams === void 0 ? void 0 : _this7$otherParams.businessCode;
@@ -230,12 +230,16 @@ export interface GlobalScanHostBridge {
230
230
  /**
231
231
  * walk-in 扫 walletPass:直接核销优惠码(对齐 SaleDetail Voucher.handleApplyCode / cart.scanCode)。
232
232
  */
233
- applyPromotionCode?: (code: string, customerId?: number) => Promise<{
233
+ applyPromotionCode?: (code: string, customerId?: number, options?: {
234
+ suppressFailureNotification?: boolean;
235
+ }) => Promise<{
234
236
  isAvailable?: boolean;
235
237
  isAccepted?: boolean;
236
238
  type?: string;
237
239
  unavailableReason?: string;
238
240
  }>;
241
+ /** 当前订单已有其他客户时,由宿主复用客户组件完成确认及切换。 */
242
+ requestCustomerSwitch?: (customer: ICustomer) => Promise<boolean | null>;
239
243
  onNotify?: (type: 'success' | 'fail' | 'info', messageKey?: string) => void;
240
244
  refresh?: () => void;
241
245
  }
@@ -5,12 +5,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { resolveBookingCanAddTime } from "./addTimeAvailability";
8
+ import { isFulfillmentTimingBooking } from "../../../modules/Order/pickupTiming";
8
9
  /**
9
10
  * 仅按 booking.product_uid 建索引,避免发明 booking 与商品行之间的其它等价关系。
10
11
  */
11
12
  export function indexBookingsByProductUid(bookings) {
12
13
  if (!Array.isArray(bookings) || bookings.length === 0) return {};
13
14
  return bookings.reduce(function (acc, booking) {
15
+ if (isFulfillmentTimingBooking(booking)) return acc;
14
16
  var uid = booking === null || booking === void 0 ? void 0 : booking.product_uid;
15
17
  if (uid === undefined || uid === null || uid === '') return acc;
16
18
  var key = String(uid);
@@ -109,7 +111,7 @@ export function buildCartView(lines, bookings) {
109
111
  var productLines = Array.isArray(lines) ? lines : [];
110
112
  var bookingList = Array.isArray(bookings) ? bookings : [];
111
113
  var childBookings = bookingList.filter(function (booking) {
112
- return booking.parent_id !== 0;
114
+ return booking.parent_id !== 0 && !isFulfillmentTimingBooking(booking);
113
115
  });
114
116
  var bookingsByProductUid = indexBookingsByProductUid(childBookings);
115
117
  var linesByUid = indexProductsByUid(productLines);
@@ -5,6 +5,7 @@ import { GlobalScanFormattedResult } from './formatGlobalScan';
5
5
  export interface GlobalScanApplyHost {
6
6
  setOrderCustomer(customer: ICustomer | null): void;
7
7
  getOrderCustomerSnapshot(): ICustomer | null;
8
+ resolveCustomerById?(customerId: string | number): Promise<ICustomer | null>;
8
9
  getBusinessCode(): string | undefined;
9
10
  buildAddProductCtx(extra?: Record<string, any>): Record<string, any>;
10
11
  decideAddProduct(item: any, options?: Record<string, any>): AddProductDecision;
@@ -26,6 +27,7 @@ export interface GlobalScanApplyHost {
26
27
  addProductToOrder(product: any, booking?: any): Promise<any>;
27
28
  refreshWalletAssets?(params?: {
28
29
  preserveSelection?: boolean;
30
+ retainSearchResultCodes?: string[];
29
31
  }): Promise<any>;
30
32
  scanWalletAsset?(code: string): Promise<{
31
33
  type: 'walletCode' | 'normalCode';