@pisell/pisellos 0.10.93 → 0.10.95
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/modules/Order/index.d.ts +1 -1
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/SalesSummary/index.d.ts +3 -0
- package/dist/modules/SalesSummary/index.js +104 -56
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
- package/dist/solution/BookingTicket/utils/redeemArrival.js +11 -5
- package/dist/solution/UnifiedBookingSales/index.d.ts +1 -0
- package/dist/solution/UnifiedBookingSales/index.js +48 -49
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +4 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +91 -14
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/SalesSummary/index.d.ts +3 -0
- package/lib/modules/SalesSummary/index.js +36 -15
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
- package/lib/solution/BookingTicket/utils/redeemArrival.js +11 -5
- package/lib/solution/UnifiedBookingSales/index.d.ts +1 -0
- package/lib/solution/UnifiedBookingSales/index.js +11 -10
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +4 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +69 -4
- package/package.json +1 -1
|
@@ -640,7 +640,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
640
640
|
generateIdempotencyToken(): string;
|
|
641
641
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
642
642
|
createOrder(params: CommitOrderParams['query']): {
|
|
643
|
-
type: "
|
|
643
|
+
type: "virtual" | "appointment_booking";
|
|
644
644
|
platform: string;
|
|
645
645
|
sales_channel: string;
|
|
646
646
|
order_sales_channel: string;
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "normal" | "duration" | "session";
|
|
53
53
|
}
|
|
@@ -11,6 +11,7 @@ export declare class SalesSummaryModule extends BaseModule implements Module, Sa
|
|
|
11
11
|
private surchargeListModuleName;
|
|
12
12
|
private otherParams;
|
|
13
13
|
private surchargeListChannel;
|
|
14
|
+
private surchargeLoads;
|
|
14
15
|
constructor(name?: string, version?: string);
|
|
15
16
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
16
17
|
/**
|
|
@@ -22,6 +23,8 @@ export declare class SalesSummaryModule extends BaseModule implements Module, Sa
|
|
|
22
23
|
updateOtherParams(params: Record<string, any>): Promise<void>;
|
|
23
24
|
private resolveChannel;
|
|
24
25
|
getSurchargeList(channel?: string): Promise<void>;
|
|
26
|
+
private loadSurcharges;
|
|
27
|
+
private fetchSurcharges;
|
|
25
28
|
private getAppData;
|
|
26
29
|
private getTaxConfig;
|
|
27
30
|
getSummary(params: {
|
|
@@ -46,6 +46,7 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
46
46
|
_defineProperty(_assertThisInitialized(_this), "surchargeListModuleName", 'surchargeList');
|
|
47
47
|
_defineProperty(_assertThisInitialized(_this), "otherParams", {});
|
|
48
48
|
_defineProperty(_assertThisInitialized(_this), "surchargeListChannel", DEFAULT_SURCHARGE_CHANNEL);
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "surchargeLoads", new Map());
|
|
49
50
|
return _this;
|
|
50
51
|
}
|
|
51
52
|
_createClass(SalesSummaryModule, [{
|
|
@@ -61,6 +62,7 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
61
62
|
this.appPlugin = this.core.getPlugin('app');
|
|
62
63
|
this.request = this.core.getPlugin('request');
|
|
63
64
|
this.otherParams = options.otherParams || {};
|
|
65
|
+
this.surchargeLoads = new Map();
|
|
64
66
|
this.store.surchargeList = ((_options$initialState = options.initialState) === null || _options$initialState === void 0 ? void 0 : _options$initialState.surchargeList) || [];
|
|
65
67
|
this.store.summary = ((_options$initialState2 = options.initialState) === null || _options$initialState2 === void 0 ? void 0 : _options$initialState2.summary) || createEmptySalesSummary();
|
|
66
68
|
this.surchargeListModuleName = ((_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.surchargeListModuleName) || 'surchargeList';
|
|
@@ -69,14 +71,14 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
69
71
|
// throw new Error('SalesSummaryModule 需要 app 插件支持');
|
|
70
72
|
// }
|
|
71
73
|
if (this.request) {
|
|
72
|
-
_context.next =
|
|
74
|
+
_context.next = 11;
|
|
73
75
|
break;
|
|
74
76
|
}
|
|
75
77
|
throw new Error('SalesSummaryModule 需要 request 插件支持');
|
|
76
|
-
case
|
|
77
|
-
_context.next =
|
|
78
|
+
case 11:
|
|
79
|
+
_context.next = 13;
|
|
78
80
|
return this.getSurchargeList();
|
|
79
|
-
case
|
|
81
|
+
case 13:
|
|
80
82
|
case "end":
|
|
81
83
|
return _context.stop();
|
|
82
84
|
}
|
|
@@ -97,23 +99,25 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
97
99
|
key: "updateOtherParams",
|
|
98
100
|
value: (function () {
|
|
99
101
|
var _updateOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
100
|
-
var
|
|
102
|
+
var _params$shopId, _this$otherParams$sho, _params$tenantId, _this$otherParams$ten;
|
|
103
|
+
var previousChannel, nextSurchargeListModuleName, nextChannel, sourceChanged;
|
|
101
104
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
102
105
|
while (1) switch (_context2.prev = _context2.next) {
|
|
103
106
|
case 0:
|
|
104
107
|
previousChannel = this.resolveChannel();
|
|
105
108
|
nextSurchargeListModuleName = (params === null || params === void 0 ? void 0 : params.surchargeListModuleName) || 'surchargeList';
|
|
106
109
|
nextChannel = this.resolveChannel(params);
|
|
107
|
-
|
|
110
|
+
sourceChanged = nextSurchargeListModuleName !== this.surchargeListModuleName || ((_params$shopId = params === null || params === void 0 ? void 0 : params.shopId) !== null && _params$shopId !== void 0 ? _params$shopId : params === null || params === void 0 ? void 0 : params.shop_id) !== ((_this$otherParams$sho = this.otherParams.shopId) !== null && _this$otherParams$sho !== void 0 ? _this$otherParams$sho : this.otherParams.shop_id) || ((_params$tenantId = params === null || params === void 0 ? void 0 : params.tenantId) !== null && _params$tenantId !== void 0 ? _params$tenantId : params === null || params === void 0 ? void 0 : params.tenant_id) !== ((_this$otherParams$ten = this.otherParams.tenantId) !== null && _this$otherParams$ten !== void 0 ? _this$otherParams$ten : this.otherParams.tenant_id);
|
|
108
111
|
this.otherParams = params || {};
|
|
109
112
|
this.surchargeListModuleName = nextSurchargeListModuleName;
|
|
110
|
-
if (
|
|
111
|
-
|
|
113
|
+
if (sourceChanged) this.surchargeLoads = new Map();
|
|
114
|
+
if (!(sourceChanged || nextChannel !== previousChannel)) {
|
|
115
|
+
_context2.next = 10;
|
|
112
116
|
break;
|
|
113
117
|
}
|
|
114
|
-
_context2.next =
|
|
118
|
+
_context2.next = 10;
|
|
115
119
|
return this.getSurchargeList(nextChannel);
|
|
116
|
-
case
|
|
120
|
+
case 10:
|
|
117
121
|
case "end":
|
|
118
122
|
return _context2.stop();
|
|
119
123
|
}
|
|
@@ -135,57 +139,91 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
135
139
|
value: function () {
|
|
136
140
|
var _getSurchargeList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
137
141
|
var channel,
|
|
138
|
-
surchargeListModule,
|
|
139
|
-
surchargeList,
|
|
140
142
|
_args3 = arguments;
|
|
141
143
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
142
144
|
while (1) switch (_context3.prev = _context3.next) {
|
|
143
145
|
case 0:
|
|
144
146
|
channel = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : this.resolveChannel();
|
|
145
|
-
_context3.
|
|
147
|
+
_context3.next = 3;
|
|
148
|
+
return this.loadSurcharges(channel);
|
|
149
|
+
case 3:
|
|
150
|
+
case "end":
|
|
151
|
+
return _context3.stop();
|
|
152
|
+
}
|
|
153
|
+
}, _callee3, this);
|
|
154
|
+
}));
|
|
155
|
+
function getSurchargeList() {
|
|
156
|
+
return _getSurchargeList.apply(this, arguments);
|
|
157
|
+
}
|
|
158
|
+
return getSurchargeList;
|
|
159
|
+
}()
|
|
160
|
+
}, {
|
|
161
|
+
key: "loadSurcharges",
|
|
162
|
+
value: function loadSurcharges(channel) {
|
|
163
|
+
var _this2 = this;
|
|
164
|
+
this.surchargeListChannel = channel;
|
|
165
|
+
var loads = this.surchargeLoads;
|
|
166
|
+
var pending = loads.get(channel);
|
|
167
|
+
if (pending) return pending;
|
|
168
|
+
|
|
169
|
+
// The core exposes the summary module while initialization is still pending.
|
|
170
|
+
// All calculations for this channel must wait for the same configuration, even when it is empty.
|
|
171
|
+
var load = this.fetchSurcharges(channel).then(function (list) {
|
|
172
|
+
loads.delete(channel);
|
|
173
|
+
if (loads === _this2.surchargeLoads && channel === _this2.surchargeListChannel) {
|
|
174
|
+
_this2.store.surchargeList = list;
|
|
175
|
+
}
|
|
176
|
+
return list;
|
|
177
|
+
});
|
|
178
|
+
loads.set(channel, load);
|
|
179
|
+
return load;
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "fetchSurcharges",
|
|
183
|
+
value: function () {
|
|
184
|
+
var _fetchSurcharges = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(channel) {
|
|
185
|
+
var surchargeListModule, surchargeList;
|
|
186
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
187
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
188
|
+
case 0:
|
|
189
|
+
_context4.prev = 0;
|
|
146
190
|
surchargeListModule = this.core.getModule(this.surchargeListModuleName);
|
|
147
191
|
if (!(surchargeListModule !== null && surchargeListModule !== void 0 && surchargeListModule.getSurchargeList)) {
|
|
148
|
-
|
|
192
|
+
_context4.next = 6;
|
|
149
193
|
break;
|
|
150
194
|
}
|
|
151
|
-
|
|
195
|
+
_context4.next = 5;
|
|
152
196
|
return surchargeListModule.getSurchargeList({
|
|
153
197
|
channel: channel
|
|
154
198
|
});
|
|
199
|
+
case 5:
|
|
200
|
+
return _context4.abrupt("return", _context4.sent);
|
|
155
201
|
case 6:
|
|
156
|
-
|
|
157
|
-
this.surchargeListChannel = channel;
|
|
158
|
-
return _context3.abrupt("return");
|
|
159
|
-
case 9:
|
|
160
|
-
_context3.next = 11;
|
|
202
|
+
_context4.next = 8;
|
|
161
203
|
return this.request.get('/order/custom-surcharge/available/v2', {
|
|
162
204
|
channel: channel,
|
|
163
205
|
is_assemble_product_data: 1,
|
|
164
206
|
is_assemble_schedule_data: 1,
|
|
165
207
|
with: ['relationSchedule']
|
|
166
208
|
});
|
|
167
|
-
case
|
|
168
|
-
surchargeList =
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
209
|
+
case 8:
|
|
210
|
+
surchargeList = _context4.sent;
|
|
211
|
+
return _context4.abrupt("return", (surchargeList === null || surchargeList === void 0 ? void 0 : surchargeList.data) || []);
|
|
212
|
+
case 12:
|
|
213
|
+
_context4.prev = 12;
|
|
214
|
+
_context4.t0 = _context4["catch"](0);
|
|
215
|
+
console.warn('[SalesSummaryModule] 加载附加费配置失败', _context4.t0);
|
|
216
|
+
return _context4.abrupt("return", []);
|
|
173
217
|
case 16:
|
|
174
|
-
_context3.prev = 16;
|
|
175
|
-
_context3.t0 = _context3["catch"](1);
|
|
176
|
-
console.warn('[SalesSummaryModule] 加载附加费配置失败', _context3.t0);
|
|
177
|
-
this.store.surchargeList = [];
|
|
178
|
-
this.surchargeListChannel = channel;
|
|
179
|
-
case 21:
|
|
180
218
|
case "end":
|
|
181
|
-
return
|
|
219
|
+
return _context4.stop();
|
|
182
220
|
}
|
|
183
|
-
},
|
|
221
|
+
}, _callee4, this, [[0, 12]]);
|
|
184
222
|
}));
|
|
185
|
-
function
|
|
186
|
-
return
|
|
223
|
+
function fetchSurcharges(_x4) {
|
|
224
|
+
return _fetchSurcharges.apply(this, arguments);
|
|
187
225
|
}
|
|
188
|
-
return
|
|
226
|
+
return fetchSurcharges;
|
|
189
227
|
}()
|
|
190
228
|
}, {
|
|
191
229
|
key: "getAppData",
|
|
@@ -211,28 +249,36 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
211
249
|
}, {
|
|
212
250
|
key: "getSummary",
|
|
213
251
|
value: function () {
|
|
214
|
-
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
215
|
-
var _this$otherParams2,
|
|
216
|
-
var _params$products, products, isPriceIncludeTax, taxRate, shopDiscount, channel, _params$virtualSettle, virtualSettlementMode, summaryChannel, taxConfig, fatherModuleName, scheduleModuleName, summarySchedule, needScheduleIds, scheduleList, scheduleById, _iterator, _step, item, summary, summaryWithTaxMeta;
|
|
217
|
-
return _regeneratorRuntime().wrap(function
|
|
218
|
-
while (1) switch (
|
|
252
|
+
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
253
|
+
var _this$otherParams2, _surchargeList$map, _ref;
|
|
254
|
+
var _params$products, products, isPriceIncludeTax, taxRate, shopDiscount, channel, _params$virtualSettle, virtualSettlementMode, summaryChannel, loads, surchargeList, taxConfig, fatherModuleName, scheduleModuleName, summarySchedule, needScheduleIds, scheduleList, scheduleById, _iterator, _step, item, summary, summaryWithTaxMeta;
|
|
255
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
256
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
219
257
|
case 0:
|
|
220
258
|
_params$products = params.products, products = _params$products === void 0 ? [] : _params$products, isPriceIncludeTax = params.isPriceIncludeTax, taxRate = params.taxRate, shopDiscount = params.shopDiscount, channel = params.channel, _params$virtualSettle = params.virtualSettlementMode, virtualSettlementMode = _params$virtualSettle === void 0 ? false : _params$virtualSettle;
|
|
221
259
|
summaryChannel = channel || this.resolveChannel();
|
|
222
|
-
|
|
223
|
-
|
|
260
|
+
loads = this.surchargeLoads;
|
|
261
|
+
if (!(loads.has(summaryChannel) || summaryChannel !== this.surchargeListChannel)) {
|
|
262
|
+
_context5.next = 9;
|
|
224
263
|
break;
|
|
225
264
|
}
|
|
226
|
-
|
|
227
|
-
return this.
|
|
228
|
-
case
|
|
265
|
+
_context5.next = 6;
|
|
266
|
+
return this.loadSurcharges(summaryChannel);
|
|
267
|
+
case 6:
|
|
268
|
+
_context5.t0 = _context5.sent;
|
|
269
|
+
_context5.next = 10;
|
|
270
|
+
break;
|
|
271
|
+
case 9:
|
|
272
|
+
_context5.t0 = this.store.surchargeList;
|
|
273
|
+
case 10:
|
|
274
|
+
surchargeList = _context5.t0;
|
|
229
275
|
taxConfig = this.getTaxConfig();
|
|
230
276
|
fatherModuleName = ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.fatherModule) || this.name.replace(/_salesSummary$/, '');
|
|
231
277
|
scheduleModuleName = "".concat(fatherModuleName, "_schedule");
|
|
232
278
|
summarySchedule = this.core.getModule(scheduleModuleName);
|
|
233
|
-
needScheduleIds = ((
|
|
279
|
+
needScheduleIds = ((surchargeList === null || surchargeList === void 0 || (_surchargeList$map = surchargeList.map(function (item) {
|
|
234
280
|
return item.available_schedule_ids;
|
|
235
|
-
})) === null ||
|
|
281
|
+
})) === null || _surchargeList$map === void 0 ? void 0 : _surchargeList$map.flat()) || []).filter(function (id) {
|
|
236
282
|
return id !== undefined && id !== null && id !== '';
|
|
237
283
|
});
|
|
238
284
|
scheduleList = needScheduleIds.length > 0 ? summarySchedule === null || summarySchedule === void 0 ? void 0 : summarySchedule.getScheduleListByIds(needScheduleIds) : [];
|
|
@@ -254,7 +300,7 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
254
300
|
products: products,
|
|
255
301
|
isPriceIncludeTax: (_ref = isPriceIncludeTax !== null && isPriceIncludeTax !== void 0 ? isPriceIncludeTax : taxConfig.isPriceIncludeTax) !== null && _ref !== void 0 ? _ref : 1,
|
|
256
302
|
taxRate: taxRate !== null && taxRate !== void 0 ? taxRate : taxConfig.taxRate,
|
|
257
|
-
surchargeList:
|
|
303
|
+
surchargeList: surchargeList,
|
|
258
304
|
scheduleById: scheduleById,
|
|
259
305
|
isInScheduleByDate: ScheduleModule.isInScheduleByDate,
|
|
260
306
|
shopDiscount: shopDiscount,
|
|
@@ -265,15 +311,17 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
265
311
|
tax_rate: taxRate !== null && taxRate !== void 0 ? taxRate : taxConfig.taxRate,
|
|
266
312
|
tax_country_code: taxConfig.taxCountryCode || ''
|
|
267
313
|
});
|
|
268
|
-
this.
|
|
269
|
-
|
|
270
|
-
|
|
314
|
+
if (loads === this.surchargeLoads && summaryChannel === this.surchargeListChannel) {
|
|
315
|
+
this.store.summary = summaryWithTaxMeta;
|
|
316
|
+
}
|
|
317
|
+
return _context5.abrupt("return", summaryWithTaxMeta);
|
|
318
|
+
case 23:
|
|
271
319
|
case "end":
|
|
272
|
-
return
|
|
320
|
+
return _context5.stop();
|
|
273
321
|
}
|
|
274
|
-
},
|
|
322
|
+
}, _callee5, this);
|
|
275
323
|
}));
|
|
276
|
-
function getSummary(
|
|
324
|
+
function getSummary(_x5) {
|
|
277
325
|
return _getSummary.apply(this, arguments);
|
|
278
326
|
}
|
|
279
327
|
return getSummary;
|
|
@@ -361,7 +361,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
361
361
|
count: number;
|
|
362
362
|
left: number;
|
|
363
363
|
summaryCount: number;
|
|
364
|
-
status: "
|
|
364
|
+
status: "sold_out" | "lots_of_space" | "filling_up_fast";
|
|
365
365
|
}[];
|
|
366
366
|
/**
|
|
367
367
|
* 找到多个资源的公共可用时间段
|
|
@@ -389,7 +389,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
389
389
|
};
|
|
390
390
|
setOtherData(key: string, value: any): void;
|
|
391
391
|
getOtherData(key: string): any;
|
|
392
|
-
getProductTypeById(id: number): Promise<"
|
|
392
|
+
getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
|
|
393
393
|
/**
|
|
394
394
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
395
395
|
*
|
|
@@ -24,28 +24,27 @@ export declare function buildArrivalCheckoutQuery(order: OrderTempOrder, summary
|
|
|
24
24
|
products: import("../../../modules/Order/types").OrderSubmitProduct[];
|
|
25
25
|
notes?: import("../../../modules/Order/types").SalesNote[] | undefined;
|
|
26
26
|
summary?: import("../../../modules/Order/types").OrderSummary | undefined;
|
|
27
|
-
status: string;
|
|
28
27
|
metadata: Record<string, any>;
|
|
29
|
-
business_code?: string | undefined;
|
|
30
|
-
customer_id: number | null;
|
|
31
28
|
type: string;
|
|
32
|
-
holder: Record<string, any> | null;
|
|
33
|
-
email: string;
|
|
34
|
-
phone: string;
|
|
35
29
|
note: string;
|
|
30
|
+
holder: Record<string, any> | null;
|
|
36
31
|
relation_forms: any[];
|
|
37
32
|
holder_relations?: import("../../../modules/Order/types").OrderHolderRelation[] | undefined;
|
|
38
|
-
country_calling_code: string;
|
|
39
|
-
contacts_info: Record<string, any> | null;
|
|
40
33
|
order_id: number | null;
|
|
41
34
|
external_sale_number: string;
|
|
42
35
|
order_number: string | null;
|
|
43
36
|
shop_order_number: string | null;
|
|
44
37
|
shop_full_order_number: string | null;
|
|
38
|
+
business_code?: string | undefined;
|
|
45
39
|
sales_channel: string;
|
|
46
40
|
order_sales_channel: string;
|
|
41
|
+
status: string;
|
|
47
42
|
shipping_status: string;
|
|
43
|
+
customer_id: number | null;
|
|
48
44
|
customer_name: string;
|
|
45
|
+
country_calling_code: string;
|
|
46
|
+
phone: string;
|
|
47
|
+
email: string;
|
|
49
48
|
is_price_include_tax: number;
|
|
50
49
|
tax_title: string;
|
|
51
50
|
tax_country_code: string;
|
|
@@ -62,6 +61,7 @@ export declare function buildArrivalCheckoutQuery(order: OrderTempOrder, summary
|
|
|
62
61
|
schedule_date: string;
|
|
63
62
|
bookings: any[];
|
|
64
63
|
payments: any[];
|
|
64
|
+
contacts_info: Record<string, any> | null;
|
|
65
65
|
order_meta_list?: import("../../../modules/Order/types").OrderMetaList | undefined;
|
|
66
66
|
refunds?: any[] | undefined;
|
|
67
67
|
surcharges: any[];
|
|
@@ -33,13 +33,14 @@ export function readArrivalWindow(config) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
function shiftedSession(booking, now, window) {
|
|
36
|
-
if (!window || !booking.start_date || !booking.start_time || !booking.end_time) return;
|
|
36
|
+
if (!window || !booking.start_date || !booking.start_time || !booking.end_time) return null;
|
|
37
37
|
var start = dayjs("".concat(booking.start_date, " ").concat(booking.start_time));
|
|
38
38
|
var end = dayjs("".concat(booking.end_date || booking.start_date, " ").concat(booking.end_time));
|
|
39
|
-
if (!start.isValid() || !end.isValid() || end.isBefore(start)) return;
|
|
39
|
+
if (!start.isValid() || !end.isValid() || end.isBefore(start)) return null;
|
|
40
40
|
var delta = dayjs(now).startOf('minute').diff(start, 'minute');
|
|
41
41
|
var minutes = Math.max(-window.earlyMinutes, Math.min(window.lateMinutes, delta));
|
|
42
|
-
if (!Number.isFinite(minutes)
|
|
42
|
+
if (!Number.isFinite(minutes)) return null;
|
|
43
|
+
if (!minutes) return;
|
|
43
44
|
var shiftedStart = start.add(minutes, 'minute');
|
|
44
45
|
var shiftedEnd = end.add(minutes, 'minute');
|
|
45
46
|
return {
|
|
@@ -70,16 +71,21 @@ export function applyRedeemArrival(order, ids, now, window, onSkip) {
|
|
|
70
71
|
_iterator.f();
|
|
71
72
|
}
|
|
72
73
|
var alreadyMarked = false;
|
|
74
|
+
var invalidSession = false;
|
|
73
75
|
var changes = new Map();
|
|
74
76
|
var bookings = order.bookings.map(function (booking) {
|
|
75
77
|
var _booking$metadata;
|
|
76
78
|
var event = redeemEventKey(booking === null || booking === void 0 ? void 0 : booking.schedule_event_id);
|
|
77
|
-
if (!event || !selected.has(event) || booking.parent_id === 0) return booking;
|
|
79
|
+
if (!event || !selected.has(event) || String(booking.parent_id) === '0') return booking;
|
|
78
80
|
if (Number((_booking$metadata = booking.metadata) === null || _booking$metadata === void 0 ? void 0 : _booking$metadata.is_change_by_redeem) === 1) {
|
|
79
81
|
alreadyMarked = true;
|
|
80
82
|
return booking;
|
|
81
83
|
}
|
|
82
84
|
var shift = shiftedSession(booking, now, window);
|
|
85
|
+
if (shift === null) {
|
|
86
|
+
invalidSession = true;
|
|
87
|
+
return booking;
|
|
88
|
+
}
|
|
83
89
|
// 准点核销的偏移量为零,也要打标,避免下一张票改变这个时段。
|
|
84
90
|
changes.set(event, shift);
|
|
85
91
|
return _objectSpread(_objectSpread(_objectSpread({}, booking), shift), {}, {
|
|
@@ -89,7 +95,7 @@ export function applyRedeemArrival(order, ids, now, window, onSkip) {
|
|
|
89
95
|
});
|
|
90
96
|
});
|
|
91
97
|
if (!changes.size) {
|
|
92
|
-
onSkip === null || onSkip === void 0 || onSkip(alreadyMarked ? 'already_marked' : 'no_linked_booking');
|
|
98
|
+
onSkip === null || onSkip === void 0 || onSkip(invalidSession ? 'invalid_booking_time' : alreadyMarked ? 'already_marked' : 'no_linked_booking');
|
|
93
99
|
return;
|
|
94
100
|
}
|
|
95
101
|
var vouchers = order.vouchers.map(function (voucher) {
|
|
@@ -91,6 +91,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
91
91
|
private availabilityProjectionRefreshInFlight;
|
|
92
92
|
private availabilityRemoteOccupancyCache;
|
|
93
93
|
private availabilitySessionResourceCache;
|
|
94
|
+
private readonly fetchAvailabilitySessionResources;
|
|
94
95
|
private availabilityRemoteResourceQueryInFlight;
|
|
95
96
|
private availabilityRemoteResourceQuerySequence;
|
|
96
97
|
private availabilityRemoteResourceEpoch;
|