@pisell/pisellos 0.10.57 → 0.10.59

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.
@@ -526,6 +526,11 @@ export interface OrderHooksConfig {
526
526
  beforeCartIntentCommit?: (context: OrderCartIntentCommitContext) => void;
527
527
  /** Captures tenant/business runtime identity for asynchronous cart intents. */
528
528
  getCartIntentScope?: () => unknown;
529
+ /** Awaited before a local cart draft is published. Reject to leave the live order unchanged. */
530
+ onBeforeCartCommit?: (context: {
531
+ currentItems: readonly OrderProduct[];
532
+ proposedItems: readonly OrderProduct[];
533
+ }) => void | Promise<void>;
529
534
  onBeforeMergeProductToOrder?: (context: OrderProductMergeDecisionContext) => OrderProductMergeDecisionResult | Promise<OrderProductMergeDecisionResult>;
530
535
  }
531
536
  /**
@@ -121,8 +121,9 @@ export declare function getBundleSellingMagnitude(bundle: Record<string, any> |
121
121
  * = `metadata.main_product_original_price` + Σ(bundle 原价 × num)。
122
122
  * - `metadata.source_product_price`:主商品/variant 基础价(已应用报价单),不含 option、
123
123
  * 不含折扣。**权威源**。
124
- * - `metadata.main_product_original_price` = source + Σ(option.price × option.num)(含 option、不含折扣)。
125
- * - `metadata.main_product_selling_price` = main_original − 主商品券 per-unit amount(含 option、含折扣)。
124
+ * - `product_sku.option[].add_price` 保留单规格折前单价;Rules 的 option.price 只用于本次计算。
125
+ * - `metadata.main_product_original_price` = source + Σ(option.add_price × option.num)(含 option、不含折扣)。
126
+ * - `metadata.main_product_selling_price` = main_original − 行内 per-unit amount(含主商品及 option 优惠)。
126
127
  * - `payment_price`:出站 payload 中为行 composite 已减整单折扣均摊价(无折扣时与 `selling_price` 同义)。
127
128
  *
128
129
  * Rules 钩子契约(hook_adapt 方案,Rules 内部保持不变):
@@ -131,8 +132,9 @@ export declare function getBundleSellingMagnitude(bundle: Record<string, any> |
131
132
  * `getProductOriginTotalPrice` 会自行叠加 option + bundle,喂 source 可避免 option 双加。
132
133
  * - `getProduct.total` = `selling_price × num`(行 composite × num),与 Rules 内部产出的
133
134
  * total(source + option + bundle)对齐。
135
+ * - `getProduct.options` 用单规格原价参与重算;主商品折后价从 main_selling 减去 option 折后合计反推。
134
136
  * - `setProduct` 反向流程:把 Rules 返回的 source-level `main_product_selling_price` / `price`
135
- * 加回 Σoptions,重新合成含 option 的 main_product_* 并派生 composite。
137
+ * 加回单规格原价合计,再减去 optionDiscountAmount;保留订单单规格原价供取消折扣及后续重算。
136
138
  * 优先级:
137
139
  * 1. `values.main_product_selling_price`(券应用分支,per-unit 券后 source-level 主价)
138
140
  * 2. `values.price`(还原分支 `restoredPrice`、good_pass 归零)
@@ -580,8 +580,9 @@ export function getBundleSellingMagnitude(bundle) {
580
580
  * = `metadata.main_product_original_price` + Σ(bundle 原价 × num)。
581
581
  * - `metadata.source_product_price`:主商品/variant 基础价(已应用报价单),不含 option、
582
582
  * 不含折扣。**权威源**。
583
- * - `metadata.main_product_original_price` = source + Σ(option.price × option.num)(含 option、不含折扣)。
584
- * - `metadata.main_product_selling_price` = main_original − 主商品券 per-unit amount(含 option、含折扣)。
583
+ * - `product_sku.option[].add_price` 保留单规格折前单价;Rules 的 option.price 只用于本次计算。
584
+ * - `metadata.main_product_original_price` = source + Σ(option.add_price × option.num)(含 option、不含折扣)。
585
+ * - `metadata.main_product_selling_price` = main_original − 行内 per-unit amount(含主商品及 option 优惠)。
585
586
  * - `payment_price`:出站 payload 中为行 composite 已减整单折扣均摊价(无折扣时与 `selling_price` 同义)。
586
587
  *
587
588
  * Rules 钩子契约(hook_adapt 方案,Rules 内部保持不变):
@@ -590,8 +591,9 @@ export function getBundleSellingMagnitude(bundle) {
590
591
  * `getProductOriginTotalPrice` 会自行叠加 option + bundle,喂 source 可避免 option 双加。
591
592
  * - `getProduct.total` = `selling_price × num`(行 composite × num),与 Rules 内部产出的
592
593
  * total(source + option + bundle)对齐。
594
+ * - `getProduct.options` 用单规格原价参与重算;主商品折后价从 main_selling 减去 option 折后合计反推。
593
595
  * - `setProduct` 反向流程:把 Rules 返回的 source-level `main_product_selling_price` / `price`
594
- * 加回 Σoptions,重新合成含 option 的 main_product_* 并派生 composite。
596
+ * 加回单规格原价合计,再减去 optionDiscountAmount;保留订单单规格原价供取消折扣及后续重算。
595
597
  * 优先级:
596
598
  * 1. `values.main_product_selling_price`(券应用分支,per-unit 券后 source-level 主价)
597
599
  * 2. `values.price`(还原分支 `restoredPrice`、good_pass 归零)
@@ -814,6 +816,15 @@ export function createDefaultOrderRulesHooks(getBookings) {
814
816
  var effectiveNum = Number(num) > 0 ? Number(num) : 1;
815
817
  return new Decimal(Number(totalLike) || 0).dividedBy(effectiveNum).toDecimalPlaces(2).toString();
816
818
  };
819
+
820
+ // optionDiscountAmount 已是每件主商品内的单规格优惠合计,不再乘商品数量。
821
+ var getOptionDiscountAmount = function getOptionDiscountAmount(discountList) {
822
+ return (discountList || []).reduce(function (total, discount) {
823
+ var _discount$metadata, _discount$metadata2;
824
+ if (discount !== null && discount !== void 0 && (_discount$metadata = discount.metadata) !== null && _discount$metadata !== void 0 && _discount$metadata.custom_product_bundle_map_id) return total;
825
+ return total.plus(Number(discount === null || discount === void 0 || (_discount$metadata2 = discount.metadata) === null || _discount$metadata2 === void 0 ? void 0 : _discount$metadata2.optionDiscountAmount) || 0);
826
+ }, new Decimal(0));
827
+ };
817
828
  var getBundleIdentity = function getBundleIdentity(bundle) {
818
829
  var _ref21, _bundle$bundle_id, _ref22, _ref23, _bundle$bundle_produc, _ref24, _ref25, _bundle$bundle_varian, _ref26, _bundle$bundle_group_;
819
830
  return [(_ref21 = (_bundle$bundle_id = bundle.bundle_id) !== null && _bundle$bundle_id !== void 0 ? _bundle$bundle_id : bundle.id) !== null && _ref21 !== void 0 ? _ref21 : '', (_ref22 = (_ref23 = (_bundle$bundle_produc = bundle.bundle_product_id) !== null && _bundle$bundle_produc !== void 0 ? _bundle$bundle_produc : bundle._bundle_product_id) !== null && _ref23 !== void 0 ? _ref23 : bundle.product_id) !== null && _ref22 !== void 0 ? _ref22 : '', (_ref24 = (_ref25 = (_bundle$bundle_varian = bundle.bundle_variant_id) !== null && _bundle$bundle_varian !== void 0 ? _bundle$bundle_varian : bundle.variant_id) !== null && _ref25 !== void 0 ? _ref25 : bundle.product_variant_id) !== null && _ref24 !== void 0 ? _ref24 : 0, (_ref26 = (_bundle$bundle_group_ = bundle.bundle_group_id) !== null && _bundle$bundle_group_ !== void 0 ? _bundle$bundle_group_ : bundle.group_id) !== null && _ref26 !== void 0 ? _ref26 : ''].join('|');
@@ -851,12 +862,14 @@ export function createDefaultOrderRulesHooks(getBookings) {
851
862
  var _product$metadata7, _product$metadata8, _product$metadata9, _metadataAny$_promoti;
852
863
  // source_product_price 是权威源;兜底链:source → mainSelling − options(反推)→ 行 selling_price
853
864
  var metadataAny = product.metadata || {};
854
- var optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
865
+ var productOptions = getProductSkuOptions(product);
866
+ var optionSum = sumOptionUnitPrice(productOptions);
867
+ var optionSellingSum = optionSum.minus(getOptionDiscountAmount(product.discount_list));
855
868
  var sourcePrice;
856
869
  if (metadataAny.source_product_price !== undefined) {
857
870
  sourcePrice = String(metadataAny.source_product_price);
858
871
  } else if (metadataAny.main_product_selling_price !== undefined) {
859
- sourcePrice = new Decimal(Number(metadataAny.main_product_selling_price) || 0).minus(optionSum).toDecimalPlaces(2).toString();
872
+ sourcePrice = new Decimal(Number(metadataAny.main_product_selling_price) || 0).minus(optionSellingSum).toDecimalPlaces(2).toString();
860
873
  } else {
861
874
  var _product$selling_pric;
862
875
  sourcePrice = String((_product$selling_pric = product.selling_price) !== null && _product$selling_pric !== void 0 ? _product$selling_pric : 0);
@@ -887,6 +900,12 @@ export function createDefaultOrderRulesHooks(getBookings) {
887
900
  num: product.num || 1,
888
901
  discount_list: product.discount_list || [],
889
902
  bundle: product.product_bundle || [],
903
+ // 仅在 Rules 入参中映射 price,避免折后价污染订单的 add_price。
904
+ options: productOptions.map(function (option) {
905
+ return _objectSpread(_objectSpread({}, option), {}, {
906
+ price: option.add_price
907
+ });
908
+ }),
890
909
  booking_id: ((_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.booking_id) || null,
891
910
  isClient: false,
892
911
  // 勿写死 false:否则 Rules 不会走 total≠origin_total 的手动价推断,
@@ -894,20 +913,22 @@ export function createDefaultOrderRulesHooks(getBookings) {
894
913
  isManualDiscount: resolveRulesManualDiscountFlag(metadataAny),
895
914
  holder_id: (_product$metadata9 = product.metadata) === null || _product$metadata9 === void 0 ? void 0 : _product$metadata9.holder_id,
896
915
  startDate: getProductStartDate(product),
897
- main_product_selling_price: metadataAny.main_product_selling_price !== undefined ? new Decimal(Number(metadataAny.main_product_selling_price) || 0).minus(optionSum).toDecimalPlaces(2).toString() : undefined,
916
+ main_product_selling_price: metadataAny.main_product_selling_price !== undefined ? new Decimal(Number(metadataAny.main_product_selling_price) || 0).minus(optionSellingSum).toDecimalPlaces(2).toString() : undefined,
898
917
  inPromotion: ((_metadataAny$_promoti = metadataAny._promotion) === null || _metadataAny$_promoti === void 0 ? void 0 : _metadataAny$_promoti.inPromotion) === true,
899
918
  _promotion: metadataAny._promotion
900
919
  };
901
920
  },
902
921
  setProduct: function setProduct(product, values) {
903
- var _ref32, _values$quantity, _ref33, _metadataAny$source_p, _product$product_sku, _values$discount_list, _values$quantity2;
922
+ var _ref32, _values$quantity, _ref33, _metadataAny$source_p, _values$discount_list, _product$product_sku, _values$quantity2;
904
923
  var nextNum = Number((_ref32 = (_values$quantity = values.quantity) !== null && _values$quantity !== void 0 ? _values$quantity : product.num) !== null && _ref32 !== void 0 ? _ref32 : 1) || 1;
905
924
  var metadataAny = product.metadata || {};
906
925
  var existedSource = (_ref33 = (_metadataAny$source_p = metadataAny.source_product_price) !== null && _metadataAny$source_p !== void 0 ? _metadataAny$source_p : product.selling_price) !== null && _ref33 !== void 0 ? _ref33 : '0';
907
926
  var nextOptions = getProductSkuOptions(product);
908
927
  var optionSum = sumOptionUnitPrice(nextOptions);
928
+ var nextDiscountList = (_values$discount_list = values.discount_list) !== null && _values$discount_list !== void 0 ? _values$discount_list : product.discount_list;
929
+ var optionSellingSum = optionSum.minus(getOptionDiscountAmount(nextDiscountList));
909
930
 
910
- // Rules 返回的 main_product_selling_price / price / total 均为 source-level。
931
+ // Rules 返回的 main_product_selling_price / price 为不含 option 的主商品价。
911
932
  // 优先级:main_product_selling_price(per-unit 券后 source)> price(还原/good_pass 分支)>
912
933
  // total/num(仅当 Rules 只给 total 时的兜底)> 保留当前 source。
913
934
  var nextSourceSellingPrice = values.main_product_selling_price !== undefined ? String(values.main_product_selling_price) : values.price !== undefined ? String(values.price) : values.total !== undefined ? toUnitPriceString(values.total, nextNum) : String(existedSource);
@@ -916,8 +937,8 @@ export function createDefaultOrderRulesHooks(getBookings) {
916
937
  // 缺省时保留现有 source(券前 = 当前 source)。
917
938
  var nextSourceOriginalPrice = values.original_price !== undefined ? String(values.original_price) : String(existedSource);
918
939
 
919
- // 含 option 的 main_product_*
920
- var nextMainSellingPrice = new Decimal(Number(nextSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
940
+ // 成交价只加回 option 折后合计;原价仍使用订单中保存的 option 原价。
941
+ var nextMainSellingPrice = new Decimal(Number(nextSourceSellingPrice) || 0).plus(optionSellingSum).toDecimalPlaces(2).toFixed(2);
921
942
  var nextMainOriginalPrice = new Decimal(Number(nextSourceOriginalPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
922
943
  var nextBundle = values.bundle !== undefined ? mergeRulesBundlePrices(product.product_bundle, values.bundle) : product.product_bundle;
923
944
  var composedSellingPrice = composeLinePrice({
@@ -937,7 +958,7 @@ export function createDefaultOrderRulesHooks(getBookings) {
937
958
  return _objectSpread(_objectSpread({}, product), {}, {
938
959
  selling_price: composedSellingPrice,
939
960
  original_price: finalOriginalPrice,
940
- discount_list: (_values$discount_list = values.discount_list) !== null && _values$discount_list !== void 0 ? _values$discount_list : product.discount_list,
961
+ discount_list: nextDiscountList,
941
962
  num: (_values$quantity2 = values.quantity) !== null && _values$quantity2 !== void 0 ? _values$quantity2 : product.num,
942
963
  product_bundle: nextBundle,
943
964
  metadata: _objectSpread(_objectSpread({}, metadataAny), {}, {
@@ -99,7 +99,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
99
99
  }, {
100
100
  key: "updateOtherParams",
101
101
  value: function updateOtherParams(params) {
102
+ var previousScope = this.otherParams.catalogScopeKey;
102
103
  this.otherParams = params || {};
104
+ if (previousScope !== this.otherParams.catalogScopeKey && (previousScope || this.otherParams.catalogScopeKey)) {
105
+ this.store.list = [];
106
+ this.rawProductPriceSources.clear();
107
+ this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
108
+ }
103
109
  }
104
110
  }, {
105
111
  key: "storeChange",
@@ -155,12 +161,12 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
155
161
  key: "loadProducts",
156
162
  value: function () {
157
163
  var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
158
- var _this$otherParams,
164
+ var _this2 = this,
165
+ _this$otherParams,
159
166
  _this$otherParams$bus,
160
167
  _this$otherParams2,
161
168
  _this$otherParams3,
162
- _this$otherParams4,
163
- _this2 = this;
169
+ _this$otherParams4;
164
170
  var _ref,
165
171
  _ref$category_ids,
166
172
  category_ids,
@@ -182,6 +188,8 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
182
188
  status,
183
189
  strategy_context,
184
190
  options,
191
+ scope,
192
+ assertScope,
185
193
  userPlugin,
186
194
  customer_id,
187
195
  _userPlugin$get,
@@ -203,7 +211,14 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
203
211
  case 0:
204
212
  _ref = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, _ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule, extension_type = _ref.extension_type, _ref$status = _ref.status, status = _ref$status === void 0 ? 'published' : _ref$status, strategy_context = _ref.strategy_context;
205
213
  options = _args5.length > 1 ? _args5[1] : undefined;
206
- // // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
214
+ scope = this.otherParams.catalogScopeKey;
215
+ assertScope = function assertScope() {
216
+ if (scope !== _this2.otherParams.catalogScopeKey) {
217
+ throw Object.assign(new Error('Product catalog context changed'), {
218
+ name: 'AbortError'
219
+ });
220
+ }
221
+ }; // // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
207
222
  // if (!schedule_ids?.length) {
208
223
  // const schedule_ids_data = this.store.schedule
209
224
  // .getScheduleListByIds(schedule_ids)
@@ -276,39 +291,46 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
276
291
  subscriptionCallback = originalCallback ? ( /*#__PURE__*/function () {
277
292
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(result) {
278
293
  var _result$data;
279
- var callbackList, resolvedCallbackList;
294
+ var callbackList, products;
280
295
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
281
296
  while (1) switch (_context4.prev = _context4.next) {
282
297
  case 0:
298
+ if (!(scope !== _this2.otherParams.catalogScopeKey)) {
299
+ _context4.next = 2;
300
+ break;
301
+ }
302
+ return _context4.abrupt("return");
303
+ case 2:
283
304
  callbackList = result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.list;
284
305
  if (Array.isArray(callbackList)) {
285
- _context4.next = 4;
306
+ _context4.next = 6;
286
307
  break;
287
308
  }
288
309
  originalCallback(result);
289
310
  return _context4.abrupt("return");
290
- case 4:
311
+ case 6:
291
312
  if (!handledByOsServer) {
292
313
  // Subscription payloads may contain only changed products, so keep
293
314
  // the existing raw catalog scope and upsert the changed records.
294
315
  _this2.rememberRawProductQueryResult(callbackList);
295
316
  }
296
- resolvedCallbackList = resolveClientDataVariants({
317
+ products = resolveClientDataVariants({
297
318
  core: _this2.core,
298
319
  otherParams: _this2.otherParams,
299
320
  products: callbackList,
300
321
  queryPayload: queryPayload,
301
322
  handledByOsServer: handledByOsServer
302
323
  });
303
- _context4.next = 8;
304
- return _this2.addProduct(resolvedCallbackList);
305
- case 8:
306
- originalCallback(resolvedCallbackList === callbackList ? result : _objectSpread(_objectSpread({}, result), {}, {
324
+ assertScope();
325
+ _context4.next = 11;
326
+ return _this2.addProduct(products);
327
+ case 11:
328
+ originalCallback(handledByOsServer ? result : _objectSpread(_objectSpread({}, result), {}, {
307
329
  data: _objectSpread(_objectSpread({}, result.data), {}, {
308
- list: resolvedCallbackList
330
+ list: products
309
331
  })
310
332
  }));
311
- case 9:
333
+ case 12:
312
334
  case "end":
313
335
  return _context4.stop();
314
336
  }
@@ -318,15 +340,16 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
318
340
  return _ref2.apply(this, arguments);
319
341
  };
320
342
  }()) : undefined;
321
- _context5.next = 16;
343
+ _context5.next = 18;
322
344
  return this.request.post("/product/query", queryPayload, {
323
345
  osServer: true,
324
346
  callback: subscriptionCallback,
325
347
  subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId,
326
348
  customToast: function customToast() {}
327
349
  });
328
- case 16:
350
+ case 18:
329
351
  productsData = _context5.sent;
352
+ assertScope();
330
353
  if (!handledByOsServer && Array.isArray(productsData.data.list)) {
331
354
  this.replaceRawProductQueryResult(productsData.data.list, product_ids);
332
355
  }
@@ -348,7 +371,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
348
371
  // }
349
372
  this.addProduct(sortedList);
350
373
  return _context5.abrupt("return", sortedList);
351
- case 22:
374
+ case 25:
352
375
  case "end":
353
376
  return _context5.stop();
354
377
  }
@@ -1,3 +1,4 @@
1
+ import { InventoryController, type CheckoutRuntimeSnapshot } from '../../inventory';
1
2
  import { Module, ModuleOptions, PisellCore } from '../../types';
2
3
  import { BaseModule } from '../../modules/BaseModule';
3
4
  import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesSubmitSalesOrderParams, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentOptions, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } from './types';
@@ -49,6 +50,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
49
50
  protected appPlugin: AppPlugin;
50
51
  protected store: BaseSalesState;
51
52
  protected otherParams: Record<string, any>;
53
+ getInventory(): InventoryController | undefined;
54
+ prepareCheckout(signal?: AbortSignal): Promise<CheckoutRuntimeSnapshot | undefined>;
52
55
  protected cacheId: string | undefined;
53
56
  /**
54
57
  * 由已在初始化阶段解析过设备短号的业务解决方案写入。
@@ -187,6 +190,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
187
190
  * 可覆盖此方法并把未识别的 name 委托给 `super.createSubModule(name)`。
188
191
  */
189
192
  protected createSubModule(moduleName: string): Module | null;
193
+ private inventoryOrderHooks?;
190
194
  protected getSubModuleHooks(moduleName: string): any;
191
195
  /**
192
196
  * 构造传给 BaseSales 子模块的完整运行态参数,保证初始化和后续同步语义一致。
@@ -224,7 +228,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
224
228
  private isActiveVirtualSettlementOrder;
225
229
  private isHistoricalVirtualSettlementOrder;
226
230
  private syncAppDataToTempOrder;
231
+ private initialization?;
232
+ /** Hosts can await readiness without changing Core's synchronous registration API. */
233
+ whenInitialized(): Promise<void>;
227
234
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
235
+ private initializeSalesRuntime;
228
236
  destroy(): Promise<void>;
229
237
  /**
230
238
  * 加载销售订单到统一 tempOrder 工作区。