@pisell/pisellos 2.2.243 → 2.2.244
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/evaluator.js +2 -3
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +4 -7
- package/dist/modules/Cart/utils/cartProduct.js +3 -24
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +0 -20
- package/dist/modules/Customer/index.js +83 -172
- package/dist/modules/Customer/types.d.ts +0 -2
- package/dist/modules/Discount/index.js +3 -4
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.d.ts +0 -8
- package/dist/modules/OpenData/index.js +17 -37
- package/dist/modules/Order/index.d.ts +18 -268
- package/dist/modules/Order/index.js +757 -3306
- package/dist/modules/Order/types.d.ts +31 -279
- package/dist/modules/Order/types.js +0 -38
- package/dist/modules/Order/utils.d.ts +5 -147
- package/dist/modules/Order/utils.js +103 -746
- package/dist/modules/Payment/index.d.ts +13 -10
- package/dist/modules/Payment/index.js +837 -467
- package/dist/modules/Payment/types.d.ts +0 -2
- package/dist/modules/Payment/utils.js +1 -2
- package/dist/modules/Payment/walletpass.js +7 -14
- package/dist/modules/ProductList/index.d.ts +12 -16
- package/dist/modules/ProductList/index.js +59 -133
- package/dist/modules/ProductList/types.d.ts +0 -14
- package/dist/modules/Quotation/index.d.ts +1 -0
- package/dist/modules/Quotation/index.js +22 -25
- package/dist/modules/Rules/index.d.ts +0 -4
- package/dist/modules/Rules/index.js +69 -93
- package/dist/modules/Rules/types.d.ts +0 -1
- package/dist/modules/SalesSummary/index.d.ts +25 -8
- package/dist/modules/SalesSummary/index.js +35 -86
- package/dist/modules/SalesSummary/types.d.ts +1 -4
- package/dist/modules/SalesSummary/utils.d.ts +25 -2
- package/dist/modules/SalesSummary/utils.js +162 -794
- package/dist/modules/Schedule/index.d.ts +0 -7
- package/dist/modules/Schedule/index.js +2 -24
- package/dist/modules/Summary/index.js +3 -4
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/request.d.ts +0 -1
- package/dist/server/index.d.ts +1 -204
- package/dist/server/index.js +928 -3658
- package/dist/server/modules/index.d.ts +0 -2
- package/dist/server/modules/index.js +0 -2
- package/dist/server/modules/order/index.d.ts +4 -120
- package/dist/server/modules/order/index.js +483 -1779
- package/dist/server/modules/order/types.d.ts +3 -32
- package/dist/server/modules/order/types.js +0 -8
- package/dist/server/modules/order/utils/filterBookings.js +3 -26
- package/dist/server/modules/order/utils/filterOrders.js +8 -23
- package/dist/server/modules/products/index.d.ts +7 -34
- package/dist/server/modules/products/index.js +317 -631
- package/dist/server/modules/resource/index.d.ts +0 -2
- package/dist/server/modules/resource/index.js +3 -29
- package/dist/server/modules/schedule/index.d.ts +4 -4
- package/dist/server/modules/schedule/index.js +88 -111
- package/dist/solution/BaseSales/index.d.ts +9 -131
- package/dist/solution/BaseSales/index.js +447 -1944
- package/dist/solution/BaseSales/types.d.ts +6 -76
- package/dist/solution/BaseSales/types.js +4 -5
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -105
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +21 -62
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +10 -270
- package/dist/solution/BookingTicket/index.js +237 -1772
- package/dist/solution/BookingTicket/types.d.ts +1 -118
- package/dist/solution/BookingTicket/types.js +2 -41
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/dist/solution/BookingTicket/utils/bookingStatus.js +0 -70
- package/dist/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/dist/solution/BookingTicket/utils/cartView.js +7 -94
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/dist/solution/BookingTicket/utils/scan/index.js +8 -20
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +0 -1
- package/dist/solution/Checkout/index.js +9 -10
- package/dist/solution/RegisterAndLogin/config.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +3 -9
- package/dist/solution/ScanOrder/index.js +134 -241
- package/dist/solution/ScanOrder/types.d.ts +5 -9
- package/dist/solution/ScanOrder/types.js +3 -2
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +22 -84
- package/dist/solution/VenueBooking/index.d.ts +2 -5
- package/dist/solution/VenueBooking/index.js +59 -110
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/dist/types/index.d.ts +0 -10
- package/lib/model/strategy/adapter/promotion/evaluator.js +1 -2
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/model/strategy/adapter/walletPass/utils.js +2 -3
- package/lib/modules/Cart/utils/cartProduct.js +3 -20
- package/lib/modules/Cart/utils/changePrice.js +20 -12
- package/lib/modules/Customer/index.d.ts +0 -20
- package/lib/modules/Customer/index.js +11 -64
- package/lib/modules/Customer/types.d.ts +0 -2
- package/lib/modules/Discount/index.js +1 -5
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.d.ts +0 -8
- package/lib/modules/OpenData/index.js +5 -19
- package/lib/modules/Order/index.d.ts +18 -268
- package/lib/modules/Order/index.js +344 -2149
- package/lib/modules/Order/types.d.ts +31 -279
- package/lib/modules/Order/types.js +0 -1
- package/lib/modules/Order/utils.d.ts +5 -147
- package/lib/modules/Order/utils.js +46 -614
- package/lib/modules/Payment/index.d.ts +13 -10
- package/lib/modules/Payment/index.js +150 -18
- package/lib/modules/Payment/types.d.ts +0 -2
- package/lib/modules/Payment/utils.js +1 -2
- package/lib/modules/Payment/walletpass.js +3 -7
- package/lib/modules/ProductList/index.d.ts +12 -16
- package/lib/modules/ProductList/index.js +4 -41
- package/lib/modules/ProductList/types.d.ts +0 -14
- package/lib/modules/Quotation/index.d.ts +1 -0
- package/lib/modules/Quotation/index.js +16 -19
- package/lib/modules/Rules/index.d.ts +0 -4
- package/lib/modules/Rules/index.js +120 -136
- package/lib/modules/Rules/types.d.ts +0 -1
- package/lib/modules/SalesSummary/index.d.ts +25 -8
- package/lib/modules/SalesSummary/index.js +4 -30
- package/lib/modules/SalesSummary/types.d.ts +1 -4
- package/lib/modules/SalesSummary/utils.d.ts +25 -2
- package/lib/modules/SalesSummary/utils.js +91 -645
- package/lib/modules/Schedule/index.d.ts +0 -7
- package/lib/modules/Schedule/index.js +1 -17
- package/lib/modules/Summary/index.js +4 -5
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/request.d.ts +0 -1
- package/lib/server/index.d.ts +1 -204
- package/lib/server/index.js +57 -1888
- package/lib/server/modules/index.d.ts +0 -2
- package/lib/server/modules/index.js +0 -3
- package/lib/server/modules/order/index.d.ts +4 -120
- package/lib/server/modules/order/index.js +142 -919
- package/lib/server/modules/order/types.d.ts +3 -32
- package/lib/server/modules/order/utils/filterBookings.js +5 -24
- package/lib/server/modules/order/utils/filterOrders.js +6 -15
- package/lib/server/modules/products/index.d.ts +7 -34
- package/lib/server/modules/products/index.js +54 -189
- package/lib/server/modules/resource/index.d.ts +0 -2
- package/lib/server/modules/resource/index.js +3 -27
- package/lib/server/modules/schedule/index.d.ts +4 -4
- package/lib/server/modules/schedule/index.js +40 -47
- package/lib/solution/BaseSales/index.d.ts +9 -131
- package/lib/solution/BaseSales/index.js +63 -1106
- package/lib/solution/BaseSales/types.d.ts +6 -76
- package/lib/solution/BaseSales/types.js +1 -3
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +18 -106
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +10 -54
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +10 -270
- package/lib/solution/BookingTicket/index.js +29 -922
- package/lib/solution/BookingTicket/types.d.ts +1 -118
- package/lib/solution/BookingTicket/types.js +0 -11
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/lib/solution/BookingTicket/utils/bookingStatus.js +2 -44
- package/lib/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/lib/solution/BookingTicket/utils/cartView.js +6 -61
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/lib/solution/BookingTicket/utils/scan/index.js +3 -17
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +0 -1
- package/lib/solution/Checkout/index.js +2 -1
- package/lib/solution/RegisterAndLogin/config.js +10 -2
- package/lib/solution/ScanOrder/index.d.ts +3 -9
- package/lib/solution/ScanOrder/index.js +70 -153
- package/lib/solution/ScanOrder/types.d.ts +5 -9
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +17 -83
- package/lib/solution/VenueBooking/index.d.ts +2 -5
- package/lib/solution/VenueBooking/index.js +17 -54
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/lib/types/index.d.ts +0 -10
- package/package.json +1 -1
- package/dist/modules/BookingContext/index.d.ts +0 -48
- package/dist/modules/BookingContext/index.js +0 -566
- package/dist/modules/BookingContext/types.d.ts +0 -102
- package/dist/modules/BookingContext/types.js +0 -51
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -284
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -145
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -218
- package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/dist/modules/BookingContext/utils/flexible.js +0 -56
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
- package/dist/modules/BookingContext/utils/index.d.ts +0 -11
- package/dist/modules/BookingContext/utils/index.js +0 -11
- package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/dist/modules/BookingContext/utils/noResource.js +0 -77
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +0 -36
- package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/dist/modules/BookingContext/utils/productExtend.js +0 -339
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
- package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
- package/dist/modules/BookingContext/utils/resources.js +0 -486
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/dist/modules/Order/utils/manualProductDiscount.js +0 -210
- package/dist/modules/SurchargeList/index.d.ts +0 -16
- package/dist/modules/SurchargeList/index.js +0 -162
- package/dist/modules/SurchargeList/types.d.ts +0 -11
- package/dist/modules/SurchargeList/types.js +0 -1
- package/dist/server/modules/payment/index.d.ts +0 -28
- package/dist/server/modules/payment/index.js +0 -305
- package/dist/server/modules/payment/types.d.ts +0 -9
- package/dist/server/modules/payment/types.js +0 -1
- package/dist/server/test.json +0 -713
- package/dist/server/utils/small-ticket.d.ts +0 -71
- package/dist/server/utils/small-ticket.js +0 -830
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/dist/solution/BaseSales/utils/cartPromotion.js +0 -1438
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +0 -95
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/dist/solution/BookingTicket/utils/exampleData.js +0 -183
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -438
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -399
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -56
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +0 -150
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +0 -78
- package/lib/modules/BookingContext/index.d.ts +0 -48
- package/lib/modules/BookingContext/index.js +0 -368
- package/lib/modules/BookingContext/types.d.ts +0 -102
- package/lib/modules/BookingContext/types.js +0 -34
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -276
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -151
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -201
- package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/lib/modules/BookingContext/utils/flexible.js +0 -80
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
- package/lib/modules/BookingContext/utils/index.d.ts +0 -11
- package/lib/modules/BookingContext/utils/index.js +0 -43
- package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/lib/modules/BookingContext/utils/noResource.js +0 -90
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +0 -56
- package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/lib/modules/BookingContext/utils/productExtend.js +0 -283
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
- package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
- package/lib/modules/BookingContext/utils/resources.js +0 -377
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/lib/modules/Order/utils/manualProductDiscount.js +0 -206
- package/lib/modules/SurchargeList/index.d.ts +0 -16
- package/lib/modules/SurchargeList/index.js +0 -89
- package/lib/modules/SurchargeList/types.d.ts +0 -11
- package/lib/modules/SurchargeList/types.js +0 -17
- package/lib/server/modules/payment/index.d.ts +0 -28
- package/lib/server/modules/payment/index.js +0 -192
- package/lib/server/modules/payment/types.d.ts +0 -9
- package/lib/server/modules/payment/types.js +0 -17
- package/lib/server/test.json +0 -713
- package/lib/server/utils/small-ticket.d.ts +0 -71
- package/lib/server/utils/small-ticket.js +0 -781
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/lib/solution/BaseSales/utils/cartPromotion.js +0 -992
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +0 -125
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -254
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -168
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -51
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +0 -127
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +0 -85
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ProductList, OrderModule
|
|
2
|
-
import { BookingContextModule } from '../../modules/BookingContext';
|
|
1
|
+
import { ProductList, OrderModule } from '../../modules';
|
|
3
2
|
import { CustomerModule } from '../../modules/Customer';
|
|
4
3
|
import { SalesSummaryModule } from '../../modules/SalesSummary';
|
|
5
4
|
import { ScheduleModule } from '../../modules/Schedule';
|
|
@@ -17,8 +16,6 @@ export interface BookingTicketState extends BaseSalesState {
|
|
|
17
16
|
salesSummary: SalesSummaryModule;
|
|
18
17
|
schedule: ScheduleModule;
|
|
19
18
|
customer: CustomerModule;
|
|
20
|
-
bookingContext: BookingContextModule;
|
|
21
|
-
openData: OpenDataModule;
|
|
22
19
|
}
|
|
23
20
|
export declare function createBookingTicketModule<T extends keyof BookingTicketState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingTicketState[T] | null;
|
|
24
21
|
export declare enum BookingTicketHooks {
|
|
@@ -79,10 +76,6 @@ export interface ILoadProductsParams {
|
|
|
79
76
|
with_count?: string[];
|
|
80
77
|
/** 是否返回日程信息 */
|
|
81
78
|
with_schedule?: number;
|
|
82
|
-
/** 扩展商品类型过滤 */
|
|
83
|
-
extension_type?: string[];
|
|
84
|
-
/** 商品发布状态 */
|
|
85
|
-
status?: string;
|
|
86
79
|
}
|
|
87
80
|
/**
|
|
88
81
|
* 加载商品详情的参数
|
|
@@ -112,8 +105,6 @@ export type BookingTicketCartItemView = BaseSalesOrderProduct;
|
|
|
112
105
|
export interface BookingTicketCartBookingView extends ISalesBooking {
|
|
113
106
|
_extend: {
|
|
114
107
|
product: BookingTicketCartItemView | null;
|
|
115
|
-
addTimeProduct: BookingTicketCartItemView[];
|
|
116
|
-
canAddTime: boolean;
|
|
117
108
|
};
|
|
118
109
|
}
|
|
119
110
|
/**
|
|
@@ -141,111 +132,3 @@ export interface BookingTicketCustomerView {
|
|
|
141
132
|
export interface BookingTicketProductCatalogView {
|
|
142
133
|
products: ProductData[];
|
|
143
134
|
}
|
|
144
|
-
/**
|
|
145
|
-
* 添加加时商品到已有 booking 的输入。
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* await bookingTicket.addAddTimeProductToBooking({
|
|
149
|
-
* booking,
|
|
150
|
-
* product,
|
|
151
|
-
* num: 1,
|
|
152
|
-
* price: '10.00',
|
|
153
|
-
* product_add_schedule_time: 30,
|
|
154
|
-
* });
|
|
155
|
-
*/
|
|
156
|
-
export interface AddAddTimeProductToBookingInput {
|
|
157
|
-
/** 当前购物车中已存在的 booking,必须带 metadata.unique_identification_number。 */
|
|
158
|
-
booking: Record<string, any>;
|
|
159
|
-
/** 加时商品原始数据,保留完整商品信息供 OrderModule 缓存原始快照。 */
|
|
160
|
-
product: ProductData & Record<string, any>;
|
|
161
|
-
/** 本次添加数量,缺省为 1。 */
|
|
162
|
-
num?: number;
|
|
163
|
-
/** 本次加时商品价格,缺省回退 product.price。 */
|
|
164
|
-
price?: number | string;
|
|
165
|
-
/** 加时时长,单位分钟;最终写入 product.metadata.product_add_schedule_time。 */
|
|
166
|
-
product_add_schedule_time?: number;
|
|
167
|
-
/** 本次加时方案实际覆盖分钟数,用于同步更新 booking 结束时间与 duration。 */
|
|
168
|
-
coveredMinutes?: number;
|
|
169
|
-
/** 直接写入 booking 的时间补丁,restart 场景使用。 */
|
|
170
|
-
bookingPatch?: {
|
|
171
|
-
start_date?: string;
|
|
172
|
-
start_time?: string;
|
|
173
|
-
end_date?: string;
|
|
174
|
-
end_time?: string;
|
|
175
|
-
duration?: number;
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* 批量添加加时商品到已有 booking 的单行输入。
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* const line: AddAddTimeProductLineInput = { product, product_add_schedule_time: 30 };
|
|
183
|
-
*/
|
|
184
|
-
export type AddAddTimeProductLineInput = Omit<AddAddTimeProductToBookingInput, 'booking' | 'coveredMinutes'>;
|
|
185
|
-
/**
|
|
186
|
-
* 批量添加加时商品到已有 booking 的输入。
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* await bookingTicket.addAddTimeProductsToBooking({
|
|
190
|
-
* booking,
|
|
191
|
-
* products: [{ product, product_add_schedule_time: 30 }],
|
|
192
|
-
* });
|
|
193
|
-
*/
|
|
194
|
-
export interface AddAddTimeProductsToBookingInput {
|
|
195
|
-
/** 当前购物车中已存在的 booking,必须带 metadata.unique_identification_number。 */
|
|
196
|
-
booking: Record<string, any>;
|
|
197
|
-
/** 需要一次性写入购物车的加时商品行。 */
|
|
198
|
-
products: AddAddTimeProductLineInput[];
|
|
199
|
-
/** 本次加时方案实际覆盖分钟数,用于同步更新 booking 结束时间与 duration。 */
|
|
200
|
-
coveredMinutes?: number;
|
|
201
|
-
/** 直接写入 booking 的时间补丁,restart 场景使用。 */
|
|
202
|
-
bookingPatch?: AddAddTimeProductToBookingInput['bookingPatch'];
|
|
203
|
-
}
|
|
204
|
-
/** 扫码宿主桥接:SalesSdk 在 pubsub 订阅回调里注入,OS 需要 UI 时直接调用 */
|
|
205
|
-
export interface GlobalScanHostBridge {
|
|
206
|
-
openProductDetail?: (payload: Record<string, any>) => Promise<any | null>;
|
|
207
|
-
openBookingEdit?: (payload: Record<string, any>) => Promise<any | null>;
|
|
208
|
-
confirmDetail?: (input: {
|
|
209
|
-
item: any;
|
|
210
|
-
detailResult: {
|
|
211
|
-
e: any;
|
|
212
|
-
extension_type?: any;
|
|
213
|
-
detail?: any;
|
|
214
|
-
};
|
|
215
|
-
options?: Record<string, any>;
|
|
216
|
-
}) => Promise<any>;
|
|
217
|
-
confirmBookingEdit?: (input: {
|
|
218
|
-
cacheItem: any;
|
|
219
|
-
options?: Record<string, any>;
|
|
220
|
-
}) => Promise<any>;
|
|
221
|
-
openOrder?: (data: {
|
|
222
|
-
order_id: number;
|
|
223
|
-
business_code?: string;
|
|
224
|
-
}) => void;
|
|
225
|
-
/**
|
|
226
|
-
* walk-in 扫 walletPass:直接核销优惠码(对齐 SaleDetail Voucher.handleApplyCode / cart.scanCode)。
|
|
227
|
-
*/
|
|
228
|
-
applyPromotionCode?: (code: string, customerId?: number) => Promise<{
|
|
229
|
-
isAvailable?: boolean;
|
|
230
|
-
type?: string;
|
|
231
|
-
unavailableReason?: string;
|
|
232
|
-
}>;
|
|
233
|
-
onNotify?: (type: 'success' | 'fail' | 'info', messageKey?: string) => void;
|
|
234
|
-
refresh?: () => void;
|
|
235
|
-
}
|
|
236
|
-
/** handleGlobalScanCode 结构化返回 */
|
|
237
|
-
export type GlobalScanHandleResult = {
|
|
238
|
-
status: 'success';
|
|
239
|
-
kind: 'customer' | 'products' | 'promotion';
|
|
240
|
-
meta?: {
|
|
241
|
-
count?: number;
|
|
242
|
-
};
|
|
243
|
-
} | {
|
|
244
|
-
status: 'pending';
|
|
245
|
-
kind: 'openOrder' | 'requiresDetail' | 'requiresBookingEdit';
|
|
246
|
-
} | {
|
|
247
|
-
status: 'cancelled';
|
|
248
|
-
} | {
|
|
249
|
-
status: 'failed';
|
|
250
|
-
reason: 'empty_code' | 'not_found' | 'invalid_data' | 'no_bridge';
|
|
251
|
-
};
|
|
@@ -24,7 +24,6 @@ __export(types_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(types_exports);
|
|
26
26
|
var import_modules = require("../../modules");
|
|
27
|
-
var import_BookingContext = require("../../modules/BookingContext");
|
|
28
27
|
var import_Customer = require("../../modules/Customer");
|
|
29
28
|
var import_SalesSummary = require("../../modules/SalesSummary");
|
|
30
29
|
var import_Schedule = require("../../modules/Schedule");
|
|
@@ -55,16 +54,6 @@ function createBookingTicketModule(moduleName, solutionName, name, version) {
|
|
|
55
54
|
`${solutionName}_${name || moduleName}`,
|
|
56
55
|
version
|
|
57
56
|
);
|
|
58
|
-
case "bookingContext":
|
|
59
|
-
return new import_BookingContext.BookingContextModule(
|
|
60
|
-
`${solutionName}_${name || moduleName}`,
|
|
61
|
-
version
|
|
62
|
-
);
|
|
63
|
-
case "openData":
|
|
64
|
-
return new import_modules.OpenDataModule(
|
|
65
|
-
`${solutionName}_${name || moduleName}`,
|
|
66
|
-
version
|
|
67
|
-
);
|
|
68
57
|
default:
|
|
69
58
|
return null;
|
|
70
59
|
}
|
|
@@ -9,21 +9,6 @@
|
|
|
9
9
|
* 字段含义严格对齐既有协议(OrderTempOrder / parseSalesResponse),
|
|
10
10
|
* 不发明等价关系。
|
|
11
11
|
*/
|
|
12
|
-
/**
|
|
13
|
-
* 子预约状态机转移动作(POST /schedule/booking-transition/{schedule_event_id})。
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* await bookingTicket.transitionChildBooking({
|
|
17
|
-
* schedule_event_id: 301,
|
|
18
|
-
* action: 'confirm',
|
|
19
|
-
* });
|
|
20
|
-
*/
|
|
21
|
-
export type BookingTransitionAction = 'confirm' | 'reject' | 'arrive' | 'start' | 'complete' | 'cancel' | 'no_show' | 'reschedule';
|
|
22
|
-
/** 子预约状态转移入参 */
|
|
23
|
-
export interface TransitionChildBookingParams {
|
|
24
|
-
schedule_event_id: number | string;
|
|
25
|
-
action: BookingTransitionAction;
|
|
26
|
-
}
|
|
27
12
|
/**
|
|
28
13
|
* 从 tempOrder 解析用于调用 appointment-status 接口的 schedule id。
|
|
29
14
|
*
|
|
@@ -50,28 +35,3 @@ export declare function applyBookingsStatus(bookings: any[] | null | undefined,
|
|
|
50
35
|
* 长度不一致时按较短一方对齐(防御式编程,正常路径不会发生)。
|
|
51
36
|
*/
|
|
52
37
|
export declare function restoreBookingsStatus(bookings: any[] | null | undefined, previous: Array<string | undefined>): void;
|
|
53
|
-
/**
|
|
54
|
-
* 将状态机 action 解析为转移后的 `appointment_status`。
|
|
55
|
-
*
|
|
56
|
-
* `reschedule` 暂未在状态矩阵启用,返回 null 表示跳过乐观更新。
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* resolveStatusAfterTransition('confirm'); // 'confirmed'
|
|
60
|
-
*/
|
|
61
|
-
export declare function resolveStatusAfterTransition(action: BookingTransitionAction): string | null;
|
|
62
|
-
/**
|
|
63
|
-
* 在 bookings 中按 `schedule_event_id` 定位子预约并乐观写入 `appointment_status`。
|
|
64
|
-
*
|
|
65
|
-
* @returns 写入前的 status;未命中时返回 undefined(调用方跳过回滚)
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* const prev = applyChildBookingStatus(tempOrder.bookings, 301, 'confirmed');
|
|
69
|
-
*/
|
|
70
|
-
export declare function applyChildBookingStatus(bookings: any[] | null | undefined, scheduleEventId: number | string, status: string): string | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* 撤销 applyChildBookingStatus 对单条子预约的乐观写入。
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* restoreChildBookingStatus(tempOrder.bookings, 301, prev);
|
|
76
|
-
*/
|
|
77
|
-
export declare function restoreChildBookingStatus(bookings: any[] | null | undefined, scheduleEventId: number | string, previous: string | undefined): void;
|
|
@@ -20,11 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var bookingStatus_exports = {};
|
|
21
21
|
__export(bookingStatus_exports, {
|
|
22
22
|
applyBookingsStatus: () => applyBookingsStatus,
|
|
23
|
-
applyChildBookingStatus: () => applyChildBookingStatus,
|
|
24
23
|
resolveScheduleId: () => resolveScheduleId,
|
|
25
|
-
|
|
26
|
-
restoreBookingsStatus: () => restoreBookingsStatus,
|
|
27
|
-
restoreChildBookingStatus: () => restoreChildBookingStatus
|
|
24
|
+
restoreBookingsStatus: () => restoreBookingsStatus
|
|
28
25
|
});
|
|
29
26
|
module.exports = __toCommonJS(bookingStatus_exports);
|
|
30
27
|
function resolveScheduleId(tempOrder) {
|
|
@@ -60,48 +57,9 @@ function restoreBookingsStatus(bookings, previous) {
|
|
|
60
57
|
b.appointment_status = previous[i];
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
|
-
function resolveStatusAfterTransition(action) {
|
|
64
|
-
const map = {
|
|
65
|
-
confirm: "confirmed",
|
|
66
|
-
reject: "rejected",
|
|
67
|
-
arrive: "arrived",
|
|
68
|
-
start: "started",
|
|
69
|
-
complete: "completed",
|
|
70
|
-
cancel: "cancelled",
|
|
71
|
-
no_show: "no_show",
|
|
72
|
-
reschedule: null
|
|
73
|
-
};
|
|
74
|
-
return map[action] ?? null;
|
|
75
|
-
}
|
|
76
|
-
function applyChildBookingStatus(bookings, scheduleEventId, status) {
|
|
77
|
-
var _a;
|
|
78
|
-
if (!Array.isArray(bookings))
|
|
79
|
-
return void 0;
|
|
80
|
-
const idx = bookings.findIndex(
|
|
81
|
-
(b) => b && String(b.schedule_event_id) === String(scheduleEventId)
|
|
82
|
-
);
|
|
83
|
-
if (idx === -1)
|
|
84
|
-
return void 0;
|
|
85
|
-
const previous = (_a = bookings[idx]) == null ? void 0 : _a.appointment_status;
|
|
86
|
-
bookings[idx].appointment_status = status;
|
|
87
|
-
return previous;
|
|
88
|
-
}
|
|
89
|
-
function restoreChildBookingStatus(bookings, scheduleEventId, previous) {
|
|
90
|
-
if (!Array.isArray(bookings) || previous === void 0)
|
|
91
|
-
return;
|
|
92
|
-
const idx = bookings.findIndex(
|
|
93
|
-
(b) => b && String(b.schedule_event_id) === String(scheduleEventId)
|
|
94
|
-
);
|
|
95
|
-
if (idx === -1)
|
|
96
|
-
return;
|
|
97
|
-
bookings[idx].appointment_status = previous;
|
|
98
|
-
}
|
|
99
60
|
// Annotate the CommonJS export names for ESM import in node:
|
|
100
61
|
0 && (module.exports = {
|
|
101
62
|
applyBookingsStatus,
|
|
102
|
-
applyChildBookingStatus,
|
|
103
63
|
resolveScheduleId,
|
|
104
|
-
|
|
105
|
-
restoreBookingsStatus,
|
|
106
|
-
restoreChildBookingStatus
|
|
64
|
+
restoreBookingsStatus
|
|
107
65
|
});
|
|
@@ -2,14 +2,6 @@ import type { BaseSalesOrderProduct } from '../../BaseSales';
|
|
|
2
2
|
import type { ISalesBooking } from '../../BaseSales/utils/parseSalesResponse';
|
|
3
3
|
import type { BookingTicketCartView, BookingTicketCustomerView, ICustomer } from '../types';
|
|
4
4
|
import type { ScanOrderTempOrder } from '../../ScanOrder/types';
|
|
5
|
-
export interface BuildCartViewOptions {
|
|
6
|
-
addTimeProducts?: any[];
|
|
7
|
-
bookingConfig?: Record<string, any> | null;
|
|
8
|
-
productsByUid?: Record<string, {
|
|
9
|
-
origin?: Record<string, any>;
|
|
10
|
-
}>;
|
|
11
|
-
shopOpeningHours?: string;
|
|
12
|
-
}
|
|
13
5
|
/**
|
|
14
6
|
* 仅按 booking.product_uid 建索引,避免发明 booking 与商品行之间的其它等价关系。
|
|
15
7
|
*/
|
|
@@ -21,7 +13,7 @@ export declare function indexBookingsByProductUid(bookings: ISalesBooking[] | un
|
|
|
21
13
|
* 关联规则(1:1):booking.product_uid ↔ line.metadata.unique_identification_number;
|
|
22
14
|
* 同一 uid 已被更早的 booking 占用时,后续 booking 的 product 为 null。
|
|
23
15
|
*/
|
|
24
|
-
export declare function buildCartView(lines: BaseSalesOrderProduct[] | undefined | null, bookings: ISalesBooking[] | undefined | null
|
|
16
|
+
export declare function buildCartView(lines: BaseSalesOrderProduct[] | undefined | null, bookings: ISalesBooking[] | undefined | null): BookingTicketCartView;
|
|
25
17
|
export declare function isWalkInCustomer(customer: Pick<ICustomer, 'id'> | null | undefined): boolean;
|
|
26
18
|
/**
|
|
27
19
|
* selected 优先,缺失时回退 tempOrder.customer_*,统一输出 UI 客户视图。
|
|
@@ -25,7 +25,6 @@ __export(cartView_exports, {
|
|
|
25
25
|
isWalkInCustomer: () => isWalkInCustomer
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(cartView_exports);
|
|
28
|
-
var import_addTimeAvailability = require("./addTimeAvailability");
|
|
29
28
|
function indexBookingsByProductUid(bookings) {
|
|
30
29
|
if (!Array.isArray(bookings) || bookings.length === 0)
|
|
31
30
|
return {};
|
|
@@ -52,85 +51,31 @@ function indexProductsByUid(lines) {
|
|
|
52
51
|
return acc;
|
|
53
52
|
}, {});
|
|
54
53
|
}
|
|
55
|
-
function
|
|
56
|
-
var _a;
|
|
57
|
-
const uid = (_a = booking == null ? void 0 : booking.metadata) == null ? void 0 : _a.unique_identification_number;
|
|
58
|
-
return uid === void 0 || uid === null ? "" : String(uid);
|
|
59
|
-
}
|
|
60
|
-
function getProductBookingUid(line) {
|
|
61
|
-
var _a;
|
|
62
|
-
const uid = (line == null ? void 0 : line.booking_uid) ?? ((_a = line == null ? void 0 : line.metadata) == null ? void 0 : _a.booking_uid);
|
|
63
|
-
return uid === void 0 || uid === null ? "" : String(uid);
|
|
64
|
-
}
|
|
65
|
-
function isAddTimeProductLine(line) {
|
|
66
|
-
var _a, _b;
|
|
67
|
-
return ((_a = line == null ? void 0 : line.metadata) == null ? void 0 : _a.product_add_schedule_time) !== void 0 && ((_b = line == null ? void 0 : line.metadata) == null ? void 0 : _b.product_add_schedule_time) !== null;
|
|
68
|
-
}
|
|
69
|
-
function indexAddTimeProductsByBookingUid(lines) {
|
|
70
|
-
return lines.reduce((acc, line) => {
|
|
71
|
-
if (!isAddTimeProductLine(line))
|
|
72
|
-
return acc;
|
|
73
|
-
const bookingUid = getProductBookingUid(line);
|
|
74
|
-
if (!bookingUid)
|
|
75
|
-
return acc;
|
|
76
|
-
if (!acc[bookingUid])
|
|
77
|
-
acc[bookingUid] = [];
|
|
78
|
-
acc[bookingUid].push(line);
|
|
79
|
-
return acc;
|
|
80
|
-
}, {});
|
|
81
|
-
}
|
|
82
|
-
function isGiftProductLine(line) {
|
|
83
|
-
var _a;
|
|
84
|
-
return Boolean((_a = line == null ? void 0 : line.metadata) == null ? void 0 : _a._giftInfo);
|
|
85
|
-
}
|
|
86
|
-
function buildCartView(lines, bookings, options = {}) {
|
|
54
|
+
function buildCartView(lines, bookings) {
|
|
87
55
|
const productLines = Array.isArray(lines) ? lines : [];
|
|
88
56
|
const bookingList = Array.isArray(bookings) ? bookings : [];
|
|
89
57
|
const linesByUid = indexProductsByUid(productLines);
|
|
90
|
-
const addTimeLinesByBookingUid = indexAddTimeProductsByBookingUid(productLines);
|
|
91
58
|
const claimedUids = /* @__PURE__ */ new Set();
|
|
92
|
-
const
|
|
93
|
-
const cartBookings = bookingList.filter((booking) => booking.parent_id !== 0).reduce((acc, booking) => {
|
|
59
|
+
const cartBookings = bookingList.filter((booking) => booking.parent_id !== 0).map((booking) => {
|
|
94
60
|
const uid = booking == null ? void 0 : booking.product_uid;
|
|
95
|
-
const bookingUid = getBookingUid(booking);
|
|
96
61
|
let product = null;
|
|
97
62
|
if (uid !== void 0 && uid !== null && uid !== "") {
|
|
98
63
|
const key = String(uid);
|
|
99
64
|
if (!claimedUids.has(key)) {
|
|
100
65
|
const line = linesByUid[key];
|
|
101
|
-
if (isGiftProductLine(line))
|
|
102
|
-
return acc;
|
|
103
66
|
if (line) {
|
|
104
67
|
claimedUids.add(key);
|
|
105
68
|
product = line;
|
|
106
69
|
}
|
|
107
70
|
}
|
|
108
71
|
}
|
|
109
|
-
|
|
110
|
-
addTimeProduct.forEach((line) => claimedAddTimeLines.add(line));
|
|
111
|
-
acc.push({
|
|
72
|
+
return {
|
|
112
73
|
...booking,
|
|
113
|
-
_extend: {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
canAddTime: (0, import_addTimeAvailability.resolveBookingCanAddTime)({
|
|
117
|
-
booking,
|
|
118
|
-
product,
|
|
119
|
-
addTimeProducts: options.addTimeProducts,
|
|
120
|
-
bookingConfig: options.bookingConfig,
|
|
121
|
-
productsByUid: options.productsByUid,
|
|
122
|
-
shopOpeningHours: options.shopOpeningHours
|
|
123
|
-
})
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
return acc;
|
|
127
|
-
}, []);
|
|
74
|
+
_extend: { product }
|
|
75
|
+
};
|
|
76
|
+
});
|
|
128
77
|
const items = productLines.filter((line) => {
|
|
129
78
|
var _a;
|
|
130
|
-
if (isGiftProductLine(line))
|
|
131
|
-
return false;
|
|
132
|
-
if (claimedAddTimeLines.has(line))
|
|
133
|
-
return false;
|
|
134
79
|
const uid = (_a = line.metadata) == null ? void 0 : _a.unique_identification_number;
|
|
135
80
|
if (uid === void 0 || uid === null || uid === "")
|
|
136
81
|
return true;
|
|
@@ -14,17 +14,12 @@ declare enum ScanResultType {
|
|
|
14
14
|
NativeScanner = "nativeScanner"
|
|
15
15
|
}
|
|
16
16
|
export default class Scan {
|
|
17
|
-
private static scanInstances;
|
|
18
|
-
private static peripheralsListenerMounted;
|
|
19
17
|
private solution;
|
|
20
18
|
private watchKey;
|
|
21
19
|
private listenerConfig;
|
|
22
20
|
constructor(solution: BookingTicketImpl, watchKey: string);
|
|
23
21
|
/**
|
|
24
22
|
* 初始化外设扫码结果监听
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* scan.initPeripheralsListener();
|
|
28
23
|
*/
|
|
29
24
|
initPeripheralsListener(): void;
|
|
30
25
|
/**
|
|
@@ -34,24 +34,17 @@ __export(scan_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(scan_exports);
|
|
35
35
|
var import_watch = __toESM(require("../../../../utils/watch"));
|
|
36
36
|
var import_task = __toESM(require("../../../../utils/task"));
|
|
37
|
-
var
|
|
37
|
+
var Scan = class {
|
|
38
38
|
constructor(solution, watchKey) {
|
|
39
39
|
this.listenerConfig = /* @__PURE__ */ new Map();
|
|
40
40
|
this.solution = solution;
|
|
41
41
|
this.watchKey = watchKey;
|
|
42
|
-
_Scan.scanInstances.add(this);
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
45
44
|
* 初始化外设扫码结果监听
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* scan.initPeripheralsListener();
|
|
49
45
|
*/
|
|
50
46
|
initPeripheralsListener() {
|
|
51
47
|
var _a, _b, _c, _d, _e;
|
|
52
|
-
if (_Scan.peripheralsListenerMounted)
|
|
53
|
-
return;
|
|
54
|
-
_Scan.peripheralsListenerMounted = true;
|
|
55
48
|
(_e = (_d = (_c = (_b = (_a = this.solution) == null ? void 0 : _a.window) == null ? void 0 : _b.interaction) == null ? void 0 : _c.utils) == null ? void 0 : _d.mountFunction) == null ? void 0 : _e.call(
|
|
56
49
|
_d,
|
|
57
50
|
"global",
|
|
@@ -60,9 +53,7 @@ var _Scan = class {
|
|
|
60
53
|
try {
|
|
61
54
|
const result = JSON.parse(strVal);
|
|
62
55
|
console.log("nativeScannerResult>>>>>>>", result);
|
|
63
|
-
|
|
64
|
-
instance.handleScan(result);
|
|
65
|
-
});
|
|
56
|
+
this.handleScan(result);
|
|
66
57
|
} catch (err) {
|
|
67
58
|
console.error(err);
|
|
68
59
|
}
|
|
@@ -79,9 +70,8 @@ var _Scan = class {
|
|
|
79
70
|
if (lastEnableEventKey) {
|
|
80
71
|
const listenerConfig = this.listenerConfig.get(lastEnableEventKey);
|
|
81
72
|
if (listenerConfig) {
|
|
82
|
-
const taskUuid = this.generateUuid();
|
|
83
73
|
listenerConfig.task.addTask({
|
|
84
|
-
uuid:
|
|
74
|
+
uuid: this.generateUuid(),
|
|
85
75
|
type: lastEnableEventKey,
|
|
86
76
|
actionParams: {
|
|
87
77
|
scanResult: result
|
|
@@ -132,7 +122,6 @@ var _Scan = class {
|
|
|
132
122
|
*/
|
|
133
123
|
removeAllListeners() {
|
|
134
124
|
var _a, _b, _c, _d;
|
|
135
|
-
_Scan.scanInstances.delete(this);
|
|
136
125
|
import_watch.default.clearEvent(this.watchKey);
|
|
137
126
|
(_b = (_a = this.listenerConfig) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (item) => {
|
|
138
127
|
var _a2;
|
|
@@ -224,6 +213,3 @@ var _Scan = class {
|
|
|
224
213
|
}
|
|
225
214
|
}
|
|
226
215
|
};
|
|
227
|
-
var Scan = _Scan;
|
|
228
|
-
Scan.scanInstances = /* @__PURE__ */ new Set();
|
|
229
|
-
Scan.peripheralsListenerMounted = false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"appointment_booking","platform":"PC","sales_channel":"my_pisel","order_sales_channel":"online_store","bookings":[{"id":0,"number":1,"registration_type":"all","relation_products":[],"is_all":false,"product":{"num":1,"product_id":61170,"product_variant_id":0,"product_bundle":[],"product_option_item":[],"discount_list":[{"amount":100,"type":"good_pass","discount":{"resource_id":64523,"title":{"auto":"玄-商品券","original":"玄-商品券","en":null,"zh-CN":null,"zh-HK":null},"original_amount":100,"product_id":61170,"percent":"1.00"}}]},"sub_type":"minutes","duration":480,"like_status":"common","resources":[{"relation_type":"form","like_status":"common","form_id":35,"relation_id":40357,"capacity":1,"metadata":{"combined_resource":{"status":1,"resource_ids":[40262,40263]},"form_name":"桌台","resource_name":"组合资源测试table-0422-01"},"children":[{"relation_type":"form","like_status":"common","id":40262,"main_field":"A01(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40262,"capacity":1,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A01(组合资源-小桌-4 人)"}},{"relation_type":"form","like_status":"common","id":40263,"main_field":"A02(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40263,"capacity":0,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A02(组合资源-小桌-4 人)"}}]},{"relation_type":"form","like_status":"common","form_id":214,"relation_id":38350,"capacity":1,"metadata":{"combined_resource":null,"form_name":"校区2","resource_name":"West Campus"}}],"schedule_id":0,"start_date":"2025-08-22","start_time":"09:00","select_date":"2025-08-22","end_time":"17:00","end_date":"2025-08-22","metadata":{"account":{"id":13433,"username":"a a"},"capacity":[{"id":0,"value":1,"name":""}]},"holder":null,"relation_forms":[]}],"shop_note":"","schedule_date":"2025-08-22 09:00:00","is_deposit":0,"relation_products":[],"relation_forms":[]}
|
|
@@ -80,6 +80,8 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
80
80
|
currentCustomer: void 0
|
|
81
81
|
};
|
|
82
82
|
await this.initializeSubModules(core, options);
|
|
83
|
+
await this.preloadPaymentMethods();
|
|
84
|
+
await this.cleanupExpiredOrdersAsync();
|
|
83
85
|
console.log("[Checkout] 初始化完成");
|
|
84
86
|
await this.core.effects.emit(`${this.name}:onCheckoutInitialized`, {
|
|
85
87
|
timestamp: Date.now()
|
|
@@ -1898,7 +1900,6 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1898
1900
|
*
|
|
1899
1901
|
* 删除本地 IndexDB 中超过指定天数且已同步到后端的订单数据
|
|
1900
1902
|
*/
|
|
1901
|
-
/** @deprecated */
|
|
1902
1903
|
async cleanupExpiredOrdersAsync() {
|
|
1903
1904
|
var _a, _b, _c;
|
|
1904
1905
|
try {
|
|
@@ -584,7 +584,11 @@ var webposConfig = {
|
|
|
584
584
|
// withCredentials: true,
|
|
585
585
|
prefix: false,
|
|
586
586
|
isDefaultSaasDomain: true,
|
|
587
|
-
cache:
|
|
587
|
+
cache: {
|
|
588
|
+
mode: "remote_local",
|
|
589
|
+
type: "indexDB",
|
|
590
|
+
cacheKeyData: values
|
|
591
|
+
}
|
|
588
592
|
})
|
|
589
593
|
},
|
|
590
594
|
emailCodeRegister: {
|
|
@@ -843,7 +847,11 @@ var shopWebposConfig = {
|
|
|
843
847
|
options: (values) => ({
|
|
844
848
|
// withCredentials: true,
|
|
845
849
|
prefix: false,
|
|
846
|
-
cache:
|
|
850
|
+
cache: {
|
|
851
|
+
mode: "remote_local",
|
|
852
|
+
type: "indexDB",
|
|
853
|
+
cacheKeyData: values
|
|
854
|
+
}
|
|
847
855
|
})
|
|
848
856
|
},
|
|
849
857
|
emailCodeRegister: {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
3
|
import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderScanCodeResult } from './types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { UpdateProductInOrderParams } from '../../modules/Order/types';
|
|
5
5
|
import type { Discount } from '../../modules/Discount/types';
|
|
6
6
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
7
7
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
8
|
-
import type { ProductData } from '../../modules/Product/types';
|
|
9
8
|
export * from './types';
|
|
10
9
|
interface ScanOrderItemRuleRuntimeConfig {
|
|
11
10
|
strategyConfigs?: StrategyConfig[];
|
|
@@ -37,14 +36,11 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
37
36
|
private customerLoginRefreshIdInFlight;
|
|
38
37
|
private static readonly PISELL1_LOGIN_SUCCESS;
|
|
39
38
|
private getScanOrderLoggerContext;
|
|
40
|
-
private safeStringify;
|
|
41
|
-
private pickErrorMessage;
|
|
42
39
|
private serializeError;
|
|
43
40
|
private addScanOrderLog;
|
|
44
41
|
private logMethodStart;
|
|
45
42
|
private logMethodSuccess;
|
|
46
43
|
private logMethodError;
|
|
47
|
-
private assertProductListLoaded;
|
|
48
44
|
addLog(params: ScanOrderAddLogParams): Promise<void>;
|
|
49
45
|
private normalizeCustomerId;
|
|
50
46
|
private resolveCustomerIdFromLoginPayload;
|
|
@@ -90,12 +86,10 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
90
86
|
onCustomerLogin(params: {
|
|
91
87
|
customerId: number;
|
|
92
88
|
}): Promise<void>;
|
|
93
|
-
private findReservationRuleResource;
|
|
94
|
-
private buildScanOrderResourceMetadata;
|
|
95
89
|
private buildSubmitPayloadEnhancer;
|
|
96
90
|
submitScanOrder<T = any>(): Promise<T>;
|
|
97
91
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
98
|
-
|
|
92
|
+
updateProductInOrder(params: UpdateProductInOrderParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
99
93
|
/**
|
|
100
94
|
* 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
|
|
101
95
|
* 多行同 SKU 时必须传入与删除/更新一致的 identity(如 `identity_key`)。
|
|
@@ -126,7 +120,7 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
126
120
|
orderAmount: number;
|
|
127
121
|
orderItems: any[];
|
|
128
122
|
}>;
|
|
129
|
-
getProductList(): Promise<
|
|
123
|
+
getProductList(): Promise<any>;
|
|
130
124
|
getOtherParams(): Record<string, any>;
|
|
131
125
|
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
132
126
|
cover?: boolean;
|