@pisell/pisellos 2.3.49 → 2.3.50

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 (162) hide show
  1. package/dist/modules/Discount/index.d.ts +1 -0
  2. package/dist/modules/Discount/index.js +40 -11
  3. package/dist/modules/Discount/types.d.ts +1 -0
  4. package/dist/modules/Holder/index.d.ts +48 -0
  5. package/dist/modules/Holder/index.js +640 -0
  6. package/dist/modules/Holder/types.d.ts +123 -0
  7. package/dist/modules/Holder/types.js +1 -0
  8. package/dist/modules/Holder/utils.d.ts +13 -0
  9. package/dist/modules/Holder/utils.js +34 -0
  10. package/dist/modules/OpenData/index.js +2 -2
  11. package/dist/modules/Order/index.d.ts +3 -1
  12. package/dist/modules/Order/index.js +54 -25
  13. package/dist/modules/Order/types.d.ts +9 -0
  14. package/dist/modules/Order/utils.d.ts +10 -0
  15. package/dist/modules/Order/utils.js +35 -3
  16. package/dist/modules/Payment/types.d.ts +0 -8
  17. package/dist/modules/Payment/walletpass.d.ts +1 -7
  18. package/dist/modules/Payment/walletpass.js +45 -155
  19. package/dist/modules/Product/types.d.ts +1 -0
  20. package/dist/modules/ProductList/index.js +33 -14
  21. package/dist/modules/Quotation/index.d.ts +1 -1
  22. package/dist/modules/Quotation/index.js +2 -2
  23. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  24. package/dist/modules/ResourcePlanner/index.js +181 -0
  25. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  26. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  27. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  28. package/dist/modules/ResourcePlanner/types.js +1 -0
  29. package/dist/modules/Rules/index.js +47 -13
  30. package/dist/modules/SalesSummary/index.js +12 -13
  31. package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
  32. package/dist/modules/ScanOrderLogger/index.js +15 -2
  33. package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
  34. package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
  35. package/dist/modules/Schedule/index.d.ts +3 -1
  36. package/dist/modules/Schedule/index.js +21 -16
  37. package/dist/modules/Summary/utils.js +38 -13
  38. package/dist/modules/index.d.ts +2 -0
  39. package/dist/modules/index.js +3 -1
  40. package/dist/plugins/window.d.ts +1 -0
  41. package/dist/server/index.d.ts +14 -0
  42. package/dist/server/index.js +907 -793
  43. package/dist/server/modules/index.d.ts +1 -1
  44. package/dist/server/modules/order/index.d.ts +0 -16
  45. package/dist/server/modules/order/index.js +776 -964
  46. package/dist/server/modules/order/types.d.ts +0 -14
  47. package/dist/server/modules/order/types.js +0 -6
  48. package/dist/solution/BaseSales/index.d.ts +8 -3
  49. package/dist/solution/BaseSales/index.js +64 -50
  50. package/dist/solution/BookingByStep/index.d.ts +17 -2
  51. package/dist/solution/BookingByStep/index.js +294 -215
  52. package/dist/solution/BookingByStep/types.d.ts +2 -1
  53. package/dist/solution/BookingByStep/types.js +3 -1
  54. package/dist/solution/BookingByStep/utils/capacity.js +17 -1
  55. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  56. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  57. package/dist/solution/BookingTicket/index.d.ts +1 -1
  58. package/dist/solution/BookingTicket/index.js +2 -2
  59. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  60. package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
  61. package/dist/solution/ScanOrder/index.d.ts +26 -14
  62. package/dist/solution/ScanOrder/index.js +1142 -739
  63. package/dist/solution/ScanOrder/types.d.ts +21 -1
  64. package/dist/solution/ScanOrder/utils.d.ts +8 -0
  65. package/dist/solution/ScanOrder/utils.js +66 -25
  66. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  67. package/dist/solution/ShopDiscount/index.js +125 -87
  68. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  69. package/dist/solution/UnifiedBookingSales/index.js +1891 -0
  70. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  71. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  72. package/dist/solution/VenueBooking/index.d.ts +39 -11
  73. package/dist/solution/VenueBooking/index.js +1167 -841
  74. package/dist/solution/VenueBooking/types.d.ts +3 -0
  75. package/dist/solution/VenueBooking/utils/resource.js +1 -0
  76. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  77. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
  78. package/dist/solution/index.d.ts +1 -0
  79. package/dist/solution/index.js +2 -1
  80. package/dist/types/index.d.ts +1 -0
  81. package/lib/model/strategy/adapter/promotion/index.js +51 -0
  82. package/lib/modules/Discount/index.d.ts +1 -0
  83. package/lib/modules/Discount/index.js +9 -0
  84. package/lib/modules/Discount/types.d.ts +1 -0
  85. package/lib/modules/Holder/index.d.ts +48 -0
  86. package/lib/modules/Holder/index.js +402 -0
  87. package/lib/modules/Holder/types.d.ts +123 -0
  88. package/lib/modules/Holder/types.js +17 -0
  89. package/lib/modules/Holder/utils.d.ts +13 -0
  90. package/lib/modules/Holder/utils.js +71 -0
  91. package/lib/modules/OpenData/index.js +1 -1
  92. package/lib/modules/Order/index.d.ts +3 -1
  93. package/lib/modules/Order/index.js +26 -10
  94. package/lib/modules/Order/types.d.ts +9 -0
  95. package/lib/modules/Order/utils.d.ts +10 -0
  96. package/lib/modules/Order/utils.js +36 -5
  97. package/lib/modules/Payment/types.d.ts +0 -8
  98. package/lib/modules/Payment/walletpass.d.ts +1 -7
  99. package/lib/modules/Payment/walletpass.js +9 -107
  100. package/lib/modules/Product/types.d.ts +1 -0
  101. package/lib/modules/ProductList/index.js +40 -31
  102. package/lib/modules/Quotation/index.d.ts +1 -1
  103. package/lib/modules/Quotation/index.js +2 -2
  104. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  105. package/lib/modules/ResourcePlanner/index.js +148 -0
  106. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  107. package/lib/modules/ResourcePlanner/planner.js +933 -0
  108. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  109. package/lib/modules/ResourcePlanner/types.js +17 -0
  110. package/lib/modules/Rules/index.js +33 -16
  111. package/lib/modules/SalesSummary/index.js +6 -7
  112. package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
  113. package/lib/modules/ScanOrderLogger/index.js +13 -1
  114. package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
  115. package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
  116. package/lib/modules/Schedule/index.d.ts +3 -1
  117. package/lib/modules/Schedule/index.js +10 -8
  118. package/lib/modules/Summary/utils.js +21 -1
  119. package/lib/modules/index.d.ts +2 -0
  120. package/lib/modules/index.js +5 -1
  121. package/lib/plugins/window.d.ts +1 -0
  122. package/lib/server/index.d.ts +14 -0
  123. package/lib/server/index.js +72 -15
  124. package/lib/server/modules/index.d.ts +1 -1
  125. package/lib/server/modules/order/index.d.ts +0 -16
  126. package/lib/server/modules/order/index.js +4 -140
  127. package/lib/server/modules/order/types.d.ts +0 -14
  128. package/lib/server/modules/order/types.js +0 -1
  129. package/lib/solution/BaseSales/index.d.ts +8 -3
  130. package/lib/solution/BaseSales/index.js +24 -14
  131. package/lib/solution/BookingByStep/index.d.ts +17 -2
  132. package/lib/solution/BookingByStep/index.js +60 -18
  133. package/lib/solution/BookingByStep/types.d.ts +2 -1
  134. package/lib/solution/BookingByStep/types.js +5 -0
  135. package/lib/solution/BookingByStep/utils/capacity.js +20 -1
  136. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  137. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  138. package/lib/solution/BookingTicket/index.d.ts +1 -1
  139. package/lib/solution/BookingTicket/index.js +10 -2
  140. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  141. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  142. package/lib/solution/ScanOrder/index.d.ts +26 -14
  143. package/lib/solution/ScanOrder/index.js +449 -182
  144. package/lib/solution/ScanOrder/types.d.ts +21 -1
  145. package/lib/solution/ScanOrder/utils.d.ts +8 -0
  146. package/lib/solution/ScanOrder/utils.js +31 -0
  147. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  148. package/lib/solution/ShopDiscount/index.js +14 -0
  149. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  150. package/lib/solution/UnifiedBookingSales/index.js +1084 -0
  151. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  152. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  153. package/lib/solution/VenueBooking/index.d.ts +39 -11
  154. package/lib/solution/VenueBooking/index.js +322 -110
  155. package/lib/solution/VenueBooking/types.d.ts +3 -0
  156. package/lib/solution/VenueBooking/utils/resource.js +1 -0
  157. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  158. package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
  159. package/lib/solution/index.d.ts +1 -0
  160. package/lib/solution/index.js +3 -1
  161. package/lib/types/index.d.ts +1 -0
  162. package/package.json +1 -1
