@pisell/pisellos 2.3.28 → 2.3.29

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 (84) hide show
  1. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  2. package/dist/model/strategy/adapter/dataVariant/adapter.js +167 -0
  3. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +89 -0
  4. package/dist/model/strategy/adapter/dataVariant/evaluator.js +780 -0
  5. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  6. package/dist/model/strategy/adapter/dataVariant/examples.js +277 -0
  7. package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  8. package/dist/model/strategy/adapter/dataVariant/index.js +4 -0
  9. package/dist/model/strategy/adapter/dataVariant/type.d.ts +148 -0
  10. package/dist/model/strategy/adapter/dataVariant/type.js +54 -0
  11. package/dist/model/strategy/adapter/index.d.ts +4 -0
  12. package/dist/model/strategy/adapter/index.js +5 -1
  13. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  14. package/dist/modules/Discount/index.d.ts +5 -2
  15. package/dist/modules/Discount/index.js +30 -7
  16. package/dist/modules/Discount/types.d.ts +4 -0
  17. package/dist/modules/Order/index.d.ts +7 -1
  18. package/dist/modules/Order/index.js +187 -74
  19. package/dist/modules/Order/types.d.ts +2 -0
  20. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  21. package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
  22. package/dist/modules/Order/utils.d.ts +2 -1
  23. package/dist/modules/Order/utils.js +2 -8
  24. package/dist/modules/Product/types.d.ts +22 -0
  25. package/dist/modules/ProductList/index.d.ts +1 -1
  26. package/dist/modules/ProductList/index.js +4 -2
  27. package/dist/modules/ProductList/types.d.ts +2 -0
  28. package/dist/server/index.d.ts +50 -0
  29. package/dist/server/index.js +995 -749
  30. package/dist/server/modules/order/index.d.ts +10 -4
  31. package/dist/server/modules/order/index.js +404 -399
  32. package/dist/server/modules/products/index.d.ts +26 -7
  33. package/dist/server/modules/products/index.js +167 -76
  34. package/dist/server/modules/products/types.d.ts +14 -0
  35. package/dist/solution/BaseSales/index.d.ts +9 -1
  36. package/dist/solution/BaseSales/index.js +998 -756
  37. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
  38. package/dist/solution/BaseSales/utils/parseSalesResponse.js +6 -8
  39. package/dist/solution/BookingByStep/index.d.ts +1 -1
  40. package/dist/solution/BookingTicket/index.d.ts +14 -2
  41. package/dist/solution/BookingTicket/types.d.ts +2 -0
  42. package/dist/solution/ShopDiscount/index.js +15 -14
  43. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  44. package/lib/model/strategy/adapter/dataVariant/adapter.js +149 -0
  45. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +89 -0
  46. package/lib/model/strategy/adapter/dataVariant/evaluator.js +583 -0
  47. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  48. package/lib/model/strategy/adapter/dataVariant/examples.js +293 -0
  49. package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  50. package/lib/model/strategy/adapter/dataVariant/index.js +38 -0
  51. package/lib/model/strategy/adapter/dataVariant/type.d.ts +148 -0
  52. package/lib/model/strategy/adapter/dataVariant/type.js +31 -0
  53. package/lib/model/strategy/adapter/index.d.ts +4 -0
  54. package/lib/model/strategy/adapter/index.js +13 -2
  55. package/lib/modules/Discount/index.d.ts +5 -2
  56. package/lib/modules/Discount/index.js +23 -3
  57. package/lib/modules/Discount/types.d.ts +4 -0
  58. package/lib/modules/Order/index.d.ts +7 -1
  59. package/lib/modules/Order/index.js +104 -6
  60. package/lib/modules/Order/types.d.ts +2 -0
  61. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  62. package/lib/modules/Order/utils/orderCollectionIdentity.js +415 -0
  63. package/lib/modules/Order/utils.d.ts +2 -1
  64. package/lib/modules/Order/utils.js +4 -11
  65. package/lib/modules/Product/types.d.ts +22 -0
  66. package/lib/modules/ProductList/index.d.ts +1 -1
  67. package/lib/modules/ProductList/index.js +4 -2
  68. package/lib/modules/ProductList/types.d.ts +2 -0
  69. package/lib/server/index.d.ts +50 -0
  70. package/lib/server/index.js +206 -29
  71. package/lib/server/modules/order/index.d.ts +10 -4
  72. package/lib/server/modules/order/index.js +198 -139
  73. package/lib/server/modules/products/index.d.ts +26 -7
  74. package/lib/server/modules/products/index.js +114 -35
  75. package/lib/server/modules/products/types.d.ts +14 -0
  76. package/lib/solution/BaseSales/index.d.ts +9 -1
  77. package/lib/solution/BaseSales/index.js +229 -54
  78. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
  79. package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -5
  80. package/lib/solution/BookingByStep/index.d.ts +1 -1
  81. package/lib/solution/BookingTicket/index.d.ts +14 -2
  82. package/lib/solution/BookingTicket/types.d.ts +2 -0
  83. package/lib/solution/ShopDiscount/index.js +2 -1
  84. package/package.json +1 -1
