@pisell/pisellos 2.2.203 → 2.2.204
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.
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/Order/index.d.ts +38 -1
- package/dist/modules/Order/index.js +380 -222
- package/dist/modules/Order/types.d.ts +2 -0
- package/dist/solution/BaseSales/index.d.ts +7 -0
- package/dist/solution/BaseSales/index.js +65 -42
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/lib/modules/Order/index.d.ts +38 -1
- package/lib/modules/Order/index.js +89 -18
- package/lib/modules/Order/types.d.ts +2 -0
- package/lib/solution/BaseSales/index.d.ts +7 -0
- package/lib/solution/BaseSales/index.js +11 -4
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// 导出评估器
|
|
2
|
+
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
+
|
|
4
|
+
// 导出适配器
|
|
5
|
+
export { PromotionAdapter } from "./adapter";
|
|
6
|
+
export { default } from "./adapter";
|
|
7
|
+
|
|
8
|
+
// 导出策略配置示例常量
|
|
9
|
+
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY } from "./examples";
|
|
@@ -250,6 +250,28 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
250
250
|
*/
|
|
251
251
|
updateVoucherOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
|
|
252
252
|
private shouldMergeProductToOrder;
|
|
253
|
+
/**
|
|
254
|
+
* 预约商品加车后的统一收尾:促销、折扣、summary 重算与持久化(批量拆行时只调用一次)。
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* await this.finalizeProductOrderMutation(tempOrder);
|
|
258
|
+
*/
|
|
259
|
+
private finalizeProductOrderMutation;
|
|
260
|
+
/**
|
|
261
|
+
* 向 tempOrder 追加一条商品行(及可选 booking),不触发 summary 重算。
|
|
262
|
+
* 带 booking 且 num>1 时由 `addProductToOrder` 拆成多次本方法调用(每次 num=1)。
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* await this.appendProductLineToTempOrder(tempOrder, { product_id: 1, num: 1 }, booking);
|
|
266
|
+
*/
|
|
267
|
+
private appendProductLineToTempOrder;
|
|
268
|
+
/**
|
|
269
|
+
* 添加商品行。带 booking 时强制独立行;num>1 时拆成多条 num=1 的 product+booking(对齐 BookingByStep / ticketBooking addService)。
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* await order.addProductToOrder({ product_id: 1, num: 3 }, { start_time: '10:00' });
|
|
273
|
+
* // → tempOrder.products 新增 3 行,每行 num=1,bookings 3 条
|
|
274
|
+
*/
|
|
253
275
|
addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput): Promise<OrderProduct[]>;
|
|
254
276
|
private hasGoodPassDiscount;
|
|
255
277
|
private getBundleRuntimeIdentity;
|
|
@@ -257,6 +279,21 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
257
279
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<OrderProduct[]>;
|
|
258
280
|
updateOrderProductQuantity(params: UpdateOrderProductQuantityParams): Promise<OrderProduct[]>;
|
|
259
281
|
updateOrderBooking(params: UpdateOrderBookingParams): any[];
|
|
282
|
+
/**
|
|
283
|
+
* 商品行写路径收尾:促销 → 折扣 → 清洗 → summary → 持久化。
|
|
284
|
+
* 批量删除等多行变更场景只应调用一次,避免 N 次 applyPromotion。
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* await this.finalizeAfterProductsMutation(tempOrder);
|
|
288
|
+
*/
|
|
289
|
+
private finalizeAfterProductsMutation;
|
|
290
|
+
/**
|
|
291
|
+
* 批量按 identity 删除购物车行,末尾仅一次促销重算。
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* await order.removeProductsFromOrder([identityA, identityB]);
|
|
295
|
+
*/
|
|
296
|
+
removeProductsFromOrder(identities: OrderProductIdentity[]): Promise<OrderProduct[]>;
|
|
260
297
|
removeProductFromOrder(identity: OrderProductIdentity): Promise<OrderProduct[]>;
|
|
261
298
|
/**
|
|
262
299
|
* 仅清空购物车行(products / bookings),不重置整单。
|
|
@@ -287,7 +324,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
287
324
|
private logSubmitBackendRejected;
|
|
288
325
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
289
326
|
createOrder(params: CommitOrderParams['query']): {
|
|
290
|
-
type: "
|
|
327
|
+
type: "appointment_booking" | "virtual";
|
|
291
328
|
platform: string;
|
|
292
329
|
sales_channel: string;
|
|
293
330
|
order_sales_channel: string;
|