@pisell/pisellos 2.3.145 → 2.3.147
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/OpenData/types.d.ts +2 -0
- package/dist/modules/ResourcePlanner/planner.js +5 -1
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.js +2 -1
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +6 -2
- package/lib/modules/OpenData/types.d.ts +2 -0
- package/lib/modules/ResourcePlanner/planner.js +5 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +7 -1
- 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";
|
|
@@ -73,6 +73,8 @@ export interface OpenDataConfig {
|
|
|
73
73
|
'sale.require_payment_on_submit'?: boolean | null;
|
|
74
74
|
'sale.enable_item_rules'?: boolean;
|
|
75
75
|
'sale.enable_short_number'?: boolean;
|
|
76
|
+
'sale.short_number_digits'?: number;
|
|
77
|
+
'sale.short_number_random'?: boolean;
|
|
76
78
|
'sale.short_number_daily_reset'?: boolean;
|
|
77
79
|
'sale.short_number_start_number'?: number;
|
|
78
80
|
'sale.short_number_prefix'?: string | null;
|
|
@@ -175,7 +175,11 @@ function resolveCutOffPolicyIssue(policy) {
|
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
177
|
function addLeadWindow(base, unit, unitType, _timezoneName) {
|
|
178
|
-
if (unitType === 'days')
|
|
178
|
+
if (unitType === 'days') {
|
|
179
|
+
var leadDate = addLocalCalendarDays(base, unit);
|
|
180
|
+
// Positive day lead times start at midnight; zero days keeps the current-time boundary.
|
|
181
|
+
return Math.trunc(unit) > 0 ? localDateToScalarStart(formatLocalDate(leadDate)) : leadDate;
|
|
182
|
+
}
|
|
179
183
|
if (unitType === 'hours') return addLocalHours(base, unit);
|
|
180
184
|
return addLocalMinutes(base, unit);
|
|
181
185
|
}
|
|
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
328
328
|
date: string;
|
|
329
329
|
status: string;
|
|
330
330
|
week: string;
|
|
331
|
-
weekNum: 0 |
|
|
331
|
+
weekNum: 0 | 1 | 2 | 3 | 5 | 4 | 6;
|
|
332
332
|
}[]>;
|
|
333
333
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
334
334
|
private getScheduleDataByIds;
|
|
@@ -347,7 +347,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
347
347
|
count: number;
|
|
348
348
|
left: number;
|
|
349
349
|
summaryCount: number;
|
|
350
|
-
status: "
|
|
350
|
+
status: "sold_out" | "lots_of_space" | "filling_up_fast";
|
|
351
351
|
}[];
|
|
352
352
|
/**
|
|
353
353
|
* 找到多个资源的公共可用时间段
|
|
@@ -571,7 +571,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
571
571
|
value: function () {
|
|
572
572
|
var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
573
573
|
var _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
|
|
574
|
-
var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode;
|
|
574
|
+
var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode, _openDataConfig7;
|
|
575
575
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
576
576
|
while (1) switch (_context8.prev = _context8.next) {
|
|
577
577
|
case 0:
|
|
@@ -632,6 +632,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
632
632
|
// TODO 现在 picoding 没这个配置的 key
|
|
633
633
|
padReceiptSequence: false,
|
|
634
634
|
receiptSequenceLength: receiptSequenceLength,
|
|
635
|
+
randomReceiptSequence: ((_openDataConfig7 = openDataConfig) === null || _openDataConfig7 === void 0 ? void 0 : _openDataConfig7['sale.short_number_random']) === true,
|
|
635
636
|
resetReceiptSequenceDaily: resetReceiptSequenceDaily,
|
|
636
637
|
receiptSequenceResetTime: operatingDayBoundary === null || operatingDayBoundary === void 0 ? void 0 : operatingDayBoundary.time,
|
|
637
638
|
receiptSequenceStart: receiptSequenceStart,
|
|
@@ -54,8 +54,12 @@ function _processScannedProductItem() {
|
|
|
54
54
|
}
|
|
55
55
|
return _context.abrupt("return", runRequiresDetailFlow(host, item, ctx, bridge));
|
|
56
56
|
case 5:
|
|
57
|
-
values = genScanProductValues(item, code);
|
|
58
|
-
|
|
57
|
+
values = genScanProductValues(item, code); // 条码已唯一命中某个规格时,商品目录的 price 可能是“最低规格价”。
|
|
58
|
+
// 仅在扫码预选规格的这条路径改用命中规格价,避免影响商品卡片和手工选规格。
|
|
59
|
+
itemWithSelection = values.price === undefined ? _objectSpread(_objectSpread({}, item), {}, {
|
|
60
|
+
cartDetailValue: values
|
|
61
|
+
}) : _objectSpread(_objectSpread({}, item), {}, {
|
|
62
|
+
price: values.price,
|
|
59
63
|
cartDetailValue: values
|
|
60
64
|
});
|
|
61
65
|
decision = host.decideAddProduct(itemWithSelection, ctx);
|
|
@@ -73,6 +73,8 @@ export interface OpenDataConfig {
|
|
|
73
73
|
'sale.require_payment_on_submit'?: boolean | null;
|
|
74
74
|
'sale.enable_item_rules'?: boolean;
|
|
75
75
|
'sale.enable_short_number'?: boolean;
|
|
76
|
+
'sale.short_number_digits'?: number;
|
|
77
|
+
'sale.short_number_random'?: boolean;
|
|
76
78
|
'sale.short_number_daily_reset'?: boolean;
|
|
77
79
|
'sale.short_number_start_number'?: number;
|
|
78
80
|
'sale.short_number_prefix'?: string | null;
|
|
@@ -163,7 +163,11 @@ function resolveCutOffPolicyIssue(policy) {
|
|
|
163
163
|
return null;
|
|
164
164
|
}
|
|
165
165
|
function addLeadWindow(base, unit, unitType, _timezoneName) {
|
|
166
|
-
if (unitType === 'days')
|
|
166
|
+
if (unitType === 'days') {
|
|
167
|
+
const leadDate = (0, _localClock.addLocalCalendarDays)(base, unit);
|
|
168
|
+
// Positive day lead times start at midnight; zero days keeps the current-time boundary.
|
|
169
|
+
return Math.trunc(unit) > 0 ? (0, _localClock.localDateToScalarStart)((0, _localClock.formatLocalDate)(leadDate)) : leadDate;
|
|
170
|
+
}
|
|
167
171
|
if (unitType === 'hours') return (0, _localClock.addLocalHours)(base, unit);
|
|
168
172
|
return (0, _localClock.addLocalMinutes)(base, unit);
|
|
169
173
|
}
|
|
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
328
328
|
date: string;
|
|
329
329
|
status: string;
|
|
330
330
|
week: string;
|
|
331
|
-
weekNum: 0 |
|
|
331
|
+
weekNum: 0 | 1 | 2 | 3 | 5 | 4 | 6;
|
|
332
332
|
}[]>;
|
|
333
333
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
334
334
|
private getScheduleDataByIds;
|
|
@@ -347,7 +347,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
347
347
|
count: number;
|
|
348
348
|
left: number;
|
|
349
349
|
summaryCount: number;
|
|
350
|
-
status: "
|
|
350
|
+
status: "sold_out" | "lots_of_space" | "filling_up_fast";
|
|
351
351
|
}[];
|
|
352
352
|
/**
|
|
353
353
|
* 找到多个资源的公共可用时间段
|
|
@@ -367,6 +367,7 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
|
|
|
367
367
|
// TODO 现在 picoding 没这个配置的 key
|
|
368
368
|
padReceiptSequence: false,
|
|
369
369
|
receiptSequenceLength,
|
|
370
|
+
randomReceiptSequence: openDataConfig?.['sale.short_number_random'] === true,
|
|
370
371
|
resetReceiptSequenceDaily,
|
|
371
372
|
receiptSequenceResetTime: operatingDayBoundary?.time,
|
|
372
373
|
receiptSequenceStart,
|
|
@@ -32,9 +32,15 @@ async function processScannedProductItem(host, item, code, bridge) {
|
|
|
32
32
|
return runRequiresDetailFlow(host, item, ctx, bridge);
|
|
33
33
|
}
|
|
34
34
|
const values = (0, _scanProductValues.genScanProductValues)(item, code);
|
|
35
|
-
|
|
35
|
+
// 条码已唯一命中某个规格时,商品目录的 price 可能是“最低规格价”。
|
|
36
|
+
// 仅在扫码预选规格的这条路径改用命中规格价,避免影响商品卡片和手工选规格。
|
|
37
|
+
const itemWithSelection = values.price === undefined ? {
|
|
36
38
|
...item,
|
|
37
39
|
cartDetailValue: values
|
|
40
|
+
} : {
|
|
41
|
+
...item,
|
|
42
|
+
price: values.price,
|
|
43
|
+
cartDetailValue: values
|
|
38
44
|
};
|
|
39
45
|
const decision = host.decideAddProduct(itemWithSelection, ctx);
|
|
40
46
|
return runAddProductDecision(host, item, decision, ctx, bridge);
|