@@ -568,19 +568,6 @@ export interface OrderChangedPayload {
568
568
  /** 触发来源,便于订阅者区分 pubsub / 远端覆盖 / 清空等场景 */
569
569
  source?: string;
570
570
  }
571
- export type RemoteProductMembershipChangeSource = 'pubsub.bodyUpsert' | 'pubsub.httpRefresh';
572
- /**
573
- * 远端订单快照相对本地订单产生商品成员增删时的广播载荷。
574
- * 只表达商品行成员关系变化,不包含数量、价格、备注等字段级修改。
575
- */
576
- export interface RemoteProductMembershipChangedPayload {
577
- order_id: OrderId;
578
- source: RemoteProductMembershipChangeSource;
579
- added_product_keys: string[];
580
- removed_product_keys: string[];
581
- previous_product_count: number;
582
- current_product_count: number;
583
- }
584
571
  /**
585
572
  * OrderSyncMessage - pubsub 同步消息结构
586
573
  */
@@ -618,6 +605,5 @@ export interface OrderState {
618
605
  export declare enum OrderHooks {
619
606
  onOrdersLoaded = "order:onOrdersLoaded",
620
607
  onOrdersChanged = "order:onOrdersChanged",
621
- onRemoteProductMembershipChanged = "order:onRemoteProductMembershipChanged",
622
608
  onOrdersSyncCompleted = "order:onOrdersSyncCompleted"
623
609
  }
@@ -135,11 +135,6 @@
135
135
  * const changedOrders = payload.changedOrders
136
136
  */
137
137
 
138
- /**
139
- * 远端订单快照相对本地订单产生商品成员增删时的广播载荷。
140
- * 只表达商品行成员关系变化,不包含数量、价格、备注等字段级修改。
141
- */
142
-
143
138
  /**
144
139
  * OrderSyncMessage - pubsub 同步消息结构
145
140
  */
@@ -154,7 +149,6 @@
154
149
  export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
155
150
  OrderHooks["onOrdersLoaded"] = "order:onOrdersLoaded";
156
151
  OrderHooks["onOrdersChanged"] = "order:onOrdersChanged";
157
- OrderHooks["onRemoteProductMembershipChanged"] = "order:onRemoteProductMembershipChanged";
158
152
  OrderHooks["onOrdersSyncCompleted"] = "order:onOrdersSyncCompleted";
159
153
  return OrderHooks;
160
154
  }({});
