@pisell/pisellos 0.10.28 → 0.10.30

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 (85) hide show
  1. package/dist/core/index.d.ts +7 -0
  2. package/dist/core/index.js +108 -65
  3. package/dist/model/strategy/adapter/dataVariant/evaluator.js +13 -2
  4. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  5. package/dist/modules/Discount/index.js +4 -1
  6. package/dist/modules/Discount/types.d.ts +14 -4
  7. package/dist/modules/Order/index.d.ts +3 -1
  8. package/dist/modules/Order/index.js +89 -16
  9. package/dist/modules/Order/types.d.ts +13 -0
  10. package/dist/modules/Order/utils.d.ts +17 -2
  11. package/dist/modules/Order/utils.js +133 -27
  12. package/dist/modules/Quotation/index.d.ts +6 -0
  13. package/dist/modules/Quotation/index.js +77 -25
  14. package/dist/modules/ResourcePlanner/planner.js +14 -4
  15. package/dist/modules/ResourcePlanner/types.d.ts +2 -0
  16. package/dist/plugins/request.d.ts +1 -0
  17. package/dist/server/index.d.ts +13 -2
  18. package/dist/server/index.js +1531 -1230
  19. package/dist/server/modules/floor-plan/index.d.ts +4 -0
  20. package/dist/server/modules/floor-plan/index.js +240 -98
  21. package/dist/server/modules/menu/index.js +48 -23
  22. package/dist/server/modules/order/index.d.ts +17 -7
  23. package/dist/server/modules/order/index.js +419 -207
  24. package/dist/server/modules/order/types.d.ts +50 -0
  25. package/dist/server/modules/order/types.js +2 -0
  26. package/dist/server/modules/products/index.d.ts +10 -4
  27. package/dist/server/modules/products/index.js +177 -84
  28. package/dist/server/modules/resource/index.js +21 -13
  29. package/dist/server/utils/product.d.ts +1 -1
  30. package/dist/server/utils/product.js +186 -22
  31. package/dist/server/utils/small-ticket.d.ts +4 -1
  32. package/dist/server/utils/small-ticket.js +543 -101
  33. package/dist/solution/BaseSales/index.d.ts +3 -3
  34. package/dist/solution/BaseSales/index.js +171 -198
  35. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  36. package/dist/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  37. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
  38. package/dist/solution/BookingByStep/index.d.ts +2 -2
  39. package/dist/solution/Sales/index.d.ts +7 -0
  40. package/dist/solution/Sales/index.js +87 -31
  41. package/dist/solution/UnifiedBookingSales/index.d.ts +2 -2
  42. package/dist/solution/UnifiedBookingSales/index.js +38 -21
  43. package/lib/core/index.d.ts +7 -0
  44. package/lib/core/index.js +20 -2
  45. package/lib/model/strategy/adapter/dataVariant/evaluator.js +12 -2
  46. package/lib/model/strategy/adapter/promotion/index.js +46 -1
  47. package/lib/modules/Discount/index.js +4 -1
  48. package/lib/modules/Discount/types.d.ts +14 -4
  49. package/lib/modules/Order/index.d.ts +3 -1
  50. package/lib/modules/Order/index.js +69 -1
  51. package/lib/modules/Order/types.d.ts +13 -0
  52. package/lib/modules/Order/utils.d.ts +17 -2
  53. package/lib/modules/Order/utils.js +131 -18
  54. package/lib/modules/Quotation/index.d.ts +6 -0
  55. package/lib/modules/Quotation/index.js +52 -8
  56. package/lib/modules/ResourcePlanner/planner.js +9 -1
  57. package/lib/modules/ResourcePlanner/types.d.ts +2 -0
  58. package/lib/plugins/request.d.ts +1 -0
  59. package/lib/server/index.d.ts +13 -2
  60. package/lib/server/index.js +210 -19
  61. package/lib/server/modules/floor-plan/index.d.ts +4 -0
  62. package/lib/server/modules/floor-plan/index.js +60 -7
  63. package/lib/server/modules/menu/index.js +26 -4
  64. package/lib/server/modules/order/index.d.ts +17 -7
  65. package/lib/server/modules/order/index.js +194 -57
  66. package/lib/server/modules/order/types.d.ts +50 -0
  67. package/lib/server/modules/order/types.js +1 -0
  68. package/lib/server/modules/products/index.d.ts +10 -4
  69. package/lib/server/modules/products/index.js +93 -23
  70. package/lib/server/modules/resource/index.js +12 -2
  71. package/lib/server/utils/product.d.ts +1 -1
  72. package/lib/server/utils/product.js +163 -3
  73. package/lib/server/utils/small-ticket.d.ts +4 -1
  74. package/lib/server/utils/small-ticket.js +507 -75
  75. package/lib/solution/BaseSales/index.d.ts +3 -3
  76. package/lib/solution/BaseSales/index.js +9 -14
  77. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  78. package/lib/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  79. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
  80. package/lib/solution/BookingByStep/index.d.ts +2 -2
  81. package/lib/solution/Sales/index.d.ts +7 -0
  82. package/lib/solution/Sales/index.js +48 -3
  83. package/lib/solution/UnifiedBookingSales/index.d.ts +2 -2
  84. package/lib/solution/UnifiedBookingSales/index.js +19 -3
  85. package/package.json +1 -1