@@ -43,8 +43,10 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
43
43
  // 最多缓存7天
44
44
  // 商品格式化器列表
45
45
  this.formatters = [];
46
- // 是否已注册内置价格格式化器
47
- this.isPriceFormatterRegistered = false;
46
+ // 是否已注册内置商品格式化器
47
+ this.isBuiltinFormatterRegistered = false;
48
+ // 旧报价单格式化器默认关闭,仅显式开启时作为兼容兜底注册
49
+ this.isLegacyPriceFormatterEnabled = false;
48
50
  this.quotationBridgeLoadedKey = "";
49
51
  this.quotationScheduleCache = /* @__PURE__ */ new Map();
50
52
  this.quotationScheduleCacheSource = null;
@@ -56,6 +58,8 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
56
58
  this.lastPreloadCompletedAtMs = 0;
57
59
  /** IndexDB 写入串行队列,避免快照与 patch 并发交错 */
58
60
  this.productIndexDBSaveQueue = Promise.resolve();
61
+ /** 最近一次智能定价评估提取的 schedule 变价时间点(HH:mm),供 Server 订阅定时刷新使用 */
62
+ this.lastScheduleTimePoints = [];
59
63
  }
60
64
  async initialize(core, options) {
61
65
  var _a;
@@ -82,7 +86,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
82
86
  console.warn("[Products] IndexDB Manager 未找到");
83
87
  }
84
88
  }
85
- this.registerBuiltinPriceFormatter();
89
+ this.registerBuiltinProductFormatters();
86
90
  this.initProductDataSource();
87
91
  this.setupProductSync();
88
92
  this.logInfo("模块初始化完成", {
@@ -474,7 +478,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
474
478
  * @private
475
479
  */
476
480
  async prepareProductsWithPrice(schedule_date, extraContext, options) {
477
- var _a, _b;
481
+ var _a, _b, _c, _d;
478
482
  const tTotal = performance.now();
479
483
  const targetIds = options == null ? void 0 : options.productIds;
480
484
  const isIncremental = Array.isArray(targetIds);
@@ -499,21 +503,28 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
499
503
  (0, import_product.perfMark)("prepareProducts.extractIds", performance.now() - tIds, { count: ids.length });
500
504
  }
501
505
  this.logInfo("获取到商品列表", { productCount: products.length });
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 });
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
+ }
511
518
  const context = {
512
519
  schedule_date,
513
520
  schedule_datetime: extraContext == null ? void 0 : extraContext.schedule_datetime,
514
521
  customer_id: extraContext == null ? void 0 : extraContext.customer_id,
515
522
  priceData,
516
523
  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,
517
528
  ...extraContext
518
529
  };
519
530
  const tFormat = performance.now();
@@ -553,7 +564,21 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
553
564
  getProductsPriceCacheKey(schedule_date, extraContext, productIds) {
554
565
  const datetime = (extraContext == null ? void 0 : extraContext.schedule_datetime) || schedule_date;
555
566
  const productScope = productIds ? `:products:${productIds.join(",")}` : "";
556
- return `${datetime}:customer:${(extraContext == null ? void 0 : extraContext.customer_id) ?? ""}${productScope}`;
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);
557
582
  }
558
583
  normalizeProductIds(productIds) {
559
584
  if (!Array.isArray(productIds))
@@ -637,21 +662,50 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
637
662
  return result;
638
663
  }
