@pisell/pisellos 0.10.25 → 0.10.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.
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/index.js +2 -2
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/index.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- 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, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -533,7 +533,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
533
533
|
generateIdempotencyToken(): string;
|
|
534
534
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
535
535
|
createOrder(params: CommitOrderParams['query']): {
|
|
536
|
-
type: "
|
|
536
|
+
type: "virtual" | "appointment_booking";
|
|
537
537
|
platform: string;
|
|
538
538
|
sales_channel: string;
|
|
539
539
|
order_sales_channel: string;
|
|
@@ -294,10 +294,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
294
294
|
}
|
|
295
295
|
if (Array.isArray(product.product_bundle)) {
|
|
296
296
|
product.product_bundle = product.product_bundle.map(function (bundle) {
|
|
297
|
-
var _ref11, _bundle$
|
|
297
|
+
var _ref11, _bundle$price, _bundle$bundle_sellin;
|
|
298
298
|
var hasBundleDiscount = Array.isArray(bundle === null || bundle === void 0 ? void 0 : bundle.discount_list) && bundle.discount_list.length > 0;
|
|
299
299
|
if (hasBundleDiscount) return bundle;
|
|
300
|
-
var restoredPrice = (_ref11 = (_bundle$
|
|
300
|
+
var restoredPrice = (_ref11 = (_bundle$price = bundle === null || bundle === void 0 ? void 0 : bundle.price) !== null && _bundle$price !== void 0 ? _bundle$price : bundle === null || bundle === void 0 ? void 0 : bundle.original_price) !== null && _ref11 !== void 0 ? _ref11 : bundle === null || bundle === void 0 ? void 0 : bundle.product_price;
|
|
301
301
|
if (restoredPrice === undefined || restoredPrice === null || restoredPrice === '') return bundle;
|
|
302
302
|
return _objectSpread(_objectSpread({}, bundle), {}, {
|
|
303
303
|
price: restoredPrice,
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
345
345
|
count: number;
|
|
346
346
|
left: number;
|
|
347
347
|
summaryCount: number;
|
|
348
|
-
status: "
|
|
348
|
+
status: "lots_of_space" | "filling_up_fast" | "sold_out";
|
|
349
349
|
}[];
|
|
350
350
|
/**
|
|
351
351
|
* 找到多个资源的公共可用时间段
|
|
@@ -458,19 +458,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
458
458
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
459
459
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
460
460
|
*/
|
|
461
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
462
|
-
action: "reloadCatalog";
|
|
463
|
-
} | {
|
|
464
|
-
action: "add";
|
|
465
|
-
cacheItem: any;
|
|
466
|
-
} | {
|
|
467
|
-
action: "requiresDetail";
|
|
468
|
-
payload: AddProductRequiresDetailPayload;
|
|
469
|
-
} | {
|
|
470
|
-
action: "requiresBookingEdit";
|
|
471
|
-
cacheItem: any;
|
|
472
|
-
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
473
|
-
};
|
|
461
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
474
462
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
475
463
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
476
464
|
/**
|
|
@@ -533,7 +533,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
533
533
|
generateIdempotencyToken(): string;
|
|
534
534
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
535
535
|
createOrder(params: CommitOrderParams['query']): {
|
|
536
|
-
type: "
|
|
536
|
+
type: "virtual" | "appointment_booking";
|
|
537
537
|
platform: string;
|
|
538
538
|
sales_channel: string;
|
|
539
539
|
order_sales_channel: string;
|
|
@@ -261,7 +261,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
261
261
|
product.product_bundle = product.product_bundle.map(bundle => {
|
|
262
262
|
const hasBundleDiscount = Array.isArray(bundle?.discount_list) && bundle.discount_list.length > 0;
|
|
263
263
|
if (hasBundleDiscount) return bundle;
|
|
264
|
-
const restoredPrice = bundle?.
|
|
264
|
+
const restoredPrice = bundle?.price ?? bundle?.original_price ?? bundle?.product_price;
|
|
265
265
|
if (restoredPrice === undefined || restoredPrice === null || restoredPrice === '') return bundle;
|
|
266
266
|
return {
|
|
267
267
|
...bundle,
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
345
345
|
count: number;
|
|
346
346
|
left: number;
|
|
347
347
|
summaryCount: number;
|
|
348
|
-
status: "
|
|
348
|
+
status: "lots_of_space" | "filling_up_fast" | "sold_out";
|
|
349
349
|
}[];
|
|
350
350
|
/**
|
|
351
351
|
* 找到多个资源的公共可用时间段
|
|
@@ -458,19 +458,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
458
458
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
459
459
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
460
460
|
*/
|
|
461
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
462
|
-
action: "reloadCatalog";
|
|
463
|
-
} | {
|
|
464
|
-
action: "add";
|
|
465
|
-
cacheItem: any;
|
|
466
|
-
} | {
|
|
467
|
-
action: "requiresDetail";
|
|
468
|
-
payload: AddProductRequiresDetailPayload;
|
|
469
|
-
} | {
|
|
470
|
-
action: "requiresBookingEdit";
|
|
471
|
-
cacheItem: any;
|
|
472
|
-
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
473
|
-
};
|
|
461
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
474
462
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
475
463
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
476
464
|
/**
|