@pisell/pisellos 0.0.568 → 0.0.569
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/walletPass/utils.js +7 -4
- package/dist/modules/BaseModule.d.ts +2 -2
- package/dist/modules/BaseModule.js +4 -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 +302 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +149 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +249 -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 +26 -5
- package/dist/modules/Cart/utils/changePrice.js +27 -20
- 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 +2 -1
- package/dist/modules/Discount/index.js +37 -9
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +36 -16
- package/dist/modules/Order/index.d.ts +448 -23
- package/dist/modules/Order/index.js +5417 -561
- package/dist/modules/Order/types.d.ts +693 -88
- package/dist/modules/Order/types.js +68 -1
- package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -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/orderCollectionIdentity.d.ts +53 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
- package/dist/modules/Order/utils.d.ts +167 -18
- package/dist/modules/Order/utils.js +960 -165
- package/dist/modules/Payment/index.d.ts +10 -9
- package/dist/modules/Payment/index.js +465 -703
- package/dist/modules/Payment/types.d.ts +40 -16
- package/dist/modules/Payment/utils.d.ts +1 -1
- package/dist/modules/Payment/utils.js +4 -3
- package/dist/modules/Payment/walletpass.js +44 -29
- package/dist/modules/Product/types.d.ts +29 -7
- package/dist/modules/ProductList/index.d.ts +17 -13
- package/dist/modules/ProductList/index.js +184 -74
- package/dist/modules/ProductList/types.d.ts +17 -0
- package/dist/modules/Quotation/index.d.ts +22 -2
- package/dist/modules/Quotation/index.js +108 -42
- package/dist/modules/Quotation/types.d.ts +19 -0
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +8 -10
- package/dist/modules/Rules/index.js +221 -109
- package/dist/modules/Rules/types.d.ts +14 -3
- package/dist/modules/SalesSummary/index.d.ts +23 -26
- package/dist/modules/SalesSummary/index.js +152 -46
- package/dist/modules/SalesSummary/types.d.ts +9 -1
- package/dist/modules/SalesSummary/utils.d.ts +3 -22
- package/dist/modules/SalesSummary/utils.js +803 -163
- package/dist/modules/Schedule/getDateIsInSchedule.js +14 -7
- package/dist/modules/Schedule/index.d.ts +18 -5
- package/dist/modules/Schedule/index.js +78 -24
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/Summary/index.js +4 -3
- package/dist/modules/SurchargeList/index.d.ts +18 -0
- package/dist/modules/SurchargeList/index.js +185 -0
- package/dist/modules/SurchargeList/types.d.ts +15 -0
- package/dist/modules/SurchargeList/types.js +1 -0
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +4 -1
- package/dist/plugins/app.d.ts +2 -0
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +462 -8
- package/dist/server/index.js +6112 -656
- package/dist/server/modules/floor-plan/index.d.ts +39 -0
- package/dist/server/modules/floor-plan/index.js +595 -0
- package/dist/server/modules/floor-plan/types.d.ts +43 -0
- package/dist/server/modules/floor-plan/types.js +13 -0
- package/dist/server/modules/index.d.ts +7 -2
- package/dist/server/modules/index.js +6 -0
- package/dist/server/modules/order/index.d.ts +207 -14
- package/dist/server/modules/order/index.js +2326 -379
- package/dist/server/modules/order/types.d.ts +76 -5
- package/dist/server/modules/order/types.js +14 -1
- package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/dist/server/modules/order/utils/filterBookings.js +118 -11
- package/dist/server/modules/order/utils/filterOrders.js +242 -14
- 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 +105 -14
- package/dist/server/modules/products/index.js +1393 -516
- package/dist/server/modules/products/types.d.ts +34 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/server/modules/quotation/index.d.ts +39 -0
- package/dist/server/modules/quotation/index.js +278 -66
- package/dist/server/modules/resource/index.d.ts +2 -3
- package/dist/server/modules/resource/index.js +108 -86
- package/dist/server/modules/schedule/index.d.ts +6 -4
- package/dist/server/modules/schedule/index.js +116 -85
- package/dist/server/test.json +713 -0
- package/dist/server/types.d.ts +2 -0
- package/dist/server/utils/product.js +2 -2
- package/dist/server/utils/small-ticket.d.ts +71 -0
- package/dist/server/utils/small-ticket.js +963 -0
- package/dist/solution/BaseSales/index.d.ts +378 -0
- package/dist/solution/BaseSales/index.js +4006 -0
- package/dist/solution/BaseSales/types.d.ts +394 -0
- package/dist/solution/BaseSales/types.js +40 -0
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
- package/dist/solution/BaseSales/utils.d.ts +40 -0
- package/dist/solution/BaseSales/utils.js +263 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +394 -25
- package/dist/solution/BookingTicket/index.js +2506 -443
- package/dist/solution/BookingTicket/types.d.ts +191 -6
- package/dist/solution/BookingTicket/types.js +83 -10
- 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 +77 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.js +136 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts +29 -0
- package/dist/solution/BookingTicket/utils/cartView.js +209 -0
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -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/cloudSearch.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +41 -1
- 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/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +11 -3
- 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 +25 -34
- package/dist/solution/Checkout/utils/index.js +4 -4
- package/dist/solution/RegisterAndLogin/config.js +2 -10
- package/dist/solution/Sales/index.d.ts +50 -5
- package/dist/solution/Sales/index.js +484 -92
- package/dist/solution/Sales/types.d.ts +26 -2
- package/dist/solution/ScanOrder/index.d.ts +27 -21
- package/dist/solution/ScanOrder/index.js +499 -434
- package/dist/solution/ScanOrder/types.d.ts +33 -11
- package/dist/solution/ScanOrder/types.js +4 -5
- package/dist/solution/ScanOrder/utils.d.ts +4 -1
- package/dist/solution/ScanOrder/utils.js +109 -34
- package/dist/solution/ShopDiscount/index.js +4 -4
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +29 -20
- package/dist/solution/VenueBooking/index.js +301 -213
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +11 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +3 -2
- package/lib/model/strategy/adapter/walletPass/utils.js +6 -4
- package/lib/modules/BaseModule.d.ts +2 -2
- package/lib/modules/BaseModule.js +4 -4
- package/lib/modules/BookingContext/index.d.ts +48 -0
- package/lib/modules/BookingContext/index.js +390 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +48 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +286 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +242 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +63 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +35 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +126 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +78 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +29 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +330 -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 +24 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +419 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +161 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +114 -0
- package/lib/modules/Cart/utils/cartProduct.js +27 -5
- package/lib/modules/Cart/utils/changePrice.js +20 -14
- package/lib/modules/Customer/index.d.ts +20 -0
- package/lib/modules/Customer/index.js +63 -10
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +2 -1
- package/lib/modules/Discount/index.js +18 -2
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +21 -3
- package/lib/modules/Order/index.d.ts +448 -23
- package/lib/modules/Order/index.js +3641 -308
- package/lib/modules/Order/types.d.ts +693 -88
- package/lib/modules/Order/types.js +55 -1
- package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/lib/modules/Order/utils/bundleDiscountHydration.js +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +353 -0
- package/lib/modules/Order/utils.d.ts +167 -18
- package/lib/modules/Order/utils.js +974 -138
- package/lib/modules/Payment/index.d.ts +10 -9
- package/lib/modules/Payment/index.js +30 -124
- package/lib/modules/Payment/types.d.ts +40 -16
- package/lib/modules/Payment/utils.d.ts +1 -1
- package/lib/modules/Payment/utils.js +4 -3
- package/lib/modules/Payment/walletpass.js +16 -6
- package/lib/modules/Product/types.d.ts +29 -7
- package/lib/modules/ProductList/index.d.ts +17 -13
- package/lib/modules/ProductList/index.js +92 -51
- package/lib/modules/ProductList/types.d.ts +17 -0
- package/lib/modules/Quotation/index.d.ts +22 -2
- package/lib/modules/Quotation/index.js +76 -20
- package/lib/modules/Quotation/types.d.ts +19 -0
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +147 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +895 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +5 -0
- package/lib/modules/Rules/index.d.ts +8 -10
- package/lib/modules/Rules/index.js +152 -60
- package/lib/modules/Rules/types.d.ts +14 -3
- package/lib/modules/SalesSummary/index.d.ts +23 -26
- package/lib/modules/SalesSummary/index.js +84 -16
- package/lib/modules/SalesSummary/types.d.ts +9 -1
- package/lib/modules/SalesSummary/utils.d.ts +3 -22
- package/lib/modules/SalesSummary/utils.js +616 -111
- package/lib/modules/Schedule/getDateIsInSchedule.js +14 -7
- package/lib/modules/Schedule/index.d.ts +18 -5
- package/lib/modules/Schedule/index.js +49 -14
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/Summary/index.js +2 -2
- package/lib/modules/SurchargeList/index.d.ts +18 -0
- package/lib/modules/SurchargeList/index.js +95 -0
- package/lib/modules/SurchargeList/types.d.ts +15 -0
- package/lib/modules/SurchargeList/types.js +5 -0
- package/lib/modules/index.d.ts +3 -0
- package/lib/modules/index.js +33 -0
- package/lib/plugins/app.d.ts +2 -0
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +462 -8
- package/lib/server/index.js +3901 -205
- package/lib/server/modules/floor-plan/index.d.ts +39 -0
- package/lib/server/modules/floor-plan/index.js +306 -0
- package/lib/server/modules/floor-plan/types.d.ts +43 -0
- package/lib/server/modules/floor-plan/types.js +19 -0
- package/lib/server/modules/index.d.ts +7 -2
- package/lib/server/modules/index.js +21 -0
- package/lib/server/modules/order/index.d.ts +207 -14
- package/lib/server/modules/order/index.js +1324 -141
- package/lib/server/modules/order/types.d.ts +76 -5
- package/lib/server/modules/order/types.js +11 -1
- package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/lib/server/modules/order/utils/filterBookings.js +119 -11
- package/lib/server/modules/order/utils/filterOrders.js +238 -13
- package/lib/server/modules/payment/index.d.ts +28 -0
- package/lib/server/modules/payment/index.js +168 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/payment/types.js +5 -0
- package/lib/server/modules/products/index.d.ts +105 -14
- package/lib/server/modules/products/index.js +588 -97
- package/lib/server/modules/products/types.d.ts +34 -1
- package/lib/server/modules/products/types.js +3 -0
- package/lib/server/modules/quotation/index.d.ts +39 -0
- package/lib/server/modules/quotation/index.js +145 -1
- package/lib/server/modules/resource/index.d.ts +2 -3
- package/lib/server/modules/resource/index.js +71 -45
- package/lib/server/modules/schedule/index.d.ts +6 -4
- package/lib/server/modules/schedule/index.js +55 -44
- package/lib/server/test.json +713 -0
- package/lib/server/types.d.ts +2 -0
- package/lib/server/utils/product.js +2 -2
- package/lib/server/utils/small-ticket.d.ts +71 -0
- package/lib/server/utils/small-ticket.js +926 -0
- package/lib/solution/BaseSales/index.d.ts +378 -0
- package/lib/solution/BaseSales/index.js +2367 -0
- package/lib/solution/BaseSales/types.d.ts +394 -0
- package/lib/solution/BaseSales/types.js +47 -0
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +1155 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +140 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +231 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +215 -0
- package/lib/solution/BaseSales/utils.d.ts +40 -0
- package/lib/solution/BaseSales/utils.js +259 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +394 -25
- package/lib/solution/BookingTicket/index.js +1350 -76
- package/lib/solution/BookingTicket/types.d.ts +191 -6
- package/lib/solution/BookingTicket/types.js +71 -10
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +353 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +94 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +136 -0
- package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
- package/lib/solution/BookingTicket/utils/cartView.js +200 -0
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +35 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +387 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +220 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +24 -3
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +64 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +4 -2
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +14 -2
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +115 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +83 -0
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +18 -19
- package/lib/solution/Checkout/utils/index.js +4 -4
- package/lib/solution/RegisterAndLogin/config.js +2 -10
- package/lib/solution/Sales/index.d.ts +50 -5
- package/lib/solution/Sales/index.js +296 -39
- package/lib/solution/Sales/types.d.ts +26 -2
- package/lib/solution/ScanOrder/index.d.ts +27 -21
- package/lib/solution/ScanOrder/index.js +144 -103
- package/lib/solution/ScanOrder/types.d.ts +33 -11
- package/lib/solution/ScanOrder/types.js +4 -5
- package/lib/solution/ScanOrder/utils.d.ts +4 -1
- package/lib/solution/ScanOrder/utils.js +98 -26
- package/lib/solution/ShopDiscount/index.js +3 -3
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1050 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +14 -0
- package/lib/solution/VenueBooking/index.d.ts +29 -20
- package/lib/solution/VenueBooking/index.js +169 -94
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +9 -3
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +22 -0
- package/lib/types/index.d.ts +11 -1
- package/package.json +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -73,13 +73,19 @@ const isInTimeSlotsSchedule = (targetDate, targetDateString, targetTimeString, s
|
|
|
73
73
|
return false;
|
|
74
74
|
}
|
|
75
75
|
const scheduleStartDate = (0, _dayjs.default)(schedule.start_time.split(' ')[0]);
|
|
76
|
+
|
|
77
|
+
// 检查日期是否在日程的有效范围内(包含 daily / weekly 重复规则)
|
|
76
78
|
if (!isDateInTimeSlotsSchedule(targetDate, schedule, scheduleStartDate)) {
|
|
77
79
|
return false;
|
|
78
80
|
}
|
|
81
|
+
|
|
82
|
+
// 检查是否在任一时间段内
|
|
79
83
|
for (const timeSlot of schedule.time_slot) {
|
|
80
|
-
const slotStart =
|
|
81
|
-
const slotEnd =
|
|
82
|
-
|
|
84
|
+
const slotStart = `${targetDateString} ${timeSlot.start_time}:00`;
|
|
85
|
+
const slotEnd = `${targetDateString} ${timeSlot.end_time}:00`;
|
|
86
|
+
const slotStartDate = (0, _dayjs.default)(slotStart);
|
|
87
|
+
const slotEndDate = (0, _dayjs.default)(slotEnd);
|
|
88
|
+
if (targetDate.isSameOrAfter(slotStartDate) && targetDate.isSameOrBefore(slotEndDate)) {
|
|
83
89
|
return true;
|
|
84
90
|
}
|
|
85
91
|
}
|
|
@@ -98,7 +104,7 @@ const isInDesignationSchedule = (targetDate, targetDateString, targetTimeString,
|
|
|
98
104
|
const endDateTime = `${designation.end_date} ${designation.end_time}:00`;
|
|
99
105
|
const startDate = (0, _dayjs.default)(startDateTime);
|
|
100
106
|
const endDate = (0, _dayjs.default)(endDateTime);
|
|
101
|
-
if (targetDate.isSameOrAfter(startDate) && targetDate.
|
|
107
|
+
if (targetDate.isSameOrAfter(startDate) && targetDate.isSameOrBefore(endDate)) {
|
|
102
108
|
return true;
|
|
103
109
|
}
|
|
104
110
|
}
|
|
@@ -175,8 +181,9 @@ const isInDailyRepeat = (targetDate, startDate, endDate, repeatRule) => {
|
|
|
175
181
|
const startTimeOfDay = startDate.hour() * 3600 + startDate.minute() * 60 + startDate.second();
|
|
176
182
|
const endTimeOfDay = endDate.hour() * 3600 + endDate.minute() * 60 + endDate.second();
|
|
177
183
|
|
|
178
|
-
// 每日重复:每天都在相同的时间段内有效
|
|
179
|
-
|
|
184
|
+
// 每日重复:每天都在相同的时间段内有效
|
|
185
|
+
// 例如:01:00:00 - 16:00:00,每天都是这个时间段
|
|
186
|
+
return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay <= endTimeOfDay;
|
|
180
187
|
};
|
|
181
188
|
|
|
182
189
|
// 每周重复逻辑
|
|
@@ -203,7 +210,7 @@ const isInWeeklyRepeat = (targetDate, startDate, endDate, repeatRule) => {
|
|
|
203
210
|
const targetTimeOfDay = targetDate.hour() * 3600 + targetDate.minute() * 60 + targetDate.second();
|
|
204
211
|
const startTimeOfDay = startDate.hour() * 3600 + startDate.minute() * 60 + startDate.second();
|
|
205
212
|
const endTimeOfDay = endDate.hour() * 3600 + endDate.minute() * 60 + endDate.second();
|
|
206
|
-
return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay
|
|
213
|
+
return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay <= endTimeOfDay;
|
|
207
214
|
};
|
|
208
215
|
|
|
209
216
|
// 日程时间段类型
|
|
@@ -9,15 +9,28 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
|
|
|
9
9
|
private cacheId;
|
|
10
10
|
private openCache;
|
|
11
11
|
private fatherModule;
|
|
12
|
+
private hasLoadedScheduleList;
|
|
12
13
|
constructor(name?: string, version?: string);
|
|
13
14
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* 更新父级解决方案透传的运行态参数,并刷新 schedule 缓存写入配置。
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* scheduleModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' });
|
|
20
|
+
*/
|
|
21
|
+
updateOtherParams(params: Record<string, any>): void;
|
|
14
22
|
/**
|
|
15
23
|
* 加载当前店铺下所有 schedule
|
|
16
24
|
*
|
|
17
25
|
* @memberof ScheduleModule
|
|
18
26
|
*/
|
|
19
|
-
loadAllSchedule(
|
|
27
|
+
loadAllSchedule(options?: {
|
|
28
|
+
useCache?: boolean;
|
|
29
|
+
}): Promise<void>;
|
|
20
30
|
setScheduleList(list: ScheduleItem[]): void;
|
|
31
|
+
private syncScheduleMap;
|
|
32
|
+
getScheduleList(): ScheduleItem[];
|
|
33
|
+
isScheduleListLoaded(): boolean;
|
|
21
34
|
loadScheduleAvailableDate({ startDate, endDate, custom_page_id, channel, }: LoadScheduleAvailableDateParams): Promise<import("../Date/types").ITime[]>;
|
|
22
35
|
getScheduleListByIds(ids: number[]): ScheduleItem[];
|
|
23
36
|
setAvailabilityScheduleDateList(list: ScheduleAvailabilityDateItem[]): void;
|
|
@@ -35,10 +48,10 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
|
|
|
35
48
|
schedule: any;
|
|
36
49
|
}): boolean;
|
|
37
50
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
* 传入一个时间, 判断改时间是否在schedule 内
|
|
52
|
+
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
42
55
|
static isInScheduleByDate({ date, schedule, }: {
|
|
43
56
|
date: string;
|
|
44
57
|
schedule: any;
|
|
@@ -23,6 +23,7 @@ class ScheduleModule extends _BaseModule.BaseModule {
|
|
|
23
23
|
cacheId;
|
|
24
24
|
openCache = false;
|
|
25
25
|
fatherModule;
|
|
26
|
+
hasLoadedScheduleList = false;
|
|
26
27
|
constructor(name, version) {
|
|
27
28
|
super(name, version);
|
|
28
29
|
}
|
|
@@ -41,10 +42,14 @@ class ScheduleModule extends _BaseModule.BaseModule {
|
|
|
41
42
|
this.store = options?.store;
|
|
42
43
|
if (options.initialState) {
|
|
43
44
|
this.store.scheduleList = options.initialState.scheduleList;
|
|
45
|
+
this.syncScheduleMap();
|
|
44
46
|
this.store.availabilityDateList = options.initialState.availabilityDateList;
|
|
47
|
+
this.hasLoadedScheduleList = Array.isArray(options.initialState.scheduleList);
|
|
45
48
|
} else {
|
|
46
49
|
this.store.scheduleList = [];
|
|
50
|
+
this.store.map = new Map();
|
|
47
51
|
this.store.availabilityDateList = [];
|
|
52
|
+
this.hasLoadedScheduleList = false;
|
|
48
53
|
}
|
|
49
54
|
if (options.otherParams?.cacheId) {
|
|
50
55
|
this.openCache = options.otherParams.openCache;
|
|
@@ -55,21 +60,45 @@ class ScheduleModule extends _BaseModule.BaseModule {
|
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
|
|
63
|
+
/**
|
|
64
|
+
* 更新父级解决方案透传的运行态参数,并刷新 schedule 缓存写入配置。
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* scheduleModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' });
|
|
68
|
+
*/
|
|
69
|
+
updateOtherParams(params) {
|
|
70
|
+
const otherParams = params || {};
|
|
71
|
+
this.openCache = otherParams.openCache ?? false;
|
|
72
|
+
this.cacheId = otherParams.cacheId;
|
|
73
|
+
this.fatherModule = otherParams.fatherModule;
|
|
74
|
+
}
|
|
75
|
+
|
|
58
76
|
/**
|
|
59
77
|
* 加载当前店铺下所有 schedule
|
|
60
78
|
*
|
|
61
79
|
* @memberof ScheduleModule
|
|
62
80
|
*/
|
|
63
|
-
async loadAllSchedule() {
|
|
81
|
+
async loadAllSchedule(options = {}) {
|
|
64
82
|
const scheduleList = await this.request.get(`/schedule`, {
|
|
65
83
|
num: 999
|
|
66
84
|
}, {
|
|
67
|
-
useCache: true
|
|
85
|
+
useCache: options.useCache ?? true
|
|
68
86
|
});
|
|
69
87
|
this.setScheduleList(scheduleList.data?.list || []);
|
|
70
88
|
}
|
|
71
89
|
setScheduleList(list) {
|
|
72
90
|
this.store.scheduleList = list;
|
|
91
|
+
this.syncScheduleMap();
|
|
92
|
+
this.hasLoadedScheduleList = true;
|
|
93
|
+
}
|
|
94
|
+
syncScheduleMap() {
|
|
95
|
+
this.store.map = new Map((this.store.scheduleList || []).map(schedule => [Number(schedule.id), schedule]));
|
|
96
|
+
}
|
|
97
|
+
getScheduleList() {
|
|
98
|
+
return this.store.scheduleList || [];
|
|
99
|
+
}
|
|
100
|
+
isScheduleListLoaded() {
|
|
101
|
+
return this.hasLoadedScheduleList;
|
|
73
102
|
}
|
|
74
103
|
async loadScheduleAvailableDate({
|
|
75
104
|
startDate,
|
|
@@ -94,19 +123,22 @@ class ScheduleModule extends _BaseModule.BaseModule {
|
|
|
94
123
|
custom_page_id,
|
|
95
124
|
channel
|
|
96
125
|
});
|
|
97
|
-
|
|
98
|
-
|
|
126
|
+
const responseData = res.data || {};
|
|
127
|
+
const dateList = Array.isArray(responseData.date_list) ? responseData.date_list : [];
|
|
128
|
+
const otherProductIds = Array.isArray(responseData.other_product_ids) ? responseData.other_product_ids : [];
|
|
129
|
+
this.setAvailabilityScheduleDateList(dateList);
|
|
130
|
+
this.setOtherProductsIds(otherProductIds);
|
|
99
131
|
// 如果没有schedule或者结束日期在今天之前,则所有日期均不可用
|
|
100
|
-
if (!
|
|
132
|
+
if (!dateList.length && !otherProductIds.length || (0, _dayjs.default)(endDate).isBefore((0, _dayjs.default)(), 'day')) {
|
|
101
133
|
return dates;
|
|
102
134
|
}
|
|
103
|
-
if (
|
|
135
|
+
if (otherProductIds.length) {
|
|
104
136
|
// 如果后端有返回 other_product_ids ,意味着有 duration 商品,则今天以及今天以后的日期均可用
|
|
105
137
|
dates.forEach(n => {
|
|
106
138
|
n.status = 'available';
|
|
107
139
|
});
|
|
108
140
|
} else {
|
|
109
|
-
|
|
141
|
+
dateList.forEach(n => {
|
|
110
142
|
const index = dates.findIndex(m => m.date === n.date);
|
|
111
143
|
if (index !== -1) {
|
|
112
144
|
dates[index].status = 'available';
|
|
@@ -117,7 +149,12 @@ class ScheduleModule extends _BaseModule.BaseModule {
|
|
|
117
149
|
return dates;
|
|
118
150
|
}
|
|
119
151
|
getScheduleListByIds(ids) {
|
|
120
|
-
|
|
152
|
+
const idSet = new Set(ids.map(id => String(id)));
|
|
153
|
+
if (this.store.map instanceof Map && this.store.map.size > 0) {
|
|
154
|
+
return ids.map(id => this.store.map.get(Number(id))).filter(Boolean);
|
|
155
|
+
}
|
|
156
|
+
const list = this.store.scheduleList?.filter(n => idSet.has(String(n.id)));
|
|
157
|
+
return list;
|
|
121
158
|
}
|
|
122
159
|
setAvailabilityScheduleDateList(list) {
|
|
123
160
|
this.store.availabilityDateList = list;
|
|
@@ -143,7 +180,6 @@ class ScheduleModule extends _BaseModule.BaseModule {
|
|
|
143
180
|
});
|
|
144
181
|
}
|
|
145
182
|
}
|
|
146
|
-
|
|
147
183
|
/**
|
|
148
184
|
* 传入一个时间, 判断改时间是否在schedule 内
|
|
149
185
|
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
@@ -155,12 +191,11 @@ class ScheduleModule extends _BaseModule.BaseModule {
|
|
|
155
191
|
}) {
|
|
156
192
|
return (0, _getDateIsInSchedule.getDateIsInSchedule)(date, [schedule]);
|
|
157
193
|
}
|
|
158
|
-
|
|
159
194
|
/**
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
195
|
+
* 传入一个时间, 判断改时间是否在schedule 内
|
|
196
|
+
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
197
|
+
* @returns
|
|
198
|
+
*/
|
|
164
199
|
static isInScheduleByDate({
|
|
165
200
|
date,
|
|
166
201
|
schedule
|
|
@@ -55,7 +55,7 @@ class SummaryModule extends _BaseModule.BaseModule {
|
|
|
55
55
|
async getSummary(cartItems) {
|
|
56
56
|
const shopInfo = this.shopStore.get('core')?.core?.shop || {};
|
|
57
57
|
const scheduleModule = this.core.getModule('appointmentBooking_schedule');
|
|
58
|
-
const needScheduleIds =
|
|
58
|
+
const needScheduleIds = this.store.surchargeList?.map(item => item.available_schedule_ids).flat();
|
|
59
59
|
const scheduleList = scheduleModule?.getScheduleListByIds(needScheduleIds);
|
|
60
60
|
const scheduleById = {};
|
|
61
61
|
if (Array.isArray(scheduleList)) {
|
|
@@ -104,7 +104,7 @@ class SummaryModule extends _BaseModule.BaseModule {
|
|
|
104
104
|
getSurchargeforUtils(items) {
|
|
105
105
|
// const surchargeList = this.store.surchargeList;
|
|
106
106
|
const scheduleModule = this.core.getModule('appointmentBooking_schedule');
|
|
107
|
-
const needScheduleIds =
|
|
107
|
+
const needScheduleIds = this.store.surchargeList?.map(item => item.available_schedule_ids).flat();
|
|
108
108
|
const scheduleList = scheduleModule?.getScheduleListByIds(needScheduleIds);
|
|
109
109
|
const scheduleById = {};
|
|
110
110
|
if (Array.isArray(scheduleList)) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { SurchargeListItem, SurchargeListModuleAPI, SurchargeListQuery } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export declare class SurchargeListModule extends BaseModule implements Module, SurchargeListModuleAPI {
|
|
6
|
+
protected defaultName: string;
|
|
7
|
+
protected defaultVersion: string;
|
|
8
|
+
private request;
|
|
9
|
+
private store;
|
|
10
|
+
private loadingPromises;
|
|
11
|
+
private requestVersion;
|
|
12
|
+
constructor(name?: string, version?: string);
|
|
13
|
+
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
14
|
+
private resolveChannel;
|
|
15
|
+
getSurchargeList(query?: SurchargeListQuery): Promise<SurchargeListItem[]>;
|
|
16
|
+
refreshSurchargeList(query?: SurchargeListQuery): Promise<SurchargeListItem[]>;
|
|
17
|
+
private loadSurchargeList;
|
|
18
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
SurchargeListModule: true
|
|
8
|
+
};
|
|
9
|
+
exports.SurchargeListModule = void 0;
|
|
10
|
+
var _BaseModule = require("../BaseModule");
|
|
11
|
+
var _types = require("./types");
|
|
12
|
+
Object.keys(_types).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _types[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
const DEFAULT_SURCHARGE_CHANNEL = 'online-store';
|
|
24
|
+
class SurchargeListModule extends _BaseModule.BaseModule {
|
|
25
|
+
defaultName = 'surchargeList';
|
|
26
|
+
defaultVersion = '1.0.0';
|
|
27
|
+
request;
|
|
28
|
+
store;
|
|
29
|
+
loadingPromises = new Map();
|
|
30
|
+
requestVersion = 0;
|
|
31
|
+
constructor(name, version) {
|
|
32
|
+
super(name, version);
|
|
33
|
+
}
|
|
34
|
+
async initialize(core, options) {
|
|
35
|
+
this.core = core;
|
|
36
|
+
this.store = options.store;
|
|
37
|
+
this.request = this.core.getPlugin('request');
|
|
38
|
+
const hasInitialSurchargeList = Array.isArray(options.initialState?.surchargeList);
|
|
39
|
+
this.store.surchargeList = hasInitialSurchargeList ? options.initialState?.surchargeList : [];
|
|
40
|
+
this.store.channel = options.initialState?.channel || options.otherParams?.channel || DEFAULT_SURCHARGE_CHANNEL;
|
|
41
|
+
this.store.isLoaded = Boolean(options.initialState?.isLoaded) || hasInitialSurchargeList;
|
|
42
|
+
if (!this.request) {
|
|
43
|
+
throw new Error('SurchargeListModule 需要 request 插件支持');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
resolveChannel(query) {
|
|
47
|
+
return query?.channel || DEFAULT_SURCHARGE_CHANNEL;
|
|
48
|
+
}
|
|
49
|
+
async getSurchargeList(query) {
|
|
50
|
+
const channel = this.resolveChannel(query);
|
|
51
|
+
if (this.store.isLoaded && this.store.channel === channel) {
|
|
52
|
+
return this.store.surchargeList;
|
|
53
|
+
}
|
|
54
|
+
const loadingPromise = this.loadingPromises.get(channel);
|
|
55
|
+
if (loadingPromise) return loadingPromise;
|
|
56
|
+
const nextPromise = this.loadSurchargeList(channel);
|
|
57
|
+
this.loadingPromises.set(channel, nextPromise);
|
|
58
|
+
return nextPromise;
|
|
59
|
+
}
|
|
60
|
+
async refreshSurchargeList(query) {
|
|
61
|
+
const channel = this.resolveChannel(query);
|
|
62
|
+
const nextPromise = this.loadSurchargeList(channel);
|
|
63
|
+
this.loadingPromises.set(channel, nextPromise);
|
|
64
|
+
return nextPromise;
|
|
65
|
+
}
|
|
66
|
+
async loadSurchargeList(channel) {
|
|
67
|
+
const currentRequestVersion = ++this.requestVersion;
|
|
68
|
+
try {
|
|
69
|
+
const surchargeList = await this.request.get('/order/custom-surcharge/available/v2', {
|
|
70
|
+
channel,
|
|
71
|
+
is_assemble_product_data: 1,
|
|
72
|
+
is_assemble_schedule_data: 1,
|
|
73
|
+
with: ['relationSchedule']
|
|
74
|
+
});
|
|
75
|
+
const nextSurchargeList = surchargeList?.data || [];
|
|
76
|
+
if (currentRequestVersion === this.requestVersion) {
|
|
77
|
+
this.store.surchargeList = nextSurchargeList;
|
|
78
|
+
this.store.channel = channel;
|
|
79
|
+
this.store.isLoaded = true;
|
|
80
|
+
}
|
|
81
|
+
return nextSurchargeList;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.warn('[SurchargeListModule] 加载附加费配置失败', error);
|
|
84
|
+
if (currentRequestVersion === this.requestVersion) {
|
|
85
|
+
this.store.surchargeList = [];
|
|
86
|
+
this.store.channel = channel;
|
|
87
|
+
this.store.isLoaded = true;
|
|
88
|
+
}
|
|
89
|
+
return [];
|
|
90
|
+
} finally {
|
|
91
|
+
this.loadingPromises.delete(channel);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.SurchargeListModule = SurchargeListModule;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SurchargeListItem {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
export interface SurchargeListState {
|
|
5
|
+
surchargeList: SurchargeListItem[];
|
|
6
|
+
isLoaded: boolean;
|
|
7
|
+
channel?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SurchargeListQuery {
|
|
10
|
+
channel?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SurchargeListModuleAPI {
|
|
13
|
+
getSurchargeList(query?: SurchargeListQuery): Promise<SurchargeListItem[]>;
|
|
14
|
+
refreshSurchargeList(query?: SurchargeListQuery): Promise<SurchargeListItem[]>;
|
|
15
|
+
}
|
package/lib/modules/index.d.ts
CHANGED
|
@@ -12,8 +12,11 @@ export * from './Resource';
|
|
|
12
12
|
export * from './Step';
|
|
13
13
|
export * from './Summary';
|
|
14
14
|
export * from './SalesSummary';
|
|
15
|
+
export * from './SurchargeList';
|
|
15
16
|
export * from './Schedule';
|
|
16
17
|
export * from './Quotation';
|
|
17
18
|
export * from './ScanOrderLogger';
|
|
18
19
|
export * from './OpenData';
|
|
20
|
+
export * from './BookingContext';
|
|
19
21
|
export * from './Holder';
|
|
22
|
+
export * from './ResourcePlanner';
|
package/lib/modules/index.js
CHANGED
|
@@ -157,6 +157,17 @@ Object.keys(_SalesSummary).forEach(function (key) {
|
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
});
|
|
160
|
+
var _SurchargeList = require("./SurchargeList");
|
|
161
|
+
Object.keys(_SurchargeList).forEach(function (key) {
|
|
162
|
+
if (key === "default" || key === "__esModule") return;
|
|
163
|
+
if (key in exports && exports[key] === _SurchargeList[key]) return;
|
|
164
|
+
Object.defineProperty(exports, key, {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () {
|
|
167
|
+
return _SurchargeList[key];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
160
171
|
var _Schedule = require("./Schedule");
|
|
161
172
|
Object.keys(_Schedule).forEach(function (key) {
|
|
162
173
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -201,6 +212,17 @@ Object.keys(_OpenData).forEach(function (key) {
|
|
|
201
212
|
}
|
|
202
213
|
});
|
|
203
214
|
});
|
|
215
|
+
var _BookingContext = require("./BookingContext");
|
|
216
|
+
Object.keys(_BookingContext).forEach(function (key) {
|
|
217
|
+
if (key === "default" || key === "__esModule") return;
|
|
218
|
+
if (key in exports && exports[key] === _BookingContext[key]) return;
|
|
219
|
+
Object.defineProperty(exports, key, {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function () {
|
|
222
|
+
return _BookingContext[key];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
});
|
|
204
226
|
var _Holder = require("./Holder");
|
|
205
227
|
Object.keys(_Holder).forEach(function (key) {
|
|
206
228
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -211,4 +233,15 @@ Object.keys(_Holder).forEach(function (key) {
|
|
|
211
233
|
return _Holder[key];
|
|
212
234
|
}
|
|
213
235
|
});
|
|
236
|
+
});
|
|
237
|
+
var _ResourcePlanner = require("./ResourcePlanner");
|
|
238
|
+
Object.keys(_ResourcePlanner).forEach(function (key) {
|
|
239
|
+
if (key === "default" || key === "__esModule") return;
|
|
240
|
+
if (key in exports && exports[key] === _ResourcePlanner[key]) return;
|
|
241
|
+
Object.defineProperty(exports, key, {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return _ResourcePlanner[key];
|
|
245
|
+
}
|
|
246
|
+
});
|
|
214
247
|
});
|
package/lib/plugins/app.d.ts
CHANGED