639
664
  /**
640
- * 注册内置的价格格式化器
641
- * 这个格式化器负责将价格数据应用到商品上
665
+ * 注册内置商品格式化器。
666
+ *
667
+ * 智能定价默认替代报价单逻辑;报价单 formatter 仅在 enableLegacyPriceFormatter=true 时启用。
642
668
  * @private
643
669
  */
644
- registerBuiltinPriceFormatter() {
645
- if (this.isPriceFormatterRegistered) {
646
- console.warn("[ProductsModule] 内置价格格式化器已注册,跳过");
670
+ registerBuiltinProductFormatters() {
671
+ if (this.isBuiltinFormatterRegistered) {
672
+ console.warn("[ProductsModule] 内置商品格式化器已注册,跳过");
647
673
  return;
648
674
  }
649
- const priceFormatter = (products, context) => {
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) => {
650
704
  if (!context.priceData || context.priceData.length === 0) {
651
- console.log("[ProductsModule] 💰 没有价格数据,跳过价格应用");
705
+ console.log("[ProductsModule] 💰 没有价格数据,跳过 legacy 报价单价格应用");
652
706
  return products;
653
707
  }
654
- console.log(`[ProductsModule] 💰 应用价格数据到 ${products.length} 个商品`);
708
+ console.log(`[ProductsModule] 💰 应用 legacy 报价单价格到 ${products.length} 个商品`);
655
709
  return (0, import_product.applyPriceDataToProducts)(products, context.priceData);
656
710
  };
657
711
  const i18nFormatter = (products, context) => {
@@ -660,15 +714,34 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
660
714
  const detailValueFormatter = (products, context) => {
661
715
  return (0, import_product.applyDetailValueToProducts)(products, context);
662
716
  };
663
- this.formatters.unshift(priceFormatter);
717
+ if (this.isLegacyPriceFormatterEnabled) {
718
+ this.formatters.push(legacyPriceFormatter);
719
+ }
720
+ this.formatters.push(dataVariantFormatter);
664
721
  this.formatters.push(i18nFormatter);
665
722
  this.formatters.push(detailValueFormatter);
666
- this.isPriceFormatterRegistered = true;
667
- console.log("[ProductsModule] ✅ 内置价格格式化器已注册(第 1 个)");
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];
668
741
  }
669
742
  /**
670
743
  * 注册商品格式化器
671
- * 格式化器会按注册顺序依次执行(内置价格格式化器始终是第一个)
744
+ * 格式化器会按注册顺序依次执行;legacy 启用时先兜底报价,再由智能定价覆盖。
672
745
  * @param formatter 格式化函数
673
746
  * @param prepend 是否插入到队列开头(默认 false,追加到末尾)
674
747
  * @example
@@ -683,7 +756,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
683
756
  */
684
757
  registerFormatter(formatter, prepend = false) {
685
758
  if (prepend) {
686
- const insertIndex = this.isPriceFormatterRegistered ? 1 : 0;
759
+ const insertIndex = this.isBuiltinFormatterRegistered ? this.isLegacyPriceFormatterEnabled ? 2 : 1 : 0;
687
760
  this.formatters.splice(insertIndex, 0, formatter);
688
761
  console.log(`[ProductsModule] 📌 已在位置 ${insertIndex + 1} 插入格式化器,当前共 ${this.formatters.length} 个`);
689
762
  } else {
@@ -692,16 +765,17 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
692
765
  }
693
766
  }
694
767
  /**
695
- * 清空所有格式化器(包括内置价格格式化器)
696
- * @param keepBuiltin 是否保留内置价格格式化器(默认 true)
768
+ * 清空所有格式化器(包括内置智能定价格式化器)
769
+ * @param keepBuiltin 是否保留内置智能定价格式化器(默认 true)
697
770
  */
698
771
  clearFormatters(keepBuiltin = true) {
699
- if (keepBuiltin && this.isPriceFormatterRegistered) {
700
- this.formatters = [this.formatters[0]];
701
- console.log("[ProductsModule] 🧹 已清空自定义格式化器,保留内置价格格式化器");
772
+ if (keepBuiltin && this.isBuiltinFormatterRegistered) {
773
+ const builtinCount = this.isLegacyPriceFormatterEnabled ? 2 : 1;
774
+ this.formatters = this.formatters.slice(0, builtinCount);
775
+ console.log("[ProductsModule] 🧹 已清空自定义格式化器,保留内置智能定价格式化器");
702
776
  } else {
703
777
  this.formatters = [];
704
- this.isPriceFormatterRegistered = false;
778
+ this.isBuiltinFormatterRegistered = false;
705
779
  console.log("[ProductsModule] 🧹 已清空所有格式化器");
706
780
  }
707
781
  }
@@ -802,7 +876,8 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
802
876
  "resourceRelation",
803
877
  "bundleGroup.bundleItem",
804
878
  "optionGroup.optionItem",
805
- "variantGroup.variantItem"
879
+ "variantGroup.variantItem",
880
+ "dataVariants"
806
881
  ],
807
882
  open_deposit: 1,
808
883
  is_append_product_description: 1,
@@ -1247,7 +1322,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
1247
1322
  * Server 层监听该事件后对变更商品增量执行 prepareProductsWithPrice 并更新缓存
1248
1323
  */
1249
1324
  async processProductSyncMessages() {
1250
- var _a, _b, _c, _d, _e, _f;
1325
+ var _a, _b, _c, _d, _e, _f, _g;
1251
1326
  const messages = [...this.pendingSyncMessages];
1252
1327
  this.pendingSyncMessages = [];
1253
1328
  if (messages.length === 0)
@@ -1301,6 +1376,10 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
1301
1376
  if ((_f = msg.relation_product_ids) == null ? void 0 : _f.length) {
1302
1377
  sseRefreshIds.push(...msg.relation_product_ids);
1303
1378
  }
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
+ }
1304
1383
  }
1305
1384
  }
