@pisell/pisellos 2.3.42 → 2.3.43

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 (147) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/Discount/index.d.ts +1 -0
  3. package/dist/modules/Discount/index.js +40 -11
  4. package/dist/modules/Discount/types.d.ts +1 -0
  5. package/dist/modules/Holder/index.d.ts +48 -0
  6. package/dist/modules/Holder/index.js +640 -0
  7. package/dist/modules/Holder/types.d.ts +123 -0
  8. package/dist/modules/Holder/types.js +1 -0
  9. package/dist/modules/Holder/utils.d.ts +13 -0
  10. package/dist/modules/Holder/utils.js +34 -0
  11. package/dist/modules/OpenData/index.js +2 -2
  12. package/dist/modules/Order/index.d.ts +3 -1
  13. package/dist/modules/Order/index.js +54 -25
  14. package/dist/modules/Order/types.d.ts +9 -0
  15. package/dist/modules/Order/utils.d.ts +10 -0
  16. package/dist/modules/Order/utils.js +35 -3
  17. package/dist/modules/Product/types.d.ts +1 -0
  18. package/dist/modules/ProductList/index.js +33 -14
  19. package/dist/modules/Quotation/index.d.ts +1 -1
  20. package/dist/modules/Quotation/index.js +2 -2
  21. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  22. package/dist/modules/ResourcePlanner/index.js +181 -0
  23. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  24. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  25. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  26. package/dist/modules/ResourcePlanner/types.js +1 -0
  27. package/dist/modules/Rules/index.js +47 -13
  28. package/dist/modules/SalesSummary/index.js +12 -13
  29. package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
  30. package/dist/modules/ScanOrderLogger/index.js +15 -2
  31. package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
  32. package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
  33. package/dist/modules/Schedule/index.d.ts +3 -1
  34. package/dist/modules/Schedule/index.js +21 -16
  35. package/dist/modules/Summary/utils.js +38 -13
  36. package/dist/modules/index.d.ts +2 -0
  37. package/dist/modules/index.js +3 -1
  38. package/dist/plugins/window.d.ts +1 -0
  39. package/dist/server/index.d.ts +14 -0
  40. package/dist/server/index.js +772 -657
  41. package/dist/solution/BaseSales/index.d.ts +7 -0
  42. package/dist/solution/BaseSales/index.js +64 -42
  43. package/dist/solution/BookingByStep/index.d.ts +17 -2
  44. package/dist/solution/BookingByStep/index.js +294 -215
  45. package/dist/solution/BookingByStep/types.d.ts +2 -1
  46. package/dist/solution/BookingByStep/types.js +3 -1
  47. package/dist/solution/BookingByStep/utils/capacity.js +17 -1
  48. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  49. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  50. package/dist/solution/BookingTicket/index.d.ts +1 -1
  51. package/dist/solution/BookingTicket/index.js +2 -2
  52. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  53. package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
  54. package/dist/solution/ScanOrder/index.d.ts +26 -14
  55. package/dist/solution/ScanOrder/index.js +1142 -739
  56. package/dist/solution/ScanOrder/types.d.ts +21 -1
  57. package/dist/solution/ScanOrder/utils.d.ts +8 -0
  58. package/dist/solution/ScanOrder/utils.js +66 -25
  59. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  60. package/dist/solution/ShopDiscount/index.js +125 -87
  61. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  62. package/dist/solution/UnifiedBookingSales/index.js +1891 -0
  63. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  64. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  65. package/dist/solution/VenueBooking/index.d.ts +39 -11
  66. package/dist/solution/VenueBooking/index.js +1167 -841
  67. package/dist/solution/VenueBooking/types.d.ts +3 -0
  68. package/dist/solution/VenueBooking/utils/resource.js +1 -0
  69. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  70. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
  71. package/dist/solution/index.d.ts +1 -0
  72. package/dist/solution/index.js +2 -1
  73. package/dist/types/index.d.ts +1 -0
  74. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  75. package/lib/modules/Discount/index.d.ts +1 -0
  76. package/lib/modules/Discount/index.js +9 -0
  77. package/lib/modules/Discount/types.d.ts +1 -0
  78. package/lib/modules/Holder/index.d.ts +48 -0
  79. package/lib/modules/Holder/index.js +402 -0
  80. package/lib/modules/Holder/types.d.ts +123 -0
  81. package/lib/modules/Holder/types.js +17 -0
  82. package/lib/modules/Holder/utils.d.ts +13 -0
  83. package/lib/modules/Holder/utils.js +71 -0
  84. package/lib/modules/OpenData/index.js +1 -1
  85. package/lib/modules/Order/index.d.ts +3 -1
  86. package/lib/modules/Order/index.js +26 -10
  87. package/lib/modules/Order/types.d.ts +9 -0
  88. package/lib/modules/Order/utils.d.ts +10 -0
  89. package/lib/modules/Order/utils.js +36 -5
  90. package/lib/modules/Product/types.d.ts +1 -0
  91. package/lib/modules/ProductList/index.js +40 -31
  92. package/lib/modules/Quotation/index.d.ts +1 -1
  93. package/lib/modules/Quotation/index.js +2 -2
  94. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  95. package/lib/modules/ResourcePlanner/index.js +148 -0
  96. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  97. package/lib/modules/ResourcePlanner/planner.js +933 -0
  98. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  99. package/lib/modules/ResourcePlanner/types.js +17 -0
  100. package/lib/modules/Rules/index.js +33 -16
  101. package/lib/modules/SalesSummary/index.js +6 -7
  102. package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
  103. package/lib/modules/ScanOrderLogger/index.js +13 -1
  104. package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
  105. package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
  106. package/lib/modules/Schedule/index.d.ts +3 -1
  107. package/lib/modules/Schedule/index.js +10 -8
  108. package/lib/modules/Summary/utils.js +21 -1
  109. package/lib/modules/index.d.ts +2 -0
  110. package/lib/modules/index.js +5 -1
  111. package/lib/plugins/window.d.ts +1 -0
  112. package/lib/server/index.d.ts +14 -0
  113. package/lib/server/index.js +65 -5
  114. package/lib/solution/BaseSales/index.d.ts +7 -0
  115. package/lib/solution/BaseSales/index.js +24 -8
  116. package/lib/solution/BookingByStep/index.d.ts +17 -2
  117. package/lib/solution/BookingByStep/index.js +60 -18
  118. package/lib/solution/BookingByStep/types.d.ts +2 -1
  119. package/lib/solution/BookingByStep/types.js +5 -0
  120. package/lib/solution/BookingByStep/utils/capacity.js +20 -1
  121. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  122. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  123. package/lib/solution/BookingTicket/index.d.ts +1 -1
  124. package/lib/solution/BookingTicket/index.js +10 -2
  125. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  126. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  127. package/lib/solution/ScanOrder/index.d.ts +26 -14
  128. package/lib/solution/ScanOrder/index.js +449 -182
  129. package/lib/solution/ScanOrder/types.d.ts +21 -1
  130. package/lib/solution/ScanOrder/utils.d.ts +8 -0
  131. package/lib/solution/ScanOrder/utils.js +31 -0
  132. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  133. package/lib/solution/ShopDiscount/index.js +14 -0
  134. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  135. package/lib/solution/UnifiedBookingSales/index.js +1084 -0
  136. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  137. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  138. package/lib/solution/VenueBooking/index.d.ts +39 -11
  139. package/lib/solution/VenueBooking/index.js +322 -110
  140. package/lib/solution/VenueBooking/types.d.ts +3 -0
  141. package/lib/solution/VenueBooking/utils/resource.js +1 -0
  142. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  143. package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
  144. package/lib/solution/index.d.ts +1 -0
  145. package/lib/solution/index.js +3 -1
  146. package/lib/types/index.d.ts +1 -0
  147. package/package.json +1 -1
