@pisell/pisellos 2.2.263 → 2.2.264

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 (132) hide show
  1. package/dist/model/strategy/adapter/index.d.ts +0 -4
  2. package/dist/model/strategy/adapter/index.js +1 -5
  3. package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  4. package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
  5. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  6. package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
  7. package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
  8. package/dist/model/strategy/adapter/promotion/examples.js +99 -0
  9. package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
  10. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
  12. package/dist/model/strategy/adapter/promotion/type.js +45 -0
  13. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +10 -16
  14. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -2
  15. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
  16. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +1 -32
  17. package/dist/modules/Discount/index.d.ts +2 -5
  18. package/dist/modules/Discount/index.js +7 -30
  19. package/dist/modules/Discount/types.d.ts +0 -4
  20. package/dist/modules/Order/index.d.ts +2 -14
  21. package/dist/modules/Order/index.js +736 -1035
  22. package/dist/modules/Order/types.d.ts +0 -16
  23. package/dist/modules/Order/utils.d.ts +3 -4
  24. package/dist/modules/Order/utils.js +61 -54
  25. package/dist/modules/Product/types.d.ts +0 -22
  26. package/dist/modules/ProductList/index.d.ts +1 -1
  27. package/dist/modules/ProductList/index.js +2 -4
  28. package/dist/modules/ProductList/types.d.ts +0 -2
  29. package/dist/modules/Rules/index.d.ts +9 -2
  30. package/dist/modules/Rules/index.js +43 -69
  31. package/dist/modules/Rules/types.d.ts +1 -10
  32. package/dist/server/index.d.ts +0 -55
  33. package/dist/server/index.js +753 -1173
  34. package/dist/server/modules/order/index.d.ts +4 -10
  35. package/dist/server/modules/order/index.js +399 -404
  36. package/dist/server/modules/order/types.d.ts +0 -4
  37. package/dist/server/modules/products/index.d.ts +8 -31
  38. package/dist/server/modules/products/index.js +390 -549
  39. package/dist/server/modules/products/types.d.ts +0 -18
  40. package/dist/solution/BaseSales/index.d.ts +1 -21
  41. package/dist/solution/BaseSales/index.js +789 -1136
  42. package/dist/solution/BaseSales/types.d.ts +1 -6
  43. package/dist/solution/BaseSales/types.js +1 -1
  44. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  45. package/dist/solution/BaseSales/utils/cartPromotion.js +97 -50
  46. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
  47. package/dist/solution/BaseSales/utils/parseSalesResponse.js +8 -6
  48. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -14
  49. package/dist/solution/BookingByStep/index.d.ts +1 -1
  50. package/dist/solution/BookingTicket/index.js +25 -59
  51. package/dist/solution/BookingTicket/types.d.ts +0 -2
  52. package/dist/solution/ScanOrder/index.js +31 -20
  53. package/dist/solution/ShopDiscount/index.js +14 -15
  54. package/dist/solution/VenueBooking/index.js +30 -19
  55. package/lib/model/strategy/adapter/index.d.ts +0 -4
  56. package/lib/model/strategy/adapter/index.js +2 -13
  57. package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  58. package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
  59. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  60. package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
  61. package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
  62. package/lib/model/strategy/adapter/promotion/examples.js +91 -0
  63. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  64. package/lib/model/strategy/adapter/promotion/index.js +51 -0
  65. package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
  66. package/lib/model/strategy/adapter/promotion/type.js +2 -0
  67. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -5
  68. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -1
  69. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
  70. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +2 -23
  71. package/lib/modules/Discount/index.d.ts +2 -5
  72. package/lib/modules/Discount/index.js +3 -23
  73. package/lib/modules/Discount/types.d.ts +0 -4
  74. package/lib/modules/Order/index.d.ts +2 -14
  75. package/lib/modules/Order/index.js +60 -326
  76. package/lib/modules/Order/types.d.ts +0 -16
  77. package/lib/modules/Order/utils.d.ts +3 -4
  78. package/lib/modules/Order/utils.js +23 -22
  79. package/lib/modules/Product/types.d.ts +0 -22
  80. package/lib/modules/ProductList/index.d.ts +1 -1
  81. package/lib/modules/ProductList/index.js +2 -4
  82. package/lib/modules/ProductList/types.d.ts +0 -2
  83. package/lib/modules/Rules/index.d.ts +9 -2
  84. package/lib/modules/Rules/index.js +29 -61
  85. package/lib/modules/Rules/types.d.ts +1 -10
  86. package/lib/server/index.d.ts +0 -55
  87. package/lib/server/index.js +34 -332
  88. package/lib/server/modules/order/index.d.ts +4 -10
  89. package/lib/server/modules/order/index.js +139 -198
  90. package/lib/server/modules/order/types.d.ts +0 -4
  91. package/lib/server/modules/products/index.d.ts +8 -31
  92. package/lib/server/modules/products/index.js +35 -134
  93. package/lib/server/modules/products/types.d.ts +0 -18
  94. package/lib/solution/BaseSales/index.d.ts +1 -21
  95. package/lib/solution/BaseSales/index.js +72 -313
  96. package/lib/solution/BaseSales/types.d.ts +1 -6
  97. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  98. package/lib/solution/BaseSales/utils/cartPromotion.js +64 -25
  99. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
  100. package/lib/solution/BaseSales/utils/parseSalesResponse.js +5 -4
  101. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +0 -8
  102. package/lib/solution/BookingByStep/index.d.ts +1 -1
  103. package/lib/solution/BookingTicket/index.js +8 -33
  104. package/lib/solution/BookingTicket/types.d.ts +0 -2
  105. package/lib/solution/ScanOrder/index.js +8 -0
  106. package/lib/solution/ShopDiscount/index.js +1 -2
  107. package/lib/solution/VenueBooking/index.js +8 -0
  108. package/package.json +1 -1
  109. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  110. package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
  111. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  112. package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -780
  113. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  114. package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
  115. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  116. package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
  117. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  118. package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
  119. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +0 -53
  120. package/dist/modules/Order/utils/orderCollectionIdentity.js +0 -405
  121. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  122. package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
  123. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  124. package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -583
  125. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  126. package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
  127. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  128. package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
  129. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  130. package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
  131. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +0 -53
  132. package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -415
