@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
|
@@ -33,17 +33,13 @@ export interface ScanOrderOrderProductIdentity {
|
|
|
33
33
|
identity_key?: string;
|
|
34
34
|
unique_identification_number?: string;
|
|
35
35
|
/** 参与合并/匹配;与 remove 通配语义见 isSkuOnlyDeleteIdentity */
|
|
36
|
-
|
|
36
|
+
product_option_item?: any[];
|
|
37
37
|
product_bundle?: any[];
|
|
38
38
|
}
|
|
39
|
-
export interface ScanOrderProductSku {
|
|
40
|
-
option: any[];
|
|
41
|
-
[key: string]: any;
|
|
42
|
-
}
|
|
43
39
|
export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
44
40
|
order_detail_id: number | null;
|
|
45
41
|
num: number;
|
|
46
|
-
|
|
42
|
+
product_option_item: any[];
|
|
47
43
|
/**
|
|
48
44
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
49
45
|
* + Σ((bundle.bundle_selling_price ?? bundle.price) × (bundle.num ?? 1))
|
|
@@ -89,8 +85,9 @@ export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
|
89
85
|
* 出站 payload 版本的商品行。
|
|
90
86
|
*
|
|
91
87
|
* 与 tempOrder 内部 `ScanOrderOrderProduct` 的字段差异:
|
|
92
|
-
* - `
|
|
93
|
-
*
|
|
88
|
+
* - `product_option_item[*]`:内部为 `{ option_group_item_id, option_group_id, num, price, ... }`,
|
|
89
|
+
* 出站保留 `{ option_group_item_id, option_group_id, num }`
|
|
90
|
+
* (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
|
|
94
91
|
* - `product_bundle[*].option[*]`:同上重命名规则。
|
|
95
92
|
*
|
|
96
93
|
* 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
|
|
@@ -115,7 +112,6 @@ export interface ScanOrderSummary {
|
|
|
115
112
|
shipping_tax_fee: string;
|
|
116
113
|
tax_fee: string;
|
|
117
114
|
surcharge_fee: string;
|
|
118
|
-
surcharges: any[];
|
|
119
115
|
discount_amount: string;
|
|
120
116
|
deposit_amount: string;
|
|
121
117
|
deposit?: {
|
|
@@ -14,8 +14,9 @@ export var ScanOrderHooks = /*#__PURE__*/function (ScanOrderHooks) {
|
|
|
14
14
|
* 出站 payload 版本的商品行。
|
|
15
15
|
*
|
|
16
16
|
* 与 tempOrder 内部 `ScanOrderOrderProduct` 的字段差异:
|
|
17
|
-
* - `
|
|
18
|
-
*
|
|
17
|
+
* - `product_option_item[*]`:内部为 `{ option_group_item_id, option_group_id, num, price, ... }`,
|
|
18
|
+
* 出站保留 `{ option_group_item_id, option_group_id, num }`
|
|
19
|
+
* (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
|
|
19
20
|
* - `product_bundle[*].option[*]`:同上重命名规则。
|
|
20
21
|
*
|
|
21
22
|
* 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
|
|
@@ -88,7 +88,7 @@ export declare function attachItemRuleLimitsToTopLevelProducts<T>(productList: T
|
|
|
88
88
|
export declare function buildProductLineFingerprint(productOptionItem?: unknown, productBundle?: unknown): string;
|
|
89
89
|
/**
|
|
90
90
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
91
|
-
* 与显式 `
|
|
91
|
+
* 与显式 `product_option_item: []` 区分:后者只匹配「无选项」行。
|
|
92
92
|
*/
|
|
93
93
|
export declare function isSkuOnlyDeleteIdentity(x: ScanOrderOrderProductIdentity): boolean;
|
|
94
94
|
/**
|
|
@@ -13,8 +13,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
14
|
import dayjs from 'dayjs';
|
|
15
15
|
import Decimal from 'decimal.js';
|
|
16
|
-
import { composeLinePrice, createUuidV4,
|
|
17
|
-
import { ensureManualProductDiscountList } from "../../modules/Order/utils/manualProductDiscount";
|
|
16
|
+
import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* 构建金额全为 0 的空 summary。
|
|
@@ -31,7 +30,6 @@ export function createEmptySummary() {
|
|
|
31
30
|
shipping_tax_fee: '0.00',
|
|
32
31
|
tax_fee: '0.00',
|
|
33
32
|
surcharge_fee: '0.00',
|
|
34
|
-
surcharges: [],
|
|
35
33
|
discount_amount: '0.00',
|
|
36
34
|
deposit_amount: '0.00',
|
|
37
35
|
expect_amount: '0.00',
|
|
@@ -381,12 +379,12 @@ export function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
|
|
|
381
379
|
export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
382
380
|
var optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
|
|
383
381
|
var normalizedOpts = optArr.map(function (item) {
|
|
384
|
-
var
|
|
382
|
+
var _item$price;
|
|
385
383
|
return {
|
|
386
384
|
option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
|
|
387
385
|
option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
|
|
388
386
|
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
389
|
-
price: String((
|
|
387
|
+
price: String((_item$price = item === null || item === void 0 ? void 0 : item.price) !== null && _item$price !== void 0 ? _item$price : '')
|
|
390
388
|
};
|
|
391
389
|
}).sort(function (p, q) {
|
|
392
390
|
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
@@ -398,9 +396,9 @@ export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
398
396
|
});
|
|
399
397
|
var bundleArr = Array.isArray(productBundle) ? productBundle : [];
|
|
400
398
|
var normalizedBundles = bundleArr.map(function (item) {
|
|
401
|
-
var
|
|
399
|
+
var _ref, _item$bundle_id;
|
|
402
400
|
return {
|
|
403
|
-
bundle_id: Number((
|
|
401
|
+
bundle_id: Number((_ref = (_item$bundle_id = item === null || item === void 0 ? void 0 : item.bundle_id) !== null && _item$bundle_id !== void 0 ? _item$bundle_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref !== void 0 ? _ref : 0) || 0,
|
|
404
402
|
product_id: Number(item === null || item === void 0 ? void 0 : item.product_id) || 0,
|
|
405
403
|
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
|
|
406
404
|
};
|
|
@@ -414,15 +412,15 @@ export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
414
412
|
|
|
415
413
|
/**
|
|
416
414
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
417
|
-
* 与显式 `
|
|
415
|
+
* 与显式 `product_option_item: []` 区分:后者只匹配「无选项」行。
|
|
418
416
|
*/
|
|
419
417
|
export function isSkuOnlyDeleteIdentity(x) {
|
|
420
418
|
if (x.unique_identification_number || x.identity_key) return false;
|
|
421
|
-
return !('
|
|
419
|
+
return !('product_option_item' in x) && !('product_bundle' in x);
|
|
422
420
|
}
|
|
423
421
|
function fingerprintForIdentityWithOptionKeys(x) {
|
|
424
422
|
var row = x;
|
|
425
|
-
var opts = '
|
|
423
|
+
var opts = 'product_option_item' in row ? Array.isArray(row.product_option_item) ? row.product_option_item : [] : [];
|
|
426
424
|
var buds = 'product_bundle' in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
|
|
427
425
|
return buildProductLineFingerprint(opts, buds);
|
|
428
426
|
}
|
|
@@ -438,10 +436,10 @@ function fingerprintForIdentityWithOptionKeys(x) {
|
|
|
438
436
|
* 忽略线侧 identity_key,按内容语义匹配。这给「行已 opaque、调用方却想按 SKU 通配 / 选项指纹删除」留兼容入口。
|
|
439
437
|
*/
|
|
440
438
|
export function isIdentityMatch(a, b) {
|
|
441
|
-
var
|
|
439
|
+
var _ref2, _metadata$unique_iden, _metadata2, _ref3, _metadata$unique_iden2, _metadata3;
|
|
442
440
|
if (a.product_id !== b.product_id || a.product_variant_id !== b.product_variant_id) return false;
|
|
443
|
-
var aUid = (
|
|
444
|
-
var bUid = (
|
|
441
|
+
var aUid = (_ref2 = (_metadata$unique_iden = (_metadata2 = a.metadata) === null || _metadata2 === void 0 ? void 0 : _metadata2.unique_identification_number) !== null && _metadata$unique_iden !== void 0 ? _metadata$unique_iden : a.unique_identification_number) !== null && _ref2 !== void 0 ? _ref2 : a.identity_key;
|
|
442
|
+
var bUid = (_ref3 = (_metadata$unique_iden2 = (_metadata3 = b.metadata) === null || _metadata3 === void 0 ? void 0 : _metadata3.unique_identification_number) !== null && _metadata$unique_iden2 !== void 0 ? _metadata$unique_iden2 : b.unique_identification_number) !== null && _ref3 !== void 0 ? _ref3 : b.identity_key;
|
|
445
443
|
var aHasKey = typeof aUid === 'string' && aUid.length > 0;
|
|
446
444
|
var bHasKey = typeof bUid === 'string' && bUid.length > 0;
|
|
447
445
|
if (aHasKey && bHasKey) return aUid === bUid;
|
|
@@ -482,67 +480,23 @@ export function getProductIdentityIndex(products, identity) {
|
|
|
482
480
|
* - 因此多次 normalize 不会重复叠加 option/bundle。
|
|
483
481
|
*/
|
|
484
482
|
export function normalizeOrderProduct(product) {
|
|
485
|
-
var _product$metadata, _metadata$origin,
|
|
483
|
+
var _product$metadata, _metadata$origin, _variantList$find, _product$is_charge_ta;
|
|
486
484
|
var metadata = _objectSpread({}, product.metadata || {});
|
|
487
485
|
// 不透明 identity 契约:每条订单行必须带 identity_key。
|
|
488
486
|
// 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
|
|
489
487
|
var resolvedIdentityKey = (_product$metadata = product.metadata) !== null && _product$metadata !== void 0 && _product$metadata.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
|
|
490
488
|
metadata.unique_identification_number = resolvedIdentityKey;
|
|
491
|
-
var
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
originOtherBundle.forEach(function (item) {
|
|
497
|
-
var _item$price;
|
|
498
|
-
if ((item === null || item === void 0 ? void 0 : item.id) == null) return;
|
|
499
|
-
var unit = (_item$price = item.price) !== null && _item$price !== void 0 ? _item$price : item.bundle_selling_price;
|
|
500
|
-
if (unit === undefined || unit === null) return;
|
|
501
|
-
priceById.set(String(item.id), String(unit));
|
|
502
|
-
});
|
|
503
|
-
var base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
|
|
504
|
-
bundleInput = base.map(function (item) {
|
|
505
|
-
var unit = priceById.get(String(item === null || item === void 0 ? void 0 : item.id));
|
|
506
|
-
if (unit === undefined) return item;
|
|
507
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
508
|
-
price: unit,
|
|
509
|
-
bundle_selling_price: unit
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
var normalizedBundle = bundleInput.map(function (item) {
|
|
514
|
-
var _item$price2, _item$bundle_id2, _item$bundle_product_, _item$bundle_group_id, _ref5, _ref6, _item$price3, _ref7, _item$price_type, _ref8, _item$price_type_ext;
|
|
515
|
-
var magnitudeSource = _objectSpread(_objectSpread({}, item), {}, {
|
|
516
|
-
// 计算 markdown 净额时,只把真实毛价交给 helper;若只有 bundle_selling_price,
|
|
517
|
-
// helper 会按历史净额兜底,避免 option 二次扣减。
|
|
518
|
-
price: (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.custom_price
|
|
519
|
-
});
|
|
520
|
-
var normalizedItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
521
|
-
bundle_id: (_item$bundle_id2 = item.bundle_id) !== null && _item$bundle_id2 !== void 0 ? _item$bundle_id2 : item.id,
|
|
522
|
-
bundle_product_id: (_item$bundle_product_ = item.bundle_product_id) !== null && _item$bundle_product_ !== void 0 ? _item$bundle_product_ : item._bundle_product_id,
|
|
523
|
-
bundle_group_id: (_item$bundle_group_id = item.bundle_group_id) !== null && _item$bundle_group_id !== void 0 ? _item$bundle_group_id : item.group_id,
|
|
524
|
-
// price 保留毛价(markdown 仍为 5),由 price_type 决定符号。
|
|
525
|
-
price: (_ref5 = (_ref6 = (_item$price3 = item.price) !== null && _item$price3 !== void 0 ? _item$price3 : item.custom_price) !== null && _ref6 !== void 0 ? _ref6 : item.bundle_selling_price) !== null && _ref5 !== void 0 ? _ref5 : '0.00',
|
|
489
|
+
var normalizedBundle = (product.product_bundle || []).map(function (item) {
|
|
490
|
+
var _ref4, _item$bundle_selling_, _ref5, _ref6, _item$price2, _ref7, _item$price_type, _ref8, _item$price_type_ext;
|
|
491
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
492
|
+
bundle_selling_price: (_ref4 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref4 !== void 0 ? _ref4 : '0.00',
|
|
493
|
+
price: (_ref5 = (_ref6 = (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.custom_price) !== null && _ref6 !== void 0 ? _ref6 : item.bundle_selling_price) !== null && _ref5 !== void 0 ? _ref5 : '0.00',
|
|
526
494
|
price_type: (_ref7 = (_item$price_type = item.price_type) !== null && _item$price_type !== void 0 ? _item$price_type : item.custom_price_type) !== null && _ref7 !== void 0 ? _ref7 : '',
|
|
527
495
|
price_type_ext: (_ref8 = (_item$price_type_ext = item.price_type_ext) !== null && _item$price_type_ext !== void 0 ? _item$price_type_ext : item.custom_price_type_ext) !== null && _ref8 !== void 0 ? _ref8 : ''
|
|
528
496
|
});
|
|
529
|
-
// bundle_selling_price 落「正净额」:markdown = |price| − Σoptions;markup/原价维持原值。
|
|
530
|
-
normalizedItem.bundle_selling_price = getBundleSellingMagnitude(magnitudeSource).toFixed(2);
|
|
531
|
-
if (normalizedItem.price_type === 'markdown' && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
|
|
532
|
-
var _normalizedItem$custo;
|
|
533
|
-
normalizedItem.custom_price = (_normalizedItem$custo = normalizedItem.custom_price) !== null && _normalizedItem$custo !== void 0 ? _normalizedItem$custo : normalizedItem.price;
|
|
534
|
-
normalizedItem.price = normalizedItem.bundle_selling_price;
|
|
535
|
-
}
|
|
536
|
-
if ((normalizedItem.price_type === 'markdown' || normalizedItem.price_type === 'markup') && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
|
|
537
|
-
delete normalizedItem.original_total;
|
|
538
|
-
}
|
|
539
|
-
return normalizedItem;
|
|
540
497
|
});
|
|
541
|
-
var normalizedOptions =
|
|
498
|
+
var normalizedOptions = product.product_option_item || [];
|
|
542
499
|
var optionSum = sumOptionUnitPrice(normalizedOptions);
|
|
543
|
-
var productSku = _objectSpread(_objectSpread({}, ensureProductSku(product)), {}, {
|
|
544
|
-
option: normalizedOptions
|
|
545
|
-
});
|
|
546
500
|
|
|
547
501
|
// 1) 解析 source_product_price。
|
|
548
502
|
// 优先级:
|
|
@@ -554,7 +508,7 @@ export function normalizeOrderProduct(product) {
|
|
|
554
508
|
// 6) 入参 selling_price(最末兜底,新添加路径 caller 只给 selling_price)
|
|
555
509
|
var isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === '2';
|
|
556
510
|
var variantId = Number(product.product_variant_id || 0);
|
|
557
|
-
var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$
|
|
511
|
+
var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.variant : null;
|
|
558
512
|
var variantPrice = Array.isArray(variantList) ? (_variantList$find = variantList.find(function (v) {
|
|
559
513
|
return Number(v === null || v === void 0 ? void 0 : v.id) === variantId;
|
|
560
514
|
})) === null || _variantList$find === void 0 ? void 0 : _variantList$find.price : undefined;
|
|
@@ -624,33 +578,17 @@ export function normalizeOrderProduct(product) {
|
|
|
624
578
|
bundle: normalizedBundle,
|
|
625
579
|
useOriginalBundle: true
|
|
626
580
|
});
|
|
627
|
-
var finalOriginalPrice = resolveManualOverrideLineOriginalPrice({
|
|
628
|
-
num: product.num,
|
|
629
|
-
metadata: metadata,
|
|
630
|
-
lineOriginalPrice: product.original_price
|
|
631
|
-
}, composedOriginalPrice);
|
|
632
|
-
var hasManualProductDiscount = (product.discount_list || []).some(function (item) {
|
|
633
|
-
return (item === null || item === void 0 ? void 0 : item.type) === 'product';
|
|
634
|
-
});
|
|
635
|
-
var manualOriginalPrice = hasManualProductDiscount && product.original_price != null ? String(product.original_price) : finalOriginalPrice;
|
|
636
|
-
var discountList = ensureManualProductDiscountList({
|
|
637
|
-
discountList: product.discount_list,
|
|
638
|
-
metadata: metadata,
|
|
639
|
-
originalPrice: manualOriginalPrice,
|
|
640
|
-
sellingPrice: composedSellingPrice,
|
|
641
|
-
quantity: getSafeProductNum(product.num)
|
|
642
|
-
});
|
|
643
581
|
return {
|
|
644
582
|
order_detail_id: product.order_detail_id || null,
|
|
645
583
|
product_id: product.product_id,
|
|
646
584
|
num: getSafeProductNum(product.num),
|
|
647
585
|
product_variant_id: product.product_variant_id,
|
|
648
|
-
|
|
586
|
+
product_option_item: normalizedOptions,
|
|
649
587
|
selling_price: composedSellingPrice,
|
|
650
|
-
original_price:
|
|
588
|
+
original_price: composedOriginalPrice,
|
|
651
589
|
tax_fee: product.tax_fee || '0.00',
|
|
652
590
|
is_charge_tax: (_product$is_charge_ta = product.is_charge_tax) !== null && _product$is_charge_ta !== void 0 ? _product$is_charge_ta : 0,
|
|
653
|
-
discount_list:
|
|
591
|
+
discount_list: product.discount_list || [],
|
|
654
592
|
product_bundle: normalizedBundle,
|
|
655
593
|
metadata: metadata,
|
|
656
594
|
note: product.note != null ? String(product.note) : ''
|
|
@@ -2,7 +2,7 @@ import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
3
|
import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
|
|
4
4
|
import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
|
|
5
|
-
import type {
|
|
5
|
+
import type { UpdateProductInOrderParams } from '../../modules/Order/types';
|
|
6
6
|
import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
|
|
7
7
|
import type { ProductData } from '../../modules/Product/types';
|
|
8
8
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
@@ -41,8 +41,6 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
|
41
41
|
private loadOpenDataConfigInFlight;
|
|
42
42
|
private static readonly OPEN_DATA_CACHE_TTL;
|
|
43
43
|
private getLoggerContext;
|
|
44
|
-
private safeStringify;
|
|
45
|
-
private pickErrorMessage;
|
|
46
44
|
private serializeError;
|
|
47
45
|
private addVenueBookingLog;
|
|
48
46
|
private logMethodStart;
|
|
@@ -156,7 +154,6 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
|
156
154
|
type: "server" | "clientCalc";
|
|
157
155
|
unavailableReason?: import("../../modules/Rules/types").UnavailableReason | undefined;
|
|
158
156
|
unavailableReasonKey?: string | null | undefined;
|
|
159
|
-
scannedDiscountList?: import("../../modules/Discount").Discount[] | undefined;
|
|
160
157
|
}>;
|
|
161
158
|
/** 获取当前折扣列表(包装 order.getDiscountList) */
|
|
162
159
|
getDiscountList(): import("../../modules/Discount").Discount[];
|
|
@@ -170,7 +167,7 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
|
170
167
|
getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
|
|
171
168
|
submitOrder<T = any>(): Promise<T>;
|
|
172
169
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
173
|
-
|
|
170
|
+
updateProductInOrder(params: UpdateProductInOrderParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
174
171
|
removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
175
172
|
getProductList(): Promise<ProductData[]>;
|
|
176
173
|
private loadOpenDataConfig;
|