@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
@@ -63,8 +63,6 @@ export interface OrderProductBundleItem {
63
63
  bundle_group_id?: number;
64
64
  /** 套餐商品 ID */
65
65
  bundle_id?: number;
66
- /** 套餐子商品封面图 */
67
- cover?: string | null;
68
66
  /** 套餐商品规格 ID */
69
67
  bundle_variant_id?: number;
70
68
  /** 数量 */
@@ -106,8 +104,6 @@ export interface OrderProductLineItem {
106
104
  num: number;
107
105
  /** 商品标题快照;本地待同步订单会补齐为多语言对象。 */
108
106
  product_title?: OrderProductTitleSnapshot | string | null;
109
- /** 商品封面图 */
110
- product_cover?: string | null;
111
107
  /** 多规格 ID。来源:Detail.product_variant_id */
112
108
  product_variant_id?: number;
113
109
  /**
@@ -2,7 +2,7 @@ import { Module, PisellCore } from '../../../types';
2
2
  import { BaseModule } from '../../../modules/BaseModule';
3
3
  import { ProductData } from '../../../modules/Product/types';
4
4
  import type { RouteDefinition } from '../../types';
5
- import { ProductIdScope, type ProductSnapshot, ProductFormatter, ProductFormatterContext } from './types';
5
+ import { ProductIdScope, ProductFormatter, ProductFormatterContext } from './types';
6
6
  /**
7
7
  * Products 模块 - 用于获取和管理完整的商品详细数据
8
8
  * 相比 ProductList 模块,Products 会获取所有详细信息并缓存
@@ -18,8 +18,7 @@ export declare class ProductsModule extends BaseModule implements Module {
18
18
  private productsPriceCache;
19
19
  private readonly CACHE_MAX_DAYS;
20
20
  private formatters;
21
- private isBuiltinFormatterRegistered;
22
- private isLegacyPriceFormatterEnabled;
21
+ private isPriceFormatterRegistered;
23
22
  private quotationPriceBridge?;
24
23
  private quotationBridgeChannel?;
25
24
  private quotationBridgeLoadedKey?;
@@ -37,8 +36,6 @@ export declare class ProductsModule extends BaseModule implements Module {
37
36
  private lastPreloadCompletedAtMs;
38
37
  /** IndexDB 写入串行队列,避免快照与 patch 并发交错 */
39
38
  private productIndexDBSaveQueue;
40
- /** 最近一次智能定价评估提取的 schedule 变价时间点(HH:mm),供 Server 订阅定时刷新使用 */
41
- private lastScheduleTimePoints;
42
39
  constructor(name?: string, version?: string);
43
40
  initialize(core: PisellCore, options: any): Promise<void>;
44
41
  /**
@@ -111,10 +108,6 @@ export declare class ProductsModule extends BaseModule implements Module {
111
108
  */
112
109
  private prepareProductsWithPrice;
113
110
  private getProductsPriceCacheKey;
114
- /**
115
- * 稳定序列化策略上下文,避免对象 key 顺序不同导致缓存 key 抖动。
116
- */
117
- private stringifyStable;
118
111
  private normalizeProductIds;
119
112
  /**
120
113
  * 按轻量范围返回商品 ID,不做 structuredClone。
@@ -129,26 +122,14 @@ export declare class ProductsModule extends BaseModule implements Module {
129
122
  */
130
123
  private applyFormatters;
131
124
  /**
132
- * 注册内置商品格式化器。
133
- *
134
- * 智能定价默认替代报价单逻辑;报价单 formatter 仅在 enableLegacyPriceFormatter=true 时启用。
125
+ * 注册内置的价格格式化器
126
+ * 这个格式化器负责将价格数据应用到商品上
135
127
  * @private
136
128
  */
137
- private registerBuiltinProductFormatters;
138
- /**
139
- * 是否启用旧报价单价格 formatter。
140
- *
141
- * 默认关闭,避免报价单逻辑覆盖智能定价结果。
142
- */
143
- private shouldEnableLegacyPriceFormatter;
144
- /**
145
- * 返回最近一次 prepareProductsWithPrice / DataVariant 评估提取的变价时间点(HH:mm)。
146
- * 供 OS Server 商品 query 订阅定时刷新使用。
147
- */
148
- getLastScheduleTimePoints(): string[];
129
+ private registerBuiltinPriceFormatter;
149
130
  /**
150
131
  * 注册商品格式化器
151
- * 格式化器会按注册顺序依次执行;legacy 启用时先兜底报价,再由智能定价覆盖。
132
+ * 格式化器会按注册顺序依次执行(内置价格格式化器始终是第一个)
152
133
  * @param formatter 格式化函数
153
134
  * @param prepend 是否插入到队列开头(默认 false,追加到末尾)
154
135
  * @example
@@ -163,8 +144,8 @@ export declare class ProductsModule extends BaseModule implements Module {
163
144
  */
164
145
  registerFormatter(formatter: ProductFormatter, prepend?: boolean): void;
165
146
  /**
166
- * 清空所有格式化器(包括内置智能定价格式化器)
167
- * @param keepBuiltin 是否保留内置智能定价格式化器(默认 true)
147
+ * 清空所有格式化器(包括内置价格格式化器)
148
+ * @param keepBuiltin 是否保留内置价格格式化器(默认 true)
168
149
  */
169
150
  clearFormatters(keepBuiltin?: boolean): void;
170
151
  /**
@@ -204,10 +185,6 @@ export declare class ProductsModule extends BaseModule implements Module {
204
185
  * 获取商品列表(深拷贝,供外部安全使用)
205
186
  */
206
187
  getProducts(): Promise<ProductData[]>;
207
- /**
208
- * 批量获取商品轻量快照,供订单详情等响应补齐展示协议字段。
209
- */
210
- getProductSnapshotsByIds(ids: number[]): Promise<Record<string, ProductSnapshot>>;
211
188
  /**
212
189
  * 内部获取商品列表的直接引用(无拷贝)
213
190
  * 仅供内部 formatter 流程使用,因为 formatter 会创建新对象