@pisell/pisellos 2.2.280 → 2.2.282
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 +0 -9
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/utils.js +6 -1
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/utils.js +5 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/package.json +1 -1
|
@@ -1,9 +0,0 @@
|
|
|
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";
|
|
@@ -512,7 +512,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
512
512
|
generateIdempotencyToken(): string;
|
|
513
513
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
514
514
|
createOrder(params: CommitOrderParams['query']): {
|
|
515
|
-
type: "
|
|
515
|
+
type: "virtual" | "appointment_booking";
|
|
516
516
|
platform: string;
|
|
517
517
|
sales_channel: string;
|
|
518
518
|
order_sales_channel: string;
|
|
@@ -1124,7 +1124,12 @@ export function buildSubmitPayload(params) {
|
|
|
1124
1124
|
var _tempOrder$bookings;
|
|
1125
1125
|
// 如果外部没有传递 types,根据订单里当前是否有 bookings 来决定是 appointment_booking 还是 virtual
|
|
1126
1126
|
if (tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length) {
|
|
1127
|
-
|
|
1127
|
+
// 260807 如果 biz 是堂食,type 使用table-order
|
|
1128
|
+
if (businessCode === 'dine_in') {
|
|
1129
|
+
submitType = 'table-order';
|
|
1130
|
+
} else {
|
|
1131
|
+
submitType = 'appointment_booking';
|
|
1132
|
+
}
|
|
1128
1133
|
} else {
|
|
1129
1134
|
submitType = 'virtual';
|
|
1130
1135
|
}
|
|
@@ -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 | 1 | 5 | 2 | 4 | 3 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -451,19 +451,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
451
451
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
452
452
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
453
453
|
*/
|
|
454
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
455
|
-
action: "reloadCatalog";
|
|
456
|
-
} | {
|
|
457
|
-
action: "add";
|
|
458
|
-
cacheItem: any;
|
|
459
|
-
} | {
|
|
460
|
-
action: "requiresDetail";
|
|
461
|
-
payload: AddProductRequiresDetailPayload;
|
|
462
|
-
} | {
|
|
463
|
-
action: "requiresBookingEdit";
|
|
464
|
-
cacheItem: any;
|
|
465
|
-
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
466
|
-
};
|
|
454
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
467
455
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
468
456
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
469
457
|
/**
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
+
var promotion_exports = {};
|
|
31
|
+
__export(promotion_exports, {
|
|
32
|
+
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
+
ITEM_REWARD_STRATEGY: () => import_examples.ITEM_REWARD_STRATEGY,
|
|
34
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
35
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
36
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
37
|
+
default: () => import_adapter2.default
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
40
|
+
var import_evaluator = require("./evaluator");
|
|
41
|
+
var import_adapter = require("./adapter");
|
|
42
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
43
|
+
var import_examples = require("./examples");
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
47
|
+
ITEM_REWARD_STRATEGY,
|
|
48
|
+
PromotionAdapter,
|
|
49
|
+
PromotionEvaluator,
|
|
50
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
51
|
+
});
|
|
@@ -512,7 +512,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
512
512
|
generateIdempotencyToken(): string;
|
|
513
513
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
514
514
|
createOrder(params: CommitOrderParams['query']): {
|
|
515
|
-
type: "
|
|
515
|
+
type: "virtual" | "appointment_booking";
|
|
516
516
|
platform: string;
|
|
517
517
|
sales_channel: string;
|
|
518
518
|
order_sales_channel: string;
|
|
@@ -994,7 +994,11 @@ function buildSubmitPayload(params) {
|
|
|
994
994
|
let submitType = type ?? tempOrder.type;
|
|
995
995
|
if (!submitType) {
|
|
996
996
|
if ((_a = tempOrder == null ? void 0 : tempOrder.bookings) == null ? void 0 : _a.length) {
|
|
997
|
-
|
|
997
|
+
if (businessCode === "dine_in") {
|
|
998
|
+
submitType = "table-order";
|
|
999
|
+
} else {
|
|
1000
|
+
submitType = "appointment_booking";
|
|
1001
|
+
}
|
|
998
1002
|
} else {
|
|
999
1003
|
submitType = "virtual";
|
|
1000
1004
|
}
|
|
@@ -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 | 1 | 5 | 2 | 4 | 3 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -451,19 +451,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
451
451
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
452
452
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
453
453
|
*/
|
|
454
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
455
|
-
action: "reloadCatalog";
|
|
456
|
-
} | {
|
|
457
|
-
action: "add";
|
|
458
|
-
cacheItem: any;
|
|
459
|
-
} | {
|
|
460
|
-
action: "requiresDetail";
|
|
461
|
-
payload: AddProductRequiresDetailPayload;
|
|
462
|
-
} | {
|
|
463
|
-
action: "requiresBookingEdit";
|
|
464
|
-
cacheItem: any;
|
|
465
|
-
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
466
|
-
};
|
|
454
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
467
455
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
468
456
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
469
457
|
/**
|