@pisell/pisellos 2.3.205 → 2.3.207
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/ResourcePlanner/planner.js +1 -1
- package/dist/server/index.js +26 -13
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +6 -5
- package/dist/solution/UnifiedBookingSales/index.d.ts +3 -1
- package/dist/solution/UnifiedBookingSales/index.js +309 -181
- package/dist/solution/UnifiedBookingSales/types.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/ResourcePlanner/planner.js +1 -1
- package/lib/server/index.js +9 -4
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +2 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +3 -1
- package/lib/solution/UnifiedBookingSales/index.js +101 -19
- package/lib/solution/UnifiedBookingSales/types.d.ts +4 -0
- 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";
|
|
@@ -2242,7 +2242,7 @@ export function queryAvailabilityProjection(projection, request) {
|
|
|
2242
2242
|
var _extractFixedOffsetMi6, _request$productIds2;
|
|
2243
2243
|
var runtimeOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2244
2244
|
var normalizedPartySize = normalizePartySize(request.partySize);
|
|
2245
|
-
var evaluatedAt = formatDateTime(localDateToScalar(new Date()), projection.meta.timezone, (_extractFixedOffsetMi6 = extractFixedOffsetMinutes(projection.meta.now)) !== null && _extractFixedOffsetMi6 !== void 0 ? _extractFixedOffsetMi6 : captureRuntimeOffsetMinutes());
|
|
2245
|
+
var evaluatedAt = runtimeOptions.evaluatedAt || formatDateTime(localDateToScalar(new Date()), projection.meta.timezone, (_extractFixedOffsetMi6 = extractFixedOffsetMinutes(projection.meta.now)) !== null && _extractFixedOffsetMi6 !== void 0 ? _extractFixedOffsetMi6 : captureRuntimeOffsetMinutes());
|
|
2246
2246
|
if (request.target === 'time') {
|
|
2247
2247
|
assertTimeCandidates(request);
|
|
2248
2248
|
assertRangesWithinProjection(projection, request.candidates);
|
package/dist/server/index.js
CHANGED
|
@@ -6081,7 +6081,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
6081
6081
|
key: "ensureCheckoutOrderNumbers",
|
|
6082
6082
|
value: function () {
|
|
6083
6083
|
var _ensureCheckoutOrderNumbers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(data, title) {
|
|
6084
|
-
var next, needsShopOrderNumber, needsShopFullOrderNumber, idGenerator;
|
|
6084
|
+
var next, needsShopOrderNumber, needsShopFullOrderNumber, idGenerator, _idGenerator$getConfi, _biz;
|
|
6085
6085
|
return _regeneratorRuntime().wrap(function _callee61$(_context61) {
|
|
6086
6086
|
while (1) switch (_context61.prev = _context61.next) {
|
|
6087
6087
|
case 0:
|
|
@@ -6123,36 +6123,49 @@ var Server = /*#__PURE__*/function () {
|
|
|
6123
6123
|
case 15:
|
|
6124
6124
|
next.shop_order_number = _context61.sent;
|
|
6125
6125
|
case 16:
|
|
6126
|
-
if (!
|
|
6127
|
-
_context61.next =
|
|
6126
|
+
if (!needsShopFullOrderNumber) {
|
|
6127
|
+
_context61.next = 26;
|
|
6128
6128
|
break;
|
|
6129
6129
|
}
|
|
6130
|
-
|
|
6130
|
+
_biz = next.business_code || 'ticket';
|
|
6131
|
+
if (!(((_idGenerator$getConfi = idGenerator.getConfig) === null || _idGenerator$getConfi === void 0 || (_idGenerator$getConfi = _idGenerator$getConfi.call(idGenerator, _biz)) === null || _idGenerator$getConfi === void 0 ? void 0 : _idGenerator$getConfi.enableShortNumber) === false)) {
|
|
6132
|
+
_context61.next = 22;
|
|
6133
|
+
break;
|
|
6134
|
+
}
|
|
6135
|
+
next.shop_full_order_number = next.shop_order_number;
|
|
6136
|
+
_context61.next = 26;
|
|
6137
|
+
break;
|
|
6138
|
+
case 22:
|
|
6139
|
+
if (!idGenerator.generateReceiptId) {
|
|
6140
|
+
_context61.next = 26;
|
|
6141
|
+
break;
|
|
6142
|
+
}
|
|
6143
|
+
_context61.next = 25;
|
|
6131
6144
|
return idGenerator.generateReceiptId({
|
|
6132
|
-
biz:
|
|
6145
|
+
biz: _biz
|
|
6133
6146
|
});
|
|
6134
|
-
case
|
|
6147
|
+
case 25:
|
|
6135
6148
|
next.shop_full_order_number = _context61.sent;
|
|
6136
|
-
case
|
|
6149
|
+
case 26:
|
|
6137
6150
|
this.logInfo("".concat(title, ": checkout \u8BA2\u5355\u53F7\u5DF2\u51C6\u5907"), {
|
|
6138
6151
|
shop_order_number: next.shop_order_number,
|
|
6139
6152
|
shop_full_order_number: next.shop_full_order_number
|
|
6140
6153
|
});
|
|
6141
|
-
_context61.next =
|
|
6154
|
+
_context61.next = 32;
|
|
6142
6155
|
break;
|
|
6143
|
-
case
|
|
6144
|
-
_context61.prev =
|
|
6156
|
+
case 29:
|
|
6157
|
+
_context61.prev = 29;
|
|
6145
6158
|
_context61.t0 = _context61["catch"](11);
|
|
6146
6159
|
this.logError("".concat(title, ": \u751F\u6210 checkout \u8BA2\u5355\u53F7\u5931\u8D25"), {
|
|
6147
6160
|
error: _context61.t0 instanceof Error ? _context61.t0.message : String(_context61.t0)
|
|
6148
6161
|
});
|
|
6149
|
-
case
|
|
6162
|
+
case 32:
|
|
6150
6163
|
return _context61.abrupt("return", this.finalizeCheckoutSalesNotes(next, title));
|
|
6151
|
-
case
|
|
6164
|
+
case 33:
|
|
6152
6165
|
case "end":
|
|
6153
6166
|
return _context61.stop();
|
|
6154
6167
|
}
|
|
6155
|
-
}, _callee61, this, [[11,
|
|
6168
|
+
}, _callee61, this, [[11, 29]]);
|
|
6156
6169
|
}));
|
|
6157
6170
|
function ensureCheckoutOrderNumbers(_x65, _x66) {
|
|
6158
6171
|
return _ensureCheckoutOrderNumbers.apply(this, arguments);
|
|
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
342
342
|
date: string;
|
|
343
343
|
status: string;
|
|
344
344
|
week: string;
|
|
345
|
-
weekNum: 0 |
|
|
345
|
+
weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
346
346
|
}[]>;
|
|
347
347
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
348
348
|
private getScheduleDataByIds;
|
|
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
366
366
|
* 获取当前的客户搜索条件
|
|
367
367
|
* @returns 当前搜索条件
|
|
368
368
|
*/
|
|
369
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
369
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
370
370
|
/**
|
|
371
371
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
372
372
|
* @returns 客户状态
|
|
@@ -630,7 +630,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
630
630
|
value: function () {
|
|
631
631
|
var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
632
632
|
var _this$otherParams5, _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
|
|
633
|
-
var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode, _openDataConfig7, _openDataConfig8, _openDataConfig9;
|
|
633
|
+
var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode, _openDataConfig7, _openDataConfig8, _openDataConfig9, _openDataConfig10;
|
|
634
634
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
635
635
|
while (1) switch (_context10.prev = _context10.next) {
|
|
636
636
|
case 0:
|
|
@@ -691,12 +691,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
691
691
|
return idGenerator.configure({
|
|
692
692
|
biz: businessCode,
|
|
693
693
|
config: {
|
|
694
|
+
enableShortNumber: ((_openDataConfig7 = openDataConfig) === null || _openDataConfig7 === void 0 ? void 0 : _openDataConfig7['sale.enable_short_number']) !== false,
|
|
694
695
|
prefix: prefix,
|
|
695
696
|
deviceCode: deviceId,
|
|
696
|
-
padReceiptSequence: ((
|
|
697
|
+
padReceiptSequence: ((_openDataConfig8 = openDataConfig) === null || _openDataConfig8 === void 0 ? void 0 : _openDataConfig8['sale.pad_with_leading_zeros']) === true,
|
|
697
698
|
receiptSequenceLength: receiptSequenceLength,
|
|
698
|
-
receiptSequenceMax: this.normalizeShortNumberMaximum((
|
|
699
|
-
randomReceiptSequence: ((
|
|
699
|
+
receiptSequenceMax: this.normalizeShortNumberMaximum((_openDataConfig9 = openDataConfig) === null || _openDataConfig9 === void 0 ? void 0 : _openDataConfig9['sale.maximum_number']),
|
|
700
|
+
randomReceiptSequence: ((_openDataConfig10 = openDataConfig) === null || _openDataConfig10 === void 0 ? void 0 : _openDataConfig10['sale.short_number_random']) === true,
|
|
700
701
|
resetReceiptSequenceDaily: resetReceiptSequenceDaily,
|
|
701
702
|
receiptSequenceResetTime: operatingDayBoundary === null || operatingDayBoundary === void 0 ? void 0 : operatingDayBoundary.time,
|
|
702
703
|
receiptSequenceStart: receiptSequenceStart,
|
|
@@ -3503,7 +3504,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3503
3504
|
_context44.next = 9;
|
|
3504
3505
|
return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
|
|
3505
3506
|
case 9:
|
|
3506
|
-
if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
|
|
3507
|
+
if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || Object.prototype.hasOwnProperty.call(params !== null && params !== void 0 ? params : {}, 'openData'))) {
|
|
3507
3508
|
_context44.next = 12;
|
|
3508
3509
|
break;
|
|
3509
3510
|
}
|
|
@@ -361,6 +361,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
361
361
|
private buildAvailabilityProjectionSnapshot;
|
|
362
362
|
private getSharedPreparedAvailabilitySnapshot;
|
|
363
363
|
private refreshAvailabilityContextProjection;
|
|
364
|
+
/** Read an existing customer selection without refreshing its clock or occupancy snapshot. */
|
|
365
|
+
private getCustomerSelectionProjection;
|
|
364
366
|
private ensureAvailabilityContextProjection;
|
|
365
367
|
private tryAcquireAvailabilityCommitLock;
|
|
366
368
|
private releaseAvailabilityCommitLock;
|
|
@@ -377,7 +379,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
377
379
|
private findProductLineByUid;
|
|
378
380
|
private findLinkedBooking;
|
|
379
381
|
removeBookingProductsOutsideStartDate(startDate: unknown): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
380
|
-
/**
|
|
382
|
+
/** Customer snapshot writes defer availability to checkout; other callers retain cache revalidation. */
|
|
381
383
|
commitAvailabilitySelection(contextId: string, params: ContextualCommitAvailabilitySelectionParams): Promise<UnifiedBookingSalesCommitAvailabilitySelectionResult>;
|
|
382
384
|
}
|
|
383
385
|
export declare const UnifiedBookingSales: typeof UnifiedBookingSalesImpl;
|