@@ -9,7 +9,7 @@ import { RequestPlugin, WindowPlugin } from '../../plugins';
9
9
  export * from './types';
10
10
  import { ProductList } from '../../modules/ProductList';
11
11
  import { PaymentModule } from '../../modules/Payment';
12
- import type { PaymentMethod, RoundingResult, WalletAssetId, WalletAssetsBehaviorOptions, WalletAssetsSnapshot, WalletAssetsState, WalletAssetSelectionSource, ScanWalletAssetResult } from '../../modules/Payment/types';
12
+ import type { PaymentMethod, RoundingResult, WalletAssetId, WalletAssetsSnapshot, WalletAssetsState, WalletAssetSelectionSource, ScanWalletAssetResult } from '../../modules/Payment/types';
13
13
  import type { SalesSummaryModule } from '../../modules/SalesSummary';
14
14
  import type { ScheduleModule } from '../../modules/Schedule';
15
15
  import { QuotationModule } from '../../modules/Quotation';
@@ -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>>;
@@ -326,8 +333,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
326
333
  getWalletAssetsState(): WalletAssetsState;
327
334
  /** 导出 Shared Checkout 跨运行时恢复所需的钱包状态与搜索缓存。 */
328
335
  exportWalletAssetsSnapshot(): WalletAssetsSnapshot;