@@ -43,10 +43,8 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
43
43
  // 最多缓存7天
44
44
  // 商品格式化器列表
45
45
  this.formatters = [];
46
- // 是否已注册内置商品格式化器
47
- this.isBuiltinFormatterRegistered = false;
48
- // 旧报价单格式化器默认关闭,仅显式开启时作为兼容兜底注册
49
- this.isLegacyPriceFormatterEnabled = false;
46
+ // 是否已注册内置价格格式化器
47
+ this.isPriceFormatterRegistered = false;
50
48
  this.quotationBridgeLoadedKey = "";
51
49
  this.quotationScheduleCache = /* @__PURE__ */ new Map();
52
50
  this.quotationScheduleCacheSource = null;
@@ -58,8 +56,6 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
58
56
  this.lastPreloadCompletedAtMs = 0;
59
57
  /** IndexDB 写入串行队列,避免快照与 patch 并发交错 */
60
58
  this.productIndexDBSaveQueue = Promise.resolve();
61
- /** 最近一次智能定价评估提取的 schedule 变价时间点(HH:mm),供 Server 订阅定时刷新使用 */
62
- this.lastScheduleTimePoints = [];
63
59
  }
64
60
  async initialize(core, options) {
65
61
  var _a;
@@ -86,7 +82,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
86
82
  console.warn("[Products] IndexDB Manager 未找到");
87
83
  }
88
84
  }
89
- this.registerBuiltinProductFormatters();
85
+ this.registerBuiltinPriceFormatter();
90
86
  this.initProductDataSource();
91
87
  this.setupProductSync();