@@ -280,6 +280,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
280
280
  confirmPendingVoucherPayments?: boolean;
281
281
  enhancePayload?: SubmitPayloadEnhancer;
282
282
  }): Promise<T>;
283
+ /**
284
+ * 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
285
+ * otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
286
+ */
287
+ protected shouldUseCheckoutSyncTask(): boolean;
288
+ /** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
289
+ protected getDefaultCheckoutSmallTicketDataFlag(): number | undefined;
283
290
  printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
284
291
  private getSubmitPaymentStatus;
285
292
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
@@ -1312,6 +1312,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1312
1312
  value: function () {
1313
1313
  var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(core) {
1314
1314
  var _this$otherParams4,
1315
+ _this$appPlugin2,
1316
+ _this$appPlugin2$getA,
1315
1317
  _this9 = this,
1316
1318
  _this$otherParams5;
1317
1319
  var options,
@@ -1335,14 +1337,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1335
1337
 
1336
1338
  // 获取 logger 实例
1337
1339
  this.appPlugin = core.getPlugin('app');
1338
- if (this.appPlugin) {
1339
- _context11.next = 12;
1340
- break;
1340
+ if (!this.appPlugin) {
1341
+ // throw new Error('Checkout 解决方案需要 app 插件支持');
1341
1342
  }
1342
- throw new Error('Checkout 解决方案需要 app 插件支持');
1343
- case 12:
1344
- app = this.appPlugin.getApp();
1345
- this.logger = app.logger;
1343
+ app = (_this$appPlugin2 = this.appPlugin) === null || _this$appPlugin2 === void 0 || (_this$appPlugin2$getA = _this$appPlugin2.getApp) === null || _this$appPlugin2$getA === void 0 ? void 0 : _this$appPlugin2$getA.call(_this$appPlugin2);
1344
+ this.logger = app === null || app === void 0 ? void 0 : app.logger;
1346
1345
  targetCacheData = this.readSessionCacheData();
1347
1346
  moduleNames = this.getRegisteredModuleNames();
1348
1347
  moduleNames.forEach(function (step) {
@@ -1367,21 +1366,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1367
1366
  }));
1368
1367
  });
1369
1368
  if (!(this.store.schedule && !this.isScheduleListLoaded(this.store.schedule))) {
1370
- _context11.next = 20;
1369
+ _context11.next = 19;
1371
1370
  break;
1372
1371
  }
1373
- _context11.next = 20;
1372
+ _context11.next = 19;
1374
1373
  return this.store.schedule.loadAllSchedule();
1375
- case 20:
1374
+ case 19:
1376
1375
  if (this.store.order && typeof ((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.enableTempOrderPersist) === 'boolean') {
1377
1376
  this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
1378
1377
  }
1379
- _context11.next = 23;
1378
+ _context11.next = 22;
1380
1379
  return this.getPaymentMethodsAsync();
1381
- case 23:
1380
+ case 22:
1382
1381
  this.registerServerOrderChangeSync();
1383
1382
  this.core.effects.emit("".concat(this.name, ":onInited"), {});
1384
- case 25:
1383
+ case 24:
1385
1384
  case "end":
1386
1385
  return _context11.stop();
1387
1386
  }
@@ -2791,8 +2790,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2791
2790
  key: "submitSalesOrder",
2792
2791
  value: (function () {
2793
2792
  var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
2794
- var _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
2795
- var inferredPaymentStatus, submitParams;
2793
+ var _params$smallTicketDa, _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
2794
+ var inferredPaymentStatus, smallTicketDataFlag, submitParams;
2796
2795
  return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2797
2796
  while (1) switch (_context27.prev = _context27.next) {
2798
2797
  case 0:
@@ -2804,6 +2803,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2804
2803
  case 2:
2805
2804
  // this.store.order.persistTempOrder();
2806
2805
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
2806
+ smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
2807
2807
  submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
2808
2808
  cacheId: this.cacheId,
2809
2809
  platform: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.platform,
@@ -2815,15 +2815,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2815
2815
  payments: params.payments
2816
2816
  } : {}), inferredPaymentStatus !== undefined ? {
2817
2817
  paymentStatus: inferredPaymentStatus
2818
- } : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
2819
- smallTicketDataFlag: params.smallTicketDataFlag
2818
+ } : {}), smallTicketDataFlag !== undefined ? {
2819
+ smallTicketDataFlag: smallTicketDataFlag
2820
2820
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
2821
2821
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
2822
2822
  } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
2823
2823
  enhancePayload: params.enhancePayload
2824
2824
  } : {});
2825
- return _context27.abrupt("return", this.store.order.submitTempOrder(submitParams));
2826
- case 5:
2825
+ return _context27.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
2826
+ case 6:
2827
2827
  case "end":
2828
2828
  return _context27.stop();
2829
2829
  }
@@ -2872,8 +2872,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2872
2872
  key: "submitTempOrderAsync",
2873
2873
  value: function () {
2874
2874
  var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
2875
- var _this$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
2876
- var inferredPaymentStatus, submitParams;
2875
+ var _params$smallTicketDa2, _this$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
2876
+ var inferredPaymentStatus, smallTicketDataFlag, submitParams;
2877
2877
  return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2878
2878
  while (1) switch (_context29.prev = _context29.next) {
2879
2879
  case 0:
@@ -2884,25 +2884,27 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2884
2884
  throw new Error('BaseSales 解决方案需要 order 模块支持');
2885
2885
  case 2:
2886
2886
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
2887
+ smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
2887
2888
  submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
2888
2889
  cacheId: this.cacheId,
2889
2890
  platform: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.platform,
2890
2891
  businessCode: ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.businessCode) || ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.business_code),
2891
2892
  channel: this.getSubmitOrderSalesChannel(),
2892
- type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type
2893
+ type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type,
2894
+ request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
2893
2895
  }, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
2894
2896
  payments: params.payments
2895
2897
  } : {}), inferredPaymentStatus !== undefined ? {
2896
2898
  paymentStatus: inferredPaymentStatus
2897
- } : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
2898
- smallTicketDataFlag: params.smallTicketDataFlag
2899
+ } : {}), smallTicketDataFlag !== undefined ? {
2900
+ smallTicketDataFlag: smallTicketDataFlag
2899
2901
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
2900
2902
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
2901
2903
  } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
2902
2904
  enhancePayload: params.enhancePayload
2903
2905
  } : {});
2904
2906
  return _context29.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
2905
- case 5:
2907
+ case 6:
2906
2908
  case "end":
2907
2909
  return _context29.stop();
2908
2910
  }
@@ -2913,11 +2915,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2913
2915
  }
2914
2916
  return submitTempOrderAsync;
2915
2917
  }()
2918
+ /**
2919
+ * 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
2920
+ * otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
2921
+ */
2922
+ }, {
2923
+ key: "shouldUseCheckoutSyncTask",
2924
+ value: function shouldUseCheckoutSyncTask() {
2925
+ var _this$otherParams18;
2926
+ var configured = (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.checkoutSyncTaskEnabled;
2927
+ return typeof configured === 'boolean' ? configured : true;
2928
+ }
2929
+
2930
+ /** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
2931
+ }, {
2932
+ key: "getDefaultCheckoutSmallTicketDataFlag",
2933
+ value: function getDefaultCheckoutSmallTicketDataFlag() {
2934
+ return undefined;
2935
+ }
2916
2936
  }, {
2917
2937
  key: "printLocalOrderReceipt",
2918
2938
  value: function () {
2919
2939
  var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
2920
- var _this$otherParams18, _this$otherParams19, _this$otherParams20, _this$otherParams21;
2940
+ var _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
2921
2941
  var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
2922
2942
  return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2923
2943
  while (1) switch (_context30.prev = _context30.next) {
@@ -2935,10 +2955,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2935
2955
  external_sale_number: lookup
2936
2956
  };
2937
2957
  context = {
2938
- platform: (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.platform,
2939
- businessCode: ((_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.businessCode) || ((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.business_code),
2958
+ platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
2959
+ businessCode: ((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.businessCode) || ((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.business_code),
2940
2960
  channel: this.getSubmitOrderSalesChannel(),
2941
- type: (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.type
2961
+ type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type
2942
2962
  };
2943
2963
  payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
2944
2964
  lookup_order_from_db: 1,
@@ -2997,7 +3017,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2997
3017
  key: "syncPaymentsToOrder",
2998
3018
  value: function () {
2999
3019
  var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
3000
- var _ref29, _params$businessCode, _this$otherParams22, _this$otherParams23, _params$channel2;
3020
+ var _ref29, _params$businessCode, _this$otherParams23, _this$otherParams24, _params$channel2;
3001
3021
  var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
3002
3022
  return _regeneratorRuntime().wrap(function _callee31$(_context31) {
3003
3023
  while (1) switch (_context31.prev = _context31.next) {
@@ -3008,9 +3028,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3008
3028
  }
3009
3029
  throw new Error('order 模块未初始化');
3010
3030
  case 2:
3011
- businessCode = (_ref29 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.businessCode) !== null && _ref29 !== void 0 ? _ref29 : (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.business_code;
3031
+ businessCode = (_ref29 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.businessCode) !== null && _ref29 !== void 0 ? _ref29 : (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.business_code;
3012
3032
  channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
3013
- syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), businessCode !== undefined ? {
3033
+ syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
3034
+ checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
3035
+ }, businessCode !== undefined ? {
3014
3036
  businessCode: businessCode
3015
3037
  } : {}), channel !== undefined ? {
3016
3038
  channel: channel
@@ -3265,7 +3287,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3265
3287
  }, {
3266
3288
  key: "addOrderPaymentWithDevicePrefix",
3267
3289
  value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
3268
- var _this$otherParams24,
3290
+ var _this$otherParams25,
3269
3291
  _paymentRecord$paymen,
3270
3292
  _paymentRecord$create,
3271
3293
  _ref30,
@@ -3281,7 +3303,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3281
3303
  return this.store.order.getOrderPayments();
3282
3304
  }
3283
3305
  var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
3284
- var shopWalletPassId = (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.shop_wallet_pass_id;
3306
+ var shopWalletPassId = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.shop_wallet_pass_id;
3285
3307
  if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
3286
3308
  metadata.shop_wallet_pass_id = shopWalletPassId;
3287
3309
  }
@@ -4137,7 +4159,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4137
4159
  key: "getCashPaymentConfig",
4138
4160
  value: (function () {
4139
4161
  var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
4140
- var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams25;
4162
+ var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams26;
4141
4163
  var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
4142
4164
  return _regeneratorRuntime().wrap(function _callee45$(_context45) {
4143
4165
  while (1) switch (_context45.prev = _context45.next) {
@@ -4163,7 +4185,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4163
4185
  amountSnapshot = (_this$store$order11 = this.store.order) === null || _this$store$order11 === void 0 || (_this$store$order11$g = _this$store$order11.getOrderAmountSnapshot) === null || _this$store$order11$g === void 0 ? void 0 : _this$store$order11$g.call(_this$store$order11);
4164
4186
  pendingWalletAmount = this.getPendingWalletPaymentAmount();
4165
4187
  amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
4166
- currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.currency) || 'USD';
4188
+ currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.currency) || 'USD';
4167
4189
  recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
4168
4190
  return _context45.abrupt("return", {
4169
4191
  available: Boolean(paymentMethod && amountDue > 0),
@@ -4298,7 +4320,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4298
4320
  key: "payCash",
4299
4321
  value: (function () {
4300
4322
  var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(params) {
4301
- var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams26, _this$window, _this$window$postMess;
4323
+ var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams27, _this$window, _this$window$postMess;
4302
4324
  var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
4303
4325
  return _regeneratorRuntime().wrap(function _callee47$(_context47) {
4304
4326
  while (1) switch (_context47.prev = _context47.next) {
@@ -4347,7 +4369,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4347
4369
  paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
4348
4370
  actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
4349
4371
  changeAmount = Number(params.changeAmount || 0);
4350
- shopWalletPassId = (_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.shop_wallet_pass_id;
4372
+ shopWalletPassId = (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.shop_wallet_pass_id;
4351
4373
  if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
4352
4374
  _context47.next = 26;
4353
4375
  break;
@@ -5250,13 +5272,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5250
5272
  key: "getProductList",
5251
5273
  value: function () {
5252
5274
  var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
5253
- var _this$otherParams27;
5275
+ var _this$otherParams28;
5254
5276
  var menu_list_ids, _this$store$products, res;
5255
5277
  return _regeneratorRuntime().wrap(function _callee62$(_context62) {
5256
5278
  while (1) switch (_context62.prev = _context62.next) {
5257
5279
  case 0:
5258
5280
  // 可以直接通过配置里的 menu 读取
5259
- menu_list_ids = ((_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 || (_this$otherParams27 = _this$otherParams27.dineInConfig) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27['menu.associated_menus'].map(function (n) {
5281
+ menu_list_ids = ((_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 || (_this$otherParams28 = _this$otherParams28.dineInConfig) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28['menu.associated_menus'].map(function (n) {
5260
5282
  return Number(n.value);
5261
5283
  })) || [];
5262
5284
  _context62.prev = 1;
@@ -5294,7 +5316,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5294
5316
  key: "setOtherParams",
5295
5317
  value: function () {
5296
5318
  var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
5297
- var _this$otherParams28;
5319
+ var _this$otherParams29;
5298
5320
  var _ref39,
5299
5321
  _ref39$cover,
5300
5322
  cover,
@@ -5308,7 +5330,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5308
5330
  } else {
5309
5331
  this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
5310
5332
  }
5311
- this.cacheId = (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.cacheId;
5333
+ this.cacheId = (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.cacheId;
5312
5334
  _context63.next = 5;
5313
5335
  return this.syncOtherParamsToSubModules(params, {
5314
5336
  cover: cover
@@ -10,6 +10,7 @@ import { ITime } from '../../modules/Date/types';
10
10
  import dayjs from 'dayjs';
11
11
  import { LoadScheduleAvailableDateParams } from '../../modules/Schedule/types';
12
12
  import { IHolder, IFetchHolderAccountsParams } from '../../modules/AccountList/types';
13
+ import { IAppendFormRecordParams } from '../../modules/Holder/types';
13
14
  export declare class BookingByStepImpl extends BaseModule implements Module {
14
15
  protected defaultName: string;
15
16
  protected defaultVersion: string;
@@ -126,6 +127,20 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
126
127
  * @param params
127
128
  */
128
129
  fetchHolderAccountsAsync(params: IFetchHolderAccountsParams): Promise<void>;
130
+ /**
131
+ * 获取 holder 表单 map
132
+ */
133
+ getHolderFormMap(): import("../../modules").HolderFormMap;
134
+ /**
135
+ * 登录后或外部触发时,按当前 holderMap 批量刷新所有表单的 records
136
+ */
137
+ refreshAllHolderFormRecords(params?: {
138
+ customer_id?: number;
139
+ }): Promise<import("../../modules").HolderFormMap>;
140
+ /**
141
+ * 添加表单记录
142
+ */
143
+ appendFormRecord(params: IAppendFormRecordParams): import("../../modules").IFormRecord;
129
144
  setDateRange(dateRange: ITime[]): Promise<void>;
130
145
  clearDateRange(): void;
131
146
  getDateRange(): Promise<ITime[]>;
@@ -302,7 +317,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
302
317
  autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
303
318
  errorList: any[];
304
319
  };
305
- getTimeSlotByAllResources(resources_code: string): any[];
320
+ getTimeSlotByAllResources(resources_code: string, split?: number): any[];
306
321
  getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
307
322
  resources_code: string;
308
323
  startDate: string;
@@ -311,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
326
  date: string;
312
327
  status: string;
313
328
  week: string;
314
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
329
+ weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
315
330
  }[]>;
316
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
332
  private getScheduleDataByIds;