329
- /** 配置仅影响 Wallet Assets,不改变 Promotion/Voucher 选择流程。 */
330
- configureWalletAssetsBehavior(options: WalletAssetsBehaviorOptions): void;
331
336
  /**
332
337
  * 恢复 Shared Checkout 钱包快照,并把选择重新同步为订单 pending payment。
333
338
  */
@@ -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
  }
@@ -2794,8 +2793,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2794
2793
  key: "submitSalesOrder",
2795
2794
  value: (function () {
2796
2795
  var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
2797
- var _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
2798
- var inferredPaymentStatus, submitParams;
2796
+ var _params$smallTicketDa, _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
2797
+ var inferredPaymentStatus, smallTicketDataFlag, submitParams;
2799
2798
  return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2800
2799
  while (1) switch (_context27.prev = _context27.next) {
2801
2800
  case 0:
@@ -2807,6 +2806,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2807
2806
  case 2:
2808
2807
  // this.store.order.persistTempOrder();
2809
2808
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
2809
+ smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
2810
2810
  submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
2811
2811
  cacheId: this.cacheId,
2812
2812
  platform: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.platform,
@@ -2818,15 +2818,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2818
2818
  payments: params.payments
2819
2819
  } : {}), inferredPaymentStatus !== undefined ? {
2820
2820
  paymentStatus: inferredPaymentStatus
2821
- } : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
2822
- smallTicketDataFlag: params.smallTicketDataFlag
2821
+ } : {}), smallTicketDataFlag !== undefined ? {
2822
+ smallTicketDataFlag: smallTicketDataFlag
2823
2823
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
2824
2824
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
2825
2825
  } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
2826
2826
  enhancePayload: params.enhancePayload
2827
2827
  } : {});
2828
- return _context27.abrupt("return", this.store.order.submitTempOrder(submitParams));
2829
- case 5:
2828
+ return _context27.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
2829
+ case 6:
2830
2830
  case "end":
2831
2831
  return _context27.stop();
2832
2832
  }
@@ -2875,8 +2875,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2875
2875
  key: "submitTempOrderAsync",
2876
2876
  value: function () {
2877
2877
  var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
2878
- var _this$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
2879
- var inferredPaymentStatus, submitParams;
2878
+ var _params$smallTicketDa2, _this$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
2879
+ var inferredPaymentStatus, smallTicketDataFlag, submitParams;
2880
2880
  return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2881
2881
  while (1) switch (_context29.prev = _context29.next) {
2882
2882
  case 0:
@@ -2887,25 +2887,27 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2887
2887
  throw new Error('BaseSales 解决方案需要 order 模块支持');
2888
2888
  case 2:
2889
2889
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
2890
+ smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
2890
2891
  submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
2891
2892
  cacheId: this.cacheId,
2892
2893
  platform: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.platform,
2893
2894
  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),
2894
2895
  channel: this.getSubmitOrderSalesChannel(),
2895
- type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type
2896
+ type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type,
2897
+ request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
2896
2898
  }, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
2897
2899
  payments: params.payments
