@pisell/pisellos 2.3.24 → 2.3.26

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 (69) 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/modules/Discount/index.d.ts +2 -5
  4. package/dist/modules/Discount/index.js +7 -30
  5. package/dist/modules/Discount/types.d.ts +0 -4
  6. package/dist/modules/Order/index.d.ts +4 -2
  7. package/dist/modules/Order/index.js +725 -647
  8. package/dist/modules/Order/types.d.ts +0 -2
  9. package/dist/modules/Product/types.d.ts +0 -22
  10. package/dist/modules/ProductList/index.d.ts +1 -1
  11. package/dist/modules/ProductList/index.js +2 -4
  12. package/dist/modules/ProductList/types.d.ts +0 -2
  13. package/dist/server/index.d.ts +0 -50
  14. package/dist/server/index.js +749 -995
  15. package/dist/server/modules/products/index.d.ts +7 -26
  16. package/dist/server/modules/products/index.js +76 -167
  17. package/dist/server/modules/products/types.d.ts +0 -14
  18. package/dist/solution/BaseSales/index.d.ts +0 -2
  19. package/dist/solution/BaseSales/index.js +50 -36
  20. package/dist/solution/BookingByStep/index.d.ts +1 -1
  21. package/dist/solution/BookingTicket/index.d.ts +1 -13
  22. package/dist/solution/BookingTicket/index.js +21 -5
  23. package/dist/solution/BookingTicket/types.d.ts +0 -2
  24. package/dist/solution/ShopDiscount/index.js +14 -15
  25. package/lib/model/strategy/adapter/index.d.ts +0 -4
  26. package/lib/model/strategy/adapter/index.js +2 -13
  27. package/lib/modules/Discount/index.d.ts +2 -5
  28. package/lib/modules/Discount/index.js +3 -23
  29. package/lib/modules/Discount/types.d.ts +0 -4
  30. package/lib/modules/Order/index.d.ts +4 -2
  31. package/lib/modules/Order/index.js +80 -34
  32. package/lib/modules/Order/types.d.ts +0 -2
  33. package/lib/modules/Product/types.d.ts +0 -22
  34. package/lib/modules/ProductList/index.d.ts +1 -1
  35. package/lib/modules/ProductList/index.js +2 -4
  36. package/lib/modules/ProductList/types.d.ts +0 -2
  37. package/lib/server/index.d.ts +0 -50
  38. package/lib/server/index.js +29 -206
  39. package/lib/server/modules/products/index.d.ts +7 -26
  40. package/lib/server/modules/products/index.js +35 -114
  41. package/lib/server/modules/products/types.d.ts +0 -14
  42. package/lib/solution/BaseSales/index.d.ts +0 -2
  43. package/lib/solution/BaseSales/index.js +22 -12
  44. package/lib/solution/BookingByStep/index.d.ts +1 -1
  45. package/lib/solution/BookingTicket/index.d.ts +1 -13
  46. package/lib/solution/BookingTicket/index.js +18 -1
  47. package/lib/solution/BookingTicket/types.d.ts +0 -2
  48. package/lib/solution/ShopDiscount/index.js +1 -2
  49. package/package.json +1 -1
  50. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  51. package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
  52. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  53. package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -780
  54. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  55. package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
  56. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  57. package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
  58. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  59. package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
  60. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  61. package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
  62. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  63. package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -583
  64. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  65. package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
  66. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  67. package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
  68. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  69. package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
@@ -309,7 +309,6 @@ export interface OrderState {
309
309
  lastOrderInfo?: Record<string, any>;
310
310
  syncState?: OrderSyncState;
311
311
  discountList: any[];
312
- availableWalletIds?: number[];
313
312
  discount: DiscountModule | null;
314
313
  rules: RulesModule | null;
315
314
  }
@@ -776,7 +775,6 @@ export interface OrderModuleAPI {
776
775
  apply?: boolean;
777
776
  }) => Promise<Discount[]>;
778
777
  getDiscountList: () => Discount[];
779
- getAvailableWalletIds: () => number[];
780
778
  applyDiscount: () => void;
781
779
  /**
782
780
  * 注入促销评估器。
@@ -9,26 +9,6 @@ export interface ProductCollection {
9
9
  /** 商品集合封面 */
10
10
  cover: string;
11
11
  }
12
- /**
13
- * 商品 Data Variant 记录,结构与后端 data_variant 表对齐。
14
- */
15
- export interface ProductDataVariant {
16
- /** 变体记录 id */
17
- id: number;
18
- /** 店铺 id */
19
- shop_id: number;
20
- /** 所属模块,商品场景固定为 product */
21
- module: string;
22
- /** 模块数据 id,商品场景对应 product.id */
23
- module_data_id: number;
24
- /** 关联 data_variant_rule.id */
25
- data_variant_rule_id: number;
26
- /** 命中策略后覆盖到商品上的字段 */
27
- data: Record<string, any>;
28
- created_at: string | null;
29
- updated_at: string | null;
30
- deleted_at: string | null;
31
- }
32
12
  /**
33
13
  * 商品基本信息接口
34
14
  */
@@ -234,8 +214,6 @@ export interface ProductData {
234
214
  bundle_group_count: number;
235
215
  /** 选项组数量 */
236
216
  option_group_count: number;
237
- /** 智能定价变体列表,/product/query with dataVariants 返回 */
238
- data_variants?: ProductDataVariant[];
239
217
  /** 服务时长 */
240
218
  service_times?: any;
241
219
  }
