@pisell/pisellos 2.2.244 → 2.2.245
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 +3 -2
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
- package/dist/modules/BookingContext/index.d.ts +48 -0
- package/dist/modules/BookingContext/index.js +566 -0
- package/dist/modules/BookingContext/types.d.ts +102 -0
- package/dist/modules/BookingContext/types.js +51 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +284 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +145 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +218 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/flexible.js +56 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
- package/dist/modules/BookingContext/utils/index.d.ts +11 -0
- package/dist/modules/BookingContext/utils/index.js +11 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/noResource.js +77 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/dist/modules/BookingContext/utils/productExtend.js +339 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
- package/dist/modules/BookingContext/utils/resources.js +486 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
- package/dist/modules/Cart/utils/cartProduct.js +24 -3
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +20 -0
- package/dist/modules/Customer/index.js +172 -83
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +1 -1
- package/dist/modules/Discount/index.js +13 -6
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +37 -17
- package/dist/modules/Order/index.d.ts +275 -19
- package/dist/modules/Order/index.js +3493 -809
- package/dist/modules/Order/types.d.ts +286 -31
- package/dist/modules/Order/types.js +38 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
- package/dist/modules/Order/utils.d.ts +147 -5
- package/dist/modules/Order/utils.js +750 -104
- package/dist/modules/Payment/index.d.ts +10 -13
- package/dist/modules/Payment/index.js +467 -837
- package/dist/modules/Payment/types.d.ts +2 -0
- package/dist/modules/Payment/utils.js +2 -1
- package/dist/modules/Payment/walletpass.js +41 -25
- package/dist/modules/ProductList/index.d.ts +16 -12
- package/dist/modules/ProductList/index.js +133 -59
- package/dist/modules/ProductList/types.d.ts +14 -0
- package/dist/modules/Quotation/index.d.ts +0 -1
- package/dist/modules/Quotation/index.js +25 -22
- package/dist/modules/Rules/index.d.ts +4 -0
- package/dist/modules/Rules/index.js +97 -70
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/SalesSummary/index.d.ts +8 -25
- package/dist/modules/SalesSummary/index.js +86 -35
- package/dist/modules/SalesSummary/types.d.ts +4 -1
- package/dist/modules/SalesSummary/utils.d.ts +2 -25
- package/dist/modules/SalesSummary/utils.js +794 -162
- package/dist/modules/Schedule/index.d.ts +7 -0
- package/dist/modules/Schedule/index.js +24 -2
- package/dist/modules/Summary/index.js +4 -3
- package/dist/modules/SurchargeList/index.d.ts +16 -0
- package/dist/modules/SurchargeList/index.js +162 -0
- package/dist/modules/SurchargeList/types.d.ts +11 -0
- package/dist/modules/SurchargeList/types.js +1 -0
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +204 -1
- package/dist/server/index.js +3654 -922
- package/dist/server/modules/index.d.ts +2 -0
- package/dist/server/modules/index.js +2 -0
- package/dist/server/modules/order/index.d.ts +120 -3
- package/dist/server/modules/order/index.js +1758 -448
- package/dist/server/modules/order/types.d.ts +32 -3
- package/dist/server/modules/order/types.js +8 -0
- package/dist/server/modules/order/utils/filterBookings.js +26 -3
- package/dist/server/modules/order/utils/filterOrders.js +23 -8
- package/dist/server/modules/payment/index.d.ts +28 -0
- package/dist/server/modules/payment/index.js +305 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/payment/types.js +1 -0
- package/dist/server/modules/products/index.d.ts +34 -7
- package/dist/server/modules/products/index.js +631 -317
- package/dist/server/modules/resource/index.d.ts +2 -0
- package/dist/server/modules/resource/index.js +29 -3
- package/dist/server/modules/schedule/index.d.ts +4 -4
- package/dist/server/modules/schedule/index.js +111 -88
- package/dist/server/test.json +713 -0
- package/dist/server/utils/small-ticket.d.ts +71 -0
- package/dist/server/utils/small-ticket.js +840 -0
- package/dist/solution/BaseSales/index.d.ts +133 -10
- package/dist/solution/BaseSales/index.js +1950 -447
- package/dist/solution/BaseSales/types.d.ts +82 -6
- package/dist/solution/BaseSales/types.js +5 -4
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1438 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +105 -24
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +62 -21
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +271 -11
- package/dist/solution/BookingTicket/index.js +1777 -242
- package/dist/solution/BookingTicket/types.d.ts +118 -1
- package/dist/solution/BookingTicket/types.js +41 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.js +70 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
- package/dist/solution/BookingTicket/utils/cartView.js +94 -7
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
- package/dist/solution/Checkout/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +10 -9
- package/dist/solution/RegisterAndLogin/config.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +9 -3
- package/dist/solution/ScanOrder/index.js +241 -134
- package/dist/solution/ScanOrder/types.d.ts +9 -5
- package/dist/solution/ScanOrder/types.js +2 -3
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +84 -22
- package/dist/solution/VenueBooking/index.d.ts +5 -2
- package/dist/solution/VenueBooking/index.js +110 -59
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/dist/types/index.d.ts +10 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +2 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +3 -2
- package/lib/modules/BookingContext/index.d.ts +48 -0
- package/lib/modules/BookingContext/index.js +368 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +34 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +151 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +201 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +80 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +43 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +90 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +283 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +377 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
- package/lib/modules/Cart/utils/cartProduct.js +20 -3
- package/lib/modules/Cart/utils/changePrice.js +12 -20
- package/lib/modules/Customer/index.d.ts +20 -0
- package/lib/modules/Customer/index.js +64 -11
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +1 -1
- package/lib/modules/Discount/index.js +9 -1
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +19 -5
- package/lib/modules/Order/index.d.ts +275 -19
- package/lib/modules/Order/index.js +2245 -336
- package/lib/modules/Order/types.d.ts +286 -31
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
- package/lib/modules/Order/utils.d.ts +147 -5
- package/lib/modules/Order/utils.js +615 -46
- package/lib/modules/Payment/index.d.ts +10 -13
- package/lib/modules/Payment/index.js +18 -150
- package/lib/modules/Payment/types.d.ts +2 -0
- package/lib/modules/Payment/utils.js +2 -1
- package/lib/modules/Payment/walletpass.js +16 -3
- package/lib/modules/ProductList/index.d.ts +16 -12
- package/lib/modules/ProductList/index.js +41 -4
- package/lib/modules/ProductList/types.d.ts +14 -0
- package/lib/modules/Quotation/index.d.ts +0 -1
- package/lib/modules/Quotation/index.js +19 -16
- package/lib/modules/Rules/index.d.ts +4 -0
- package/lib/modules/Rules/index.js +137 -120
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/SalesSummary/index.d.ts +8 -25
- package/lib/modules/SalesSummary/index.js +30 -4
- package/lib/modules/SalesSummary/types.d.ts +4 -1
- package/lib/modules/SalesSummary/utils.d.ts +2 -25
- package/lib/modules/SalesSummary/utils.js +645 -91
- package/lib/modules/Schedule/index.d.ts +7 -0
- package/lib/modules/Schedule/index.js +17 -1
- package/lib/modules/Summary/index.js +5 -4
- package/lib/modules/SurchargeList/index.d.ts +16 -0
- package/lib/modules/SurchargeList/index.js +89 -0
- package/lib/modules/SurchargeList/types.d.ts +11 -0
- package/lib/modules/SurchargeList/types.js +17 -0
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +204 -1
- package/lib/server/index.js +1891 -59
- package/lib/server/modules/index.d.ts +2 -0
- package/lib/server/modules/index.js +3 -0
- package/lib/server/modules/order/index.d.ts +120 -3
- package/lib/server/modules/order/index.js +883 -94
- package/lib/server/modules/order/types.d.ts +32 -3
- package/lib/server/modules/order/utils/filterBookings.js +24 -5
- package/lib/server/modules/order/utils/filterOrders.js +15 -6
- package/lib/server/modules/payment/index.d.ts +28 -0
- package/lib/server/modules/payment/index.js +192 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/payment/types.js +17 -0
- package/lib/server/modules/products/index.d.ts +34 -7
- package/lib/server/modules/products/index.js +189 -54
- package/lib/server/modules/resource/index.d.ts +2 -0
- package/lib/server/modules/resource/index.js +27 -3
- package/lib/server/modules/schedule/index.d.ts +4 -4
- package/lib/server/modules/schedule/index.js +47 -40
- package/lib/server/test.json +713 -0
- package/lib/server/utils/small-ticket.d.ts +71 -0
- package/lib/server/utils/small-ticket.js +800 -0
- package/lib/solution/BaseSales/index.d.ts +133 -10
- package/lib/solution/BaseSales/index.js +1111 -63
- package/lib/solution/BaseSales/types.d.ts +82 -6
- package/lib/solution/BaseSales/types.js +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +992 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +106 -18
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +54 -10
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +271 -11
- package/lib/solution/BookingTicket/index.js +922 -29
- package/lib/solution/BookingTicket/types.d.ts +118 -1
- package/lib/solution/BookingTicket/types.js +11 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +44 -2
- package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
- package/lib/solution/BookingTicket/utils/cartView.js +61 -6
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +17 -3
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +1 -2
- package/lib/solution/RegisterAndLogin/config.js +2 -10
- package/lib/solution/ScanOrder/index.d.ts +9 -3
- package/lib/solution/ScanOrder/index.js +153 -70
- package/lib/solution/ScanOrder/types.d.ts +9 -5
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +83 -17
- package/lib/solution/VenueBooking/index.d.ts +5 -2
- package/lib/solution/VenueBooking/index.js +54 -17
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/lib/types/index.d.ts +10 -0
- package/package.json +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesScanCodeResult } from './types';
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesProductBookingPriceResult, BaseSalesScanCodeResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
|
-
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput,
|
|
5
|
+
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from '../../modules/Order/types';
|
|
6
6
|
import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
|
|
7
7
|
import type { Discount } from '../../modules/Discount/types';
|
|
8
8
|
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
9
9
|
export * from './types';
|
|
10
10
|
import { ProductList } from '../../modules/ProductList';
|
|
11
11
|
import { PaymentModule } from '../../modules/Payment';
|
|
12
|
+
import type { PaymentMethod } from '../../modules/Payment/types';
|
|
12
13
|
import type { SalesSummaryModule } from '../../modules/SalesSummary';
|
|
13
14
|
import type { ScheduleModule } from '../../modules/Schedule';
|
|
15
|
+
import { QuotationModule } from '../../modules/Quotation';
|
|
14
16
|
import type { ISalesDetail, ISalesDetailHeader, ISalesBooking, ISalesPayment, ISalesSurcharge } from './utils/parseSalesResponse';
|
|
17
|
+
import { AppPlugin } from '../../plugins/app';
|
|
15
18
|
import { type TransformBaseProductToOrderProductParams } from './utils/transformBaseProductToOrderProduct';
|
|
16
19
|
export interface BaseSalesState {
|
|
17
20
|
order?: OrderModule;
|
|
@@ -19,13 +22,16 @@ export interface BaseSalesState {
|
|
|
19
22
|
payment?: PaymentModule;
|
|
20
23
|
salesSummary?: SalesSummaryModule;
|
|
21
24
|
schedule?: ScheduleModule;
|
|
25
|
+
quotation?: QuotationModule;
|
|
22
26
|
}
|
|
27
|
+
export type BaseSalesPrintLocalOrderReceiptParams = string | number;
|
|
23
28
|
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
24
29
|
protected defaultName: string;
|
|
25
30
|
protected defaultVersion: string;
|
|
26
31
|
isSolution: boolean;
|
|
27
32
|
protected initializeOptions: ModuleOptions;
|
|
28
33
|
private logger;
|
|
34
|
+
protected appPlugin: AppPlugin;
|
|
29
35
|
protected store: BaseSalesState;
|
|
30
36
|
protected otherParams: Record<string, any>;
|
|
31
37
|
protected cacheId: string | undefined;
|
|
@@ -36,10 +42,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
36
42
|
window: WindowPlugin;
|
|
37
43
|
request: RequestPlugin;
|
|
38
44
|
protected currentSalesDetail: ISalesDetail | null;
|
|
45
|
+
protected discountConfigCacheKey: string | null;
|
|
46
|
+
protected hasManualDiscountSelection: boolean;
|
|
47
|
+
private paymentMethodsCache;
|
|
39
48
|
constructor(name?: string, version?: string);
|
|
40
49
|
/**
|
|
41
50
|
* 子类可覆盖此方法以追加/收敛要注册的子模块。
|
|
42
|
-
* 默认包含通用销售模块:products / order / salesSummary / schedule / payment。
|
|
51
|
+
* 默认包含通用销售模块:products / order / salesSummary / schedule / payment / quotation。
|
|
43
52
|
*/
|
|
44
53
|
protected getRegisteredModuleNames(): readonly string[];
|
|
45
54
|
/**
|
|
@@ -54,7 +63,19 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
54
63
|
* 记录错误日志
|
|
55
64
|
*/
|
|
56
65
|
private logError;
|
|
66
|
+
private hydrateOrderPaymentNames;
|
|
57
67
|
get payment(): PaymentModule | undefined;
|
|
68
|
+
private getCurrentOrderCustomerId;
|
|
69
|
+
private applyQuotationScheduleResolver;
|
|
70
|
+
private loadQuotationForPriceQuery;
|
|
71
|
+
private getPriceQueryProductId;
|
|
72
|
+
private getPriceQuerySchedule;
|
|
73
|
+
private loadProductForPriceQuery;
|
|
74
|
+
private getAuthoritativeBundleItems;
|
|
75
|
+
private findAuthoritativeBundleItem;
|
|
76
|
+
private getAuthoritativeBundleUnitPrice;
|
|
77
|
+
private mergeProductForPriceQuery;
|
|
78
|
+
protected getSubmitOrderSalesChannel(): string | undefined;
|
|
58
79
|
/**
|
|
59
80
|
* 工厂入口:根据子模块名实例化对应模块。
|
|
60
81
|
* 默认使用 BookingByStep 公共 `createModule`。子类若需引入额外类型(如 customer),
|
|
@@ -62,16 +83,35 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
62
83
|
*/
|
|
63
84
|
protected createSubModule(moduleName: string): Module | null;
|
|
64
85
|
protected getSubModuleHooks(moduleName: string): any;
|
|
86
|
+
/**
|
|
87
|
+
* 构造传给 BaseSales 子模块的完整运行态参数,保证初始化和后续同步语义一致。
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const params = this.buildSubModuleOtherParams();
|
|
91
|
+
* this.core.registerModule(orderModule, { otherParams: params });
|
|
92
|
+
*/
|
|
93
|
+
protected buildSubModuleOtherParams(): Record<string, any>;
|
|
94
|
+
/**
|
|
95
|
+
* 将父级 otherParams 的变更显式同步给已注册的子模块。
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* await this.syncOtherParamsToSubModules({ channel: 'pos' });
|
|
99
|
+
*/
|
|
100
|
+
protected syncOtherParamsToSubModules(changedParams: Record<string, any>, { cover }?: {
|
|
101
|
+
cover?: boolean;
|
|
102
|
+
}): Promise<void>;
|
|
65
103
|
/**
|
|
66
104
|
* 读取 sessionStorage[this.name][cacheId],作为子模块 initialState 的来源。
|
|
67
105
|
* sessionStorage 损坏时静默忽略,按空状态注册。
|
|
68
106
|
*/
|
|
69
107
|
protected readSessionCacheData(): Record<string, any>;
|
|
108
|
+
protected getAppData<T>(key: string): T | undefined;
|
|
109
|
+
private syncAppDataToTempOrder;
|
|
70
110
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
71
111
|
destroy(): Promise<void>;
|
|
72
112
|
/**
|
|
73
113
|
* 加载销售订单到统一 tempOrder 工作区。
|
|
74
|
-
*
|
|
114
|
+
* 统一通过 OrderModule 的 sales detail lookup 加载订单详情。
|
|
75
115
|
*
|
|
76
116
|
* 子类可在 `super.loadSalesDetail` 之后基于返回的 `sales` 做业务侧装配
|
|
77
117
|
* (比如把 `sales.customer` 写入 CustomerModule、emit 业务 hook 等)。
|
|
@@ -91,27 +131,61 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
91
131
|
getPayments(): ISalesPayment[];
|
|
92
132
|
/** 获取附加费用(运费/服务费/税费等)。 */
|
|
93
133
|
getSurcharges(): ISalesSurcharge[];
|
|
94
|
-
getTempOrder():
|
|
134
|
+
getTempOrder(): OrderTempOrder | null;
|
|
135
|
+
replaceTempOrder(tempOrder: OrderTempOrder): Promise<OrderTempOrder>;
|
|
95
136
|
getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
|
|
96
137
|
getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
|
|
97
138
|
getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
|
|
98
139
|
getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
|
|
99
140
|
getTempOrderNote(): string;
|
|
100
141
|
updateTempOrderNote(note: string): string;
|
|
142
|
+
updateTempOrderNote(note: string, sync: true): Promise<string>;
|
|
143
|
+
updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
|
|
144
|
+
updateRemoteOrderNote(orderId: number | string, note: string): void;
|
|
101
145
|
updateTempOrderShopDiscount(amount: string | number): string;
|
|
146
|
+
updateTempOrderDepositAmount(amount: string | number): OrderSummary;
|
|
102
147
|
updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
|
|
148
|
+
/** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化。 */
|
|
149
|
+
setEnableTempOrderPersist(enabled: boolean): void;
|
|
150
|
+
/** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
|
|
151
|
+
isTempOrderPersistEnabled(): boolean;
|
|
103
152
|
private ensureTempOrder;
|
|
104
|
-
addNewOrder(): Promise<
|
|
153
|
+
addNewOrder(): Promise<OrderTempOrder>;
|
|
105
154
|
saveDraft(): Promise<void>;
|
|
106
|
-
restoreOrder(): Promise<
|
|
155
|
+
restoreOrder(): Promise<OrderTempOrder>;
|
|
156
|
+
/**
|
|
157
|
+
* 仅清空 tempOrder 购物车行(products / bookings / discount_list)。
|
|
158
|
+
* 同步清空内存中的 salesDetail 商品/预约视图,避免编辑态仍读到旧 bookings。
|
|
159
|
+
*/
|
|
160
|
+
clearOrderCartLines(): Promise<OrderTempOrder>;
|
|
107
161
|
getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
|
|
108
|
-
getSummary(): Promise<
|
|
162
|
+
getSummary(): Promise<OrderSummary>;
|
|
163
|
+
private getHistoricalProductDiscountList;
|
|
164
|
+
private isPersistedOrderProduct;
|
|
165
|
+
private mergeHistoricalDiscountList;
|
|
166
|
+
private shouldSkipAutoApplyFetchedDiscountsInEditMode;
|
|
167
|
+
private mergeCurrentDiscountSelectionState;
|
|
168
|
+
loadDiscountConfig(params?: {
|
|
169
|
+
customerId?: number;
|
|
170
|
+
action?: 'create' | 'edit';
|
|
171
|
+
}): Promise<{
|
|
172
|
+
productList: Record<string, any>[];
|
|
173
|
+
discountList: Discount[];
|
|
174
|
+
}>;
|
|
175
|
+
bestDiscount(cb?: (result: any) => void): Promise<{
|
|
176
|
+
productList: Record<string, any>[];
|
|
177
|
+
discountList: Discount[];
|
|
178
|
+
}>;
|
|
109
179
|
getDiscountList(): Discount[];
|
|
110
180
|
scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
|
|
111
181
|
setDiscountSelected(params: {
|
|
112
182
|
discountId: number;
|
|
113
183
|
isSelected: boolean;
|
|
114
184
|
}): Promise<void>;
|
|
185
|
+
applyDiscountCalculationResult(result?: {
|
|
186
|
+
productList?: Record<string, any>[];
|
|
187
|
+
discountList?: Discount[];
|
|
188
|
+
}): Promise<void>;
|
|
115
189
|
submitScanOrder<T = any>(params?: {
|
|
116
190
|
payments?: OrderPaymentSource[];
|
|
117
191
|
paymentStatus?: BaseSalesPaymentStatus;
|
|
@@ -130,6 +204,14 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
130
204
|
smallTicketDataFlag?: number;
|
|
131
205
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
132
206
|
}): Promise<T>;
|
|
207
|
+
submitTempOrderAsync<T = any>(params?: {
|
|
208
|
+
payments?: OrderPaymentSource[];
|
|
209
|
+
paymentStatus?: BaseSalesPaymentStatus;
|
|
210
|
+
smallTicketDataFlag?: number;
|
|
211
|
+
enhancePayload?: SubmitPayloadEnhancer;
|
|
212
|
+
}): Promise<T>;
|
|
213
|
+
printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
|
|
214
|
+
private getSubmitPaymentStatus;
|
|
133
215
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
134
216
|
/** 读取当前 BaseSales 订单上下文中的 Sales 协议支付项。 */
|
|
135
217
|
getOrderPayments(): OrderPaymentData[];
|
|
@@ -160,7 +242,9 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
160
242
|
email: string;
|
|
161
243
|
};
|
|
162
244
|
/** 获取可用支付方式列表,供 PaymentModal 渲染支付选项。 */
|
|
163
|
-
getPaymentMethodsAsync(): Promise<
|
|
245
|
+
getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
|
|
246
|
+
/** 同步读取初始化时缓存的支付方式列表。 */
|
|
247
|
+
getPaymentMethods(): PaymentMethod[];
|
|
164
248
|
/** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
|
|
165
249
|
roundAmount(params: {
|
|
166
250
|
amount: string | number;
|
|
@@ -183,14 +267,53 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
183
267
|
submitBeforeSend?: boolean;
|
|
184
268
|
}): Promise<T>;
|
|
185
269
|
transformBaseProductToOrderProduct(params: TransformBaseProductToOrderProductParams): import("./utils/transformBaseProductToOrderProduct").BaseProductOrderProductInput | null;
|
|
270
|
+
calculateProductBookingPrice(params: BaseSalesCalculateProductBookingPriceParams): Promise<BaseSalesProductBookingPriceResult>;
|
|
186
271
|
addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
187
|
-
|
|
272
|
+
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
273
|
+
updateOrderProductQuantity(params: BaseSalesUpdateOrderProductQuantityParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
274
|
+
updateOrderBooking(params: UpdateOrderBookingParams): any[];
|
|
188
275
|
/**
|
|
189
276
|
* 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
|
|
190
277
|
* 多行同 SKU 时必须传入与删除/更新一致的 unique_identification_number。
|
|
191
278
|
*/
|
|
192
279
|
setOrderProductLineNote(identity: BaseSalesOrderProductIdentity, note: string): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
280
|
+
/**
|
|
281
|
+
* 批量删除购物车行,末尾仅一次促销重算。
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* await baseSales.removeProductsFromOrder([identityA, identityB]);
|
|
285
|
+
*/
|
|
286
|
+
removeProductsFromOrder(identities: BaseSalesOrderProductIdentity[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
193
287
|
removeProductFromOrder(identity: BaseSalesOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
288
|
+
/**
|
|
289
|
+
* 注入促销评估器到底层 OrderModule。
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* solution.setPromotionEvaluator(appHelper.utils.promotionEvaluator);
|
|
293
|
+
*/
|
|
294
|
+
setPromotionEvaluator(evaluator: OrderPromotionEvaluator | null): void;
|
|
295
|
+
/**
|
|
296
|
+
* 注入赠品选择 resolver。UI 层(SalesSdk)通过 bridge 提供。
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* solution.setGiftSelectResolver(async (ctx) => bridge.request(ctx));
|
|
300
|
+
*/
|
|
301
|
+
setGiftSelectResolver(resolver: OrderGiftSelectResolver | null): void;
|
|
302
|
+
/**
|
|
303
|
+
* 为商品目录追加促销标签,供 SalesSdkProductProvider 等商品列表入口复用。
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* const products = solution.appendPromotionTags(catalogProducts);
|
|
307
|
+
*/
|
|
308
|
+
appendPromotionTags<T extends Record<string, any>>(products: T[]): T[];
|
|
309
|
+
/**
|
|
310
|
+
* 主动触发一次促销应用(一般写路径会自动触发,少数场景如客户切换后可手动调)。
|
|
311
|
+
*/
|
|
312
|
+
applyPromotion(): Promise<void>;
|
|
313
|
+
/** 最近一次促销计算输出的未满足提示。 */
|
|
314
|
+
getUnfulfilledPromotions(): OrderUnfulfilledPromotion[];
|
|
315
|
+
/** 最近一次促销计算输出的赠品操作 diff。 */
|
|
316
|
+
getLastGiftActions(): OrderLastGiftActions | null;
|
|
194
317
|
getProductList(): Promise<any>;
|
|
195
318
|
getOtherParams(): Record<string, any>;
|
|
196
319
|
setOtherParams(params: Record<string, any>, { cover }?: {
|