1306
1385
  const uniqueDeleteIds = [...new Set(deleteIds)];
@@ -114,6 +114,8 @@ export interface ProductSyncMessage {
114
114
  change_types?: string[];
115
115
  /** 关联商品 ID(product_collection / product_category / product_quotation 变更时携带) */
116
116
  relation_product_ids?: number[];
117
+ /** 关联商品 ID(product_data_variant 变更时携带) */
118
+ product_ids?: number[];
117
119
  message_uuid?: string;
118
120
  timestamp?: string;
119
121
  /** 内部标记:来源频道 key */
@@ -128,6 +130,18 @@ export interface ProductFormatterContext {
128
130
  customer_id?: number | string;
129
131
  priceData?: LoadProductsPriceData[];
130
132
  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
+ };
131
145
  locale?: string;
132
146
  }
133
147
  /**
@@ -49,9 +49,12 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
49
49
  private queuedAutoPaymentSync;
50
50
  private autoPaymentSyncFlushing;
51
51
  private autoPaymentSyncTimer;
52
- private salesDetailLoadInFlight;
52
+ private salesDetailLoadInFlightCount;
53
+ private salesDetailLoadSequence;
54
+ private salesDetailHydrateQueue;
53
55
  private serverOrderChangeUnsubscribe;
54
56
  private serverOrderChangeHydrateInFlight;
57
+ private queuedServerOrderChanges;
55
58
  private serverOrderChangeSyncEnabled;
56
59
  constructor(name?: string, version?: string);
57
60
  /**
@@ -75,8 +78,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
75
78
  private logError;
76
79
  private isCurrentSalesOrderRecord;
77
80
  setServerOrderChangeSyncEnabled(enabled: boolean): void;
81
+ private queueLatestServerOrderChange;
82
+ private drainQueuedServerOrderChanges;
78
83
  private syncCurrentSalesDetailFromServerOrderChange;
79
84
  private registerServerOrderChangeSync;
85
+ private hydrateLatestLoadedSalesDetail;
80
86
  private hydrateOrderPaymentNames;
81
87
  get payment(): PaymentModule | undefined;
82
88
  private getCurrentOrderCustomerId;
@@ -187,7 +193,9 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
187
193
  }): Promise<{
188
194
  productList: Record<string, any>[];
189
195
  discountList: Discount[];
196
+ availableWalletIds: number[];
190
197
  }>;
198
+ getAvailableWalletIds(): number[];
191
199
  bestDiscount(cb?: (result: any) => void): Promise<{
192
200
  productList: Record<string, any>[];
193
201
  discountList: Discount[];