@pisell/pisellos 2.2.222 → 2.2.224
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/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +3 -0
- package/dist/modules/Customer/index.d.ts +7 -0
- package/dist/modules/Customer/index.js +16 -0
- package/dist/modules/OpenData/index.d.ts +7 -0
- package/dist/modules/OpenData/index.js +16 -1
- package/dist/modules/Order/index.d.ts +43 -0
- package/dist/modules/Order/index.js +296 -112
- package/dist/modules/Order/types.d.ts +16 -0
- package/dist/modules/Order/utils.js +7 -4
- package/dist/modules/Payment/index.d.ts +7 -0
- package/dist/modules/Payment/index.js +12 -0
- package/dist/modules/ProductList/index.d.ts +7 -0
- package/dist/modules/ProductList/index.js +11 -0
- package/dist/modules/SalesSummary/index.d.ts +7 -0
- package/dist/modules/SalesSummary/index.js +61 -26
- package/dist/modules/Schedule/index.d.ts +7 -0
- package/dist/modules/Schedule/index.js +16 -0
- package/dist/modules/Summary/index.js +2 -1
- package/dist/server/modules/order/types.d.ts +2 -0
- package/dist/server/modules/order/utils/filterBookings.js +25 -2
- package/dist/server/utils/small-ticket.js +160 -30
- package/dist/solution/BaseSales/index.d.ts +17 -0
- package/dist/solution/BaseSales/index.js +524 -439
- package/dist/solution/BaseSales/utils/cartPromotion.js +24 -7
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +0 -8
- package/dist/solution/BookingTicket/index.js +41 -75
- package/dist/types/index.d.ts +10 -0
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +3 -0
- package/lib/modules/Customer/index.d.ts +7 -0
- package/lib/modules/Customer/index.js +12 -0
- package/lib/modules/OpenData/index.d.ts +7 -0
- package/lib/modules/OpenData/index.js +13 -1
- package/lib/modules/Order/index.d.ts +43 -0
- package/lib/modules/Order/index.js +145 -3
- package/lib/modules/Order/types.d.ts +16 -0
- package/lib/modules/Order/utils.js +6 -2
- package/lib/modules/Payment/index.d.ts +7 -0
- package/lib/modules/Payment/index.js +9 -0
- package/lib/modules/ProductList/index.d.ts +7 -0
- package/lib/modules/ProductList/index.js +9 -0
- package/lib/modules/SalesSummary/index.d.ts +7 -0
- package/lib/modules/SalesSummary/index.js +15 -1
- package/lib/modules/Schedule/index.d.ts +7 -0
- package/lib/modules/Schedule/index.js +12 -0
- package/lib/modules/Summary/index.js +2 -1
- package/lib/server/modules/order/types.d.ts +2 -0
- package/lib/server/modules/order/utils/filterBookings.js +17 -2
- package/lib/server/utils/small-ticket.js +141 -32
- package/lib/solution/BaseSales/index.d.ts +17 -0
- package/lib/solution/BaseSales/index.js +48 -10
- package/lib/solution/BaseSales/utils/cartPromotion.js +28 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +0 -8
- package/lib/solution/BookingTicket/index.js +0 -12
- package/lib/types/index.d.ts +10 -0
- 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 } from "./examples";
|
|
@@ -193,6 +193,9 @@ export function cacheItemToBookingInput(cacheItem, options) {
|
|
|
193
193
|
if (ext.holder_id !== undefined && ext.holder_id !== null) {
|
|
194
194
|
metadata.holder_id = ext.holder_id;
|
|
195
195
|
}
|
|
196
|
+
if (ext.holder !== undefined) {
|
|
197
|
+
metadata.holder = ext.holder;
|
|
198
|
+
}
|
|
196
199
|
if (ext.collect_pax !== undefined) metadata.collect_pax = ext.collect_pax;
|
|
197
200
|
// 与 info2 formatMetaData 一致:优先写入完整人数维度数组,供编辑回显 / 详情回灌。
|
|
198
201
|
var extendCapacity = normalizeExtendCapacityForMetadata(ext.capacity);
|
|
@@ -19,6 +19,13 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
19
19
|
private otherParams;
|
|
20
20
|
constructor(name?: string, version?: string);
|
|
21
21
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
|
|
27
|
+
*/
|
|
28
|
+
updateOtherParams(params: Record<string, any>): void;
|
|
22
29
|
/**
|
|
23
30
|
* 获取客户列表数据(内部方法)
|
|
24
31
|
* @param params 查询参数
|
|
@@ -149,6 +149,22 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
149
149
|
}
|
|
150
150
|
return initialize;
|
|
151
151
|
}()
|
|
152
|
+
/**
|
|
153
|
+
* 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
|
|
157
|
+
*/
|
|
158
|
+
}, {
|
|
159
|
+
key: "updateOtherParams",
|
|
160
|
+
value: function updateOtherParams(params) {
|
|
161
|
+
var _this$otherParams$ope;
|
|
162
|
+
this.otherParams = params || {};
|
|
163
|
+
this.openCache = (_this$otherParams$ope = this.otherParams.openCache) !== null && _this$otherParams$ope !== void 0 ? _this$otherParams$ope : false;
|
|
164
|
+
this.cacheId = this.otherParams.cacheId;
|
|
165
|
+
this.fatherModule = this.otherParams.fatherModule;
|
|
166
|
+
}
|
|
167
|
+
|
|
152
168
|
/**
|
|
153
169
|
* 获取客户列表数据(内部方法)
|
|
154
170
|
* @param params 查询参数
|
|
@@ -17,6 +17,13 @@ export declare class OpenDataModule extends BaseModule implements Module {
|
|
|
17
17
|
private otherParams;
|
|
18
18
|
constructor(name?: string, version?: string);
|
|
19
19
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
|
|
25
|
+
*/
|
|
26
|
+
updateOtherParams(params: Record<string, any>): void;
|
|
20
27
|
fetchOpenData(params: OpenDataFetchParams): Promise<OpenDataConfig>;
|
|
21
28
|
getOpenData(): OpenDataConfig | null;
|
|
22
29
|
getLastFetchedAt(): number | null;
|
|
@@ -86,6 +86,21 @@ export var OpenDataModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
86
86
|
}
|
|
87
87
|
return initialize;
|
|
88
88
|
}()
|
|
89
|
+
/**
|
|
90
|
+
* 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
|
|
94
|
+
*/
|
|
95
|
+
}, {
|
|
96
|
+
key: "updateOtherParams",
|
|
97
|
+
value: function updateOtherParams(params) {
|
|
98
|
+
var _this$otherParams$ope2;
|
|
99
|
+
this.otherParams = params || {};
|
|
100
|
+
this.openCache = (_this$otherParams$ope2 = this.otherParams.openCache) !== null && _this$otherParams$ope2 !== void 0 ? _this$otherParams$ope2 : false;
|
|
101
|
+
this.cacheId = this.otherParams.cacheId;
|
|
102
|
+
this.fatherModule = this.otherParams.fatherModule;
|
|
103
|
+
}
|
|
89
104
|
}, {
|
|
90
105
|
key: "fetchOpenData",
|
|
91
106
|
value: function () {
|
|
@@ -155,7 +170,7 @@ export var OpenDataModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
155
170
|
key: "checkAvailability",
|
|
156
171
|
value: function checkAvailability(scheduleModule) {
|
|
157
172
|
var _this$store$data;
|
|
158
|
-
var scheduleList = scheduleModule ? scheduleModule.getScheduleListByIds(((_this$store$data = this.store.data) === null || _this$store$data === void 0 ? void 0 : _this$store$data['availability.operating_hours']) || []) : undefined;
|
|
173
|
+
var scheduleList = scheduleModule ? scheduleModule === null || scheduleModule === void 0 ? void 0 : scheduleModule.getScheduleListByIds(((_this$store$data = this.store.data) === null || _this$store$data === void 0 ? void 0 : _this$store$data['availability.operating_hours']) || []) : undefined;
|
|
159
174
|
return computeAvailability({
|
|
160
175
|
config: this.store.data,
|
|
161
176
|
scheduleList: scheduleList
|
|
@@ -17,6 +17,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
17
17
|
private cacheId;
|
|
18
18
|
private salesSummaryModuleName;
|
|
19
19
|
private rulesHooksOverride?;
|
|
20
|
+
private moduleHooksOverride?;
|
|
20
21
|
private orderHooks?;
|
|
21
22
|
private otherParams?;
|
|
22
23
|
/** 评估器引用;由 SalesSdkProvider 注入,未注入时 applyPromotion 静默跳过 */
|
|
@@ -43,6 +44,13 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
43
44
|
private applyProductDiscountPrices;
|
|
44
45
|
constructor(name?: string, version?: string);
|
|
45
46
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* 更新父级解决方案透传的运行态参数,并同步 Order 内部依赖的派生字段。
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* orderModule.updateOtherParams({ cacheId: 'cache-2', channel: 'pos' });
|
|
52
|
+
*/
|
|
53
|
+
updateOtherParams(params: Record<string, any>): void;
|
|
46
54
|
/**
|
|
47
55
|
* 记录信息日志
|
|
48
56
|
*/
|
|
@@ -186,6 +194,41 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
186
194
|
private ensureExtend;
|
|
187
195
|
private captureProductRuntime;
|
|
188
196
|
private createLinkedProductAndBooking;
|
|
197
|
+
/**
|
|
198
|
+
* booking.holder 是提交真源;metadata.holder 作为详情/回显冗余字段同步保存。
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* this.syncBookingMetadataHolder(booking, metadata);
|
|
202
|
+
*/
|
|
203
|
+
private syncBookingMetadataHolder;
|
|
204
|
+
/**
|
|
205
|
+
* 从单条 booking 的 holder / metadata 中收集 holder form_record。
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* const ids = this.collectBookingHolderRecords(booking);
|
|
209
|
+
*/
|
|
210
|
+
private collectBookingHolderRecords;
|
|
211
|
+
/**
|
|
212
|
+
* 按 form_record 顺序读取 booking holder 的主字段名称。
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* const names = this.collectBookingHolderNames(booking);
|
|
216
|
+
*/
|
|
217
|
+
private collectBookingHolderNames;
|
|
218
|
+
/**
|
|
219
|
+
* 按老 ticketBooking `formatHolder` 语义汇总订单顶层 holder。
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* const holder = this.buildTempOrderHolderFromBookings(tempOrder);
|
|
223
|
+
*/
|
|
224
|
+
private buildTempOrderHolderFromBookings;
|
|
225
|
+
/**
|
|
226
|
+
* 将 booking 级 holder 汇总到 tempOrder 顶层 holder。
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* this.syncTempOrderHolderFromBookings(tempOrder);
|
|
230
|
+
*/
|
|
231
|
+
private syncTempOrderHolderFromBookings;
|
|
189
232
|
private getBookingUniqueIdentificationNumber;
|
|
190
233
|
private findBookingIndexByUniqueIdentificationNumber;
|
|
191
234
|
private removeLinkedBookingsForProduct;
|