@@ -927,9 +927,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
927
927
  }
928
928
 
929
929
  /**
930
- * Change Time / customer reprice 必须沿用商品列表的渠道口径。
931
- * SalesSdk Provider 通常将渠道存为 platform,因此不能只读取 otherParams.channel。
932
- */
930
+ * Change Time / customer reprice 必须沿用商品列表的渠道口径。
931
+ * SalesSdk Provider 通常将渠道存为 platform,因此不能只读取 otherParams.channel。
932
+ */
933
933
  }, {
934
934
  key: "getPriceQueryChannel",
935
935
  value: function getPriceQueryChannel(channel) {
@@ -2325,7 +2325,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2325
2325
  key: "restoreOrder",
2326
2326
  value: function () {
2327
2327
  var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
2328
- var _this$store$payment, tempOrder, wallet;
2328
+ var _this$store$payment, tempOrder, appDataChanged, wallet;
2329
2329
  return _regeneratorRuntime().wrap(function _callee18$(_context18) {
2330
2330
  while (1) switch (_context18.prev = _context18.next) {
2331
2331
  case 0:
@@ -2337,43 +2337,44 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2337
2337
  throw new Error('scanOrder 解决方案需要 order 模块支持');
2338
2338
  case 3:
2339
2339
  // this.store.resource = null;
2340
- tempOrder = this.store.order.restoreOrder();
2340
+ tempOrder = this.store.order.restoreOrder(); // 先补齐店铺级订单字段,再通知监听方,避免发布带空税区/币种的中间快照。
2341
+ appDataChanged = this.syncAppDataToTempOrder(tempOrder);
2341
2342
  this.currentSalesDetail = null;
2342
2343
  this.discountConfigCacheKey = null;
2343
2344
  this.hasManualDiscountSelection = false;
2344
2345
  wallet = (_this$store$payment = this.store.payment) === null || _this$store$payment === void 0 ? void 0 : _this$store$payment.wallet;
2345
2346
  if (!wallet) {
2346
- _context18.next = 13;
2347
+ _context18.next = 14;
2347
2348
  break;
2348
2349
  }
2349
2350
  this.walletAssetsRefreshSequence += 1;
2350
2351
  wallet.clearAllCache();
2351
- _context18.next = 13;
2352
+ _context18.next = 14;
2352
2353
  return this.publishWalletAssetsState(wallet.getWalletAssetsState());
2353
- case 13:
2354
- _context18.next = 15;
2354
+ case 14:
2355
+ _context18.next = 16;
2355
2356
  return this.effectsEmit('onTempOrderReplaced', {
2356
2357
  tempOrder: tempOrder
2357
2358
  });
2358
- case 15:
2359
- if (!(this.syncAppDataToTempOrder(tempOrder) && this.isTempOrderPersistEnabled())) {
2360
- _context18.next = 19;
2359
+ case 16:
2360
+ if (!(appDataChanged && this.isTempOrderPersistEnabled())) {
2361
+ _context18.next = 20;
2361
2362
  break;
2362
2363
  }
2363
2364
  this.store.order.persistTempOrder();
2364
- _context18.next = 19;
2365
+ _context18.next = 20;
2365
2366
  return this.store.order.saveDraft();
2366
- case 19:
2367
+ case 20:
2367
2368
  return _context18.abrupt("return", tempOrder);
2368
- case 22:
2369
- _context18.prev = 22;
2369
+ case 23:
2370
+ _context18.prev = 23;
2370
2371
  _context18.t0 = _context18["catch"](0);
2371
2372
  throw _context18.t0;
2372
- case 25:
2373
+ case 26:
2373
2374
  case "end":
2374
2375
  return _context18.stop();
2375
2376
  }
2376
- }, _callee18, this, [[0, 22]]);
2377
+ }, _callee18, this, [[0, 23]]);
2377
2378
  }));
