@pisell/pisellos 2.1.118 → 2.1.120
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/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/model/strategy/adapter/index.d.ts +4 -0
- package/dist/model/strategy/adapter/index.js +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +439 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
- package/dist/model/strategy/adapter/itemRule/examples.d.ts +64 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +315 -0
- package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/dist/model/strategy/adapter/itemRule/index.js +5 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +206 -0
- package/dist/model/strategy/adapter/itemRule/type.js +101 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +271 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +1206 -0
- package/dist/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/dist/model/strategy/adapter/promotion/examples.js +166 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -0
- package/dist/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/dist/model/strategy/adapter/promotion/type.js +209 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -1
- package/dist/model/strategy/engine.d.ts +106 -0
- package/dist/model/strategy/engine.js +611 -0
- package/dist/model/strategy/index.d.ts +2 -93
- package/dist/model/strategy/index.js +6 -549
- package/dist/modules/Cart/types.d.ts +0 -2
- package/dist/modules/Cart/utils/cartProduct.js +25 -56
- package/dist/modules/Discount/types.d.ts +0 -18
- package/dist/modules/OpenData/index.d.ts +23 -0
- package/dist/modules/OpenData/index.js +167 -0
- package/dist/modules/OpenData/types.d.ts +73 -0
- package/dist/modules/OpenData/types.js +1 -0
- package/dist/modules/OpenData/utils.d.ts +2 -0
- package/dist/modules/OpenData/utils.js +75 -0
- package/dist/modules/Order/index.d.ts +58 -1
- package/dist/modules/Order/index.js +780 -29
- package/dist/modules/Order/types.d.ts +144 -12
- package/dist/modules/Order/utils.d.ts +25 -0
- package/dist/modules/Order/utils.js +225 -1
- package/dist/modules/Payment/index.d.ts +1 -2
- package/dist/modules/Payment/index.js +7 -10
- package/dist/modules/Payment/utils.js +0 -3
- package/dist/modules/Payment/walletpass.d.ts +0 -23
- package/dist/modules/Payment/walletpass.js +95 -191
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +2 -1
- package/dist/modules/Quotation/index.d.ts +48 -0
- package/dist/modules/Quotation/index.js +245 -0
- package/dist/modules/Quotation/types.d.ts +42 -0
- package/dist/modules/Quotation/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +5 -9
- package/dist/modules/Rules/index.js +164 -673
- package/dist/modules/Rules/types.d.ts +0 -2
- package/dist/modules/SalesSummary/index.d.ts +63 -0
- package/dist/modules/SalesSummary/index.js +174 -0
- package/dist/modules/SalesSummary/types.d.ts +59 -0
- package/dist/modules/SalesSummary/types.js +1 -0
- package/dist/modules/SalesSummary/utils.d.ts +30 -0
- package/dist/modules/SalesSummary/utils.js +513 -0
- package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
- package/dist/modules/ScanOrderLogger/index.js +161 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.js +95 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
- package/dist/modules/ScanOrderLogger/types.d.ts +46 -0
- package/dist/modules/ScanOrderLogger/types.js +1 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
- package/dist/modules/Summary/types.d.ts +0 -2
- package/dist/modules/Summary/utils.d.ts +3 -9
- package/dist/modules/Summary/utils.js +4 -25
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.js +5 -1
- package/dist/plugins/window.d.ts +0 -2
- package/dist/solution/BookingByStep/index.d.ts +1 -2
- package/dist/solution/BookingByStep/index.js +44 -42
- package/dist/solution/BookingByStep/types.d.ts +3 -1
- package/dist/solution/BookingByStep/types.js +5 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/Checkout/index.js +0 -2
- package/dist/solution/ScanOrder/index.d.ts +90 -0
- package/dist/solution/ScanOrder/index.js +1853 -0
- package/dist/solution/ScanOrder/types.d.ts +210 -0
- package/dist/solution/ScanOrder/types.js +16 -0
- package/dist/solution/ScanOrder/utils.d.ts +93 -0
- package/dist/solution/ScanOrder/utils.js +397 -0
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +7 -23
- package/dist/solution/ShopDiscount/types.d.ts +0 -1
- package/dist/solution/ShopDiscount/types.js +1 -2
- package/dist/solution/ShopDiscount/utils.js +12 -26
- package/dist/solution/VenueBooking/index.d.ts +158 -0
- package/dist/solution/VenueBooking/index.js +2873 -0
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/dist/solution/VenueBooking/types.d.ts +130 -0
- package/dist/solution/VenueBooking/types.js +21 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +102 -0
- package/dist/solution/VenueBooking/utils/resource.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/resource.js +94 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +204 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +256 -0
- package/dist/solution/VenueBooking/utils.d.ts +1 -0
- package/dist/solution/VenueBooking/utils.js +1 -0
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/model/strategy/adapter/index.d.ts +4 -0
- package/lib/model/strategy/adapter/index.js +12 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +338 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
- package/lib/model/strategy/adapter/itemRule/examples.d.ts +64 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +269 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/lib/model/strategy/adapter/itemRule/index.js +58 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +206 -0
- package/lib/model/strategy/adapter/itemRule/type.js +46 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +217 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +844 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/lib/model/strategy/adapter/promotion/examples.js +192 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/lib/model/strategy/adapter/promotion/type.js +51 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -1
- package/lib/model/strategy/engine.d.ts +106 -0
- package/lib/model/strategy/engine.js +450 -0
- package/lib/model/strategy/index.d.ts +2 -93
- package/lib/model/strategy/index.js +6 -381
- package/lib/modules/Cart/types.d.ts +0 -2
- package/lib/modules/Cart/utils/cartProduct.js +12 -39
- package/lib/modules/Discount/types.d.ts +0 -18
- package/lib/modules/OpenData/index.d.ts +23 -0
- package/lib/modules/OpenData/index.js +116 -0
- package/lib/modules/OpenData/types.d.ts +73 -0
- package/lib/modules/OpenData/types.js +17 -0
- package/lib/modules/OpenData/utils.d.ts +2 -0
- package/lib/modules/OpenData/utils.js +111 -0
- package/lib/modules/Order/index.d.ts +58 -1
- package/lib/modules/Order/index.js +423 -1
- package/lib/modules/Order/types.d.ts +144 -12
- package/lib/modules/Order/utils.d.ts +25 -0
- package/lib/modules/Order/utils.js +229 -0
- package/lib/modules/Payment/index.d.ts +1 -2
- package/lib/modules/Payment/index.js +0 -1
- package/lib/modules/Payment/utils.js +0 -3
- package/lib/modules/Payment/walletpass.d.ts +0 -23
- package/lib/modules/Payment/walletpass.js +17 -94
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +2 -1
- package/lib/modules/Quotation/index.d.ts +48 -0
- package/lib/modules/Quotation/index.js +149 -0
- package/lib/modules/Quotation/types.d.ts +42 -0
- package/lib/modules/Quotation/types.js +17 -0
- package/lib/modules/Rules/index.d.ts +5 -9
- package/lib/modules/Rules/index.js +286 -778
- package/lib/modules/Rules/types.d.ts +0 -2
- package/lib/modules/SalesSummary/index.d.ts +63 -0
- package/lib/modules/SalesSummary/index.js +105 -0
- package/lib/modules/SalesSummary/types.d.ts +59 -0
- package/lib/modules/SalesSummary/types.js +17 -0
- package/lib/modules/SalesSummary/utils.d.ts +30 -0
- package/lib/modules/SalesSummary/utils.js +452 -0
- package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
- package/lib/modules/ScanOrderLogger/index.js +135 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.js +82 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
- package/lib/modules/ScanOrderLogger/types.d.ts +46 -0
- package/lib/modules/ScanOrderLogger/types.js +17 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
- package/lib/modules/Summary/types.d.ts +0 -2
- package/lib/modules/Summary/utils.d.ts +3 -9
- package/lib/modules/Summary/utils.js +4 -19
- package/lib/modules/index.d.ts +4 -0
- package/lib/modules/index.js +9 -1
- package/lib/plugins/window.d.ts +0 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -2
- package/lib/solution/BookingByStep/index.js +4 -2
- package/lib/solution/BookingByStep/types.d.ts +3 -1
- package/lib/solution/BookingByStep/types.js +10 -0
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/Checkout/index.js +0 -2
- package/lib/solution/ScanOrder/index.d.ts +90 -0
- package/lib/solution/ScanOrder/index.js +1071 -0
- package/lib/solution/ScanOrder/types.d.ts +210 -0
- package/lib/solution/ScanOrder/types.js +36 -0
- package/lib/solution/ScanOrder/utils.d.ts +93 -0
- package/lib/solution/ScanOrder/utils.js +359 -0
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +8 -22
- package/lib/solution/ShopDiscount/types.d.ts +0 -1
- package/lib/solution/ShopDiscount/utils.js +6 -10
- package/lib/solution/VenueBooking/index.d.ts +158 -0
- package/lib/solution/VenueBooking/index.js +1545 -0
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/lib/solution/VenueBooking/types.d.ts +130 -0
- package/lib/solution/VenueBooking/types.js +44 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +101 -0
- package/lib/solution/VenueBooking/utils/resource.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/resource.js +80 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +209 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +200 -0
- package/lib/solution/VenueBooking/utils.d.ts +1 -0
- package/lib/solution/VenueBooking/utils.js +69 -0
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/package.json +1 -1
package/dist/plugins/window.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { WalletPassEvaluator } from '../model';
|
|
2
1
|
import { Plugin } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* WindowPlugin 接口定义
|
|
@@ -15,7 +14,6 @@ export interface WindowPlugin extends Plugin {
|
|
|
15
14
|
document: Partial<Document>;
|
|
16
15
|
history: History;
|
|
17
16
|
interaction?: any;
|
|
18
|
-
getWalletPassEvaluator?: () => WalletPassEvaluator;
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
19
|
* 简单的 Storage 接口实现
|
|
@@ -144,7 +144,6 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
144
144
|
getSummary(): Promise<{
|
|
145
145
|
subtotal: string | number;
|
|
146
146
|
total: string | number;
|
|
147
|
-
originTotal: string | number;
|
|
148
147
|
taxTitle?: string | undefined;
|
|
149
148
|
totalTaxFee?: string | number | undefined;
|
|
150
149
|
isPriceIncludeTax?: 0 | 1 | undefined;
|
|
@@ -311,7 +310,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
310
|
date: string;
|
|
312
311
|
status: string;
|
|
313
312
|
week: string;
|
|
314
|
-
weekNum: 0 | 2 | 1 |
|
|
313
|
+
weekNum: 0 | 2 | 1 | 4 | 3 | 6 | 5;
|
|
315
314
|
}[]>;
|
|
316
315
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
316
|
private getScheduleDataByIds;
|
|
@@ -2008,7 +2008,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2008
2008
|
return n.code === resources_code;
|
|
2009
2009
|
})) === null || _productResources$fin === void 0 ? void 0 : _productResources$fin.renderList;
|
|
2010
2010
|
if (targetRenderList && targetRenderList.length > 0) {
|
|
2011
|
-
var _item$_origin$resourc2;
|
|
2011
|
+
var _item$_origin$resourc2, _dateRange$5, _item$duration2, _item$_productOrigin6;
|
|
2012
2012
|
// 如果购物车里已经有同类型的 form_id 的资源了,则不处理
|
|
2013
2013
|
if ((_item$_origin$resourc2 = item._origin.resources) !== null && _item$_origin$resourc2 !== void 0 && _item$_origin$resourc2.some(function (n) {
|
|
2014
2014
|
return n.form_id === targetRenderList[0].form_id;
|
|
@@ -2018,7 +2018,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2018
2018
|
var fastestResource = findFastestAvailableResource({
|
|
2019
2019
|
resources: targetRenderList,
|
|
2020
2020
|
currentCapacity: currentCapacity,
|
|
2021
|
-
countMap: selectResourcesMap
|
|
2021
|
+
countMap: selectResourcesMap,
|
|
2022
|
+
targetDate: dateRange === null || dateRange === void 0 || (_dateRange$5 = dateRange[0]) === null || _dateRange$5 === void 0 ? void 0 : _dateRange$5.date,
|
|
2023
|
+
durationMinutes: (item === null || item === void 0 || (_item$duration2 = item.duration) === null || _item$duration2 === void 0 ? void 0 : _item$duration2.value) || (item === null || item === void 0 || (_item$_productOrigin6 = item._productOrigin) === null || _item$_productOrigin6 === void 0 || (_item$_productOrigin6 = _item$_productOrigin6.duration) === null || _item$_productOrigin6 === void 0 ? void 0 : _item$_productOrigin6.value) || 10
|
|
2022
2024
|
});
|
|
2023
2025
|
var targetResource = fastestResource || targetRenderList[0];
|
|
2024
2026
|
targetResource.capacity = currentCapacity;
|
|
@@ -2084,8 +2086,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2084
2086
|
var maxCutOffTime = undefined;
|
|
2085
2087
|
var maxCutOffTimeValue = dayjs();
|
|
2086
2088
|
cartItems.forEach(function (item) {
|
|
2087
|
-
var _item$
|
|
2088
|
-
(_item$
|
|
2089
|
+
var _item$_productOrigin7, _item$_productOrigin8, _item$_productOrigin9, _item$_productOrigin10;
|
|
2090
|
+
(_item$_productOrigin7 = item._productOrigin) === null || _item$_productOrigin7 === void 0 || (_item$_productOrigin7 = _item$_productOrigin7.product_resource) === null || _item$_productOrigin7 === void 0 || (_item$_productOrigin7 = _item$_productOrigin7.resources) === null || _item$_productOrigin7 === void 0 || _item$_productOrigin7.forEach(function (n) {
|
|
2089
2091
|
// TODO: 少了个 status 的判断
|
|
2090
2092
|
if (n.code === resources_code) {
|
|
2091
2093
|
resources.push.apply(resources, _toConsumableArray(n.renderList || []));
|
|
@@ -2098,10 +2100,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2098
2100
|
if (item.resource_id && !resourceIds.includes(item.resource_id)) {
|
|
2099
2101
|
resourceIds.push(item.resource_id);
|
|
2100
2102
|
}
|
|
2101
|
-
resourcesTypeId = item === null || item === void 0 || (_item$
|
|
2103
|
+
resourcesTypeId = item === null || item === void 0 || (_item$_productOrigin8 = item._productOrigin) === null || _item$_productOrigin8 === void 0 || (_item$_productOrigin8 = _item$_productOrigin8.product_resource) === null || _item$_productOrigin8 === void 0 || (_item$_productOrigin8 = _item$_productOrigin8.resources) === null || _item$_productOrigin8 === void 0 || (_item$_productOrigin8 = _item$_productOrigin8.find(function (n) {
|
|
2102
2104
|
return n.code === resources_code;
|
|
2103
|
-
})) === null || _item$
|
|
2104
|
-
if ((_item$
|
|
2105
|
+
})) === null || _item$_productOrigin8 === void 0 ? void 0 : _item$_productOrigin8.id;
|
|
2106
|
+
if ((_item$_productOrigin9 = item._productOrigin) !== null && _item$_productOrigin9 !== void 0 && _item$_productOrigin9.cut_off_time && ((_item$_productOrigin10 = item._productOrigin) === null || _item$_productOrigin10 === void 0 ? void 0 : _item$_productOrigin10.cut_off_time.type) === 'advance') {
|
|
2105
2107
|
var currentCutOffTime = dayjs().add(item._productOrigin.cut_off_time.unit, item._productOrigin.cut_off_time.unit_type);
|
|
2106
2108
|
if (currentCutOffTime.isAfter(maxCutOffTimeValue, 'minute')) {
|
|
2107
2109
|
maxCutOffTimeValue = currentCutOffTime;
|
|
@@ -2151,13 +2153,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2151
2153
|
cartItems.forEach(function (item) {
|
|
2152
2154
|
// 单个预约累加账号 多个预约取最大值
|
|
2153
2155
|
if (isSingleResource) {
|
|
2154
|
-
var _item$_productOrigin10;
|
|
2155
|
-
accountDuration += ((_item$_productOrigin10 = item._productOrigin) === null || _item$_productOrigin10 === void 0 || (_item$_productOrigin10 = _item$_productOrigin10.duration) === null || _item$_productOrigin10 === void 0 ? void 0 : _item$_productOrigin10.value) || 10;
|
|
2156
|
-
} else {
|
|
2157
2156
|
var _item$_productOrigin11;
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2157
|
+
accountDuration += ((_item$_productOrigin11 = item._productOrigin) === null || _item$_productOrigin11 === void 0 || (_item$_productOrigin11 = _item$_productOrigin11.duration) === null || _item$_productOrigin11 === void 0 ? void 0 : _item$_productOrigin11.value) || 10;
|
|
2158
|
+
} else {
|
|
2159
|
+
var _item$_productOrigin12;
|
|
2160
|
+
if (accountDuration < (((_item$_productOrigin12 = item._productOrigin) === null || _item$_productOrigin12 === void 0 || (_item$_productOrigin12 = _item$_productOrigin12.duration) === null || _item$_productOrigin12 === void 0 ? void 0 : _item$_productOrigin12.value) || 10)) {
|
|
2161
|
+
var _item$_productOrigin13;
|
|
2162
|
+
accountDuration = ((_item$_productOrigin13 = item._productOrigin) === null || _item$_productOrigin13 === void 0 || (_item$_productOrigin13 = _item$_productOrigin13.duration) === null || _item$_productOrigin13 === void 0 ? void 0 : _item$_productOrigin13.value) || 10;
|
|
2161
2163
|
}
|
|
2162
2164
|
}
|
|
2163
2165
|
});
|
|
@@ -2194,8 +2196,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2194
2196
|
}
|
|
2195
2197
|
var resourcesUseableMap = {};
|
|
2196
2198
|
var hasFlexibleDuration = cartItems.some(function (item) {
|
|
2197
|
-
var _item$
|
|
2198
|
-
return ((_item$
|
|
2199
|
+
var _item$_productOrigin14;
|
|
2200
|
+
return ((_item$_productOrigin14 = item._productOrigin) === null || _item$_productOrigin14 === void 0 || (_item$_productOrigin14 = _item$_productOrigin14.duration) === null || _item$_productOrigin14 === void 0 ? void 0 : _item$_productOrigin14.type) === 'flexible';
|
|
2199
2201
|
});
|
|
2200
2202
|
var operating_day_boundary = (_this$shopStore$get = this.shopStore.get('core')) === null || _this$shopStore$get === void 0 || (_this$shopStore$get = _this$shopStore$get.core) === null || _this$shopStore$get === void 0 ? void 0 : _this$shopStore$get.operating_day_boundary;
|
|
2201
2203
|
|
|
@@ -2203,11 +2205,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2203
2205
|
var maxBlockThreshold = 0;
|
|
2204
2206
|
if (hasFlexibleDuration) {
|
|
2205
2207
|
maxBlockThreshold = cartItems.reduce(function (max, item) {
|
|
2206
|
-
var _item$
|
|
2208
|
+
var _item$_productOrigin15;
|
|
2207
2209
|
// 如果开启了灵活时长商品配置,则取 block_threshold 的值
|
|
2208
|
-
if ((_item$
|
|
2209
|
-
var _item$
|
|
2210
|
-
return Math.max(max, ((_item$
|
|
2210
|
+
if ((_item$_productOrigin15 = item._productOrigin) !== null && _item$_productOrigin15 !== void 0 && (_item$_productOrigin15 = _item$_productOrigin15.duration) !== null && _item$_productOrigin15 !== void 0 && (_item$_productOrigin15 = _item$_productOrigin15.flexible_config) !== null && _item$_productOrigin15 !== void 0 && _item$_productOrigin15.is_enable_minimum_duration) {
|
|
2211
|
+
var _item$_productOrigin16;
|
|
2212
|
+
return Math.max(max, ((_item$_productOrigin16 = item._productOrigin) === null || _item$_productOrigin16 === void 0 || (_item$_productOrigin16 = _item$_productOrigin16.duration) === null || _item$_productOrigin16 === void 0 || (_item$_productOrigin16 = _item$_productOrigin16.flexible_config) === null || _item$_productOrigin16 === void 0 ? void 0 : _item$_productOrigin16.block_threshold) || 0);
|
|
2211
2213
|
}
|
|
2212
2214
|
return 0;
|
|
2213
2215
|
}, 0);
|
|
@@ -2299,8 +2301,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2299
2301
|
maxCutOffTime = undefined;
|
|
2300
2302
|
maxCutOffTimeValue = dayjs();
|
|
2301
2303
|
cartItems.forEach(function (item) {
|
|
2302
|
-
var _item$
|
|
2303
|
-
(_item$
|
|
2304
|
+
var _item$_productOrigin17, _item$_productOrigin18, _item$_productOrigin19, _item$_productOrigin20;
|
|
2305
|
+
(_item$_productOrigin17 = item._productOrigin) === null || _item$_productOrigin17 === void 0 || (_item$_productOrigin17 = _item$_productOrigin17.product_resource) === null || _item$_productOrigin17 === void 0 || (_item$_productOrigin17 = _item$_productOrigin17.resources) === null || _item$_productOrigin17 === void 0 || _item$_productOrigin17.forEach(function (n) {
|
|
2304
2306
|
// TODO: 少了个 status 的判断
|
|
2305
2307
|
if (n.code === resources_code) {
|
|
2306
2308
|
resources.push.apply(resources, _toConsumableArray(n.renderList || []));
|
|
@@ -2313,10 +2315,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2313
2315
|
if (item.resource_id && !resourceIds.includes(item.resource_id)) {
|
|
2314
2316
|
resourceIds.push(item.resource_id);
|
|
2315
2317
|
}
|
|
2316
|
-
resourcesTypeId = item === null || item === void 0 || (_item$
|
|
2318
|
+
resourcesTypeId = item === null || item === void 0 || (_item$_productOrigin18 = item._productOrigin) === null || _item$_productOrigin18 === void 0 || (_item$_productOrigin18 = _item$_productOrigin18.product_resource) === null || _item$_productOrigin18 === void 0 || (_item$_productOrigin18 = _item$_productOrigin18.resources) === null || _item$_productOrigin18 === void 0 || (_item$_productOrigin18 = _item$_productOrigin18.find(function (n) {
|
|
2317
2319
|
return n.code === resources_code;
|
|
2318
|
-
})) === null || _item$
|
|
2319
|
-
if ((_item$
|
|
2320
|
+
})) === null || _item$_productOrigin18 === void 0 ? void 0 : _item$_productOrigin18.id;
|
|
2321
|
+
if ((_item$_productOrigin19 = item._productOrigin) !== null && _item$_productOrigin19 !== void 0 && _item$_productOrigin19.cut_off_time && ((_item$_productOrigin20 = item._productOrigin) === null || _item$_productOrigin20 === void 0 ? void 0 : _item$_productOrigin20.cut_off_time.type) === 'advance') {
|
|
2320
2322
|
var currentCutOffTime = dayjs().add(item._productOrigin.cut_off_time.unit, item._productOrigin.cut_off_time.unit_type);
|
|
2321
2323
|
if (currentCutOffTime.isAfter(maxCutOffTimeValue, 'minute')) {
|
|
2322
2324
|
maxCutOffTimeValue = currentCutOffTime;
|
|
@@ -2339,13 +2341,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2339
2341
|
cartItems.forEach(function (item) {
|
|
2340
2342
|
// 单个预约累加账号 多个预约取最大值
|
|
2341
2343
|
if (isSingleResource) {
|
|
2342
|
-
var _item$_productOrigin20;
|
|
2343
|
-
accountDuration += ((_item$_productOrigin20 = item._productOrigin) === null || _item$_productOrigin20 === void 0 || (_item$_productOrigin20 = _item$_productOrigin20.duration) === null || _item$_productOrigin20 === void 0 ? void 0 : _item$_productOrigin20.value) || 10;
|
|
2344
|
-
} else {
|
|
2345
2344
|
var _item$_productOrigin21;
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2345
|
+
accountDuration += ((_item$_productOrigin21 = item._productOrigin) === null || _item$_productOrigin21 === void 0 || (_item$_productOrigin21 = _item$_productOrigin21.duration) === null || _item$_productOrigin21 === void 0 ? void 0 : _item$_productOrigin21.value) || 10;
|
|
2346
|
+
} else {
|
|
2347
|
+
var _item$_productOrigin22;
|
|
2348
|
+
if (accountDuration < (((_item$_productOrigin22 = item._productOrigin) === null || _item$_productOrigin22 === void 0 || (_item$_productOrigin22 = _item$_productOrigin22.duration) === null || _item$_productOrigin22 === void 0 ? void 0 : _item$_productOrigin22.value) || 10)) {
|
|
2349
|
+
var _item$_productOrigin23;
|
|
2350
|
+
accountDuration = ((_item$_productOrigin23 = item._productOrigin) === null || _item$_productOrigin23 === void 0 || (_item$_productOrigin23 = _item$_productOrigin23.duration) === null || _item$_productOrigin23 === void 0 ? void 0 : _item$_productOrigin23.value) || 10;
|
|
2349
2351
|
}
|
|
2350
2352
|
}
|
|
2351
2353
|
});
|
|
@@ -2371,18 +2373,18 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2371
2373
|
case 20:
|
|
2372
2374
|
resourcesUseableMap = {};
|
|
2373
2375
|
hasFlexibleDuration = cartItems.some(function (item) {
|
|
2374
|
-
var _item$
|
|
2375
|
-
return ((_item$
|
|
2376
|
+
var _item$_productOrigin24;
|
|
2377
|
+
return ((_item$_productOrigin24 = item._productOrigin) === null || _item$_productOrigin24 === void 0 || (_item$_productOrigin24 = _item$_productOrigin24.duration) === null || _item$_productOrigin24 === void 0 ? void 0 : _item$_productOrigin24.type) === 'flexible';
|
|
2376
2378
|
});
|
|
2377
2379
|
operating_day_boundary = (_this$shopStore$get2 = this.shopStore.get('core')) === null || _this$shopStore$get2 === void 0 || (_this$shopStore$get2 = _this$shopStore$get2.core) === null || _this$shopStore$get2 === void 0 ? void 0 : _this$shopStore$get2.operating_day_boundary; // 如果有 hasFlexibleDuration,需要把动态时长商品(可能是多个,取最长的那个最低禁止购买时长)的最低禁止购买时长作为 split 的值
|
|
2378
2380
|
maxBlockThreshold = 0;
|
|
2379
2381
|
if (hasFlexibleDuration) {
|
|
2380
2382
|
maxBlockThreshold = cartItems.reduce(function (max, item) {
|
|
2381
|
-
var _item$
|
|
2383
|
+
var _item$_productOrigin25;
|
|
2382
2384
|
// 如果开启了灵活时长商品配置,则取 block_threshold 的值
|
|
2383
|
-
if ((_item$
|
|
2384
|
-
var _item$
|
|
2385
|
-
return Math.max(max, ((_item$
|
|
2385
|
+
if ((_item$_productOrigin25 = item._productOrigin) !== null && _item$_productOrigin25 !== void 0 && (_item$_productOrigin25 = _item$_productOrigin25.duration) !== null && _item$_productOrigin25 !== void 0 && (_item$_productOrigin25 = _item$_productOrigin25.flexible_config) !== null && _item$_productOrigin25 !== void 0 && _item$_productOrigin25.is_enable_minimum_duration) {
|
|
2386
|
+
var _item$_productOrigin26;
|
|
2387
|
+
return Math.max(max, ((_item$_productOrigin26 = item._productOrigin) === null || _item$_productOrigin26 === void 0 || (_item$_productOrigin26 = _item$_productOrigin26.duration) === null || _item$_productOrigin26 === void 0 || (_item$_productOrigin26 = _item$_productOrigin26.flexible_config) === null || _item$_productOrigin26 === void 0 ? void 0 : _item$_productOrigin26.block_threshold) || 0);
|
|
2386
2388
|
}
|
|
2387
2389
|
return 0;
|
|
2388
2390
|
}, 0);
|
|
@@ -2543,10 +2545,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2543
2545
|
var osWarnTips = [];
|
|
2544
2546
|
var newResources = cloneDeep(item._origin.resources);
|
|
2545
2547
|
newResources.forEach(function (resource) {
|
|
2546
|
-
var _item$
|
|
2548
|
+
var _item$_productOrigin27;
|
|
2547
2549
|
// 如果商品配置的是灵活时长,开始时间设置为提交的时间,结束时间从资源的可用最晚时间和店铺营业结束时间里取一个最早的
|
|
2548
|
-
if (((_item$
|
|
2549
|
-
var _allResources$find, _item$
|
|
2550
|
+
if (((_item$_productOrigin27 = item._productOrigin) === null || _item$_productOrigin27 === void 0 || (_item$_productOrigin27 = _item$_productOrigin27.duration) === null || _item$_productOrigin27 === void 0 ? void 0 : _item$_productOrigin27.type) === 'flexible') {
|
|
2551
|
+
var _allResources$find, _item$_productOrigin28, _item$_productOrigin29;
|
|
2550
2552
|
item.duration = {
|
|
2551
2553
|
type: 'minutes',
|
|
2552
2554
|
value: 10
|
|
@@ -2629,15 +2631,15 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2629
2631
|
resource.endTime = formattedEndTime.format('YYYY-MM-DD HH:mm');
|
|
2630
2632
|
// 如果是动态时长商品,并且当前选择的时间的结束时间小于了最低提示时长(warningThreshold),则追加一个提示
|
|
2631
2633
|
// 如果currentStartTime + warningThreshold 大于 currentEndTime,且 osWarnTips 没有pisell2.product.card.closing-soon.warning 这一项,则加入这一项
|
|
2632
|
-
if ((_item$
|
|
2634
|
+
if ((_item$_productOrigin28 = item._productOrigin) !== null && _item$_productOrigin28 !== void 0 && (_item$_productOrigin28 = _item$_productOrigin28.duration) !== null && _item$_productOrigin28 !== void 0 && (_item$_productOrigin28 = _item$_productOrigin28.flexible_config) !== null && _item$_productOrigin28 !== void 0 && _item$_productOrigin28.is_enable_minimum_duration && dayjs(currentStartTime).add(((_item$_productOrigin29 = item._productOrigin) === null || _item$_productOrigin29 === void 0 || (_item$_productOrigin29 = _item$_productOrigin29.duration) === null || _item$_productOrigin29 === void 0 || (_item$_productOrigin29 = _item$_productOrigin29.flexible_config) === null || _item$_productOrigin29 === void 0 ? void 0 : _item$_productOrigin29.warning_threshold) || 0, 'minutes').isAfter(dayjs(formattedEndTime))) {
|
|
2633
2635
|
if (!osWarnTips.includes('pisell2.product.card.closing-soon.warning')) {
|
|
2634
2636
|
osWarnTips.push('pisell2.product.card.closing-soon.warning');
|
|
2635
2637
|
}
|
|
2636
2638
|
}
|
|
2637
2639
|
} else {
|
|
2638
|
-
var _item$
|
|
2640
|
+
var _item$_productOrigin30;
|
|
2639
2641
|
resource.startTime = currentStartTime;
|
|
2640
|
-
resource.endTime = dayjs(currentStartTime).add(((_item$
|
|
2642
|
+
resource.endTime = dayjs(currentStartTime).add(((_item$_productOrigin30 = item._productOrigin) === null || _item$_productOrigin30 === void 0 || (_item$_productOrigin30 = _item$_productOrigin30.duration) === null || _item$_productOrigin30 === void 0 ? void 0 : _item$_productOrigin30.value) || 10, 'minutes').format('YYYY-MM-DD HH:mm');
|
|
2641
2643
|
}
|
|
2642
2644
|
// delete resource.times;
|
|
2643
2645
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, ScheduleModule } from '../../modules';
|
|
1
|
+
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from '../../modules';
|
|
2
2
|
export interface BookingByStepState {
|
|
3
3
|
cart: CartModule;
|
|
4
4
|
summary: SummaryModule;
|
|
@@ -14,6 +14,8 @@ export interface BookingByStepState {
|
|
|
14
14
|
currentProduct?: ProductData;
|
|
15
15
|
currentProductMeta?: Record<string, any>;
|
|
16
16
|
schedule: ScheduleModule;
|
|
17
|
+
salesSummary?: SalesSummaryModule;
|
|
18
|
+
scanOrderLogger?: ScanOrderLoggerModule;
|
|
17
19
|
}
|
|
18
20
|
export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
|
|
19
21
|
export declare enum BookingByStepHooks {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, ScheduleModule } from "../../modules";
|
|
1
|
+
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from "../../modules";
|
|
2
2
|
export function createModule(moduleName, solutionName, name, version) {
|
|
3
3
|
switch (moduleName) {
|
|
4
4
|
case 'cart':
|
|
5
5
|
return new CartModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
6
6
|
case 'summary':
|
|
7
7
|
return new SummaryModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
8
|
+
case 'salesSummary':
|
|
9
|
+
return new SalesSummaryModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
8
10
|
case 'step':
|
|
9
11
|
return new StepModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
10
12
|
case 'products':
|
|
@@ -19,6 +21,8 @@ export function createModule(moduleName, solutionName, name, version) {
|
|
|
19
21
|
return new PaymentModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
20
22
|
case 'schedule':
|
|
21
23
|
return new ScheduleModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
24
|
+
case 'scanOrderLogger':
|
|
25
|
+
return new ScanOrderLoggerModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
22
26
|
default:
|
|
23
27
|
throw new Error("Unknown module type: ".concat(moduleName));
|
|
24
28
|
}
|
|
@@ -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
|
}
|
|
@@ -403,7 +403,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
403
403
|
product_id: item.product_id,
|
|
404
404
|
product_variant_id: item.product_variant_id,
|
|
405
405
|
quantity: item.num,
|
|
406
|
-
is_price_include_tax: item.is_price_include_tax,
|
|
407
406
|
// 商品是否含税:1;0
|
|
408
407
|
is_charge_tax: (_item$is_charge_tax = item.is_charge_tax) !== null && _item$is_charge_tax !== void 0 ? _item$is_charge_tax : 0,
|
|
409
408
|
// 若商品不含税,计算得到的税费,单位(元)
|
|
@@ -428,7 +427,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
428
427
|
},
|
|
429
428
|
product_bundle: (item.product_bundle || []).map(function (bundle) {
|
|
430
429
|
return {
|
|
431
|
-
is_price_include_tax: item.is_price_include_tax,
|
|
432
430
|
bundle_id: bundle.bundle_id,
|
|
433
431
|
bundle_product_id: bundle.bundle_product_id,
|
|
434
432
|
bundle_variant_id: bundle.bundle_variant_id,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderTableConfigApiData } from './types';
|
|
4
|
+
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
5
|
+
import type { StrategyConfig } from '../../model/strategy/type';
|
|
6
|
+
export * from './types';
|
|
7
|
+
interface ScanOrderItemRuleRuntimeConfig {
|
|
8
|
+
strategyConfigs?: StrategyConfig[];
|
|
9
|
+
pax?: Partial<PaxInfo>;
|
|
10
|
+
historicalItems?: CartItemSummary[];
|
|
11
|
+
serviceType?: string;
|
|
12
|
+
submissionIndex?: number;
|
|
13
|
+
custom?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
16
|
+
protected defaultName: string;
|
|
17
|
+
protected defaultVersion: string;
|
|
18
|
+
isSolution: boolean;
|
|
19
|
+
private initializeOptions;
|
|
20
|
+
private store;
|
|
21
|
+
private otherParams;
|
|
22
|
+
private cacheId;
|
|
23
|
+
private window;
|
|
24
|
+
private request;
|
|
25
|
+
private itemRuleEvaluator;
|
|
26
|
+
private itemRuleConfigs;
|
|
27
|
+
private itemRuleConfigsPromise;
|
|
28
|
+
private itemRulePrefillApplied;
|
|
29
|
+
private itemRuleRuntimeConfig;
|
|
30
|
+
private getScanOrderLoggerContext;
|
|
31
|
+
private serializeError;
|
|
32
|
+
private addScanOrderLog;
|
|
33
|
+
private logMethodStart;
|
|
34
|
+
private logMethodSuccess;
|
|
35
|
+
private logMethodError;
|
|
36
|
+
addLog(params: ScanOrderAddLogParams): Promise<void>;
|
|
37
|
+
constructor(name?: string, version?: string);
|
|
38
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
39
|
+
destroy(): Promise<void>;
|
|
40
|
+
retryInit(): Promise<void>;
|
|
41
|
+
refresh(): Promise<void>;
|
|
42
|
+
getStatus(): import("./types").ScanOrderStatus;
|
|
43
|
+
getEntryContext(): import("./types").ScanOrderEntryContext | null;
|
|
44
|
+
getConfig(): ScanOrderTableConfigApiData;
|
|
45
|
+
getItemRuleQuantityLimits(): QuantityLimitResult[];
|
|
46
|
+
getCartValidationPassed(): boolean | null;
|
|
47
|
+
getCartValidation(): {
|
|
48
|
+
passed: boolean | null;
|
|
49
|
+
failures: QuantityCheckResult[];
|
|
50
|
+
};
|
|
51
|
+
getTempOrder(): import("./types").ScanOrderTempOrder | null;
|
|
52
|
+
updateTempOrderNote(note: string): string;
|
|
53
|
+
private ensureTempOrder;
|
|
54
|
+
addNewOrder(): Promise<import("./types").ScanOrderTempOrder>;
|
|
55
|
+
getOrderProducts(): ScanOrderOrderProduct[];
|
|
56
|
+
getSummary(): Promise<import("./types").ScanOrderSummary>;
|
|
57
|
+
submitScanOrder<T = any>(): Promise<T>;
|
|
58
|
+
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
59
|
+
updateProductInOrder(params: {
|
|
60
|
+
product_id: number | null;
|
|
61
|
+
product_variant_id: number;
|
|
62
|
+
updates: Partial<ScanOrderOrderProduct>;
|
|
63
|
+
}): Promise<ScanOrderOrderProduct[]>;
|
|
64
|
+
removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
65
|
+
private loadRuntimeConfigs;
|
|
66
|
+
private syncItemRuleConfigsFromDineInConfig;
|
|
67
|
+
private fetchItemRuleConfigsByModelIds;
|
|
68
|
+
private buildPrefillProductSourceMap;
|
|
69
|
+
private getItemRuleRuntimeConfig;
|
|
70
|
+
private ensureItemRuleConfigsLoaded;
|
|
71
|
+
private refreshItemRuleQuantityLimits;
|
|
72
|
+
private applyPrefillByItemRule;
|
|
73
|
+
applyItemRulePrefill(): Promise<void>;
|
|
74
|
+
private evaluateCartValidationByItemRule;
|
|
75
|
+
private validateBeforeSubmitByItemRule;
|
|
76
|
+
private refreshCartValidationPassed;
|
|
77
|
+
setItemRuleRuntimeConfig(config?: ScanOrderItemRuleRuntimeConfig): Promise<void>;
|
|
78
|
+
private normalizeResourceState;
|
|
79
|
+
private fetchTableConfigByResourceId;
|
|
80
|
+
checkResourceAvailable(resourceId: string, hasOrderId: boolean): Promise<ScanOrderAvailabilityInfo>;
|
|
81
|
+
getAdditionalOrderInfo(): Promise<{
|
|
82
|
+
orderId: string;
|
|
83
|
+
orderStatus: 'pending' | 'processing' | 'completed' | 'cancelled';
|
|
84
|
+
orderTime: string;
|
|
85
|
+
orderAmount: number;
|
|
86
|
+
orderItems: any[];
|
|
87
|
+
}>;
|
|
88
|
+
getProductList(): Promise<any>;
|
|
89
|
+
getOtherParams(): Record<string, any>;
|
|
90
|
+
}
|