2898
2900
  } : {}), inferredPaymentStatus !== undefined ? {
2899
2901
  paymentStatus: inferredPaymentStatus
2900
- } : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
2901
- smallTicketDataFlag: params.smallTicketDataFlag
2902
+ } : {}), smallTicketDataFlag !== undefined ? {
2903
+ smallTicketDataFlag: smallTicketDataFlag
2902
2904
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
2903
2905
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
2904
2906
  } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
2905
2907
  enhancePayload: params.enhancePayload
2906
2908
  } : {});
2907
2909
  return _context29.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
2908
- case 5:
2910
+ case 6:
2909
2911
  case "end":
2910
2912
  return _context29.stop();
2911
2913
  }
@@ -2916,11 +2918,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2916
2918
  }
2917
2919
  return submitTempOrderAsync;
2918
2920
  }()
2921
+ /**
2922
+ * 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
2923
+ * otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
2924
+ */
2925
+ }, {
2926
+ key: "shouldUseCheckoutSyncTask",
2927
+ value: function shouldUseCheckoutSyncTask() {
2928
+ var _this$otherParams18;
2929
+ var configured = (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.checkoutSyncTaskEnabled;
2930
+ return typeof configured === 'boolean' ? configured : true;
2931
+ }
2932
+
2933
+ /** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
2934
+ }, {
2935
+ key: "getDefaultCheckoutSmallTicketDataFlag",
2936
+ value: function getDefaultCheckoutSmallTicketDataFlag() {
2937
+ return undefined;
2938
+ }
2919
2939
  }, {
2920
2940
  key: "printLocalOrderReceipt",
2921
2941
  value: function () {
2922
2942
  var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
2923
- var _this$otherParams18, _this$otherParams19, _this$otherParams20, _this$otherParams21;
2943
+ var _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
2924
2944
  var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
2925
2945
  return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2926
2946
  while (1) switch (_context30.prev = _context30.next) {
@@ -2938,10 +2958,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2938
2958
  external_sale_number: lookup
2939
2959
  };
2940
2960
  context = {
2941
- platform: (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.platform,
2942
- 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),
2961
+ platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
2962
+ 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),
2943
2963
  channel: this.getSubmitOrderSalesChannel(),
2944
- type: (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.type
2964
+ type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type
2945
2965
  };
2946
2966
  payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
2947
2967
  lookup_order_from_db: 1,
@@ -3000,7 +3020,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3000
3020
  key: "syncPaymentsToOrder",
3001
3021
  value: function () {
3002
3022
  var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
3003
- var _ref29, _params$businessCode, _this$otherParams22, _this$otherParams23, _params$channel2;
3023
+ var _ref29, _params$businessCode, _this$otherParams23, _this$otherParams24, _params$channel2;
3004
3024
  var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
3005
3025
  return _regeneratorRuntime().wrap(function _callee31$(_context31) {
3006
3026
  while (1) switch (_context31.prev = _context31.next) {
@@ -3011,9 +3031,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3011
3031
  }
3012
3032
  throw new Error('order 模块未初始化');
3013
3033
  case 2:
3014
- 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;
3034
+ 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;
3015
3035
  channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
3016
- syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), businessCode !== undefined ? {
3036
+ syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
3037
+ checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
3038
+ }, businessCode !== undefined ? {
3017
3039
  businessCode: businessCode
3018
3040
  } : {}), channel !== undefined ? {
3019
3041
  channel: channel
@@ -3268,7 +3290,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3268
3290
  }, {
3269
3291
  key: "addOrderPaymentWithDevicePrefix",
3270
3292
  value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
3271
- var _this$otherParams24,
3293
+ var _this$otherParams25,
3272
3294
  _paymentRecord$paymen,
3273
3295
  _paymentRecord$create,
3274
3296
  _ref30,
@@ -3284,7 +3306,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3284
3306
  return this.store.order.getOrderPayments();
3285
3307
  }
3286
3308
  var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
3287
- var shopWalletPassId = (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.shop_wallet_pass_id;
3309
+ var shopWalletPassId = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.shop_wallet_pass_id;
3288
3310
  if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
3289
3311
  metadata.shop_wallet_pass_id = shopWalletPassId;
3290
3312
  }
@@ -3821,14 +3843,6 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3821
3843
  return this.store.payment.wallet.exportWalletAssetsSnapshot();
3822
3844
  }
3823
3845
 
3824
- /** 配置仅影响 Wallet Assets,不改变 Promotion/Voucher 选择流程。 */
3825
- }, {
3826
- key: "configureWalletAssetsBehavior",
3827
- value: function configureWalletAssetsBehavior(options) {
3828
- if (!this.store.payment) throw new Error('payment 模块未初始化');
3829
- this.store.payment.wallet.configureWalletAssetsBehavior(options);
3830
- }
3831
-
3832
3846
  /**
3833
3847
  * 恢复 Shared Checkout 钱包快照,并把选择重新同步为订单 pending payment。
3834
3848
  */
@@ -4148,7 +4162,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4148
4162
  key: "getCashPaymentConfig",
4149
4163
  value: (function () {
4150
4164
  var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
4151
- var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams25;
4165
+ var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams26;
4152
4166
  var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
4153
4167
  return _regeneratorRuntime().wrap(function _callee45$(_context45) {
4154
4168
  while (1) switch (_context45.prev = _context45.next) {
@@ -4174,7 +4188,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4174
4188
  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);
4175
4189
  pendingWalletAmount = this.getPendingWalletPaymentAmount();
4176
4190
  amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
4177
- 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';
4191
+ 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';
4178
4192
  recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
4179
4193
  return _context45.abrupt("return", {
4180
4194
  available: Boolean(paymentMethod && amountDue > 0),
@@ -4309,7 +4323,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4309
4323
  key: "payCash",
4310
4324
  value: (function () {
4311
4325
  var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(params) {
4312
- var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams26, _this$window, _this$window$postMess;
4326
+ var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams27, _this$window, _this$window$postMess;
4313
4327
  var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
4314
4328
  return _regeneratorRuntime().wrap(function _callee47$(_context47) {
4315
4329
  while (1) switch (_context47.prev = _context47.next) {
@@ -4358,7 +4372,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4358
4372
  paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
4359
4373
  actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
4360
4374
  changeAmount = Number(params.changeAmount || 0);
4361
- shopWalletPassId = (_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.shop_wallet_pass_id;
4375
+ shopWalletPassId = (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.shop_wallet_pass_id;
4362
4376
  if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
4363
4377
  _context47.next = 26;
4364
4378
  break;
@@ -5261,13 +5275,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5261
5275
  key: "getProductList",
5262
5276
  value: function () {
5263
5277
  var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
5264
- var _this$otherParams27;
5278
+ var _this$otherParams28;
5265
5279
  var menu_list_ids, _this$store$products, res;
5266
5280
  return _regeneratorRuntime().wrap(function _callee62$(_context62) {
5267
5281
  while (1) switch (_context62.prev = _context62.next) {
5268
5282
  case 0:
5269
5283
  // 可以直接通过配置里的 menu 读取
5270
- 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) {
5284
+ 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) {
5271
5285
  return Number(n.value);
5272
5286
  })) || [];
5273
5287
  _context62.prev = 1;
@@ -5305,7 +5319,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5305
5319
  key: "setOtherParams",
5306
5320
  value: function () {
5307
5321
  var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
5308
- var _this$otherParams28;
5322
+ var _this$otherParams29;
5309
5323
  var _ref39,
5310
5324
  _ref39$cover,
5311
5325
  cover,
@@ -5319,7 +5333,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5319
5333
  } else {
5320
5334
  this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
5321
5335
  }
5322
- this.cacheId = (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.cacheId;
5336
+ this.cacheId = (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.cacheId;
5323
5337
  _context63.next = 5;
5324
5338
  return this.syncOtherParamsToSubModules(params, {
5325
5339
  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 | 2 | 1 | 5 | 4 | 3 | 6;
315
330
  }[]>;
316
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
332
  private getScheduleDataByIds;