@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
|
@@ -13,6 +13,7 @@ exports.collectLinkProductIdsFromReservationRules = collectLinkProductIdsFromRes
|
|
|
13
13
|
exports.computeResourceIsFull = computeResourceIsFull;
|
|
14
14
|
exports.createEmptySummary = createEmptySummary;
|
|
15
15
|
exports.extractStrategyModelIdsFromTableConfig = extractStrategyModelIdsFromTableConfig;
|
|
16
|
+
exports.filterProductsForScanOrderMore = filterProductsForScanOrderMore;
|
|
16
17
|
exports.findReservationRuleProductByResourceId = findReservationRuleProductByResourceId;
|
|
17
18
|
exports.getProductIdentityIndex = getProductIdentityIndex;
|
|
18
19
|
exports.getSafeProductNum = getSafeProductNum;
|
|
@@ -36,6 +37,7 @@ exports.toPriceString = toPriceString;
|
|
|
36
37
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
37
38
|
var _decimal = _interopRequireDefault(require("decimal.js"));
|
|
38
39
|
var _utils = require("../../modules/Order/utils");
|
|
40
|
+
var _manualProductDiscount = require("../../modules/Order/utils/manualProductDiscount");
|
|
39
41
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
42
|
/**
|
|
41
43
|
* 构建金额全为 0 的空 summary。
|
|
@@ -52,10 +54,14 @@ function createEmptySummary() {
|
|
|
52
54
|
shipping_tax_fee: '0.00',
|
|
53
55
|
tax_fee: '0.00',
|
|
54
56
|
surcharge_fee: '0.00',
|
|
57
|
+
surcharges: [],
|
|
55
58
|
discount_amount: '0.00',
|
|
56
59
|
deposit_amount: '0.00',
|
|
57
60
|
expect_amount: '0.00',
|
|
58
61
|
total_amount: '0.00',
|
|
62
|
+
total_refund_amount: '0.00',
|
|
63
|
+
customer_paid_amount: '0.00',
|
|
64
|
+
order_paid_amount: '0.00',
|
|
59
65
|
amount_gap: '0.00',
|
|
60
66
|
rounding_amount: '0.00',
|
|
61
67
|
pay_service_charge_amount: '0.00'
|
|
@@ -154,6 +160,11 @@ function toPriceString(value, fallback = '0.00') {
|
|
|
154
160
|
function buildProductKey(productId, productVariantId) {
|
|
155
161
|
return `${productId}_${productVariantId}`;
|
|
156
162
|
}
|
|
163
|
+
|
|
164
|
+
/** 加餐接口只提交本次新增商品,过滤掉首单预约占位规则行。 */
|
|
165
|
+
function filterProductsForScanOrderMore(products = []) {
|
|
166
|
+
return products.filter(product => product.metadata?.is_rule !== true);
|
|
167
|
+
}
|
|
157
168
|
function getTopLevelProductId(product) {
|
|
158
169
|
const rawProductId = product.product_id ?? product.id;
|
|
159
170
|
const productId = Number(rawProductId);
|
|
@@ -358,13 +369,13 @@ function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
|
|
|
358
369
|
function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
359
370
|
const optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
|
|
360
371
|
const normalizedOpts = optArr.map(item => ({
|
|
361
|
-
|
|
372
|
+
option_group_item_id: Number(item?.option_group_item_id) || 0,
|
|
362
373
|
option_group_id: Number(item?.option_group_id) || 0,
|
|
363
374
|
num: typeof item?.num === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
364
|
-
price: String(item?.price ?? '')
|
|
375
|
+
price: String(item?.add_price ?? item?.price ?? '')
|
|
365
376
|
})).sort((p, q) => {
|
|
366
|
-
if (p.
|
|
367
|
-
return p.
|
|
377
|
+
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
378
|
+
return p.option_group_item_id - q.option_group_item_id;
|
|
368
379
|
}
|
|
369
380
|
if (p.option_group_id !== q.option_group_id) return p.option_group_id - q.option_group_id;
|
|
370
381
|
if (p.num !== q.num) return p.num - q.num;
|
|
@@ -385,15 +396,15 @@ function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
385
396
|
|
|
386
397
|
/**
|
|
387
398
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
388
|
-
* 与显式 `
|
|
399
|
+
* 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
|
|
389
400
|
*/
|
|
390
401
|
function isSkuOnlyDeleteIdentity(x) {
|
|
391
|
-
if (x.identity_key) return false;
|
|
392
|
-
return !('
|
|
402
|
+
if (x.unique_identification_number || x.identity_key) return false;
|
|
403
|
+
return !('product_sku' in x) && !('product_bundle' in x);
|
|
393
404
|
}
|
|
394
405
|
function fingerprintForIdentityWithOptionKeys(x) {
|
|
395
406
|
const row = x;
|
|
396
|
-
const opts = '
|
|
407
|
+
const opts = 'product_sku' in row ? (0, _utils.getProductSkuOptions)(row) : [];
|
|
397
408
|
const buds = 'product_bundle' in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
|
|
398
409
|
return buildProductLineFingerprint(opts, buds);
|
|
399
410
|
}
|
|
@@ -410,9 +421,11 @@ function fingerprintForIdentityWithOptionKeys(x) {
|
|
|
410
421
|
*/
|
|
411
422
|
function isIdentityMatch(a, b) {
|
|
412
423
|
if (a.product_id !== b.product_id || a.product_variant_id !== b.product_variant_id) return false;
|
|
413
|
-
const
|
|
414
|
-
const
|
|
415
|
-
|
|
424
|
+
const aUid = a.metadata?.unique_identification_number ?? a.unique_identification_number ?? a.identity_key;
|
|
425
|
+
const bUid = b.metadata?.unique_identification_number ?? b.unique_identification_number ?? b.identity_key;
|
|
426
|
+
const aHasKey = typeof aUid === 'string' && aUid.length > 0;
|
|
427
|
+
const bHasKey = typeof bUid === 'string' && bUid.length > 0;
|
|
428
|
+
if (aHasKey && bHasKey) return aUid === bUid;
|
|
416
429
|
if (isSkuOnlyDeleteIdentity(a) || isSkuOnlyDeleteIdentity(b)) return true;
|
|
417
430
|
return fingerprintForIdentityWithOptionKeys(a) === fingerprintForIdentityWithOptionKeys(b);
|
|
418
431
|
}
|
|
@@ -453,17 +466,64 @@ function normalizeOrderProduct(product) {
|
|
|
453
466
|
};
|
|
454
467
|
// 不透明 identity 契约:每条订单行必须带 identity_key。
|
|
455
468
|
// 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
|
|
456
|
-
const resolvedIdentityKey = product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : (0, _utils.createUuidV4)();
|
|
457
|
-
|
|
458
|
-
|
|
469
|
+
const resolvedIdentityKey = product.metadata?.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : (0, _utils.createUuidV4)();
|
|
470
|
+
metadata.unique_identification_number = resolvedIdentityKey;
|
|
471
|
+
const priceOverride = metadata.price_override;
|
|
472
|
+
const originOtherBundle = metadata.origin?._extend?.other?.bundle;
|
|
473
|
+
let bundleInput = product.product_bundle || [];
|
|
474
|
+
if (priceOverride !== undefined && priceOverride !== null && priceOverride !== '' && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
|
|
475
|
+
const priceById = new Map();
|
|
476
|
+
originOtherBundle.forEach(item => {
|
|
477
|
+
if (item?.id == null) return;
|
|
478
|
+
const unit = item.price ?? item.bundle_selling_price;
|
|
479
|
+
if (unit === undefined || unit === null) return;
|
|
480
|
+
priceById.set(String(item.id), String(unit));
|
|
481
|
+
});
|
|
482
|
+
const base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
|
|
483
|
+
bundleInput = base.map(item => {
|
|
484
|
+
const unit = priceById.get(String(item?.id));
|
|
485
|
+
if (unit === undefined) return item;
|
|
486
|
+
return {
|
|
487
|
+
...item,
|
|
488
|
+
price: unit,
|
|
489
|
+
bundle_selling_price: unit
|
|
490
|
+
};
|
|
491
|
+
});
|
|
459
492
|
}
|
|
460
|
-
const normalizedBundle =
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
493
|
+
const normalizedBundle = bundleInput.map(item => {
|
|
494
|
+
const magnitudeSource = {
|
|
495
|
+
...item,
|
|
496
|
+
// 计算 markdown 净额时,只把真实毛价交给 helper;若只有 bundle_selling_price,
|
|
497
|
+
// helper 会按历史净额兜底,避免 option 二次扣减。
|
|
498
|
+
price: item.price ?? item.custom_price
|
|
499
|
+
};
|
|
500
|
+
const normalizedItem = {
|
|
501
|
+
...item,
|
|
502
|
+
bundle_id: item.bundle_id ?? item.id,
|
|
503
|
+
bundle_product_id: item.bundle_product_id ?? item._bundle_product_id,
|
|
504
|
+
bundle_group_id: item.bundle_group_id ?? item.group_id,
|
|
505
|
+
// price 保留毛价(markdown 仍为 5),由 price_type 决定符号。
|
|
506
|
+
price: item.price ?? item.custom_price ?? item.bundle_selling_price ?? '0.00',
|
|
507
|
+
price_type: item.price_type ?? item.custom_price_type ?? '',
|
|
508
|
+
price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ''
|
|
509
|
+
};
|
|
510
|
+
// bundle_selling_price 落「正净额」:markdown = |price| − Σoptions;markup/原价维持原值。
|
|
511
|
+
normalizedItem.bundle_selling_price = (0, _utils.getBundleSellingMagnitude)(magnitudeSource).toFixed(2);
|
|
512
|
+
if (normalizedItem.price_type === 'markdown' && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
|
|
513
|
+
normalizedItem.custom_price = normalizedItem.custom_price ?? normalizedItem.price;
|
|
514
|
+
normalizedItem.price = normalizedItem.bundle_selling_price;
|
|
515
|
+
}
|
|
516
|
+
if ((normalizedItem.price_type === 'markdown' || normalizedItem.price_type === 'markup') && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
|
|
517
|
+
delete normalizedItem.original_total;
|
|
518
|
+
}
|
|
519
|
+
return normalizedItem;
|
|
520
|
+
});
|
|
521
|
+
const normalizedOptions = (0, _utils.normalizeProductSkuOptions)(product.product_sku?.option);
|
|
466
522
|
const optionSum = (0, _utils.sumOptionUnitPrice)(normalizedOptions);
|
|
523
|
+
const productSku = {
|
|
524
|
+
...(0, _utils.ensureProductSku)(product),
|
|
525
|
+
option: normalizedOptions
|
|
526
|
+
};
|
|
467
527
|
|
|
468
528
|
// 1) 解析 source_product_price。
|
|
469
529
|
// 优先级:
|
|
@@ -543,22 +603,34 @@ function normalizeOrderProduct(product) {
|
|
|
543
603
|
bundle: normalizedBundle,
|
|
544
604
|
useOriginalBundle: true
|
|
545
605
|
});
|
|
606
|
+
const finalOriginalPrice = (0, _utils.resolveManualOverrideLineOriginalPrice)({
|
|
607
|
+
num: product.num,
|
|
608
|
+
metadata,
|
|
609
|
+
lineOriginalPrice: product.original_price
|
|
610
|
+
}, composedOriginalPrice);
|
|
611
|
+
const hasManualProductDiscount = (product.discount_list || []).some(item => item?.type === 'product');
|
|
612
|
+
const manualOriginalPrice = hasManualProductDiscount && product.original_price != null ? String(product.original_price) : finalOriginalPrice;
|
|
613
|
+
const discountList = (0, _manualProductDiscount.ensureManualProductDiscountList)({
|
|
614
|
+
discountList: product.discount_list,
|
|
615
|
+
metadata,
|
|
616
|
+
originalPrice: manualOriginalPrice,
|
|
617
|
+
sellingPrice: composedSellingPrice,
|
|
618
|
+
quantity: getSafeProductNum(product.num)
|
|
619
|
+
});
|
|
546
620
|
return {
|
|
547
621
|
order_detail_id: product.order_detail_id || null,
|
|
548
622
|
product_id: product.product_id,
|
|
549
623
|
num: getSafeProductNum(product.num),
|
|
550
624
|
product_variant_id: product.product_variant_id,
|
|
551
|
-
|
|
552
|
-
product_option_item: normalizedOptions,
|
|
625
|
+
product_sku: productSku,
|
|
553
626
|
selling_price: composedSellingPrice,
|
|
554
|
-
original_price:
|
|
627
|
+
original_price: manualOriginalPrice,
|
|
555
628
|
tax_fee: product.tax_fee || '0.00',
|
|
556
629
|
is_charge_tax: product.is_charge_tax ?? 0,
|
|
557
|
-
discount_list:
|
|
630
|
+
discount_list: discountList,
|
|
558
631
|
product_bundle: normalizedBundle,
|
|
559
632
|
metadata,
|
|
560
|
-
note: product.note != null ? String(product.note) : ''
|
|
561
|
-
_origin: product._origin
|
|
633
|
+
note: product.note != null ? String(product.note) : ''
|
|
562
634
|
};
|
|
563
635
|
}
|
|
564
636
|
|
|
@@ -365,7 +365,7 @@ class ShopDiscountImpl extends _BaseModule.BaseModule {
|
|
|
365
365
|
this.setDiscountList(newDiscountList || []);
|
|
366
366
|
this.store.originalDiscountList = newDiscountList || [];
|
|
367
367
|
this.setProductList(newProductList || []);
|
|
368
|
-
if (this.isWalkIn() && resultDiscountList.length && this.options.otherParams?.platform === 'shop') {
|
|
368
|
+
if (this.isWalkIn() && resultDiscountList.length && this.options.otherParams?.platform === 'shop' && !((resultDiscountList[0].customer_id || 1) === 1)) {
|
|
369
369
|
await this.getCustomerWallet(resultDiscountList[0].customer_id);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
@@ -524,7 +524,7 @@ class ShopDiscountImpl extends _BaseModule.BaseModule {
|
|
|
524
524
|
// return
|
|
525
525
|
// }
|
|
526
526
|
|
|
527
|
-
const
|
|
527
|
+
const prepareConfigResult = await this.store.discount?.loadPrepareConfig({
|
|
528
528
|
customer_id: customerId,
|
|
529
529
|
action: orderId ? 'edit' : 'create',
|
|
530
530
|
with_good_pass: 1,
|
|
@@ -535,7 +535,7 @@ class ShopDiscountImpl extends _BaseModule.BaseModule {
|
|
|
535
535
|
order_id: orderId
|
|
536
536
|
} : {})
|
|
537
537
|
});
|
|
538
|
-
const goodPassList =
|
|
538
|
+
const goodPassList = prepareConfigResult?.discountList || [];
|
|
539
539
|
const scanDiscount = this.getDiscountList()?.filter(item => item.isScan);
|
|
540
540
|
|
|
541
541
|
// goodPassList 里可能有 scanDiscount 重合的部分,goodPassList 需要剔除
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { Module } from '../../types';
|
|
2
|
+
import type { ProductData } from '../../modules';
|
|
3
|
+
import type { OpenDataConfig } from '../../modules/OpenData';
|
|
4
|
+
import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
|
|
5
|
+
import type { ProductListLoadProductsParams } from '../../modules/ProductList';
|
|
6
|
+
import type { ResourcePlannerAssignment, ResourcePlannerAssignableSlotResult, ResourcePlannerEvent, ResourcePlannerProduct, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerResource, ResourcePlannerSelectionPatch, ResourcePlannerSnapshot, ResourcePlannerValidationResult } from '../../modules/ResourcePlanner';
|
|
7
|
+
import type { UnifiedBookingSalesCommitPlannerSelectionParams, UnifiedBookingSalesCommitResult, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadPlannerContextParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesStagePlannerProductsParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
8
|
+
import { BookingTicket } from '../BookingTicket';
|
|
9
|
+
export * from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Converts Rules/Order discount internals into a small UI-facing diagnostic. The result keeps
|
|
12
|
+
* candidate-card state separate from line-level applications: a selected card is not proof that
|
|
13
|
+
* it actually discounted a planner product.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildPlannerDiscountResult(params: {
|
|
16
|
+
customerId: number | null;
|
|
17
|
+
discountList: Record<string, any>[];
|
|
18
|
+
products: Record<string, any>[];
|
|
19
|
+
summaryBefore?: unknown;
|
|
20
|
+
summaryAfter?: unknown;
|
|
21
|
+
status: UnifiedBookingSalesDiscountResult['status'];
|
|
22
|
+
preferredDiscountId?: number | string;
|
|
23
|
+
preferredDiscountFound?: boolean;
|
|
24
|
+
}): UnifiedBookingSalesDiscountResult;
|
|
25
|
+
/** Converts a ProductList record into the pure input shape consumed by ResourcePlanner. */
|
|
26
|
+
export declare function normalizeProductForPlanner(product: ProductData | Record<string, any>): ResourcePlannerProduct;
|
|
27
|
+
/**
|
|
28
|
+
* Materializes resource work windows locally from v2's schedule ids, then keeps its flat
|
|
29
|
+
* event_list as planner events. This deliberately avoids the older API's times -> event_list
|
|
30
|
+
* response nesting and lets one resource response serve any requested date range.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildPlannerResourcesFromV2(params: {
|
|
33
|
+
rawResources: Record<string, any>[];
|
|
34
|
+
scheduleList: ScheduleItem[];
|
|
35
|
+
dateRange?: ResourcePlannerQuery['dateRange'];
|
|
36
|
+
}): {
|
|
37
|
+
resources: ResourcePlannerResource[];
|
|
38
|
+
externalEvents: ResourcePlannerEvent[];
|
|
39
|
+
};
|
|
40
|
+
/** Combines URL-locked resources with every resource referenced by the selected products. */
|
|
41
|
+
export declare function collectPlannerResourceIds(products: ResourcePlannerProduct[], explicitResourceIds?: Array<number | string>): Array<number | string>;
|
|
42
|
+
/** Convenience wrapper for the usual one-resource booking case. */
|
|
43
|
+
export declare function buildBookingFromAssignment(params: {
|
|
44
|
+
assignment: ResourcePlannerAssignment;
|
|
45
|
+
product: ResourcePlannerProduct;
|
|
46
|
+
}): Record<string, any>;
|
|
47
|
+
/**
|
|
48
|
+
* Converts all resources needed by one product/time interval into the one booking expected by
|
|
49
|
+
* OrderModule. Callers must group assignments before this function so a multi-form booking does
|
|
50
|
+
* not become several competing bookings.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildBookingFromAssignments(params: {
|
|
53
|
+
assignments: ResourcePlannerAssignment[];
|
|
54
|
+
product: ResourcePlannerProduct;
|
|
55
|
+
}): Record<string, any>;
|
|
56
|
+
/** Builds the exact identity BaseSales needs to remove only this solution's order lines. */
|
|
57
|
+
export declare function buildPlannerLineIdentity(product: Record<string, any>): Record<string, any>;
|
|
58
|
+
export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
59
|
+
protected defaultName: string;
|
|
60
|
+
protected defaultVersion: string;
|
|
61
|
+
protected store: UnifiedBookingSalesState;
|
|
62
|
+
private unifiedProductCatalog;
|
|
63
|
+
private openDataTarget;
|
|
64
|
+
private loadOpenDataInFlight;
|
|
65
|
+
private loadOpenDataInFlightTarget;
|
|
66
|
+
/**
|
|
67
|
+
* Kiosk 不能把已收款订单留在本地等待重试:默认直接等待云端 checkout。
|
|
68
|
+
* 兼容仍需要 WebPOS 待同步模式的入口可显式传 checkoutSyncTaskEnabled: true。
|
|
69
|
+
*/
|
|
70
|
+
protected shouldUseCheckoutSyncTask(): boolean;
|
|
71
|
+
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
72
|
+
protected getDefaultCheckoutSmallTicketDataFlag(): number;
|
|
73
|
+
protected getRegisteredModuleNames(): readonly string[];
|
|
74
|
+
protected createSubModule(moduleName: string): Module | null;
|
|
75
|
+
/**
|
|
76
|
+
* Loads OpenData without borrowing BookingTicket. Cache ownership is tied to the exact
|
|
77
|
+
* business/channel target so a reused solution instance cannot leak another entry's menus.
|
|
78
|
+
*/
|
|
79
|
+
loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
|
|
80
|
+
getOpenData(): Promise<OpenDataConfig | null>;
|
|
81
|
+
/**
|
|
82
|
+
* Loads the product catalog used by both UI and Planner. Schedule data is requested with each
|
|
83
|
+
* product because session products carry their fixed intervals there.
|
|
84
|
+
*/
|
|
85
|
+
loadProducts(params?: ProductListLoadProductsParams, options?: {
|
|
86
|
+
callback?: (result: any) => void;
|
|
87
|
+
subscriberId?: string;
|
|
88
|
+
}): Promise<ProductData[]>;
|
|
89
|
+
/** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
|
|
90
|
+
loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Implements the date-first product pool: the chosen date's product ids plus globally sellable
|
|
93
|
+
* other_product_ids. If a batch product query is unexpectedly empty, retry one id at a time so
|
|
94
|
+
* a partial backend incompatibility does not hide the entire date's catalog.
|
|
95
|
+
*/
|
|
96
|
+
loadProductsByScheduleDate(params: UnifiedBookingSalesLoadProductsByScheduleDateParams): Promise<ProductData[]>;
|
|
97
|
+
/** Returns a copy so UI consumers cannot accidentally mutate the solution's product cache. */
|
|
98
|
+
getProductCatalog(): {
|
|
99
|
+
products: ProductData[];
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Read-only compatibility view for salesSdk skins. It reconnects a booking to its product but
|
|
103
|
+
* must not be used to mutate tempOrder; all writes go through BaseSales / planner APIs.
|
|
104
|
+
*/
|
|
105
|
+
getCart(): {
|
|
106
|
+
items: any[];
|
|
107
|
+
bookings: any[];
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Loads the current customer's product coupons and discount cards after planner lines exist,
|
|
111
|
+
* then optionally lets the existing Rules engine select the best valid combination. This is a
|
|
112
|
+
* diagnostic boundary for new booking skins: no pricing logic is duplicated in the planner.
|
|
113
|
+
*/
|
|
114
|
+
applyPlannerDiscounts(params?: UnifiedBookingSalesApplyPlannerDiscountsParams): Promise<UnifiedBookingSalesDiscountResult>;
|
|
115
|
+
/** ResourcePlanner is a required child module; fail early instead of producing partial availability. */
|
|
116
|
+
private getPlanner;
|
|
117
|
+
private buildUnifiedOrderProduct;
|
|
118
|
+
/** Replacing a staged selection is idempotent and never removes unrelated cart lines. */
|
|
119
|
+
private removeExistingStagedLines;
|
|
120
|
+
private stageProducts;
|
|
121
|
+
/**
|
|
122
|
+
* Adds the current product choice to an otherwise clean planner cart without creating bookings.
|
|
123
|
+
* This separates "what the customer wants" from the later time/resource confirmation step.
|
|
124
|
+
*/
|
|
125
|
+
stagePlannerProducts(params: UnifiedBookingSalesStagePlannerProductsParams): Promise<Record<string, any> | null>;
|
|
126
|
+
/**
|
|
127
|
+
* Adds ordinary retail products without asking ResourcePlanner for booking facts.
|
|
128
|
+
* Its staged lines have separate ownership so planner and retail skins can coexist safely.
|
|
129
|
+
*/
|
|
130
|
+
stageRetailProducts(params: UnifiedBookingSalesStageRetailProductsParams): Promise<Record<string, any> | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Adds one retail line without replacing the cart's existing retail selection.
|
|
133
|
+
* This is intentionally separate from stageRetailProducts(), whose contract is
|
|
134
|
+
* "replace the staged selection" for demo and wizard-like callers.
|
|
135
|
+
*/
|
|
136
|
+
addRetailProduct(params: UnifiedBookingSalesAddRetailProductParams): Promise<Record<string, any>[]>;
|
|
137
|
+
/** Normalizes caller-provided products or loads the catalog before any resource request is made. */
|
|
138
|
+
private loadPlannerProducts;
|
|
139
|
+
/** Loads the reusable store-level schedule catalog on demand. */
|
|
140
|
+
private ensurePlannerSchedulesLoaded;
|
|
141
|
+
/**
|
|
142
|
+
* v2 resources reference schedule ids rather than expanded work times. Refresh once when the
|
|
143
|
+
* cached schedule catalog cannot materialize all referenced ids.
|
|
144
|
+
*/
|
|
145
|
+
private ensurePlannerSchedulesForResources;
|
|
146
|
+
/**
|
|
147
|
+
* Fetches resource metadata plus flat occupied events. Work windows are intentionally derived
|
|
148
|
+
* locally in buildPlannerResourcesFromV2 from /schedule, rather than requested from the legacy
|
|
149
|
+
* resource dates endpoint.
|
|
150
|
+
*/
|
|
151
|
+
private fetchPlannerResourcesV2;
|
|
152
|
+
/**
|
|
153
|
+
* Resolves the Planner context in precedence order: explicit normalized context, test raw data,
|
|
154
|
+
* then the v2 resource API inferred from selected product requirements and any URL lock.
|
|
155
|
+
*/
|
|
156
|
+
private loadPlannerResources;
|
|
157
|
+
/**
|
|
158
|
+
* Boundary between IO and pure planning. Once this returns, all later availability/slot calls
|
|
159
|
+
* operate on the ResourcePlanner snapshot and do not issue resource requests themselves.
|
|
160
|
+
*/
|
|
161
|
+
loadPlannerContext(params?: UnifiedBookingSalesLoadPlannerContextParams): Promise<ResourcePlannerSnapshot>;
|
|
162
|
+
/** Returns cells, date summaries and a derived grid; cells are continuous ranges, not UI slots. */
|
|
163
|
+
queryPlannerAvailability(query?: ResourcePlannerQuery): Promise<ResourcePlannerProjection>;
|
|
164
|
+
/** Turns compatible availability ranges into user-selectable intervals and ready-to-commit assignments. */
|
|
165
|
+
resolveAssignableSlots(query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
|
|
166
|
+
/** Stores a UI choice only. It is deliberately side-effect free with respect to tempOrder. */
|
|
167
|
+
setPlannerSelection(patch: ResourcePlannerSelectionPatch): ResourcePlannerSnapshot;
|
|
168
|
+
/**
|
|
169
|
+
* Legacy-friendly automatic assignment for already fixed intervals. Duration products without a
|
|
170
|
+
* start time intentionally remain unresolved; callers offering a picker should use slots.
|
|
171
|
+
*/
|
|
172
|
+
autoAssignPlanner(query?: ResourcePlannerQuery): Promise<ResourcePlannerSnapshot>;
|
|
173
|
+
/** Rechecks remote events, capacity and conflicts among the current selection before committing. */
|
|
174
|
+
validatePlannerSelection(): ResourcePlannerValidationResult;
|
|
175
|
+
/** Read-only snapshot for UI diagnostics and progressive flow steps. */
|
|
176
|
+
getPlannerSnapshot(): ResourcePlannerSnapshot;
|
|
177
|
+
/**
|
|
178
|
+
* Validates then writes assignments to tempOrder. Real order submission is opt-in so UI callers
|
|
179
|
+
* can safely preview the cart; pass submitAfterCommit only after an explicit confirmation.
|
|
180
|
+
*/
|
|
181
|
+
commitPlannerSelection(params?: UnifiedBookingSalesCommitPlannerSelectionParams): Promise<UnifiedBookingSalesCommitResult>;
|
|
182
|
+
}
|
|
183
|
+
export declare const UnifiedBookingSales: typeof UnifiedBookingSalesImpl;
|