2378
2379
  function restoreOrder() {
2379
2380
  return _restoreOrder.apply(this, arguments);
@@ -5712,15 +5713,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5712
5713
  }, {
5713
5714
  key: "shouldRecalculateProductBookingPricesForContextChange",
5714
5715
  value: function shouldRecalculateProductBookingPricesForContextChange(params) {
5715
- var scopeInfo = this.getQuotationCustomerScopeInfo();
5716
- var scopedCustomerIds = new Set(scopeInfo.customerIds.map(function (id) {
5717
- return String(id);
5718
- }));
5719
5716
  var previousCustomerId = this.normalizePriceContextCustomerId(params.previousCustomerId);
5720
5717
  var nextCustomerId = this.normalizePriceContextCustomerId(params.nextCustomerId);
5721
5718
  if (this.isCustomerUserPriceQuery() || this.hasSmartPricingStrategies()) {
5722
5719
  return previousCustomerId !== nextCustomerId;
5723
5720
  }
5721
+ var scopeInfo = this.getQuotationCustomerScopeInfo();
5722
+ var scopedCustomerIds = new Set(scopeInfo.customerIds.map(function (id) {
5723
+ return String(id);
5724
+ }));
5724
5725
  var previousInScope = previousCustomerId ? scopedCustomerIds.has(previousCustomerId) : false;
5725
5726
  var nextInScope = nextCustomerId ? scopedCustomerIds.has(nextCustomerId) : false;
5726
5727
  var shouldRecalculate = false;
@@ -5738,17 +5739,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5738
5739
  }, {
5739
5740
  key: "calculateProductBookingPrices",
5740
5741
  value: function () {
5741
- var _calculateProductBookingPrices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(paramsList) {
5742
+ var _calculateProductBookingPrices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(paramsList) {
5742
5743
  var _this18 = this;
5743
- var useCustomerUserPricing, quotation, currentOrderCustomerId, resolvedChannels, authoritativeProducts, preparedCustomerKeys, groups, quotationContexts;
5744
- return _regeneratorRuntime().wrap(function _callee58$(_context58) {
5745
- while (1) switch (_context58.prev = _context58.next) {
5744
+ var useCustomerUserPricing, quotation, currentOrderCustomerId, resolvedChannels, authoritativeProducts, groups, quotationContexts;
5745
+ return _regeneratorRuntime().wrap(function _callee57$(_context57) {
5746
+ while (1) switch (_context57.prev = _context57.next) {
5746
5747
  case 0:
5747
5748
  if (paramsList.length) {
5748
- _context58.next = 2;
5749
+ _context57.next = 2;
5749
5750
  break;
5750
5751
  }
5751
- return _context58.abrupt("return", []);
5752
+ return _context57.abrupt("return", []);
5752
5753
  case 2:
5753
5754
  useCustomerUserPricing = this.isCustomerUserPriceQuery();
5754
5755
  quotation = useCustomerUserPricing ? undefined : this.store.quotation;
@@ -5759,43 +5760,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5759
5760
  authoritativeProducts = paramsList.map(function () {
5760
5761
  return null;
5761
5762
  });
5762
- preparedCustomerKeys = new Set();
5763
- _context58.next = 10;
5764
- return Promise.all(paramsList.map( /*#__PURE__*/function () {
5765
- var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(params) {
5766
- var _params$customer_id2;
5767
- var customerId, customerKey;
5768
- return _regeneratorRuntime().wrap(function _callee56$(_context56) {
5769
- while (1) switch (_context56.prev = _context56.next) {
5770
- case 0:
5771
- customerId = (_params$customer_id2 = params.customer_id) !== null && _params$customer_id2 !== void 0 ? _params$customer_id2 : currentOrderCustomerId;
5772
- customerKey = _this18.normalizePriceContextCustomerId(customerId) || '';
5773
- if (!preparedCustomerKeys.has(customerKey)) {
5774
- _context56.next = 4;
5775
- break;
5776
- }
5777
- return _context56.abrupt("return");
5778
- case 4:
5779
- preparedCustomerKeys.add(customerKey);
5780
- _context56.next = 7;
5781
- return _this18.prepareProductPriceQueryContext(customerId);
5782
- case 7:
5783
- case "end":
5784
- return _context56.stop();
5785
- }
5786
- }, _callee56);
5787
- }));
5788
- return function (_x47) {
5789
- return _ref50.apply(this, arguments);
5790
- };
5791
- }()));
5792
- case 10:
5793
5763
  groups = new Map();
5794
5764
  paramsList.forEach(function (params, index) {
5795
- var _params$customer_id3;
5765
+ var _params$customer_id2;
5796
5766
  var schedule = _this18.getPriceQuerySchedule(params);
5797
5767
  var channel = resolvedChannels[index];
5798
- var customerId = (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId;
5768
+ var customerId = (_params$customer_id2 = params.customer_id) !== null && _params$customer_id2 !== void 0 ? _params$customer_id2 : currentOrderCustomerId;
5799
5769
  var groupKey = [schedule.schedule_date, schedule.schedule_datetime, channel || '', _this18.normalizePriceContextCustomerId(customerId) || ''].join('|');
5800
5770
  var group = groups.get(groupKey) || {
5801
5771
  indices: [],
@@ -5806,67 +5776,70 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5806
5776
  group.indices.push(index);
5807
5777
  groups.set(groupKey, group);
5808
5778
  });
5809
- _context58.next = 14;
5779
+ _context57.next = 11;
5810
5780
  return Promise.all(Array.from(groups.values()).map( /*#__PURE__*/function () {
5811
- var _ref51 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(group) {
5781
+ var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(group) {
5812
5782
  var priceQueries, resolvedProducts;
5813
- return _regeneratorRuntime().wrap(function _callee57$(_context57) {
5814
- while (1) switch (_context57.prev = _context57.next) {
5783
+ return _regeneratorRuntime().wrap(function _callee56$(_context56) {
5784
+ while (1) switch (_context56.prev = _context56.next) {
5815
5785
  case 0:
5786
+ _context56.next = 2;
5787
+ return _this18.prepareProductPriceQueryContext(group.customerId);
5788
+ case 2:
5816
5789
  priceQueries = group.indices.map(function (index) {
5817
5790
  return paramsList[index];
5818
5791
  });
5819
- _context57.next = 3;
5792
+ _context56.next = 5;
5820
5793
  return _this18.resolveProductsForPriceQuery({
5821
5794
  priceQueries: priceQueries,
5822
5795
  schedule: group.schedule,
5823
5796
  customerId: group.customerId,
5824
5797
  channel: group.channel
5825
5798
  });
5826
- case 3:
5827
- resolvedProducts = _context57.sent;
5799
+ case 5:
5800
+ resolvedProducts = _context56.sent;
5828
5801
  group.indices.forEach(function (originalIndex, groupIndex) {
5829
5802
  authoritativeProducts[originalIndex] = resolvedProducts[groupIndex] || null;
5830
5803
  });
5831
- case 5:
5804
+ case 7:
5832
5805
  case "end":
5833
- return _context57.stop();
5806
+ return _context56.stop();
5834
5807
  }
5835
- }, _callee57);
5808
+ }, _callee56);
5836
5809
  }));
5837
- return function (_x48) {
5838
- return _ref51.apply(this, arguments);
5810
+ return function (_x47) {
5811
+ return _ref50.apply(this, arguments);
5839
5812
  };
5840
5813
  }()));
5841
- case 14:
5814
+ case 11:
5842
5815
  if (useCustomerUserPricing) {
5843
- _context58.next = 19;
5816
+ _context57.next = 16;
5844
5817
  break;
5845
5818
  }
5846
5819
  quotationContexts = new Map();
5847
5820
  paramsList.forEach(function (params, index) {
5848
- var _params$customer_id4;
5821
+ var _params$customer_id3;
5849
5822
  var channel = resolvedChannels[index];
5850
5823
  var key = channel || '';
5851
5824
  if (quotationContexts.has(key)) return;
5852
5825
  quotationContexts.set(key, {
5853
5826
  channel: channel,
5854
- customer_id: (_params$customer_id4 = params.customer_id) !== null && _params$customer_id4 !== void 0 ? _params$customer_id4 : currentOrderCustomerId
5827
+ customer_id: (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId
5855
5828
  });
5856
5829
  });
5857
- _context58.next = 19;
5830
+ _context57.next = 16;
5858
5831
  return Promise.all(Array.from(quotationContexts.values()).map(function (context) {
5859
5832
  return _this18.loadQuotationForPriceQuery(_objectSpread({
5860
5833
  quotation: quotation
5861
5834
  }, context));
5862
5835
  }));
5863
- case 19:
5864
- return _context58.abrupt("return", paramsList.map(function (params, index) {
5865
- var _params$customer_id5;
5836
+ case 16:
5837
+ return _context57.abrupt("return", paramsList.map(function (params, index) {
5838
+ var _params$customer_id4;
5866
5839
  var productInput = params.product || {};
5867
5840
  var authoritativeProduct = authoritativeProducts[index];
5868
5841
  var product = _this18.mergeProductForPriceQuery(productInput, authoritativeProduct);
5869
- var customerId = (_params$customer_id5 = params.customer_id) !== null && _params$customer_id5 !== void 0 ? _params$customer_id5 : currentOrderCustomerId;
5842
+ var customerId = (_params$customer_id4 = params.customer_id) !== null && _params$customer_id4 !== void 0 ? _params$customer_id4 : currentOrderCustomerId;
5870
5843
  var channel = resolvedChannels[index];
5871
5844
  return calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
5872
5845
  channel: channel,
@@ -5876,11 +5849,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5876
5849
  quotation: authoritativeProduct && _this18.preferAuthoritativeProductQueryPrice() ? undefined : quotation
5877
5850
  }));
5878
5851
  }));
5879
- case 20:
5852
+ case 17:
5880
5853
  case "end":
5881
- return _context58.stop();
5854
+ return _context57.stop();
5882
5855
  }
5883
- }, _callee58, this);
5856
+ }, _callee57, this);
5884
5857
  }));
5885
5858
  function calculateProductBookingPrices(_x46) {
5886
5859
  return _calculateProductBookingPrices.apply(this, arguments);
@@ -5890,7 +5863,42 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5890
5863
  }, {
5891
5864
  key: "addProductToOrder",
5892
5865
  value: function () {
5893
- var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(product, booking, options) {
5866
+ var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(product, booking, options) {
5867
+ var products;
5868
+ return _regeneratorRuntime().wrap(function _callee58$(_context58) {
5869
+ while (1) switch (_context58.prev = _context58.next) {
5870
+ case 0:
5871
+ _context58.prev = 0;
5872
+ if (this.store.order) {
5873
+ _context58.next = 3;
5874
+ break;
5875
+ }
5876
+ throw new Error('order 模块未初始化');
5877
+ case 3:
5878
+ _context58.next = 5;
5879
+ return this.store.order.addProductToOrder(product, booking, options);
5880
+ case 5:
5881
+ products = _context58.sent;
5882
+ return _context58.abrupt("return", products);
5883
+ case 9:
5884
+ _context58.prev = 9;
5885
+ _context58.t0 = _context58["catch"](0);
5886
+ throw _context58.t0;
5887
+ case 12:
5888
+ case "end":
5889
+ return _context58.stop();
5890
+ }
5891
+ }, _callee58, this, [[0, 9]]);
5892
+ }));
5893
+ function addProductToOrder(_x48, _x49, _x50) {
5894
+ return _addProductToOrder.apply(this, arguments);
5895
+ }
5896
+ return addProductToOrder;
5897
+ }()
5898
+ }, {
5899
+ key: "updateOrderProduct",
5900
+ value: function () {
5901
+ var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(params) {
5894
5902
  var products;
5895
5903
  return _regeneratorRuntime().wrap(function _callee59$(_context59) {
5896
5904
  while (1) switch (_context59.prev = _context59.next) {
@@ -5903,7 +5911,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5903
5911
  throw new Error('order 模块未初始化');
5904
5912
  case 3:
5905
5913
  _context59.next = 5;
5906
- return this.store.order.addProductToOrder(product, booking, options);
5914
+ return this.store.order.updateOrderProduct(params);
5907
5915
  case 5:
5908
5916
  products = _context59.sent;
5909
5917
  return _context59.abrupt("return", products);
@@ -5917,15 +5925,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5917
5925
  }
5918
5926
  }, _callee59, this, [[0, 9]]);
5919
5927
  }));
5920
- function addProductToOrder(_x49, _x50, _x51) {
5921
- return _addProductToOrder.apply(this, arguments);
5928
+ function updateOrderProduct(_x51) {
5929
+ return _updateOrderProduct.apply(this, arguments);
5922
5930
  }
5923
- return addProductToOrder;
5931
+ return updateOrderProduct;
5924
5932
  }()
5925
5933
  }, {
5926
- key: "updateOrderProduct",
5934
+ key: "updateOrderProducts",
5927
5935
  value: function () {
5928
- var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(params) {
5936
+ var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(paramsList) {
5929
5937
  var products;
5930
5938
  return _regeneratorRuntime().wrap(function _callee60$(_context60) {
5931
5939
  while (1) switch (_context60.prev = _context60.next) {
@@ -5938,7 +5946,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5938
5946
  throw new Error('order 模块未初始化');
5939
5947
  case 3:
5940
5948
  _context60.next = 5;
5941
- return this.store.order.updateOrderProduct(params);
5949
+ return this.store.order.updateOrderProducts(paramsList);
5942
5950
  case 5:
5943
5951
  products = _context60.sent;
5944
5952
  return _context60.abrupt("return", products);
@@ -5952,15 +5960,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5952
5960
  }
5953
5961
  }, _callee60, this, [[0, 9]]);
5954
5962
  }));
5955
- function updateOrderProduct(_x52) {
5956
- return _updateOrderProduct.apply(this, arguments);
5963
+ function updateOrderProducts(_x52) {
5964
+ return _updateOrderProducts.apply(this, arguments);
5957
5965
  }
5958
- return updateOrderProduct;
5966
+ return updateOrderProducts;
5959
5967
  }()
5960
5968
  }, {
5961
- key: "updateOrderProducts",
5969
+ key: "updateOrderProductQuantity",
5962
5970
  value: function () {
5963
- var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(paramsList) {
5971
+ var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(params) {
5964
5972
  var products;
5965
5973
  return _regeneratorRuntime().wrap(function _callee61$(_context61) {
5966
5974
  while (1) switch (_context61.prev = _context61.next) {
@@ -5973,7 +5981,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5973
5981
  throw new Error('order 模块未初始化');
5974
5982
  case 3:
5975
5983
  _context61.next = 5;
5976
- return this.store.order.updateOrderProducts(paramsList);
5984
+ return this.store.order.updateOrderProductQuantity(params);
5977
5985
  case 5:
5978
5986
  products = _context61.sent;
5979
5987
  return _context61.abrupt("return", products);
@@ -5987,42 +5995,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5987
5995
  }
5988
5996
  }, _callee61, this, [[0, 9]]);
5989
5997
  }));
5990
- function updateOrderProducts(_x53) {
5991
- return _updateOrderProducts.apply(this, arguments);
5992
- }
5993
- return updateOrderProducts;
5994
- }()
5995
- }, {
5996
- key: "updateOrderProductQuantity",
5997
- value: function () {
5998
- var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(params) {
5999
- var products;
6000
- return _regeneratorRuntime().wrap(function _callee62$(_context62) {
6001
- while (1) switch (_context62.prev = _context62.next) {
6002
- case 0:
6003
- _context62.prev = 0;
6004
- if (this.store.order) {
6005
- _context62.next = 3;
6006
- break;
6007
- }
6008
- throw new Error('order 模块未初始化');
6009
- case 3:
6010
- _context62.next = 5;
6011
- return this.store.order.updateOrderProductQuantity(params);
6012
- case 5:
6013
- products = _context62.sent;
6014
- return _context62.abrupt("return", products);
6015
- case 9:
6016
- _context62.prev = 9;
6017
- _context62.t0 = _context62["catch"](0);
6018
- throw _context62.t0;
6019
- case 12:
6020
- case "end":
6021
- return _context62.stop();
6022
- }
6023
- }, _callee62, this, [[0, 9]]);
6024
- }));
6025
- function updateOrderProductQuantity(_x54) {
5998
+ function updateOrderProductQuantity(_x53) {
6026
5999
  return _updateOrderProductQuantity.apply(this, arguments);
6027
6000
  }
6028
6001
  return updateOrderProductQuantity;
@@ -6045,12 +6018,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6045
6018
  }, {
6046
6019
  key: "setOrderProductLineNote",
6047
6020
  value: (function () {
6048
- var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(identity, note) {
6021
+ var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(identity, note) {
6049
6022
  var params, products;
6050
- return _regeneratorRuntime().wrap(function _callee63$(_context63) {
6051
- while (1) switch (_context63.prev = _context63.next) {
6023
+ return _regeneratorRuntime().wrap(function _callee62$(_context62) {
6024
+ while (1) switch (_context62.prev = _context62.next) {
6052
6025
  case 0:
6053
- _context63.prev = 0;
6026
+ _context62.prev = 0;
6054
6027
  params = {
6055
6028
  product_id: identity.product_id,
6056
6029
  product_variant_id: identity.product_variant_id,
@@ -6065,22 +6038,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6065
6038
  params.product_sku = identity.product_sku;
6066
6039
  }
6067
6040
  if (identity.product_bundle !== undefined) params.product_bundle = identity.product_bundle;
6068
- _context63.next = 7;
6041
+ _context62.next = 7;
6069
6042
  return this.updateOrderProduct(params);
6070
6043
  case 7:
6071
- products = _context63.sent;
6072
- return _context63.abrupt("return", products);
6044
+ products = _context62.sent;
6045
+ return _context62.abrupt("return", products);
6073
6046
  case 11:
6074
- _context63.prev = 11;
6075
- _context63.t0 = _context63["catch"](0);
6076
- throw _context63.t0;
6047
+ _context62.prev = 11;
6048
+ _context62.t0 = _context62["catch"](0);
6049
+ throw _context62.t0;
6077
6050
  case 14:
6078
6051
  case "end":
6079
- return _context63.stop();
6052
+ return _context62.stop();
6080
6053
  }
6081
- }, _callee63, this, [[0, 11]]);
6054
+ }, _callee62, this, [[0, 11]]);
6082
6055
  }));
6083
- function setOrderProductLineNote(_x55, _x56) {
6056
+ function setOrderProductLineNote(_x54, _x55) {
6084
6057
  return _setOrderProductLineNote.apply(this, arguments);
6085
6058
  }
6086
6059
  return setOrderProductLineNote;
@@ -6095,32 +6068,32 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6095
6068
  }, {
6096
6069
  key: "removeProductsFromOrder",
6097
6070
  value: (function () {
6098
- var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(identities, options) {
6099
- return _regeneratorRuntime().wrap(function _callee64$(_context64) {
6100
- while (1) switch (_context64.prev = _context64.next) {
6071
+ var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(identities, options) {
6072
+ return _regeneratorRuntime().wrap(function _callee63$(_context63) {
6073
+ while (1) switch (_context63.prev = _context63.next) {
6101
6074
  case 0:
6102
- _context64.prev = 0;
6075
+ _context63.prev = 0;
6103
6076
  if (this.store.order) {
6104
- _context64.next = 3;
6077
+ _context63.next = 3;
6105
6078
  break;
6106
6079
  }
6107
6080
  throw new Error('order 模块未初始化');
6108
6081
  case 3:
6109
- _context64.next = 5;
6082
+ _context63.next = 5;
6110
6083
  return this.store.order.removeProductsFromOrder(identities, options);
6111
6084
  case 5:
6112
- return _context64.abrupt("return", _context64.sent);
6085
+ return _context63.abrupt("return", _context63.sent);
6113
6086
  case 8:
6114
- _context64.prev = 8;
6115
- _context64.t0 = _context64["catch"](0);
6116
- throw _context64.t0;
6087
+ _context63.prev = 8;
6088
+ _context63.t0 = _context63["catch"](0);
6089
+ throw _context63.t0;
6117
6090
  case 11:
6118
6091
  case "end":
6119
- return _context64.stop();
6092
+ return _context63.stop();
6120
6093
  }
6121
- }, _callee64, this, [[0, 8]]);
6094
+ }, _callee63, this, [[0, 8]]);
6122
6095
  }));
6123
- function removeProductsFromOrder(_x57, _x58) {
6096
+ function removeProductsFromOrder(_x56, _x57) {
6124
6097
  return _removeProductsFromOrder.apply(this, arguments);
6125
6098
  }
6126
6099
  return removeProductsFromOrder;
@@ -6128,18 +6101,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6128
6101
  }, {
6129
6102
  key: "removeProductFromOrder",
6130
6103
  value: function () {
6131
- var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(identity, options) {
6132
- return _regeneratorRuntime().wrap(function _callee65$(_context65) {
6133
- while (1) switch (_context65.prev = _context65.next) {
6104
+ var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(identity, options) {
6105
+ return _regeneratorRuntime().wrap(function _callee64$(_context64) {
6106
+ while (1) switch (_context64.prev = _context64.next) {
6134
6107
  case 0:
6135
- return _context65.abrupt("return", this.removeProductsFromOrder([identity], options));
6108
+ return _context64.abrupt("return", this.removeProductsFromOrder([identity], options));
6136
6109
  case 1:
6137
6110
  case "end":
6138
- return _context65.stop();
6111
+ return _context64.stop();
6139
6112
  }
6140
- }, _callee65, this);
6113
+ }, _callee64, this);
6141
6114
  }));
6142
- function removeProductFromOrder(_x59, _x60) {
6115
+ function removeProductFromOrder(_x58, _x59) {
6143
6116
  return _removeProductFromOrder.apply(this, arguments);
6144
6117
  }
6145
6118
  return removeProductFromOrder;
@@ -6189,23 +6162,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6189
6162
  }, {
6190
6163
  key: "applyPromotion",
6191
6164
  value: (function () {
6192
- var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66() {
6193
- return _regeneratorRuntime().wrap(function _callee66$(_context66) {
6194
- while (1) switch (_context66.prev = _context66.next) {
6165
+ var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65() {
6166
+ return _regeneratorRuntime().wrap(function _callee65$(_context65) {
6167
+ while (1) switch (_context65.prev = _context65.next) {
6195
6168
  case 0:
6196
6169
  if (this.store.order) {
6197
- _context66.next = 2;
6170
+ _context65.next = 2;
6198
6171
  break;
6199
6172
  }
6200
6173
  throw new Error('order 模块未初始化');
6201
6174
  case 2:
6202
- _context66.next = 4;
6175
+ _context65.next = 4;
6203
6176
  return this.store.order.applyPromotion();
6204
6177
  case 4:
6205
6178
  case "end":
6206
- return _context66.stop();
6179
+ return _context65.stop();
6207
6180
  }
6208
- }, _callee66, this);
6181
+ }, _callee65, this);
6209
6182
  }));
6210
6183
  function applyPromotion() {
6211
6184
  return _applyPromotion.apply(this, arguments);
@@ -6232,18 +6205,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6232
6205
  }, {
6233
6206
  key: "getProductList",
6234
6207
  value: function () {
6235
- var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67() {
6208
+ var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66() {
6236
6209
  var _this$otherParams36;
6237
6210
  var menu_list_ids, _this$store$products, res;
6238
- return _regeneratorRuntime().wrap(function _callee67$(_context67) {
6239
- while (1) switch (_context67.prev = _context67.next) {
6211
+ return _regeneratorRuntime().wrap(function _callee66$(_context66) {
6212
+ while (1) switch (_context66.prev = _context66.next) {
6240
6213
  case 0:
6241
6214
  // 可以直接通过配置里的 menu 读取
6242
6215
  menu_list_ids = ((_this$otherParams36 = this.otherParams) === null || _this$otherParams36 === void 0 || (_this$otherParams36 = _this$otherParams36.dineInConfig) === null || _this$otherParams36 === void 0 ? void 0 : _this$otherParams36['menu.associated_menus'].map(function (n) {
6243
6216
  return Number(n.value);
6244
6217
  })) || [];
6245
- _context67.prev = 1;
6246
- _context67.next = 4;
6218
+ _context66.prev = 1;
6219
+ _context66.next = 4;
6247
6220
  return (_this$store$products = this.store.products) === null || _this$store$products === void 0 ? void 0 : _this$store$products.loadProducts({
6248
6221
  menu_list_ids: menu_list_ids,
6249
6222
  cacheId: this.cacheId,
@@ -6251,17 +6224,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6251
6224
  schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
6252
6225
  });
6253
6226
  case 4:
6254
- res = _context67.sent;
6255
- return _context67.abrupt("return", res);
6227
+ res = _context66.sent;
6228
+ return _context66.abrupt("return", res);
6256
6229
  case 8:
6257
- _context67.prev = 8;
6258
- _context67.t0 = _context67["catch"](1);
6259
- throw _context67.t0;
6230
+ _context66.prev = 8;
6231
+ _context66.t0 = _context66["catch"](1);
6232
+ throw _context66.t0;
6260
6233
  case 11:
6261
6234
  case "end":
6262
- return _context67.stop();
6235
+ return _context66.stop();
6263
6236
  }
6264
- }, _callee67, this, [[1, 8]]);
6237
+ }, _callee66, this, [[1, 8]]);
6265
6238
  }));
6266
6239
  function getProductList() {
6267
6240
  return _getProductList.apply(this, arguments);
@@ -6276,33 +6249,33 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6276
6249
  }, {
6277
6250
  key: "setOtherParams",
6278
6251
  value: function () {
6279
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(params) {
6252
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(params) {
6280
6253
  var _this$otherParams37;
6281
- var _ref52,
6282
- _ref52$cover,
6254
+ var _ref51,
6255
+ _ref51$cover,
6283
6256
  cover,
6284
- _args68 = arguments;
6285
- return _regeneratorRuntime().wrap(function _callee68$(_context68) {
6286
- while (1) switch (_context68.prev = _context68.next) {
6257
+ _args67 = arguments;
6258
+ return _regeneratorRuntime().wrap(function _callee67$(_context67) {
6259
+ while (1) switch (_context67.prev = _context67.next) {
6287
6260
  case 0:
6288
- _ref52 = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {}, _ref52$cover = _ref52.cover, cover = _ref52$cover === void 0 ? false : _ref52$cover;
6261
+ _ref51 = _args67.length > 1 && _args67[1] !== undefined ? _args67[1] : {}, _ref51$cover = _ref51.cover, cover = _ref51$cover === void 0 ? false : _ref51$cover;
6289
6262
  if (cover) {
6290
6263
  this.otherParams = _objectSpread({}, params);
6291
6264
  } else {
6292
6265
  this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
6293
6266
  }
6294
6267
  this.cacheId = (_this$otherParams37 = this.otherParams) === null || _this$otherParams37 === void 0 ? void 0 : _this$otherParams37.cacheId;
6295
- _context68.next = 5;
6268
+ _context67.next = 5;
6296
6269
  return this.syncOtherParamsToSubModules(params, {
6297
6270
  cover: cover
6298
6271
  });
6299
6272
  case 5:
6300
6273
  case "end":
6301
- return _context68.stop();
6274
+ return _context67.stop();
6302
6275
  }
6303
- }, _callee68, this);
6276
+ }, _callee67, this);
6304
6277
  }));
6305
- function setOtherParams(_x61) {
6278
+ function setOtherParams(_x60) {
6306
6279
  return _setOtherParams.apply(this, arguments);
6307
6280
  }
6308
6281
  return setOtherParams;