92
88
  this.logInfo("模块初始化完成", {
@@ -478,7 +474,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
478
474
  * @private
479
475
  */
480
476
  async prepareProductsWithPrice(schedule_date, extraContext, options) {
481
- var _a, _b, _c, _d;
477
+ var _a, _b;
482
478
  const tTotal = performance.now();
483
479
  const targetIds = options == null ? void 0 : options.productIds;
484
480
  const isIncremental = Array.isArray(targetIds);
@@ -503,28 +499,21 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
503
499
  (0, import_product.perfMark)("prepareProducts.extractIds", performance.now() - tIds, { count: ids.length });
504
500
  }
505
501
  this.logInfo("获取到商品列表", { productCount: products.length });
506
- let priceData = [];
507
- if (this.isLegacyPriceFormatterEnabled) {
508
- const tPrice = performance.now();
509
- priceData = await this.loadProductsPrice({
510
- ids,
511
- schedule_date,
512
- schedule_datetime: extraContext == null ? void 0 : extraContext.schedule_datetime,
513
- customer_id: extraContext == null ? void 0 : extraContext.customer_id
514
- });
515
- (0, import_product.perfMark)("prepareProducts.loadPrice", performance.now() - tPrice, { count: ids.length });
516
- this.logInfo("获取商品报价单价格成功", { priceDataCount: (priceData == null ? void 0 : priceData.length) ?? 0 });
517
- }
502
+ const tPrice = performance.now();
503
+ const priceData = await this.loadProductsPrice({
504
+ ids,
505
+ schedule_date,
506
+ schedule_datetime: extraContext == null ? void 0 : extraContext.schedule_datetime,
507
+ customer_id: extraContext == null ? void 0 : extraContext.customer_id
508
+ });
509
+ (0, import_product.perfMark)("prepareProducts.loadPrice", performance.now() - tPrice, { count: ids.length });
510
+ this.logInfo("获取商品报价单价格成功", { priceDataCount: (priceData == null ? void 0 : priceData.length) ?? 0 });
518
511
  const context = {
519
512
  schedule_date,
520
513
  schedule_datetime: extraContext == null ? void 0 : extraContext.schedule_datetime,
521
514
  customer_id: extraContext == null ? void 0 : extraContext.customer_id,
522
515
  priceData,
523
516
  locale: (_b = (_a = this.core) == null ? void 0 : _a.context) == null ? void 0 : _b.locale,
524
- dataVariantEvaluator: (extraContext == null ? void 0 : extraContext.dataVariantEvaluator) || ((_d = (_c = this.core) == null ? void 0 : _c.context) == null ? void 0 : _d.dataVariantEvaluator),
525
- menuList: (extraContext == null ? void 0 : extraContext.menuList) || [],
526
- scheduleList: (extraContext == null ? void 0 : extraContext.scheduleList) || [],
527
- strategy_context: extraContext == null ? void 0 : extraContext.strategy_context,
528
517
  ...extraContext
529
518
  };
530
519
  const tFormat = performance.now();
@@ -564,21 +553,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
564
553
  getProductsPriceCacheKey(schedule_date, extraContext, productIds) {
565
554
  const datetime = (extraContext == null ? void 0 : extraContext.schedule_datetime) || schedule_date;
566
555
  const productScope = productIds ? `:products:${productIds.join(",")}` : "";
567
- const strategyScope = this.stringifyStable((extraContext == null ? void 0 : extraContext.strategy_context) || {});
568
- return `${datetime}:customer:${(extraContext == null ? void 0 : extraContext.customer_id) ?? ""}:strategy:${strategyScope}${productScope}`;
569
- }
570
- /**
571
- * 稳定序列化策略上下文,避免对象 key 顺序不同导致缓存 key 抖动。
572
- */
573
- stringifyStable(value) {
574
- if (value == null)
575
- return "";
576
- if (Array.isArray(value))
577
- return `[${value.map((item) => this.stringifyStable(item)).join(",")}]`;
578
- if (typeof value === "object") {
579
- return `{${Object.keys(value).sort().map((key) => `${key}:${this.stringifyStable(value[key])}`).join(",")}}`;
580
- }
581
- return String(value);
556
+ return `${datetime}:customer:${(extraContext == null ? void 0 : extraContext.customer_id) ?? ""}${productScope}`;
582
557
  }
583
558
  normalizeProductIds(productIds) {
584
559
  if (!Array.isArray(productIds))
@@ -662,50 +637,21 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
662
637
  return result;
663
638
  }
664
639
  /**
665
- * 注册内置商品格式化器。
666
- *
667
- * 智能定价默认替代报价单逻辑;报价单 formatter 仅在 enableLegacyPriceFormatter=true 时启用。
640
+ * 注册内置的价格格式化器
641
+ * 这个格式化器负责将价格数据应用到商品上
668
642
  * @private
669
643
  */
670
- registerBuiltinProductFormatters() {
671
- if (this.isBuiltinFormatterRegistered) {
672
- console.warn("[ProductsModule] 内置商品格式化器已注册,跳过");
644
+ registerBuiltinPriceFormatter() {
645
+ if (this.isPriceFormatterRegistered) {
646
+ console.warn("[ProductsModule] 内置价格格式化器已注册,跳过");
673
647
  return;
674
648
  }
675
- this.isLegacyPriceFormatterEnabled = this.shouldEnableLegacyPriceFormatter();
676
- const dataVariantFormatter = (products, context) => {
677
- var _a, _b;
678
- const evaluator = context.dataVariantEvaluator || ((_b = (_a = this.core) == null ? void 0 : _a.context) == null ? void 0 : _b.dataVariantEvaluator);
679
- if (!evaluator || typeof evaluator.resolveProducts !== "function") {
680
- this.lastScheduleTimePoints = [];
681
- this.logWarning("智能定价评估器未注入,跳过 DataVariant 格式化", {
682
- productCount: products.length
683
- });
684
- return products;
685
- }
686
- const strategyContext = context.strategy_context || {};
687
- const businessData = {
688
- products,
689
- scheduleDateTime: context.schedule_datetime || context.schedule_date,
690
- scheduleList: context.scheduleList || [],
691
- menuList: context.menuList || [],
692
- customerId: context.customer_id,
693
- channel: strategyContext.channel,
694
- orderType: strategyContext.orderType || strategyContext.order_type,
695
- businessCode: strategyContext.business_code ?? strategyContext.businessCode,
696
- availableWalletIds: strategyContext.available_wallet_ids,
697
- custom: strategyContext
698
- };
699
- const result = evaluator.resolveProducts(businessData);
700
- this.lastScheduleTimePoints = Array.isArray(result == null ? void 0 : result.scheduleTimePoints) ? [...result.scheduleTimePoints] : [];
701
- return Array.isArray(result == null ? void 0 : result.products) ? result.products : products;
702
- };
703
- const legacyPriceFormatter = (products, context) => {
649
+ const priceFormatter = (products, context) => {
704
650
  if (!context.priceData || context.priceData.length === 0) {
705
- console.log("[ProductsModule] 💰 没有价格数据,跳过 legacy 报价单价格应用");
651
+ console.log("[ProductsModule] 💰 没有价格数据,跳过价格应用");
706
652
  return products;
707
653
  }
708
- console.log(`[ProductsModule] 💰 应用 legacy 报价单价格到 ${products.length} 个商品`);
654
+ console.log(`[ProductsModule] 💰 应用价格数据到 ${products.length} 个商品`);
709
655
  return (0, import_product.applyPriceDataToProducts)(products, context.priceData);
710
656
  };
711
657
  const i18nFormatter = (products, context) => {
@@ -714,34 +660,15 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
714
660
  const detailValueFormatter = (products, context) => {
715
661
  return (0, import_product.applyDetailValueToProducts)(products, context);
716
662
  };
717
- if (this.isLegacyPriceFormatterEnabled) {
718
- this.formatters.push(legacyPriceFormatter);
719
- }
720
- this.formatters.push(dataVariantFormatter);
663
+ this.formatters.unshift(priceFormatter);
721
664
  this.formatters.push(i18nFormatter);
722
665
  this.formatters.push(detailValueFormatter);
723
- this.isBuiltinFormatterRegistered = true;
724
- console.log("[ProductsModule] ✅ 内置商品格式化器已注册(智能定价优先)");
725
- }
726
- /**
727
- * 是否启用旧报价单价格 formatter。
728
- *
729
- * 默认关闭,避免报价单逻辑覆盖智能定价结果。
730
- */
731
- shouldEnableLegacyPriceFormatter() {
732
- var _a, _b, _c;
733
- return ((_a = this.otherParams) == null ? void 0 : _a.enableLegacyPriceFormatter) === true || ((_c = (_b = this.core) == null ? void 0 : _b.context) == null ? void 0 : _c.enableLegacyPriceFormatter) === true;
734
- }
735
- /**
736
- * 返回最近一次 prepareProductsWithPrice / DataVariant 评估提取的变价时间点(HH:mm)。
737
- * 供 OS Server 商品 query 订阅定时刷新使用。
738
- */
739
- getLastScheduleTimePoints() {
740
- return [...this.lastScheduleTimePoints];
666
+ this.isPriceFormatterRegistered = true;
667
+ console.log("[ProductsModule] ✅ 内置价格格式化器已注册(第 1 个)");
741
668
  }
742
669
  /**
743
670
  * 注册商品格式化器
744
- * 格式化器会按注册顺序依次执行;legacy 启用时先兜底报价,再由智能定价覆盖。
671
+ * 格式化器会按注册顺序依次执行(内置价格格式化器始终是第一个)
745
672
  * @param formatter 格式化函数
746
673
  * @param prepend 是否插入到队列开头(默认 false,追加到末尾)
747
674
  * @example
@@ -756,7 +683,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
756
683
  */
757
684
  registerFormatter(formatter, prepend = false) {
758
685
  if (prepend) {
759
- const insertIndex = this.isBuiltinFormatterRegistered ? this.isLegacyPriceFormatterEnabled ? 2 : 1 : 0;
686
+ const insertIndex = this.isPriceFormatterRegistered ? 1 : 0;
760
687
  this.formatters.splice(insertIndex, 0, formatter);
761
688
  console.log(`[ProductsModule] 📌 已在位置 ${insertIndex + 1} 插入格式化器,当前共 ${this.formatters.length} 个`);
762
689
  } else {
@@ -765,17 +692,16 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
765
692
  }
766
693
  }
767
694
  /**
768
- * 清空所有格式化器(包括内置智能定价格式化器)
769
- * @param keepBuiltin 是否保留内置智能定价格式化器(默认 true)
695
+ * 清空所有格式化器(包括内置价格格式化器)
696
+ * @param keepBuiltin 是否保留内置价格格式化器(默认 true)
770
697
  */
771
698
  clearFormatters(keepBuiltin = true) {
772
- if (keepBuiltin && this.isBuiltinFormatterRegistered) {
773
- const builtinCount = this.isLegacyPriceFormatterEnabled ? 2 : 1;
774
- this.formatters = this.formatters.slice(0, builtinCount);
775
- console.log("[ProductsModule] 🧹 已清空自定义格式化器,保留内置智能定价格式化器");
699
+ if (keepBuiltin && this.isPriceFormatterRegistered) {
700
+ this.formatters = [this.formatters[0]];
701
+ console.log("[ProductsModule] 🧹 已清空自定义格式化器,保留内置价格格式化器");
776
702
  } else {
777
703
  this.formatters = [];
778
- this.isBuiltinFormatterRegistered = false;
704
+ this.isPriceFormatterRegistered = false;
779
705
  console.log("[ProductsModule] 🧹 已清空所有格式化器");
780
706
  }
781
707
  }
@@ -876,8 +802,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
876
802
  "resourceRelation",
877
803
  "bundleGroup.bundleItem",
878
804
  "optionGroup.optionItem",
879
- "variantGroup.variantItem",
880
- "dataVariants"
805
+ "variantGroup.variantItem"
881
806
  ],
882
807
  open_deposit: 1,
883
808
  is_append_product_description: 1,
@@ -935,26 +860,6 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
935
860
  (0, import_product.perfMark)("ProductsModule.getProducts(structuredClone)", performance.now() - t0, { count: result.length });
936
861
  return result;
937
862
  }
938
- /**
939
- * 批量获取商品轻量快照,供订单详情等响应补齐展示协议字段。
940
- */
941
- async getProductSnapshotsByIds(ids) {
942
- const snapshots = {};
943
- const seen = /* @__PURE__ */ new Set();
944
- for (const id of ids) {
945
- if (!Number.isFinite(id) || seen.has(id))
946
- continue;
947
- seen.add(id);
948
- const product = this.store.map.get(id);
949
- if (!product)
950
- continue;
951
- snapshots[String(id)] = {
952
- cover: product.cover,
953
- holder_config: product.holder_config
954
- };
955
- }
956
- return snapshots;
957
- }
958
863
  /**
959
864
  * 内部获取商品列表的直接引用(无拷贝)
960
865
  * 仅供内部 formatter 流程使用,因为 formatter 会创建新对象
@@ -1322,7 +1227,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
1322
1227
  * Server 层监听该事件后对变更商品增量执行 prepareProductsWithPrice 并更新缓存
1323
1228
  */
1324
1229
  async processProductSyncMessages() {
1325
- var _a, _b, _c, _d, _e, _f, _g;
1230
+ var _a, _b, _c, _d, _e, _f;
1326
1231
  const messages = [...this.pendingSyncMessages];
1327
1232
  this.pendingSyncMessages = [];
1328
1233
  if (messages.length === 0)
@@ -1376,10 +1281,6 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
1376
1281
  if ((_f = msg.relation_product_ids) == null ? void 0 : _f.length) {
1377
1282
  sseRefreshIds.push(...msg.relation_product_ids);
1378
1283
  }
1379
- } else if (["product_data_variant"].includes(channelKey)) {
1380
- if ((_g = msg.product_ids) == null ? void 0 : _g.length) {
1381
- sseRefreshIds.push(...msg.product_ids);
1382
- }
1383
1284
  }
1384
1285
  }
1385
1286
  const uniqueDeleteIds = [...new Set(deleteIds)];
@@ -28,10 +28,6 @@ export interface ProductIdScope {
28
28
  /** 指定商品集合 ID */
29
29
  collectionIds?: number[];
30
30
  }
31
- export interface ProductSnapshot {
32
- cover?: ProductData['cover'];
33
- holder_config?: ProductData['holder_config'];
34
- }
35
31
  /**
36
32
  * 加载报价单商品价格参数
37
33
  */
@@ -114,8 +110,6 @@ export interface ProductSyncMessage {
114
110
  change_types?: string[];
115
111
  /** 关联商品 ID(product_collection / product_category / product_quotation 变更时携带) */
116
112
  relation_product_ids?: number[];
117
- /** 关联商品 ID(product_data_variant 变更时携带) */
118
- product_ids?: number[];
119
113
  message_uuid?: string;
120
114
  timestamp?: string;
121
115
  /** 内部标记:来源频道 key */
@@ -130,18 +124,6 @@ export interface ProductFormatterContext {
130
124
  customer_id?: number | string;
131
125
  priceData?: LoadProductsPriceData[];
132
126
  scheduleModule?: any;
133
- /** 全量餐牌列表,供智能定价 menu_match 等条件判断使用 */
134
- menuList?: any[];
135
- /** 全量日程列表,供智能定价 schedule_match 等条件判断使用 */
136
- scheduleList?: any[];
137
- /** 外部传入的策略上下文,仅承载定价条件,不参与商品集合筛选 */
138
- strategy_context?: Record<string, any>;
139
- /** 智能定价评估器,由宿主统一注入到 PisellOS context */
140
- dataVariantEvaluator?: {
141
- resolveProducts: (businessData: any) => {
142
- products: ProductData[];
143
- };
144
- };
145
127
  locale?: string;
146
128
  }
147
129
  /**
@@ -49,13 +49,9 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
49
49
  private queuedAutoPaymentSync;
50
50
  private autoPaymentSyncFlushing;
51
51
  private autoPaymentSyncTimer;
52
- private salesDetailLoadInFlightCount;
53
- private salesDetailLoadSequence;
54
- private salesDetailHydrateQueue;
52
+ private salesDetailLoadInFlight;
55
53
  private serverOrderChangeUnsubscribe;
56
54
  private serverOrderChangeHydrateInFlight;
57
- private queuedServerOrderChanges;
58
- private serverOrderChangeSyncEnabled;
59
55
  constructor(name?: string, version?: string);
60
56
  /**
61
57
  * 子类可覆盖此方法以追加/收敛要注册的子模块。
@@ -77,12 +73,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
77
73
  */
78
74
  private logError;
79
75
  private isCurrentSalesOrderRecord;
80
- setServerOrderChangeSyncEnabled(enabled: boolean): void;
81
- private queueLatestServerOrderChange;
82
- private drainQueuedServerOrderChanges;
83
76
  private syncCurrentSalesDetailFromServerOrderChange;
84
77
  private registerServerOrderChangeSync;
85
- private hydrateLatestLoadedSalesDetail;
86
78
  private hydrateOrderPaymentNames;
87
79
  get payment(): PaymentModule | undefined;
88
80
  private getCurrentOrderCustomerId;
@@ -193,24 +185,12 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
193
185
  }): Promise<{
194
186
  productList: Record<string, any>[];
195
187
  discountList: Discount[];
196
- availableWalletIds: number[];
197
188
  }>;
198
- getAvailableWalletIds(): number[];
199
189
  bestDiscount(cb?: (result: any) => void): Promise<{
200
190
  productList: Record<string, any>[];
201
191
  discountList: Discount[];
202
192
  }>;
203
193
  getDiscountList(): Discount[];
204
- /** 读取 Discount 模块原始券列表(未经过 bookingTime 等过滤)。 */
205
- getOriginalDiscountList(): Discount[];
206
- /**
207
- * 同步写入 Discount 模块的 discountList / originalDiscountList。
208
- * 供 Holder 补全等场景在 OS store 层更新 machinecode holder 字段。
209
- */
210
- replaceDiscountStoreLists(params: {
211
- discountList: Discount[];
212
- originalDiscountList?: Discount[];
213
- }): Promise<void>;
214
194
  scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
215
195
  setDiscountSelected(params: {
216
196
  discountId: number;