@pisell/pisellos 2.3.37 → 2.3.39
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/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +11 -28
- package/dist/modules/Order/index.js +513 -747
- package/dist/modules/Order/types.d.ts +10 -33
- package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +40 -11
- package/dist/modules/Payment/index.d.ts +0 -2
- package/dist/modules/Payment/index.js +49 -78
- package/dist/modules/Payment/types.d.ts +24 -26
- package/dist/modules/Payment/types.js +0 -2
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -14
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.js +48 -15
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +14 -16
- package/dist/server/index.js +1162 -1943
- package/dist/server/modules/order/index.d.ts +4 -49
- package/dist/server/modules/order/index.js +695 -1574
- package/dist/server/modules/order/types.d.ts +3 -11
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +10 -33
- package/dist/solution/BaseSales/index.js +385 -676
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/dist/solution/BookingByStep/index.d.ts +17 -2
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.js +1 -2
- package/dist/solution/Sales/index.d.ts +0 -1
- package/dist/solution/Sales/index.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1140 -737
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +66 -25
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1177 -850
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +11 -28
- package/lib/modules/Order/index.js +83 -187
- package/lib/modules/Order/types.d.ts +10 -33
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +39 -10
- package/lib/modules/Payment/index.d.ts +0 -2
- package/lib/modules/Payment/index.js +12 -33
- package/lib/modules/Payment/types.d.ts +24 -26
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +40 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.js +34 -18
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +14 -16
- package/lib/server/index.js +88 -678
- package/lib/server/modules/order/index.d.ts +4 -49
- package/lib/server/modules/order/index.js +66 -657
- package/lib/server/modules/order/types.d.ts +3 -11
- package/lib/solution/BaseSales/index.d.ts +10 -33
- package/lib/solution/BaseSales/index.js +33 -201
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/lib/solution/BookingByStep/index.d.ts +17 -2
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.js +1 -2
- package/lib/solution/Sales/index.d.ts +0 -1
- package/lib/solution/Sales/index.js +3 -5
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -182
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +31 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1076 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +328 -115
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/payment-utils.js +0 -225
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/payment-number.js +0 -69
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/payment-utils.js +0 -224
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/payment-number.js +0 -64
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from '../../modules';
|
|
1
|
+
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule, HolderModule } from '../../modules';
|
|
2
2
|
export interface BookingByStepState {
|
|
3
3
|
cart: CartModule;
|
|
4
4
|
summary: SummaryModule;
|
|
@@ -16,6 +16,7 @@ export interface BookingByStepState {
|
|
|
16
16
|
schedule: ScheduleModule;
|
|
17
17
|
salesSummary?: SalesSummaryModule;
|
|
18
18
|
scanOrderLogger?: ScanOrderLoggerModule;
|
|
19
|
+
holder: HolderModule;
|
|
19
20
|
}
|
|
20
21
|
export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
|
|
21
22
|
export declare enum BookingByStepHooks {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from "../../modules";
|
|
1
|
+
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule, HolderModule } from "../../modules";
|
|
2
2
|
export function createModule(moduleName, solutionName, name, version) {
|
|
3
3
|
switch (moduleName) {
|
|
4
4
|
case 'cart':
|
|
@@ -23,6 +23,8 @@ export function createModule(moduleName, solutionName, name, version) {
|
|
|
23
23
|
return new ScheduleModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
24
24
|
case 'scanOrderLogger':
|
|
25
25
|
return new ScanOrderLoggerModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
26
|
+
case 'holder':
|
|
27
|
+
return new HolderModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
26
28
|
default:
|
|
27
29
|
throw new Error("Unknown module type: ".concat(moduleName));
|
|
28
30
|
}
|
|
@@ -23,11 +23,27 @@ export var formatDefaultCapacitys = function formatDefaultCapacitys(_ref) {
|
|
|
23
23
|
product_bundle = _ref.product_bundle;
|
|
24
24
|
if ((capacity === null || capacity === void 0 ? void 0 : capacity.type) === 'package') {
|
|
25
25
|
return (product_bundle || []).map(function (d) {
|
|
26
|
+
var _window;
|
|
26
27
|
var id = d.bundle_product_id;
|
|
27
28
|
var variantId = d.bundle_variant_id;
|
|
28
29
|
var item = ((capacity === null || capacity === void 0 ? void 0 : capacity.package) || []).find(function (item) {
|
|
29
|
-
return item.product_id
|
|
30
|
+
return item.product_id == id || item.product_id == variantId;
|
|
30
31
|
});
|
|
32
|
+
if (!item && (_window = window) !== null && _window !== void 0 && _window.sendWarningLog) {
|
|
33
|
+
window.sendWarningLog({
|
|
34
|
+
title: '未找到套餐 capacity 配置',
|
|
35
|
+
content: [{
|
|
36
|
+
key: 'product_id',
|
|
37
|
+
value: id
|
|
38
|
+
}, {
|
|
39
|
+
key: 'variant_id',
|
|
40
|
+
value: variantId
|
|
41
|
+
}, {
|
|
42
|
+
key: 'package',
|
|
43
|
+
value: JSON.stringify((capacity === null || capacity === void 0 ? void 0 : capacity.package) || [])
|
|
44
|
+
}]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
31
47
|
return {
|
|
32
48
|
id: id,
|
|
33
49
|
value: item ? d.num || 0 : 0,
|
|
@@ -19,10 +19,12 @@ export declare function calculateResourceAvailableTime({ resource, timeSlots, cu
|
|
|
19
19
|
* @param countMap 已预约数量映射
|
|
20
20
|
* @returns 最快可用的资源
|
|
21
21
|
*/
|
|
22
|
-
export declare function findFastestAvailableResource({ resources, currentCapacity, countMap, }: {
|
|
22
|
+
export declare function findFastestAvailableResource({ resources, currentCapacity, countMap, targetDate, durationMinutes, }: {
|
|
23
23
|
resources: ResourceItem[];
|
|
24
24
|
currentCapacity?: number;
|
|
25
25
|
countMap?: Record<number, number>;
|
|
26
|
+
targetDate?: string | Dayjs;
|
|
27
|
+
durationMinutes?: number;
|
|
26
28
|
}): ResourceItem | null;
|
|
27
29
|
/**
|
|
28
30
|
* 给定一个时间列表,通过开始和结束时间过滤出符合条件的时间段
|
|
@@ -91,8 +91,14 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
91
91
|
_ref2$currentCapacity = _ref2.currentCapacity,
|
|
92
92
|
currentCapacity = _ref2$currentCapacity === void 0 ? 1 : _ref2$currentCapacity,
|
|
93
93
|
_ref2$countMap = _ref2.countMap,
|
|
94
|
-
countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap
|
|
94
|
+
countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap,
|
|
95
|
+
targetDate = _ref2.targetDate,
|
|
96
|
+
_ref2$durationMinutes = _ref2.durationMinutes,
|
|
97
|
+
durationMinutes = _ref2$durationMinutes === void 0 ? 30 : _ref2$durationMinutes;
|
|
95
98
|
var currentTime = dayjs();
|
|
99
|
+
var resolvedDuration = durationMinutes > 0 ? durationMinutes : 30;
|
|
100
|
+
var targetDay = targetDate ? dayjs(targetDate) : currentTime;
|
|
101
|
+
var isTargetDayToday = targetDay.isSame(currentTime, 'day');
|
|
96
102
|
var fastestTime = null;
|
|
97
103
|
var fastestResources = [];
|
|
98
104
|
console.log('[TimeslotUtils] 查找最快可用资源:', {
|
|
@@ -108,17 +114,18 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
108
114
|
try {
|
|
109
115
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
110
116
|
var _resource = _step2.value;
|
|
111
|
-
//
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
// 获取资源在目标日期且还在工作时间内的时间段
|
|
118
|
+
var targetDayTimes = _resource.times.filter(function (time) {
|
|
119
|
+
var isSameTargetDay = dayjs(time.start_at).isSame(targetDay, 'day');
|
|
120
|
+
if (!isSameTargetDay) return false;
|
|
121
|
+
if (!isTargetDayToday) return true;
|
|
122
|
+
return dayjs(time.end_at).isAfter(currentTime);
|
|
116
123
|
});
|
|
117
|
-
if (
|
|
124
|
+
if (targetDayTimes.length === 0) {
|
|
118
125
|
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, ") \u4ECA\u65E5\u65E0\u53EF\u7528\u65F6\u95F4\u6BB5"));
|
|
119
126
|
continue;
|
|
120
127
|
}
|
|
121
|
-
var _iterator4 = _createForOfIteratorHelper(
|
|
128
|
+
var _iterator4 = _createForOfIteratorHelper(targetDayTimes),
|
|
122
129
|
_step4;
|
|
123
130
|
try {
|
|
124
131
|
var _loop = function _loop() {
|
|
@@ -128,7 +135,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
128
135
|
var workEndTime = dayjs(time.end_at);
|
|
129
136
|
|
|
130
137
|
// 确定检查的起始时间(当前时间 vs 工作开始时间)
|
|
131
|
-
var nextAvailableTime = currentTime.
|
|
138
|
+
var nextAvailableTime = isTargetDayToday && currentTime.isAfter(workStartTime) ? currentTime : workStartTime;
|
|
132
139
|
console.log("[TimeslotUtils] \u68C0\u67E5\u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, "):"), {
|
|
133
140
|
workTime: "".concat(workStartTime.format('HH:mm'), "-").concat(workEndTime.format('HH:mm')),
|
|
134
141
|
checkStartTime: nextAvailableTime.format('HH:mm:ss'),
|
|
@@ -165,7 +172,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
165
172
|
// 检查资源类型和容量
|
|
166
173
|
if (_resource.resourceType === 'single' || (_resource.capacity || 1) === 1) {
|
|
167
174
|
// 单人预约资源:检查时间冲突
|
|
168
|
-
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(
|
|
175
|
+
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(resolvedDuration, 'minute'))) {
|
|
169
176
|
// 有冲突,使用事件结束时间
|
|
170
177
|
finalAvailableTime = _eventEnd;
|
|
171
178
|
console.log("[TimeslotUtils] \u53D1\u73B0\u65F6\u95F4\u51B2\u7A81\uFF0C\u8C03\u6574\u5230: ".concat(finalAvailableTime.format('HH:mm:ss')));
|
|
@@ -177,7 +184,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
177
184
|
var eventUsedCapacity = _event.pax || 1;
|
|
178
185
|
|
|
179
186
|
// 如果在事件时间范围内,检查容量是否足够
|
|
180
|
-
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(
|
|
187
|
+
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(resolvedDuration, 'minute'))) {
|
|
181
188
|
var totalRequiredCapacity = currentUsedCapacity + currentCapacity + eventUsedCapacity;
|
|
182
189
|
if (totalRequiredCapacity > totalCapacity) {
|
|
183
190
|
// 容量不足,使用事件结束时间
|
|
@@ -194,7 +201,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
194
201
|
} finally {
|
|
195
202
|
_iterator5.f();
|
|
196
203
|
}
|
|
197
|
-
if (finalAvailableTime.isAfter(workEndTime)) {
|
|
204
|
+
if (finalAvailableTime.add(resolvedDuration, 'minute').isAfter(workEndTime)) {
|
|
198
205
|
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, " \u53EF\u7528\u65F6\u95F4\u8D85\u51FA\u5DE5\u4F5C\u65F6\u95F4\uFF0C\u8DF3\u8FC7"));
|
|
199
206
|
return 0; // continue
|
|
200
207
|
}
|
|
@@ -1993,8 +1993,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1993
1993
|
}, {
|
|
1994
1994
|
key: "getBookingConfig",
|
|
1995
1995
|
value: function getBookingConfig() {
|
|
1996
|
-
|
|
1997
|
-
return (_this$store$bookingCo = this.store.bookingContext) === null || _this$store$bookingCo === void 0 ? void 0 : _this$store$bookingCo.getBookingConfig();
|
|
1996
|
+
return this.store.bookingContext.getBookingConfig();
|
|
1998
1997
|
}
|
|
1999
1998
|
|
|
2000
1999
|
/** 写入资源全集(来源:`/form/schedule`),同步派生 resourcesOriginMap。 */
|
|
@@ -83,7 +83,6 @@ export declare class SalesImpl extends BaseModule implements Module, SalesModule
|
|
|
83
83
|
private getBookingAppointmentStatus;
|
|
84
84
|
private isBookingIncludedInStats;
|
|
85
85
|
private getBookingOrderPaymentStatus;
|
|
86
|
-
private isUnpaidBooking;
|
|
87
86
|
private countBookingOrders;
|
|
88
87
|
private countCompletedBookings;
|
|
89
88
|
private groupBookingsByResource;
|
|
@@ -29,7 +29,6 @@ import dayjs from 'dayjs';
|
|
|
29
29
|
import { BaseModule } from "../../modules/BaseModule";
|
|
30
30
|
import { SalesHooks } from "./types";
|
|
31
31
|
export * from "./types";
|
|
32
|
-
var UNPAID_PAYMENT_STATUSES = new Set(['unpaid', 'partially_paid', 'payment_processing']);
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
34
|
* Sales 解决方案基础骨架
|
|
@@ -416,11 +415,6 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
416
415
|
var _booking$order$paymen, _booking$order;
|
|
417
416
|
return String((_booking$order$paymen = (_booking$order = booking.order) === null || _booking$order === void 0 ? void 0 : _booking$order.payment_status) !== null && _booking$order$paymen !== void 0 ? _booking$order$paymen : '');
|
|
418
417
|
}
|
|
419
|
-
}, {
|
|
420
|
-
key: "isUnpaidBooking",
|
|
421
|
-
value: function isUnpaidBooking(booking) {
|
|
422
|
-
return UNPAID_PAYMENT_STATUSES.has(this.getBookingOrderPaymentStatus(booking));
|
|
423
|
-
}
|
|
424
418
|
}, {
|
|
425
419
|
key: "countBookingOrders",
|
|
426
420
|
value: function countBookingOrders(bookings) {
|
|
@@ -901,11 +895,9 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
901
895
|
});
|
|
902
896
|
completedBookingList = matchedBookingList.filter(function (booking) {
|
|
903
897
|
return _this7.getBookingAppointmentStatus(booking) === 'completed';
|
|
904
|
-
});
|
|
905
|
-
// (booking) => this.getBookingOrderPaymentStatus(booking) === 'unpaid' || this.getBookingOrderPaymentStatus(booking) === 'payment_processing',
|
|
906
|
-
// );
|
|
898
|
+
});
|
|
907
899
|
unpaidBookingList = matchedBookingList.filter(function (booking) {
|
|
908
|
-
return _this7.
|
|
900
|
+
return _this7.getBookingOrderPaymentStatus(booking) === 'unpaid' || _this7.getBookingOrderPaymentStatus(booking) === 'payment_processing';
|
|
909
901
|
});
|
|
910
902
|
bookings = this.pickBookingsForCurrentPoint(current, this.normalizeResourceBookings(current, deviceCurrent, matchedBookingList));
|
|
911
903
|
completedBookings = completedBookingList.map(function (booking) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderScanCodeResult } from './types';
|
|
2
|
+
import { BaseSalesImpl } from '../BaseSales';
|
|
3
|
+
import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderAllowAddItemsInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderReservationResourceSelectInfo, ScanOrderState, ScanOrderScanCodeResult, ScanOrderSyncAdditionalOrderResult } from './types';
|
|
4
4
|
import type { UpdateOrderProductParams } from '../../modules/Order/types';
|
|
5
5
|
import type { Discount } from '../../modules/Discount/types';
|
|
6
|
+
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
6
7
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
7
8
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
8
9
|
import type { ProductData } from '../../modules/Product/types';
|
|
@@ -15,16 +16,16 @@ interface ScanOrderItemRuleRuntimeConfig {
|
|
|
15
16
|
submissionIndex?: number;
|
|
16
17
|
custom?: Record<string, any>;
|
|
17
18
|
}
|
|
18
|
-
export declare class ScanOrderImpl extends
|
|
19
|
+
export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
|
|
19
20
|
protected defaultName: string;
|
|
20
21
|
protected defaultVersion: string;
|
|
21
22
|
isSolution: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
protected initializeOptions: ModuleOptions;
|
|
24
|
+
protected store: ScanOrderState;
|
|
25
|
+
protected otherParams: Record<string, any>;
|
|
26
|
+
protected cacheId: string | undefined;
|
|
27
|
+
window: WindowPlugin;
|
|
28
|
+
request: RequestPlugin;
|
|
28
29
|
private itemRuleEvaluator;
|
|
29
30
|
private itemRuleConfigs;
|
|
30
31
|
private itemRuleConfigsPromise;
|
|
@@ -53,9 +54,10 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
53
54
|
private registerCustomerLoginListeners;
|
|
54
55
|
private refreshOrderMarketingAfterLogin;
|
|
55
56
|
constructor(name?: string, version?: string);
|
|
57
|
+
protected getRegisteredModuleNames(): readonly string[];
|
|
58
|
+
protected createSubModule(moduleName: string): Module | null;
|
|
56
59
|
/** 与 `otherParams.cacheId` 一致,供宿主在 URL 变化时判断是否需要重新注册模块 */
|
|
57
60
|
getCacheId(): string | undefined;
|
|
58
|
-
private destroyRegisteredChildModules;
|
|
59
61
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
60
62
|
destroy(): Promise<void>;
|
|
61
63
|
retryInit(): Promise<void>;
|
|
@@ -71,12 +73,14 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
71
73
|
};
|
|
72
74
|
getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
|
|
73
75
|
updateTempOrderNote(note: string): string;
|
|
76
|
+
updateTempOrderNote(note: string, sync: true): Promise<string>;
|
|
77
|
+
updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
|
|
74
78
|
setPickupReferenceMode(mode: 'counter_pickup' | 'table_service'): {
|
|
75
|
-
service_type: 'dine_in';
|
|
79
|
+
service_type: 'dine_in' | '';
|
|
76
80
|
pickup_reference_mode: 'counter_pickup' | 'table_service';
|
|
77
81
|
};
|
|
78
82
|
setPickupRef(buzzer: string): string;
|
|
79
|
-
private
|
|
83
|
+
private ensureScanOrderTempOrder;
|
|
80
84
|
addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
81
85
|
restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
82
86
|
getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
|
|
@@ -92,7 +96,10 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
92
96
|
}): Promise<void>;
|
|
93
97
|
private findReservationRuleResource;
|
|
94
98
|
private buildScanOrderResourceMetadata;
|
|
99
|
+
private prepareRetailAvailability;
|
|
95
100
|
private buildSubmitPayloadEnhancer;
|
|
101
|
+
private isScanOrderMoreMode;
|
|
102
|
+
private submitScanOrderMore;
|
|
96
103
|
submitScanOrder<T = any>(): Promise<T>;
|
|
97
104
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
98
105
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
@@ -117,8 +124,10 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
117
124
|
setItemRuleRuntimeConfig(config?: ScanOrderItemRuleRuntimeConfig): Promise<void>;
|
|
118
125
|
private normalizeResourceState;
|
|
119
126
|
private resolveResourceSelectType;
|
|
120
|
-
private
|
|
121
|
-
|
|
127
|
+
private fetchResourceOccupyDetailsByResourceId;
|
|
128
|
+
private resolveAdditionalOrderFromOccupyDetail;
|
|
129
|
+
checkResourceAvailable(resourceId?: string | null, hasOrderId?: boolean): Promise<ScanOrderAvailabilityInfo>;
|
|
130
|
+
restorePreviousOrderData(): Promise<void>;
|
|
122
131
|
getAdditionalOrderInfo(): Promise<{
|
|
123
132
|
orderId: string;
|
|
124
133
|
orderStatus: 'pending' | 'processing' | 'completed' | 'cancelled';
|
|
@@ -141,6 +150,9 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
141
150
|
clearUIState(): void;
|
|
142
151
|
setEntryPaxNumber(number: number): Promise<void>;
|
|
143
152
|
getEntryPaxNumber(): number | null;
|
|
153
|
+
syncAdditionalOrderFromResource(resourceId?: string | null): Promise<ScanOrderSyncAdditionalOrderResult>;
|
|
154
|
+
getReservationResourceSelectType(): ScanOrderReservationResourceSelectInfo;
|
|
155
|
+
checkAllowAddItems(): ScanOrderAllowAddItemsInfo;
|
|
144
156
|
getFulfillmentModes(): {
|
|
145
157
|
enablePickup: boolean;
|
|
146
158
|
enableTableService: boolean;
|