@pisell/pisellos 2.2.242 → 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 -3659
- 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/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 -1889
- 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
|
@@ -2,129 +2,15 @@ import { CartItem } from '../Cart/types';
|
|
|
2
2
|
import type { DiscountModule } from '../Discount';
|
|
3
3
|
import type { RulesModule } from '../Rules';
|
|
4
4
|
import type { Discount } from '../Discount/types';
|
|
5
|
-
import type { UnavailableReason } from '../Rules/types';
|
|
6
5
|
import type { SubmitPayloadEnhancer } from './utils';
|
|
7
6
|
import type { PaymentItem } from '../Payment/types';
|
|
8
7
|
import type { ICustomer } from '../AccountList/types';
|
|
9
|
-
import type { OrderProductDiscountItem } from '../../server/modules/order/types';
|
|
10
|
-
export type { OrderProductDiscountItem } from '../../server/modules/order/types';
|
|
11
8
|
export declare enum OrderHooks {
|
|
12
9
|
OnOrderCreate = "order:onOrderCreate",
|
|
13
10
|
OnOrderUpdate = "order:onOrderUpdate",
|
|
14
11
|
OnOrderCancel = "order:onOrderCancel",
|
|
15
12
|
OnOrderStatusChange = "order:onOrderStatusChange",
|
|
16
|
-
OnOrderCustomerChange = "order:onOrderCustomerChange"
|
|
17
|
-
OnPromotionApplied = "order:onPromotionApplied"
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* 促销评估器协议(OS 与 PromotionEvaluator 之间的桥接接口)。
|
|
21
|
-
*
|
|
22
|
-
* 与 `pisell_os/src/model/strategy/adapter/promotion/evaluator.ts` 中的
|
|
23
|
-
* `PromotionEvaluator` 实例结构保持兼容。SalesSdkProvider 会从 `appHelper.utils.promotionEvaluator`
|
|
24
|
-
* 读取实例并通过 `setPromotionEvaluator` 注入到 OrderModule。
|
|
25
|
-
*
|
|
26
|
-
* 这里只声明 OrderModule 需要调用的子集,避免反向依赖具体 evaluator 实现。
|
|
27
|
-
*/
|
|
28
|
-
export interface OrderPromotionEvaluator {
|
|
29
|
-
evaluateCartWithPricing(input: {
|
|
30
|
-
products: any[];
|
|
31
|
-
channel?: string;
|
|
32
|
-
}): any;
|
|
33
|
-
getProductsApplicableStrategies(input: {
|
|
34
|
-
products: any[];
|
|
35
|
-
channel?: string;
|
|
36
|
-
}, matchVariant?: boolean): any[];
|
|
37
|
-
}
|
|
38
|
-
/** 赠品解析回调 context(OS → SDK 的请求体) */
|
|
39
|
-
export interface OrderGiftSelectContext {
|
|
40
|
-
strategyId: string;
|
|
41
|
-
strategyName: string | Record<string, string>;
|
|
42
|
-
giftCount: number;
|
|
43
|
-
giftOptions: Array<{
|
|
44
|
-
product_id: number;
|
|
45
|
-
product_variant_id: number;
|
|
46
|
-
}>;
|
|
47
|
-
/** 触发此赠品的主商品 metadata.unique_identification_number 列表 */
|
|
48
|
-
sourceProductIds: string[];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* 赠品 resolver 返回值。
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* return { products: [giftProduct], bookings: [giftBooking] };
|
|
55
|
-
*/
|
|
56
|
-
export interface OrderGiftSelectResult {
|
|
57
|
-
/** 完整赠品购物车行,必须带 metadata._giftInfo。 */
|
|
58
|
-
products: Partial<OrderProduct>[];
|
|
59
|
-
/** 预约赠品对应的 booking,按 products 下标一一关联。 */
|
|
60
|
-
bookings?: AddProductBookingInput[];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* 赠品解析回调签名(SDK → OS 的返回值)。
|
|
64
|
-
*
|
|
65
|
-
* - 单选项:SDK 内部自动构造商品,不弹窗
|
|
66
|
-
* - 多选项:SDK 弹窗等用户确认后构造
|
|
67
|
-
* - 用户取消:抛错或返回空数组(OS 视为放弃本次添加)
|
|
68
|
-
*
|
|
69
|
-
* 返回数组时沿用旧协议,只写 tempOrder.products;返回对象时可同时写入预约 bookings。
|
|
70
|
-
*/
|
|
71
|
-
export type OrderGiftSelectResolver = (ctx: OrderGiftSelectContext) => Promise<Partial<OrderProduct>[] | OrderGiftSelectResult | null>;
|
|
72
|
-
/** 未满足的促销策略(购物车底部 alert 渲染源) */
|
|
73
|
-
export interface OrderUnfulfilledPromotion {
|
|
74
|
-
strategyId: string;
|
|
75
|
-
strategyName: string | Record<string, string>;
|
|
76
|
-
actionType: string;
|
|
77
|
-
needQuantity: number;
|
|
78
|
-
currentQuantity: number;
|
|
79
|
-
requiredQuantity: number;
|
|
80
|
-
eligibleProducts: Array<{
|
|
81
|
-
product_id: number;
|
|
82
|
-
product_variant_id: number;
|
|
83
|
-
}>;
|
|
84
|
-
strategyMetadata?: any;
|
|
85
|
-
display?: {
|
|
86
|
-
text: string | Record<string, string>;
|
|
87
|
-
type: string;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/** 上一次 applyPromotion 计算出的赠品操作(仅供调试/读取使用) */
|
|
91
|
-
export interface OrderLastGiftActions {
|
|
92
|
-
toAdd: Array<{
|
|
93
|
-
strategyId: string;
|
|
94
|
-
strategyName: string | Record<string, string>;
|
|
95
|
-
giftCount: number;
|
|
96
|
-
giftOptions: Array<{
|
|
97
|
-
product_id: number;
|
|
98
|
-
product_variant_id: number;
|
|
99
|
-
}>;
|
|
100
|
-
sourceProductIds: string[];
|
|
101
|
-
}>;
|
|
102
|
-
toReduce: Array<{
|
|
103
|
-
strategyId: string;
|
|
104
|
-
items: Array<{
|
|
105
|
-
uid: string;
|
|
106
|
-
currentQuantity: number;
|
|
107
|
-
newQuantity: number;
|
|
108
|
-
}>;
|
|
109
|
-
}>;
|
|
110
|
-
toRemove: string[];
|
|
111
|
-
}
|
|
112
|
-
/** onPromotionApplied 事件 payload */
|
|
113
|
-
export interface OrderPromotionAppliedPayload {
|
|
114
|
-
unfulfilledPromotions: OrderUnfulfilledPromotion[];
|
|
115
|
-
giftActions: OrderLastGiftActions;
|
|
116
|
-
/** evaluator 返回的赠品摘要 */
|
|
117
|
-
gifts: Array<{
|
|
118
|
-
strategyId: string;
|
|
119
|
-
strategyName: string | Record<string, string>;
|
|
120
|
-
giftCount: number;
|
|
121
|
-
giftOptions: Array<{
|
|
122
|
-
product_id: number;
|
|
123
|
-
product_variant_id: number;
|
|
124
|
-
}>;
|
|
125
|
-
}>;
|
|
126
|
-
/** 处理后的商品列表 */
|
|
127
|
-
products: OrderProduct[];
|
|
13
|
+
OnOrderCustomerChange = "order:onOrderCustomerChange"
|
|
128
14
|
}
|
|
129
15
|
/**
|
|
130
16
|
* tempOrder 上的下单客户协议字段视图。
|
|
@@ -162,35 +48,25 @@ export interface OrderCustomerChangePayload {
|
|
|
162
48
|
patch: OrderCustomerView;
|
|
163
49
|
snapshot: ICustomer | null;
|
|
164
50
|
}
|
|
165
|
-
export interface OrderScanCodeResult {
|
|
166
|
-
isAvailable: boolean;
|
|
167
|
-
discountList: Discount[];
|
|
168
|
-
scannedDiscountList: Discount[];
|
|
169
|
-
type: 'server' | 'clientCalc';
|
|
170
|
-
unavailableReason?: UnavailableReason;
|
|
171
|
-
}
|
|
172
51
|
export interface OrderProductIdentity {
|
|
173
52
|
product_id: number | null;
|
|
174
53
|
product_variant_id: number;
|
|
175
54
|
unique_identification_number?: string;
|
|
176
|
-
|
|
55
|
+
product_option_item?: any[];
|
|
177
56
|
product_bundle?: any[];
|
|
178
57
|
}
|
|
179
|
-
export interface OrderProductSku {
|
|
180
|
-
option: any[];
|
|
181
|
-
[key: string]: any;
|
|
182
|
-
}
|
|
183
58
|
export interface OrderProduct extends OrderProductIdentity {
|
|
184
59
|
order_detail_id: number | null;
|
|
185
60
|
num: number;
|
|
186
61
|
bundle_edit?: number;
|
|
187
|
-
|
|
62
|
+
product_option_item: any[];
|
|
63
|
+
product_sku?: Record<string, any>;
|
|
188
64
|
gift_card?: number;
|
|
189
65
|
selling_price: string;
|
|
190
66
|
original_price: string;
|
|
191
67
|
tax_fee: string;
|
|
192
68
|
is_charge_tax: number;
|
|
193
|
-
discount_list:
|
|
69
|
+
discount_list: any[];
|
|
194
70
|
product_bundle: any[];
|
|
195
71
|
booking_uid?: string;
|
|
196
72
|
metadata: Record<string, any>;
|
|
@@ -206,7 +82,6 @@ export interface OrderSummary {
|
|
|
206
82
|
shipping_tax_fee: string;
|
|
207
83
|
tax_fee: string;
|
|
208
84
|
surcharge_fee: string;
|
|
209
|
-
surcharges: any[];
|
|
210
85
|
discount_amount: string;
|
|
211
86
|
deposit_amount: string;
|
|
212
87
|
deposit?: {
|
|
@@ -228,11 +103,11 @@ export interface OrderSummary {
|
|
|
228
103
|
export interface OrderTempOrder {
|
|
229
104
|
order_id: number | null;
|
|
230
105
|
external_sale_number: string;
|
|
231
|
-
order_number: string
|
|
232
|
-
shop_order_number: string
|
|
233
|
-
shop_full_order_number: string
|
|
106
|
+
order_number: string;
|
|
107
|
+
shop_order_number: string;
|
|
108
|
+
shop_full_order_number: string;
|
|
234
109
|
type: string;
|
|
235
|
-
business_code
|
|
110
|
+
business_code: string;
|
|
236
111
|
platform: string;
|
|
237
112
|
sales_channel: string;
|
|
238
113
|
order_sales_channel: string;
|
|
@@ -261,39 +136,36 @@ export interface OrderTempOrder {
|
|
|
261
136
|
delivery_type?: string;
|
|
262
137
|
table_number?: Record<string, any>;
|
|
263
138
|
schedule_date: string;
|
|
264
|
-
created_at: string
|
|
139
|
+
created_at: string;
|
|
265
140
|
request_unique_idempotency_token?: string;
|
|
266
141
|
products: OrderProduct[];
|
|
267
142
|
bookings: any[];
|
|
268
143
|
payments: any[];
|
|
269
144
|
surcharges: any[];
|
|
270
|
-
discount_list
|
|
145
|
+
discount_list: any[];
|
|
271
146
|
relation_forms: any[];
|
|
272
147
|
contacts: any[];
|
|
273
148
|
contacts_info: Record<string, any> | null;
|
|
274
149
|
holder: Record<string, any> | null;
|
|
275
150
|
metadata: Record<string, any>;
|
|
276
|
-
summary?: OrderSummary;
|
|
277
151
|
_extend?: {
|
|
278
152
|
productsByUid?: Record<string, Record<string, any>>;
|
|
279
153
|
[key: string]: any;
|
|
280
154
|
};
|
|
281
155
|
}
|
|
282
|
-
export interface OrderSubmitProduct extends Omit<OrderProduct, 'unique_identification_number' | 'num'> {
|
|
156
|
+
export interface OrderSubmitProduct extends Omit<OrderProduct, 'unique_identification_number' | 'num' | 'product_option_item'> {
|
|
283
157
|
product_quantity: number;
|
|
284
158
|
payment_price: string;
|
|
285
|
-
product_sku:
|
|
159
|
+
product_sku: Record<string, any>;
|
|
286
160
|
}
|
|
287
|
-
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer' | '
|
|
161
|
+
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer' | 'shop_full_order_number'> {
|
|
288
162
|
platform: string;
|
|
289
|
-
created_at?: string | undefined;
|
|
290
163
|
request_unique_idempotency_token?: string;
|
|
291
164
|
form_record_ids?: Array<{
|
|
292
165
|
form_id: number | string;
|
|
293
166
|
form_record_id: number | string;
|
|
294
167
|
}>;
|
|
295
168
|
products: OrderSubmitProduct[];
|
|
296
|
-
summary?: OrderSummary;
|
|
297
169
|
small_ticket_data_flag?: number;
|
|
298
170
|
}
|
|
299
171
|
export interface OrderState {
|
|
@@ -305,45 +177,16 @@ export interface OrderState {
|
|
|
305
177
|
discount: DiscountModule | null;
|
|
306
178
|
rules: RulesModule | null;
|
|
307
179
|
}
|
|
308
|
-
export interface ReplaceTempOrderOptions {
|
|
309
|
-
recalculateSummary?: boolean;
|
|
310
|
-
persist?: boolean;
|
|
311
|
-
saveDraft?: boolean;
|
|
312
|
-
}
|
|
313
|
-
export type AddProductBookingInput = Record<string, any>;
|
|
314
180
|
/** 更新购物车行:仅传 SKU 时命中同 SKU 第一行;多行同 SKU 须传 unique_identification_number / 选项指纹等 */
|
|
315
|
-
export interface
|
|
181
|
+
export interface UpdateProductInOrderParams {
|
|
316
182
|
product_id: number | null;
|
|
317
183
|
product_variant_id: number;
|
|
318
184
|
updates: Partial<OrderProduct>;
|
|
319
185
|
unique_identification_number?: string;
|
|
320
|
-
|
|
321
|
-
product_sku?: OrderProductSku;
|
|
186
|
+
product_option_item?: any[];
|
|
322
187
|
product_bundle?: any[];
|
|
323
|
-
booking?: AddProductBookingInput;
|
|
324
|
-
/**
|
|
325
|
-
* 预约时间 / 时长变更后允许使用本次报价覆盖已落库订单行历史价。
|
|
326
|
-
*
|
|
327
|
-
* @example
|
|
328
|
-
* await order.updateOrderProduct({
|
|
329
|
-
* product_id: 1,
|
|
330
|
-
* product_variant_id: 0,
|
|
331
|
-
* updates: { selling_price: '6.00', metadata: { source_product_price: '6.00' } },
|
|
332
|
-
* booking: { duration: 2 },
|
|
333
|
-
* allow_booking_reprice: true,
|
|
334
|
-
* });
|
|
335
|
-
*/
|
|
336
|
-
allow_booking_reprice?: boolean;
|
|
337
|
-
}
|
|
338
|
-
/** 仅更新购物车行数量;行定位语义与 updateOrderProduct / removeProductFromOrder 保持一致 */
|
|
339
|
-
export interface UpdateOrderProductQuantityParams extends OrderProductIdentity {
|
|
340
|
-
num: number;
|
|
341
|
-
identity_key?: string;
|
|
342
|
-
}
|
|
343
|
-
export interface UpdateOrderBookingParams {
|
|
344
|
-
unique_identification_number: string;
|
|
345
|
-
updates: AddProductBookingInput;
|
|
346
188
|
}
|
|
189
|
+
export type AddProductBookingInput = Record<string, any>;
|
|
347
190
|
export interface OrderProductMergeDecisionContext {
|
|
348
191
|
incomingProduct: Partial<OrderProduct> & OrderProductIdentity;
|
|
349
192
|
normalizedIncoming: OrderProduct;
|
|
@@ -394,11 +237,10 @@ export interface SubmitSalesOrderParams {
|
|
|
394
237
|
query: {
|
|
395
238
|
order_id: number | null;
|
|
396
239
|
external_sale_number: string;
|
|
397
|
-
order_number: string
|
|
398
|
-
shop_order_number: string
|
|
399
|
-
shop_full_order_number: string | null;
|
|
240
|
+
order_number: string;
|
|
241
|
+
shop_order_number: string;
|
|
400
242
|
type: string;
|
|
401
|
-
business_code
|
|
243
|
+
business_code: string;
|
|
402
244
|
platform: string;
|
|
403
245
|
request_unique_idempotency_token?: string;
|
|
404
246
|
sales_channel: string;
|
|
@@ -425,19 +267,18 @@ export interface SubmitSalesOrderParams {
|
|
|
425
267
|
delivery_type?: string;
|
|
426
268
|
table_number?: Record<string, any>;
|
|
427
269
|
schedule_date: string;
|
|
428
|
-
created_at
|
|
270
|
+
created_at: string;
|
|
429
271
|
products: OrderSubmitProduct[];
|
|
430
272
|
bookings: OrderSubmitBooking[];
|
|
431
273
|
payments: any[];
|
|
432
|
-
vouchers: any[];
|
|
433
274
|
surcharges?: any[];
|
|
275
|
+
discount_list: any[];
|
|
434
276
|
relation_forms: any[];
|
|
435
277
|
form_record_ids?: OrderSubmitFormRecord[];
|
|
436
278
|
contacts: any[];
|
|
437
279
|
contacts_info: Record<string, any> | null;
|
|
438
280
|
holder: Record<string, any> | null;
|
|
439
281
|
metadata: Record<string, any>;
|
|
440
|
-
summary?: OrderSummary;
|
|
441
282
|
small_ticket_data_flag?: number;
|
|
442
283
|
};
|
|
443
284
|
}
|
|
@@ -459,10 +300,6 @@ export interface PaymentItemData {
|
|
|
459
300
|
name: string;
|
|
460
301
|
/** 支付类型 */
|
|
461
302
|
type: string;
|
|
462
|
-
/** 支付时间 (格式: YYYY-MM-DD HH:mm:ss) */
|
|
463
|
-
payment_time?: string;
|
|
464
|
-
/** 支付项创建时间 (格式: YYYY-MM-DD HH:mm:ss) */
|
|
465
|
-
created_at?: string;
|
|
466
303
|
/** @deprecated BaseSales/Sales 协议不提交该字段;旧 Checkout/Payment 内部仍可能使用 */
|
|
467
304
|
isSynced?: boolean;
|
|
468
305
|
}
|
|
@@ -475,7 +312,6 @@ export interface OrderPaymentMetadata {
|
|
|
475
312
|
[key: string]: any;
|
|
476
313
|
}
|
|
477
314
|
export interface OrderPaymentData {
|
|
478
|
-
order_payment_id?: number | string;
|
|
479
315
|
amount: string;
|
|
480
316
|
code: string;
|
|
481
317
|
custom_payment_id: number;
|
|
@@ -485,11 +321,9 @@ export interface OrderPaymentData {
|
|
|
485
321
|
origin_amount?: string;
|
|
486
322
|
service_fee?: string;
|
|
487
323
|
status?: 'active' | 'voided' | string;
|
|
488
|
-
/** 支付时间 (格式: YYYY-MM-DD HH:mm:ss) */
|
|
489
324
|
payment_time?: string;
|
|
490
325
|
wallet_pass_usage_unit?: unknown;
|
|
491
326
|
wallet_pass_use_value?: string | number | null;
|
|
492
|
-
fund_record?: Record<string, any>;
|
|
493
327
|
metadata: OrderPaymentMetadata;
|
|
494
328
|
rounding_amount?: string;
|
|
495
329
|
service_charge?: {
|
|
@@ -497,7 +331,6 @@ export interface OrderPaymentData {
|
|
|
497
331
|
amount?: string;
|
|
498
332
|
};
|
|
499
333
|
order_payment_type?: 'normal' | 'deposit';
|
|
500
|
-
/** 支付项创建时间 (格式: YYYY-MM-DD HH:mm:ss) */
|
|
501
334
|
created_at?: string;
|
|
502
335
|
updated_at?: string;
|
|
503
336
|
}
|
|
@@ -512,19 +345,12 @@ export interface LoadSalesDetailParams {
|
|
|
512
345
|
externalSaleNumber?: string;
|
|
513
346
|
external_sale_number?: string;
|
|
514
347
|
forceRemote?: boolean;
|
|
515
|
-
merge?: boolean;
|
|
516
|
-
}
|
|
517
|
-
export interface SalesOrderLookupParams {
|
|
518
|
-
lookup: number | string;
|
|
519
|
-
forceRemote?: boolean;
|
|
520
348
|
}
|
|
521
349
|
export interface SyncPaymentsToOrderParams {
|
|
522
350
|
payments: OrderPaymentSource[];
|
|
523
351
|
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
524
352
|
submitWhenPaid?: boolean;
|
|
525
353
|
smallTicketDataFlag?: number;
|
|
526
|
-
businessCode?: string;
|
|
527
|
-
channel?: string;
|
|
528
354
|
}
|
|
529
355
|
export interface SyncPaymentsToOrderResult<T = any> {
|
|
530
356
|
isFullyPaid: boolean;
|
|
@@ -621,7 +447,6 @@ export interface OrderModuleAPI {
|
|
|
621
447
|
}) => void;
|
|
622
448
|
getTempOrder: () => OrderTempOrder | null;
|
|
623
449
|
ensureTempOrder: () => OrderTempOrder;
|
|
624
|
-
replaceTempOrder: (tempOrder: OrderTempOrder, options?: ReplaceTempOrderOptions) => Promise<OrderTempOrder>;
|
|
625
450
|
addNewOrder: () => Promise<OrderTempOrder>;
|
|
626
451
|
restoreOrder: () => OrderTempOrder;
|
|
627
452
|
getOrderProducts: () => OrderProduct[];
|
|
@@ -633,40 +458,16 @@ export interface OrderModuleAPI {
|
|
|
633
458
|
getOrderSnapshot: () => OrderSnapshot | null;
|
|
634
459
|
getOrderSyncState: () => OrderSyncState;
|
|
635
460
|
getOrderAmountSnapshot: () => OrderAmountSnapshot | null;
|
|
636
|
-
buildCurrentSubmitPayloadForLocalPrint: (params?: {
|
|
637
|
-
cacheId?: string;
|
|
638
|
-
platform?: string;
|
|
639
|
-
businessCode?: string;
|
|
640
|
-
channel?: string;
|
|
641
|
-
type?: string;
|
|
642
|
-
}) => OrderSubmitPayload;
|
|
643
|
-
applyLocalPrintOrderNumbers: (order?: Record<string, any> | null) => Promise<OrderTempOrder>;
|
|
644
461
|
getTempOrderNote: () => string;
|
|
645
|
-
updateTempOrderNote:
|
|
646
|
-
(note: string): string;
|
|
647
|
-
(note: string, sync: true): Promise<string>;
|
|
648
|
-
(note: string, sync: boolean): string | Promise<string>;
|
|
649
|
-
};
|
|
462
|
+
updateTempOrderNote: (note: string) => string;
|
|
650
463
|
updateTempOrderShopDiscount: (amount: string | number) => string;
|
|
651
464
|
updateTempOrderCustomer: (customer: UpdateTempOrderCustomerInput) => OrderSnapshot['customer'];
|
|
652
465
|
updateTempOrderBuzzer: (buzzer: string) => string;
|
|
653
466
|
updateTempOrderContactsInfo: (contactsInfo: Record<string, any> | null) => Record<string, any> | null;
|
|
654
467
|
addProductToOrder: (product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput) => Promise<OrderProduct[]>;
|
|
655
|
-
|
|
656
|
-
updateOrderProductQuantity: (params: UpdateOrderProductQuantityParams) => Promise<OrderProduct[]>;
|
|
657
|
-
updateOrderBooking: (params: UpdateOrderBookingParams) => any[];
|
|
468
|
+
updateProductInOrder: (params: UpdateProductInOrderParams) => Promise<OrderProduct[]>;
|
|
658
469
|
removeProductFromOrder: (identity: OrderProductIdentity) => Promise<OrderProduct[]>;
|
|
659
|
-
/** 批量删除购物车行,末尾仅触发一次促销重算与 summary 刷新 */
|
|
660
|
-
removeProductsFromOrder: (identities: OrderProductIdentity[]) => Promise<OrderProduct[]>;
|
|
661
|
-
/** @deprecated no-op;OrderModule 不再负责 tempOrder localStorage 持久化。 */
|
|
662
470
|
persistTempOrder: () => void;
|
|
663
|
-
/**
|
|
664
|
-
* 控制 IndexedDB 草稿(saveDraft)开关;localStorage tempOrder 持久化已废弃。
|
|
665
|
-
* BigSale 弹窗等场景传 false 可跳过 saveDraft。
|
|
666
|
-
*/
|
|
667
|
-
setEnableTempOrderPersist: (enabled: boolean) => void;
|
|
668
|
-
/** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
|
|
669
|
-
isTempOrderPersistEnabled: () => boolean;
|
|
670
471
|
submitTempOrder: <T = any>(params?: {
|
|
671
472
|
cacheId?: string;
|
|
672
473
|
platform?: string;
|
|
@@ -678,17 +479,6 @@ export interface OrderModuleAPI {
|
|
|
678
479
|
smallTicketDataFlag?: number;
|
|
679
480
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
680
481
|
}) => Promise<T>;
|
|
681
|
-
submitTempOrderAsync: <T = any>(params?: {
|
|
682
|
-
cacheId?: string;
|
|
683
|
-
platform?: string;
|
|
684
|
-
businessCode?: string;
|
|
685
|
-
channel?: string;
|
|
686
|
-
type?: string;
|
|
687
|
-
payments?: OrderPaymentSource[];
|
|
688
|
-
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
689
|
-
smallTicketDataFlag?: number;
|
|
690
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
691
|
-
}) => Promise<T>;
|
|
692
482
|
getOrderPayments: () => OrderPaymentData[];
|
|
693
483
|
setOrderPayments: (payments: OrderPaymentSource[]) => OrderPaymentData[];
|
|
694
484
|
addOrderPayment: (payment: OrderPaymentSource) => OrderPaymentData[];
|
|
@@ -697,11 +487,15 @@ export interface OrderModuleAPI {
|
|
|
697
487
|
updateVoucherOrderPayments: (payments: OrderPaymentSource[]) => OrderPaymentData[];
|
|
698
488
|
sendCustomerPayLink: <T = any>(params: SendCustomerPayLinkParams) => Promise<T>;
|
|
699
489
|
saveDraft: () => Promise<void>;
|
|
490
|
+
hasLocalDatabase: () => boolean;
|
|
491
|
+
getLocalOrderByOrderId: (orderId: number | string) => Promise<Record<string, any> | null>;
|
|
492
|
+
getLocalOrderByExternalSaleNumber: (externalSaleNumber: string) => Promise<Record<string, any> | null>;
|
|
493
|
+
getLocalOrderByOrderNumber: (orderNumber: string) => Promise<Record<string, any> | null>;
|
|
700
494
|
hydrateTempOrderFromRecord: (record: Record<string, any>, options?: {
|
|
701
495
|
recalcOnHydrate?: boolean;
|
|
702
496
|
}) => Promise<OrderTempOrder>;
|
|
703
497
|
syncPaymentsToOrder: <T = any>(params: SyncPaymentsToOrderParams) => Promise<SyncPaymentsToOrderResult<T>>;
|
|
704
|
-
|
|
498
|
+
getOrderInfoByRemote: (order_id: number) => Promise<any>;
|
|
705
499
|
getLastOrderInfo: () => Record<string, any> | undefined;
|
|
706
500
|
getOrderInfo: (order_id: number) => Promise<any>;
|
|
707
501
|
/**
|
|
@@ -723,52 +517,10 @@ export interface OrderModuleAPI {
|
|
|
723
517
|
clearOrderCustomer: () => void;
|
|
724
518
|
loadDiscountConfig: (params: {
|
|
725
519
|
customerId: number;
|
|
726
|
-
action?: 'create'
|
|
727
|
-
|
|
728
|
-
apply?: boolean;
|
|
729
|
-
}) => Promise<Discount[]>;
|
|
520
|
+
action?: 'create';
|
|
521
|
+
}) => Promise<void>;
|
|
730
522
|
getDiscountList: () => Discount[];
|
|
731
523
|
applyDiscount: () => void;
|
|
732
|
-
/**
|
|
733
|
-
* 注入促销评估器。
|
|
734
|
-
*
|
|
735
|
-
* SalesSdkProvider 在初始化 bookingTicket 后会自动从 `appHelper.utils.promotionEvaluator`
|
|
736
|
-
* 读取实例并调用本方法注入。host 透明,业务 UI 不感知。
|
|
737
|
-
*
|
|
738
|
-
* @example
|
|
739
|
-
* order.setPromotionEvaluator(appHelper.utils.promotionEvaluator);
|
|
740
|
-
*/
|
|
741
|
-
setPromotionEvaluator: (evaluator: OrderPromotionEvaluator | null) => void;
|
|
742
|
-
/**
|
|
743
|
-
* 注入赠品选择 resolver。OS 在 applyPromotion 内部当需要新增赠品时会 await 调用 resolver。
|
|
744
|
-
*
|
|
745
|
-
* 缺省时 OS 会 `console.warn` 并跳过新增(既有赠品的 reduce/remove 仍会执行)。
|
|
746
|
-
*
|
|
747
|
-
* @example
|
|
748
|
-
* order.setGiftSelectResolver((ctx) => giftSelectBridge.request(ctx));
|
|
749
|
-
*/
|
|
750
|
-
setGiftSelectResolver: (resolver: OrderGiftSelectResolver | null) => void;
|
|
751
|
-
/**
|
|
752
|
-
* 为商品目录追加促销标签。
|
|
753
|
-
*
|
|
754
|
-
* @example
|
|
755
|
-
* const taggedProducts = order.appendPromotionTags(products);
|
|
756
|
-
*/
|
|
757
|
-
appendPromotionTags: <T extends Record<string, any>>(products: T[]) => T[];
|
|
758
|
-
/**
|
|
759
|
-
* 应用购物车促销(评估 → 差异化赠品 → 写回 tempOrder.products → emit onPromotionApplied)。
|
|
760
|
-
*
|
|
761
|
-
* 自动在 addProductToOrder / updateOrderProductQuantity / removeProductFromOrder /
|
|
762
|
-
* clearOrderCartLines / setOrderCustomer 等写路径末尾触发,业务一般无需手动调用。
|
|
763
|
-
*
|
|
764
|
-
* 多选项赠品依赖 giftSelectResolver;如未注入则跳过且 console.warn。
|
|
765
|
-
* 内部以 `_isApplyingPromotion` flag 防递归。
|
|
766
|
-
*/
|
|
767
|
-
applyPromotion: () => Promise<void>;
|
|
768
|
-
/** 读取上次 applyPromotion 产出的未满足促销提示 */
|
|
769
|
-
getUnfulfilledPromotions: () => OrderUnfulfilledPromotion[];
|
|
770
|
-
/** 读取上次 applyPromotion 产出的赠品操作 diff(toAdd / toReduce / toRemove) */
|
|
771
|
-
getLastGiftActions: () => OrderLastGiftActions | null;
|
|
772
524
|
/**
|
|
773
525
|
* 取消订单
|
|
774
526
|
* @param params 取消订单参数
|
|
@@ -4,45 +4,9 @@ export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
|
|
|
4
4
|
OrderHooks["OnOrderCancel"] = "order:onOrderCancel";
|
|
5
5
|
OrderHooks["OnOrderStatusChange"] = "order:onOrderStatusChange";
|
|
6
6
|
OrderHooks["OnOrderCustomerChange"] = "order:onOrderCustomerChange";
|
|
7
|
-
OrderHooks["OnPromotionApplied"] = "order:onPromotionApplied";
|
|
8
7
|
return OrderHooks;
|
|
9
8
|
}({});
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* 促销评估器协议(OS 与 PromotionEvaluator 之间的桥接接口)。
|
|
13
|
-
*
|
|
14
|
-
* 与 `pisell_os/src/model/strategy/adapter/promotion/evaluator.ts` 中的
|
|
15
|
-
* `PromotionEvaluator` 实例结构保持兼容。SalesSdkProvider 会从 `appHelper.utils.promotionEvaluator`
|
|
16
|
-
* 读取实例并通过 `setPromotionEvaluator` 注入到 OrderModule。
|
|
17
|
-
*
|
|
18
|
-
* 这里只声明 OrderModule 需要调用的子集,避免反向依赖具体 evaluator 实现。
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/** 赠品解析回调 context(OS → SDK 的请求体) */
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 赠品 resolver 返回值。
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* return { products: [giftProduct], bookings: [giftBooking] };
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 赠品解析回调签名(SDK → OS 的返回值)。
|
|
32
|
-
*
|
|
33
|
-
* - 单选项:SDK 内部自动构造商品,不弹窗
|
|
34
|
-
* - 多选项:SDK 弹窗等用户确认后构造
|
|
35
|
-
* - 用户取消:抛错或返回空数组(OS 视为放弃本次添加)
|
|
36
|
-
*
|
|
37
|
-
* 返回数组时沿用旧协议,只写 tempOrder.products;返回对象时可同时写入预约 bookings。
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/** 未满足的促销策略(购物车底部 alert 渲染源) */
|
|
41
|
-
|
|
42
|
-
/** 上一次 applyPromotion 计算出的赠品操作(仅供调试/读取使用) */
|
|
43
|
-
|
|
44
|
-
/** onPromotionApplied 事件 payload */
|
|
45
|
-
|
|
46
10
|
/**
|
|
47
11
|
* tempOrder 上的下单客户协议字段视图。
|
|
48
12
|
* 这些字段会随订单提交到后端。
|
|
@@ -65,8 +29,6 @@ export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
|
|
|
65
29
|
|
|
66
30
|
/** 更新购物车行:仅传 SKU 时命中同 SKU 第一行;多行同 SKU 须传 unique_identification_number / 选项指纹等 */
|
|
67
31
|
|
|
68
|
-
/** 仅更新购物车行数量;行定位语义与 updateOrderProduct / removeProductFromOrder 保持一致 */
|
|
69
|
-
|
|
70
32
|
/**
|
|
71
33
|
* 订单信息
|
|
72
34
|
*/
|