@@ -26,7 +26,7 @@ export declare class ProductList extends BaseModule implements Module {
26
26
  * const products = await productList.getAddTimeProducts({ schedule_date: '2026-06-16' });
27
27
  */
28
28
  getAddTimeProducts(params?: ProductListLoadProductsParams): Promise<any>;
29
- loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, extension_type, status, strategy_context, }?: ProductListLoadProductsParams, options?: {
29
+ loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, extension_type, status, }?: ProductListLoadProductsParams, options?: {
30
30
  callback?: (result: any) => void;
31
31
  subscriberId?: string;
32
32
  }): Promise<any>;
@@ -152,7 +152,6 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
152
152
  extension_type,
153
153
  _ref$status,
154
154
  status,
155
- strategy_context,
156
155
  options,
157
156
  userPlugin,
158
157
  customer_id,
@@ -163,7 +162,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
163
162
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
164
163
  while (1) switch (_context4.prev = _context4.next) {
165
164
  case 0:
166
- _ref = _args4.length > 0 && _args4[0] !== undefined ? _args4[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;
165
+ _ref = _args4.length > 0 && _args4[0] !== undefined ? _args4[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;
167
166
  options = _args4.length > 1 ? _args4[1] : undefined;
168
167
  // // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
169
168
  // if (!schedule_ids?.length) {
@@ -207,8 +206,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
207
206
  is_eject: 1,
208
207
  with_schedule: with_schedule,
209
208
  schedule_datetime: schedule_datetime,
210
- extension_type: extension_type,
211
- strategy_context: strategy_context
209
+ extension_type: extension_type
212
210
  }, {
213
211
  osServer: true,
214
212
  callback: options === null || options === void 0 ? void 0 : options.callback,
@@ -12,8 +12,6 @@ export interface ProductListLoadProductsParams {
12
12
  with_schedule?: number;
13
13
  extension_type?: string[];
14
14
  status?: string;
15
- /** 智能定价条件上下文,仅影响策略命中,不参与商品集合筛选 */
16
- strategy_context?: Record<string, any>;
17
15
  }
18
16
  export interface ProductListData {
19
17
  list: ProductData[];
@@ -47,8 +47,6 @@ declare class Server {
47
47
  private prefixRouterGet;
48
48
  router: Router;
49
49
  private productQuerySubscribers;
50
- /** subscriberId → 智能定价变价时间点定时器句柄(与 subscriber 分离存储,便于 clear) */
51
- private productQueryScheduleTimers;
52
50
  private orderQuerySubscribers;
53
51
  private bookingQuerySubscribers;
54
52
  private bookingRemoteQuerySubscribers;
@@ -212,48 +210,6 @@ declare class Server {
212
210
  * 根据 subscriberId 移除商品查询订阅者
213
211
  */
214
212
  removeProductQuerySubscriber(subscriberId?: string): void;
215
- /**
216
- * 构建商品 query 响应 data 段,附带智能定价 schedule_time_points 元数据。
217
- */
218
- private buildProductQueryResultPayload;
219
- /**
220
- * 是否启用商品 query 订阅的 schedule 时间点定时重算。
221
- * strategy_context.enable_schedule_reload === false 时关闭。
222
- */
223
- private shouldScheduleProductQueryReload;
224
- /**
225
- * 清除指定 subscriber 的全部 schedule 定时器,防止重复 query 或 unsubscribe 后泄漏。
226
- */
227
- private clearSubscriberScheduleTimers;
228
- /**
229
- * 从 productQueryScheduleTimers 移除已触发的 timer 引用。
230
- */
231
- private removeScheduleTimerRef;
232
- /**
233
- * 计算 schedule 变价时间点到当前时刻的延迟(ms)。已过期返回 -1。
234
- */
235
- private computeScheduleTimePointDelayMs;
236
- /**
237
- * 定时重算前刷新 subscriber schedule 上下文:使用执行瞬间时间,禁止沿用首次 query 的 schedule_datetime。
238
- */
239
- private refreshSubscriberScheduleAtExecution;
240
- /**
241
- * 为 subscriber 注册智能定价 scheduleTimePoints 定时重算。
242
- * 必须先 clearSubscriberScheduleTimers,再调用本方法。
243
- */
244
- private scheduleSubscriberTimePointReloads;
245
- /**
246
- * schedule 变价时间点定时器触发:刷新 schedule_datetime 后重算并 callback。
247
- */
248
- private onScheduleTimePointTimerFire;
249
- /**
250
- * 对单个商品 query 订阅者重算并推送(定时路径;不新建 schedule timer)。
251
- */
252
- private recomputeAndNotifySubscriber;
253
- /**
254
- * query 完成后为 subscriber 同步 schedule 定时器(先 clear 再 schedule)。
255
- */
256
- private syncProductQueryScheduleTimers;
257
213
  /**
258
214
  * 处理商品查询请求
259
215
  * 存储订阅者信息,便于数据变更时推送最新结果
@@ -614,12 +570,6 @@ declare class Server {
614
570
  * @param options.changedIds 变更的商品 IDs,用于增量更新价格缓存
615
571
  */
616
572
  private computeProductQueryResult;
617
- /**
618
- * 构建商品格式化上下文。
619
- *
620
- * 智能定价条件使用全量 menuList/scheduleList;Product Query 顶层参数只保留筛选商品集合所需字段。
621
- */
622
- private buildProductFormatterContext;
623
573
  /**
624
574
  * 数据变更后,遍历所有订阅者重新计算查询结果并通过 callback 推送
625
575
  * 由 ProductsModule 的 onProductsSyncCompleted 事件触发