@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,4 +1,4 @@
|
|
|
1
|
-
import { OrderModule, ProductList,
|
|
1
|
+
import { OrderModule, ProductList, SalesSummaryModule, ScanOrderLoggerModule as BaseSalesLoggerModule, ScheduleModule } from '../../modules';
|
|
2
2
|
import type { ScanOrderLogInput as BaseSalesLogInput, ScanOrderLoggerProviderConfig as BaseSalesLoggerProviderConfig, ScanOrderLoggerProviderType as BaseSalesLoggerProviderType } from '../../modules/ScanOrderLogger/types';
|
|
3
3
|
import type { QuantityCheckResult, QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
4
4
|
/**
|
|
@@ -11,8 +11,6 @@ export declare const BaseSalesHookNames: {
|
|
|
11
11
|
readonly onRetryInit: "onRetryInit";
|
|
12
12
|
readonly onRefresh: "onRefresh";
|
|
13
13
|
readonly onCartValidationChanged: "onCartValidationChanged";
|
|
14
|
-
readonly onPaymentSyncStart: "onPaymentSyncStart";
|
|
15
|
-
readonly onPaymentSyncEnd: "onPaymentSyncEnd";
|
|
16
14
|
};
|
|
17
15
|
export type BaseSalesHookName = typeof BaseSalesHookNames[keyof typeof BaseSalesHookNames];
|
|
18
16
|
export declare function createBaseSalesHook(moduleName: string, hookName: BaseSalesHookName): string;
|
|
@@ -41,20 +39,13 @@ export interface BaseSalesOrderProductIdentity {
|
|
|
41
39
|
identity_key?: string;
|
|
42
40
|
unique_identification_number?: string;
|
|
43
41
|
/** 参与合并/匹配;与 remove 通配语义见 isSkuOnlyDeleteIdentity */
|
|
44
|
-
|
|
42
|
+
product_option_item?: any[];
|
|
45
43
|
product_bundle?: any[];
|
|
46
44
|
}
|
|
47
|
-
export interface BaseSalesProductSku {
|
|
48
|
-
option: any[];
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}
|
|
51
|
-
export interface BaseSalesUpdateOrderProductQuantityParams extends BaseSalesOrderProductIdentity {
|
|
52
|
-
num: number;
|
|
53
|
-
}
|
|
54
45
|
export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
|
|
55
46
|
order_detail_id: number | null;
|
|
56
47
|
num: number;
|
|
57
|
-
|
|
48
|
+
product_option_item: any[];
|
|
58
49
|
/**
|
|
59
50
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
60
51
|
* + Σ((bundle.bundle_selling_price ?? bundle.price) × (bundle.num ?? 1))
|
|
@@ -100,8 +91,9 @@ export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
|
|
|
100
91
|
* 出站 payload 版本的商品行。
|
|
101
92
|
*
|
|
102
93
|
* 与 tempOrder 内部 `BaseSalesOrderProduct` 的字段差异:
|
|
103
|
-
* - `
|
|
104
|
-
*
|
|
94
|
+
* - `product_option_item[*]`:内部为 `{ option_group_item_id, option_group_id, num, price, ... }`,
|
|
95
|
+
* 出站保留 `{ option_group_item_id, option_group_id, num }`
|
|
96
|
+
* (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
|
|
105
97
|
* - `product_bundle[*].option[*]`:同上重命名规则。
|
|
106
98
|
*
|
|
107
99
|
* 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
|
|
@@ -126,7 +118,6 @@ export interface BaseSalesSummary {
|
|
|
126
118
|
shipping_tax_fee: string;
|
|
127
119
|
tax_fee: string;
|
|
128
120
|
surcharge_fee: string;
|
|
129
|
-
surcharges?: any[];
|
|
130
121
|
discount_amount: string;
|
|
131
122
|
deposit_amount: string;
|
|
132
123
|
deposit?: {
|
|
@@ -212,66 +203,6 @@ export interface BaseSalesSubmitPayload extends Omit<BaseSalesTempOrder, 'platfo
|
|
|
212
203
|
}>;
|
|
213
204
|
products: BaseSalesSubmitProduct[];
|
|
214
205
|
}
|
|
215
|
-
export interface BaseSalesQuotationDurationConfig {
|
|
216
|
-
type: string;
|
|
217
|
-
value: number;
|
|
218
|
-
flexible_config?: {
|
|
219
|
-
is_enable_minimum_duration?: 0 | 1;
|
|
220
|
-
warning_threshold?: number;
|
|
221
|
-
block_threshold?: number;
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
export interface BaseSalesCalculateProductBookingPriceParams {
|
|
225
|
-
product: Record<string, any>;
|
|
226
|
-
booking?: {
|
|
227
|
-
start_date?: string;
|
|
228
|
-
start_time?: string;
|
|
229
|
-
end_date?: string;
|
|
230
|
-
end_time?: string;
|
|
231
|
-
[key: string]: any;
|
|
232
|
-
};
|
|
233
|
-
duration?: BaseSalesQuotationDurationConfig;
|
|
234
|
-
customer_id?: number | string;
|
|
235
|
-
fallback_price?: number | string;
|
|
236
|
-
datetime?: string;
|
|
237
|
-
channel?: string;
|
|
238
|
-
}
|
|
239
|
-
export type BaseSalesProductBookingPriceSegmentSource = 'quotation' | 'fallback';
|
|
240
|
-
export interface BaseSalesProductBookingPriceSegment {
|
|
241
|
-
start_datetime: string;
|
|
242
|
-
end_datetime?: string;
|
|
243
|
-
time_point: string;
|
|
244
|
-
unit_price: string;
|
|
245
|
-
quantity: number;
|
|
246
|
-
total_price: string;
|
|
247
|
-
quotation_shelf_id: number;
|
|
248
|
-
source: BaseSalesProductBookingPriceSegmentSource;
|
|
249
|
-
}
|
|
250
|
-
export interface BaseSalesBundleProductBookingPriceResult {
|
|
251
|
-
bundle_id?: number;
|
|
252
|
-
group_id?: number;
|
|
253
|
-
bundle_group_id?: number;
|
|
254
|
-
bundle_product_id: number | null;
|
|
255
|
-
bundle_variant_id: number;
|
|
256
|
-
unit_price: string;
|
|
257
|
-
total_price: string;
|
|
258
|
-
quantity: number;
|
|
259
|
-
quotation_shelf_id: number;
|
|
260
|
-
source: BaseSalesProductBookingPriceSegmentSource;
|
|
261
|
-
segments: BaseSalesProductBookingPriceSegment[];
|
|
262
|
-
}
|
|
263
|
-
export interface BaseSalesProductBookingPriceResult {
|
|
264
|
-
product_id: number | null;
|
|
265
|
-
product_variant_id: number;
|
|
266
|
-
customer_id?: number | string;
|
|
267
|
-
unit_price: string;
|
|
268
|
-
total_price: string;
|
|
269
|
-
quantity: number;
|
|
270
|
-
duration?: BaseSalesQuotationDurationConfig;
|
|
271
|
-
quotation_shelf_id: number;
|
|
272
|
-
segments: BaseSalesProductBookingPriceSegment[];
|
|
273
|
-
product_bundle?: BaseSalesBundleProductBookingPriceResult[];
|
|
274
|
-
}
|
|
275
206
|
export type BaseSalesAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | 'additional_order_with_code' | 'additional_order';
|
|
276
207
|
export interface BaseSalesTableFormRecord {
|
|
277
208
|
policy?: string | null;
|
|
@@ -350,7 +281,6 @@ export interface BaseSalesState {
|
|
|
350
281
|
error: string | null;
|
|
351
282
|
products?: ProductList;
|
|
352
283
|
order?: OrderModule;
|
|
353
|
-
quotation?: QuotationModule;
|
|
354
284
|
salesSummary?: SalesSummaryModule;
|
|
355
285
|
baseSalesLogger?: BaseSalesLoggerModule;
|
|
356
286
|
schedule?: ScheduleModule;
|
|
@@ -28,9 +28,7 @@ var BaseSalesHookNames = {
|
|
|
28
28
|
onDestroy: "onDestroy",
|
|
29
29
|
onRetryInit: "onRetryInit",
|
|
30
30
|
onRefresh: "onRefresh",
|
|
31
|
-
onCartValidationChanged: "onCartValidationChanged"
|
|
32
|
-
onPaymentSyncStart: "onPaymentSyncStart",
|
|
33
|
-
onPaymentSyncEnd: "onPaymentSyncEnd"
|
|
31
|
+
onCartValidationChanged: "onCartValidationChanged"
|
|
34
32
|
};
|
|
35
33
|
function createBaseSalesHook(moduleName, hookName) {
|
|
36
34
|
return `${moduleName}:${hookName}`;
|
|
@@ -23,7 +23,6 @@ export interface BaseProductDetailPayload {
|
|
|
23
23
|
option?: BaseProductDetailOptionItem[];
|
|
24
24
|
options?: BaseProductDetailOptionItem[];
|
|
25
25
|
product_option_item?: BaseProductDetailOptionItem[];
|
|
26
|
-
product_sku?: Record<string, any>;
|
|
27
26
|
bundle?: BaseProductDetailBundleItem[];
|
|
28
27
|
product_bundle?: BaseProductDetailBundleItem[];
|
|
29
28
|
unique?: string;
|
|
@@ -22,8 +22,6 @@ __export(transformBaseProductToOrderProduct_exports, {
|
|
|
22
22
|
transformBaseProductToOrderProduct: () => transformBaseProductToOrderProduct
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(transformBaseProductToOrderProduct_exports);
|
|
25
|
-
var import_utils = require("../../../modules/Order/utils");
|
|
26
|
-
var import_manualProductDiscount = require("../../../modules/Order/utils/manualProductDiscount");
|
|
27
25
|
function toNumber(value, fallback = 0) {
|
|
28
26
|
const parsedValue = Number(value);
|
|
29
27
|
if (!Number.isFinite(parsedValue))
|
|
@@ -54,49 +52,23 @@ function normalizeOptionItems(optionItems) {
|
|
|
54
52
|
if (!Array.isArray(optionItems))
|
|
55
53
|
return [];
|
|
56
54
|
return optionItems.map((optionItem) => {
|
|
57
|
-
const optionGroupItemId = toNumber(
|
|
55
|
+
const optionGroupItemId = toNumber(optionItem == null ? void 0 : optionItem.option_group_item_id);
|
|
58
56
|
const price = (optionItem == null ? void 0 : optionItem.price) ?? (optionItem == null ? void 0 : optionItem.add_price) ?? 0;
|
|
59
57
|
return {
|
|
60
|
-
...optionItem,
|
|
61
58
|
option_group_item_id: optionGroupItemId,
|
|
62
59
|
option_group_id: toNumber(optionItem == null ? void 0 : optionItem.option_group_id),
|
|
63
60
|
num: toSafePositiveInt((optionItem == null ? void 0 : optionItem.num) ?? (optionItem == null ? void 0 : optionItem.quantity), 1),
|
|
64
|
-
|
|
65
|
-
price: void 0
|
|
61
|
+
price: toNumber(price, 0)
|
|
66
62
|
};
|
|
67
63
|
});
|
|
68
64
|
}
|
|
69
|
-
function normalizeBundleItems(bundleItems
|
|
65
|
+
function normalizeBundleItems(bundleItems) {
|
|
70
66
|
if (!Array.isArray(bundleItems))
|
|
71
67
|
return [];
|
|
72
|
-
return bundleItems.map((bundleItem) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const magnitudeSource = {
|
|
77
|
-
...bundleItem,
|
|
78
|
-
option: normalizeOptionItems(bundleItem == null ? void 0 : bundleItem.option),
|
|
79
|
-
bundle_selling_price: unitStr,
|
|
80
|
-
// 计算 markdown 净额时,只传真实毛价;仅有 bundle_selling_price 时按历史净额兜底。
|
|
81
|
-
price: bundleItem.price ?? bundleItem.custom_price
|
|
82
|
-
};
|
|
83
|
-
const normalizedItem = {
|
|
84
|
-
...bundleItem,
|
|
85
|
-
num,
|
|
86
|
-
quantity: (bundleItem == null ? void 0 : bundleItem.quantity) ?? num,
|
|
87
|
-
// price 保留毛价(markdown 仍为正),由 price_type 决定符号。
|
|
88
|
-
price: bundleItem.price ?? unitStr,
|
|
89
|
-
bundle_selling_price: unitStr,
|
|
90
|
-
original_price: bundleItem.original_price ?? bundleItem.product_price ?? bundleItem.price ?? unitStr,
|
|
91
|
-
option: normalizeOptionItems(bundleItem == null ? void 0 : bundleItem.option)
|
|
92
|
-
};
|
|
93
|
-
normalizedItem.bundle_selling_price = (0, import_utils.getBundleSellingMagnitude)(magnitudeSource).toFixed(2);
|
|
94
|
-
if ((normalizedItem.price_type ?? normalizedItem.custom_price_type) === "markdown" && (normalizedItem.price_type_ext === "" || normalizedItem.price_type_ext === void 0 || normalizedItem.price_type_ext === null)) {
|
|
95
|
-
normalizedItem.custom_price = normalizedItem.custom_price ?? normalizedItem.price;
|
|
96
|
-
normalizedItem.price = normalizedItem.bundle_selling_price;
|
|
97
|
-
}
|
|
98
|
-
return normalizedItem;
|
|
99
|
-
});
|
|
68
|
+
return bundleItems.map((bundleItem) => ({
|
|
69
|
+
...bundleItem,
|
|
70
|
+
option: normalizeOptionItems(bundleItem == null ? void 0 : bundleItem.option)
|
|
71
|
+
}));
|
|
100
72
|
}
|
|
101
73
|
function findVariantById(origin, variantId) {
|
|
102
74
|
if (!origin || !variantId || variantId <= 0)
|
|
@@ -105,7 +77,7 @@ function findVariantById(origin, variantId) {
|
|
|
105
77
|
return variants.find((variant) => Number(variant == null ? void 0 : variant.id) === variantId) || null;
|
|
106
78
|
}
|
|
107
79
|
function transformBaseProductToOrderProduct(params) {
|
|
108
|
-
var _a, _b
|
|
80
|
+
var _a, _b;
|
|
109
81
|
const { payload, fallbackProductId = null } = params;
|
|
110
82
|
if (!payload || typeof payload !== "object")
|
|
111
83
|
return null;
|
|
@@ -129,61 +101,13 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
129
101
|
payload.price ?? payload.selling_price ?? (matchedVariant == null ? void 0 : matchedVariant.price) ?? (matchedVariant == null ? void 0 : matchedVariant.base_price) ?? (origin == null ? void 0 : origin.price) ?? (origin == null ? void 0 : origin.base_price) ?? (sourceProduct == null ? void 0 : sourceProduct.price) ?? (sourceProduct == null ? void 0 : sourceProduct.selling_price) ?? (sourceProduct == null ? void 0 : sourceProduct.base_price),
|
|
130
102
|
"0.00"
|
|
131
103
|
);
|
|
132
|
-
const
|
|
133
|
-
payload.
|
|
134
|
-
sourceProductPrice
|
|
135
|
-
);
|
|
136
|
-
const hasPriceOverride = payload.price_override !== void 0 && payload.price_override !== null && payload.price_override !== "";
|
|
137
|
-
const productOptionItem = (0, import_utils.normalizeProductSkuOptions)(
|
|
138
|
-
normalizeOptionItems(
|
|
139
|
-
((_d = payload.product_sku) == null ? void 0 : _d.option) ?? payload.option ?? payload.options ?? payload.product_option_item
|
|
140
|
-
)
|
|
104
|
+
const productOptionItem = normalizeOptionItems(
|
|
105
|
+
payload.option ?? payload.options ?? payload.product_option_item
|
|
141
106
|
);
|
|
142
107
|
const productBundle = normalizeBundleItems(
|
|
143
|
-
payload.bundle ?? payload.product_bundle
|
|
144
|
-
hasPriceOverride
|
|
145
|
-
);
|
|
146
|
-
const uniqueIdentificationNumber = payload.unique_identification_number;
|
|
147
|
-
const resolvedQuantity = toSafePositiveInt(payload.quantity ?? payload.num, 1);
|
|
148
|
-
const originTotal = (0, import_manualProductDiscount.resolveManualDiscountOriginTotal)({
|
|
149
|
-
originTotal: payload.origin_total,
|
|
150
|
-
extendOriginTotal: (_e = payload._extend) == null ? void 0 : _e.origin_total,
|
|
151
|
-
originExtendOriginTotal: (_f = origin == null ? void 0 : origin._extend) == null ? void 0 : _f.origin_total,
|
|
152
|
-
sourceExtendOriginTotal: (_g = sourceProduct == null ? void 0 : sourceProduct._extend) == null ? void 0 : _g.origin_total,
|
|
153
|
-
catalogUnitPrice: (origin == null ? void 0 : origin.base_price) ?? (origin == null ? void 0 : origin.price) ?? (sourceProduct == null ? void 0 : sourceProduct.base_price) ?? (sourceProduct == null ? void 0 : sourceProduct.price),
|
|
154
|
-
quantity: resolvedQuantity
|
|
155
|
-
});
|
|
156
|
-
const sellingTotal = Number(
|
|
157
|
-
payload.line_total ?? payload.total ?? ((_h = payload._extend) == null ? void 0 : _h.total) ?? lineCompositeTotal
|
|
158
|
-
);
|
|
159
|
-
const discountReason = (0, import_manualProductDiscount.resolveManualDiscountReasonFromSources)({
|
|
160
|
-
discountReason: payload.discount_reason,
|
|
161
|
-
extendDiscountReason: (_i = payload._extend) == null ? void 0 : _i.discount_reason,
|
|
162
|
-
originExtendDiscountReason: (_j = origin == null ? void 0 : origin._extend) == null ? void 0 : _j.discount_reason
|
|
163
|
-
});
|
|
164
|
-
const lineOriginalPrice = hasPriceOverride && Number.isFinite(originTotal) ? toPriceString(originTotal) : lineCompositeTotal;
|
|
165
|
-
const manualDiscountList = (0, import_manualProductDiscount.shouldBuildManualProductDiscount)({
|
|
166
|
-
hasPriceOverride,
|
|
167
|
-
originTotal,
|
|
168
|
-
sellingTotal
|
|
169
|
-
}) ? (0, import_manualProductDiscount.mergeManualProductDiscountIntoList)(
|
|
170
|
-
payload.discount_list,
|
|
171
|
-
(0, import_manualProductDiscount.buildManualProductDiscountItem)({
|
|
172
|
-
originTotal: Number.isFinite(originTotal) ? originTotal : Number(lineOriginalPrice),
|
|
173
|
-
sellingTotal: Number.isFinite(sellingTotal) ? sellingTotal : Number(lineCompositeTotal),
|
|
174
|
-
quantity: resolvedQuantity,
|
|
175
|
-
message: discountReason,
|
|
176
|
-
discountway: (_k = payload._extend) == null ? void 0 : _k.discountway,
|
|
177
|
-
discount_per: (_l = payload._extend) == null ? void 0 : _l.discount_per
|
|
178
|
-
})
|
|
179
|
-
) : payload.discount_list || [];
|
|
180
|
-
const optionSum = (0, import_utils.sumOptionUnitPrice)(productOptionItem).toNumber();
|
|
181
|
-
const mainProductOriginalPrice = toPriceString(Number(sourceProductPrice) + optionSum);
|
|
182
|
-
const bundleOnlyComposite = (0, import_utils.composeLinePrice)({ mainPrice: 0, bundle: productBundle });
|
|
183
|
-
const derivedMainSelling = Number(lineCompositeTotal) - Number(bundleOnlyComposite);
|
|
184
|
-
const mainProductSellingPrice = toPriceString(
|
|
185
|
-
Number.isFinite(derivedMainSelling) && derivedMainSelling >= 0 ? derivedMainSelling : Number(mainProductOriginalPrice)
|
|
108
|
+
payload.bundle ?? payload.product_bundle
|
|
186
109
|
);
|
|
110
|
+
const uniqueIdentificationNumber = payload.unique_identification_number ?? payload.unique;
|
|
187
111
|
const metadata = {
|
|
188
112
|
unique: payload.unique,
|
|
189
113
|
session: payload.session,
|
|
@@ -194,15 +118,8 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
194
118
|
duration: payload.duration,
|
|
195
119
|
policy_id: payload.policy_id,
|
|
196
120
|
source_shop_id: payload.source_shop_id,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
main_product_original_price: mainProductOriginalPrice,
|
|
200
|
-
price_schema_version: 2,
|
|
201
|
-
...hasPriceOverride ? {
|
|
202
|
-
price_override: String(payload.price_override),
|
|
203
|
-
is_manual_discount: 1
|
|
204
|
-
} : {},
|
|
205
|
-
...payload.bundle_edit !== void 0 ? { bundle_edit: payload.bundle_edit } : {}
|
|
121
|
+
origin,
|
|
122
|
+
source_product_price: sourceProductPrice
|
|
206
123
|
};
|
|
207
124
|
if (uniqueIdentificationNumber) {
|
|
208
125
|
metadata.unique_identification_number = String(uniqueIdentificationNumber);
|
|
@@ -211,16 +128,11 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
211
128
|
product_id: productId,
|
|
212
129
|
product_variant_id: productVariantId,
|
|
213
130
|
unique_identification_number: uniqueIdentificationNumber ? String(uniqueIdentificationNumber) : void 0,
|
|
214
|
-
num:
|
|
215
|
-
|
|
216
|
-
...payload.product_sku && typeof payload.product_sku === "object" ? payload.product_sku : {},
|
|
217
|
-
option: productOptionItem
|
|
218
|
-
},
|
|
131
|
+
num: toSafePositiveInt(payload.quantity ?? payload.num, 1),
|
|
132
|
+
product_option_item: productOptionItem,
|
|
219
133
|
product_bundle: productBundle,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
selling_price: lineCompositeTotal,
|
|
223
|
-
original_price: lineOriginalPrice,
|
|
134
|
+
selling_price: sourceProductPrice,
|
|
135
|
+
original_price: sourceProductPrice,
|
|
224
136
|
tax_fee: toPriceString(
|
|
225
137
|
payload.tax_fee ?? (matchedVariant == null ? void 0 : matchedVariant.tax_fee) ?? (origin == null ? void 0 : origin.tax_fee) ?? (sourceProduct == null ? void 0 : sourceProduct.tax_fee),
|
|
226
138
|
"0.00"
|
|
@@ -12,7 +12,7 @@ export declare function buildProductLineFingerprint(productOptionItem?: unknown,
|
|
|
12
12
|
export declare function getSafeProductNum(num?: number): number;
|
|
13
13
|
/**
|
|
14
14
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
15
|
-
* 与显式 `
|
|
15
|
+
* 与显式 `product_option_item: []` 区分:后者只匹配「无选项」行。
|
|
16
16
|
*/
|
|
17
17
|
export declare function isSkuOnlyDeleteIdentity(x: BaseSalesOrderProductIdentity): boolean;
|
|
18
18
|
/**
|
|
@@ -38,7 +38,6 @@ __export(utils_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(utils_exports);
|
|
39
39
|
var import_decimal = __toESM(require("decimal.js"));
|
|
40
40
|
var import_utils = require("../../modules/Order/utils");
|
|
41
|
-
var import_manualProductDiscount = require("../../modules/Order/utils/manualProductDiscount");
|
|
42
41
|
function createEmptySummary() {
|
|
43
42
|
return {
|
|
44
43
|
product_quantity: 0,
|
|
@@ -65,7 +64,7 @@ function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
65
64
|
option_group_item_id: Number(item == null ? void 0 : item.option_group_item_id) || 0,
|
|
66
65
|
option_group_id: Number(item == null ? void 0 : item.option_group_id) || 0,
|
|
67
66
|
num: typeof (item == null ? void 0 : item.num) === "number" && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
68
|
-
price: String((item == null ? void 0 : item.
|
|
67
|
+
price: String((item == null ? void 0 : item.price) ?? "")
|
|
69
68
|
})).sort((p, q) => {
|
|
70
69
|
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
71
70
|
return p.option_group_item_id - q.option_group_item_id;
|
|
@@ -100,58 +99,26 @@ function getSafeProductNum(num) {
|
|
|
100
99
|
function isSkuOnlyDeleteIdentity(x) {
|
|
101
100
|
if (x.identity_key)
|
|
102
101
|
return false;
|
|
103
|
-
return !("
|
|
102
|
+
return !("product_option_item" in x) && !("product_bundle" in x);
|
|
104
103
|
}
|
|
105
104
|
function normalizeOrderProduct(product) {
|
|
106
|
-
var _a, _b, _c
|
|
105
|
+
var _a, _b, _c;
|
|
107
106
|
const metadata = { ...product.metadata || {} };
|
|
108
107
|
const resolvedIdentityKey = ((_a = product.metadata) == null ? void 0 : _a.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) : (0, import_utils.createUuidV4)();
|
|
109
108
|
metadata.unique_identification_number = resolvedIdentityKey;
|
|
110
|
-
const
|
|
111
|
-
const originOtherBundle = (_d = (_c = (_b = metadata.origin) == null ? void 0 : _b._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.bundle;
|
|
112
|
-
let bundleInput = product.product_bundle || [];
|
|
113
|
-
if (priceOverride !== void 0 && priceOverride !== null && priceOverride !== "" && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
|
|
114
|
-
const priceById = /* @__PURE__ */ new Map();
|
|
115
|
-
originOtherBundle.forEach((item) => {
|
|
116
|
-
if ((item == null ? void 0 : item.id) == null)
|
|
117
|
-
return;
|
|
118
|
-
const unit = item.price ?? item.bundle_selling_price;
|
|
119
|
-
if (unit === void 0 || unit === null)
|
|
120
|
-
return;
|
|
121
|
-
priceById.set(String(item.id), String(unit));
|
|
122
|
-
});
|
|
123
|
-
const base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
|
|
124
|
-
bundleInput = base.map((item) => {
|
|
125
|
-
const unit = priceById.get(String(item == null ? void 0 : item.id));
|
|
126
|
-
if (unit === void 0)
|
|
127
|
-
return item;
|
|
128
|
-
return {
|
|
129
|
-
...item,
|
|
130
|
-
price: unit,
|
|
131
|
-
bundle_selling_price: unit
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
const normalizedBundle = bundleInput.map((item) => ({
|
|
109
|
+
const normalizedBundle = (product.product_bundle || []).map((item) => ({
|
|
136
110
|
...item,
|
|
137
|
-
bundle_id: item.bundle_id ?? item.id,
|
|
138
|
-
bundle_product_id: item.bundle_product_id ?? item._bundle_product_id,
|
|
139
|
-
bundle_group_id: item.bundle_group_id ?? item.group_id,
|
|
140
111
|
bundle_selling_price: item.bundle_selling_price ?? item.price ?? "0.00",
|
|
141
112
|
price: item.price ?? item.custom_price ?? item.bundle_selling_price ?? "0.00",
|
|
142
113
|
price_type: item.price_type ?? item.custom_price_type ?? "",
|
|
143
114
|
price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ""
|
|
144
115
|
}));
|
|
145
|
-
const normalizedOptions =
|
|
116
|
+
const normalizedOptions = product.product_option_item || [];
|
|
146
117
|
const optionSum = (0, import_utils.sumOptionUnitPrice)(normalizedOptions);
|
|
147
|
-
const productSku = {
|
|
148
|
-
...(0, import_utils.ensureProductSku)(product),
|
|
149
|
-
option: normalizedOptions
|
|
150
|
-
};
|
|
151
118
|
const isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === "2";
|
|
152
119
|
const variantId = Number(product.product_variant_id || 0);
|
|
153
|
-
const variantList = variantId ? (
|
|
154
|
-
const variantPrice = Array.isArray(variantList) ? (
|
|
120
|
+
const variantList = variantId ? (_b = metadata == null ? void 0 : metadata.origin) == null ? void 0 : _b.variant : null;
|
|
121
|
+
const variantPrice = Array.isArray(variantList) ? (_c = variantList.find((v) => Number(v == null ? void 0 : v.id) === variantId)) == null ? void 0 : _c.price : void 0;
|
|
155
122
|
const resolvedSource = (() => {
|
|
156
123
|
var _a2, _b2;
|
|
157
124
|
if (metadata.source_product_price !== void 0) {
|
|
@@ -207,28 +174,17 @@ function normalizeOrderProduct(product) {
|
|
|
207
174
|
bundle: normalizedBundle,
|
|
208
175
|
useOriginalBundle: true
|
|
209
176
|
});
|
|
210
|
-
const finalOriginalPrice = (0, import_utils.resolveManualOverrideLineOriginalPrice)(
|
|
211
|
-
{ num: product.num, metadata, lineOriginalPrice: product.original_price },
|
|
212
|
-
composedOriginalPrice
|
|
213
|
-
);
|
|
214
|
-
const discountList = (0, import_manualProductDiscount.ensureManualProductDiscountList)({
|
|
215
|
-
discountList: product.discount_list,
|
|
216
|
-
metadata,
|
|
217
|
-
originalPrice: finalOriginalPrice,
|
|
218
|
-
sellingPrice: composedSellingPrice,
|
|
219
|
-
quantity: getSafeProductNum(product.num)
|
|
220
|
-
});
|
|
221
177
|
return {
|
|
222
178
|
order_detail_id: product.order_detail_id || null,
|
|
223
179
|
product_id: product.product_id,
|
|
224
180
|
num: getSafeProductNum(product.num),
|
|
225
181
|
product_variant_id: product.product_variant_id,
|
|
226
|
-
|
|
182
|
+
product_option_item: normalizedOptions,
|
|
227
183
|
selling_price: composedSellingPrice,
|
|
228
|
-
original_price:
|
|
184
|
+
original_price: composedOriginalPrice,
|
|
229
185
|
tax_fee: product.tax_fee || "0.00",
|
|
230
186
|
is_charge_tax: product.is_charge_tax ?? 0,
|
|
231
|
-
discount_list:
|
|
187
|
+
discount_list: product.discount_list || [],
|
|
232
188
|
product_bundle: normalizedBundle,
|
|
233
189
|
metadata,
|
|
234
190
|
note: product.note != null ? String(product.note) : ""
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 | 2 | 1 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|