@pisell/pisellos 0.0.568 → 0.0.570
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/effects/index.d.ts +2 -2
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +3 -3
- package/dist/model/strategy/adapter/itemRule/type.d.ts +6 -6
- package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
- package/dist/model/strategy/adapter/promotion/type.d.ts +5 -5
- package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
- package/dist/model/strategy/type.d.ts +1 -1
- 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 +3 -1
- package/dist/modules/Discount/index.d.ts +2 -1
- package/dist/modules/Discount/index.js +37 -9
- package/dist/modules/Discount/types.d.ts +2 -1
- package/dist/modules/Holder/types.d.ts +1 -1
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +36 -16
- package/dist/modules/OpenData/types.d.ts +1 -1
- 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 +47 -23
- 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/index.d.ts +1 -1
- 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 +222 -109
- package/dist/modules/Rules/types.d.ts +15 -4
- 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/ScanOrderLogger/types.d.ts +2 -2
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
- 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/type.d.ts +7 -7
- package/dist/modules/Schedule/types.d.ts +11 -9
- 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 +3 -2
- 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/menu/types.d.ts +1 -1
- 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 +91 -20
- 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 +35 -2
- 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/resource/types.d.ts +1 -1
- package/dist/server/modules/schedule/index.d.ts +6 -4
- package/dist/server/modules/schedule/index.js +116 -85
- package/dist/server/modules/schedule/utils.d.ts +1 -1
- package/dist/server/test.json +713 -0
- package/dist/server/types.d.ts +6 -4
- 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 +2 -2
- package/dist/solution/BookingByStep/utils/resources.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +382 -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 +29 -5
- package/dist/solution/ScanOrder/index.d.ts +27 -21
- package/dist/solution/ScanOrder/index.js +499 -434
- package/dist/solution/ScanOrder/types.d.ts +38 -16
- 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/ShopDiscount/types.d.ts +1 -1
- package/dist/solution/ShopDiscount/utils.d.ts +2 -2
- 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/types.d.ts +1 -1
- 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 +12 -2
- package/dist/utils/task.d.ts +2 -2
- package/dist/utils/watch.d.ts +2 -2
- package/lib/effects/index.d.ts +2 -2
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +3 -3
- package/lib/model/strategy/adapter/itemRule/type.d.ts +6 -6
- package/lib/model/strategy/adapter/promotion/evaluator.js +3 -2
- package/lib/model/strategy/adapter/promotion/type.d.ts +5 -5
- package/lib/model/strategy/adapter/walletPass/utils.js +6 -4
- package/lib/model/strategy/type.d.ts +1 -1
- 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 +3 -1
- package/lib/modules/Discount/index.d.ts +2 -1
- package/lib/modules/Discount/index.js +18 -2
- package/lib/modules/Discount/types.d.ts +2 -1
- package/lib/modules/Holder/types.d.ts +1 -1
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +21 -3
- package/lib/modules/OpenData/types.d.ts +1 -1
- 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 +47 -23
- 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/index.d.ts +1 -1
- 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 +153 -61
- package/lib/modules/Rules/types.d.ts +15 -4
- 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/ScanOrderLogger/types.d.ts +2 -2
- package/lib/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
- 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/type.d.ts +7 -7
- package/lib/modules/Schedule/types.d.ts +11 -9
- 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 +3 -2
- 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/menu/types.d.ts +1 -1
- 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 +91 -20
- 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 +35 -2
- 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/resource/types.d.ts +1 -1
- package/lib/server/modules/schedule/index.d.ts +6 -4
- package/lib/server/modules/schedule/index.js +55 -44
- package/lib/server/modules/schedule/utils.d.ts +1 -1
- package/lib/server/test.json +713 -0
- package/lib/server/types.d.ts +6 -4
- 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 +2 -2
- package/lib/solution/BookingByStep/utils/resources.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +382 -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 +29 -5
- package/lib/solution/ScanOrder/index.d.ts +27 -21
- package/lib/solution/ScanOrder/index.js +144 -103
- package/lib/solution/ScanOrder/types.d.ts +38 -16
- 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/ShopDiscount/types.d.ts +1 -1
- package/lib/solution/ShopDiscount/utils.d.ts +2 -2
- 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/types.d.ts +1 -1
- 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 +12 -2
- package/lib/utils/task.d.ts +2 -2
- package/lib/utils/watch.d.ts +2 -2
- package/package.json +18 -19
- package/dist/model/strategy/adapter/promotion/index.d.ts +0 -4
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/model/strategy/adapter/promotion/index.d.ts +0 -4
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -7,7 +7,7 @@ var _exportNames = {
|
|
|
7
7
|
VenueBookingImpl: true
|
|
8
8
|
};
|
|
9
9
|
exports.VenueBookingImpl = void 0;
|
|
10
|
-
var
|
|
10
|
+
var _BaseSales = require("../BaseSales");
|
|
11
11
|
var _types = require("./types");
|
|
12
12
|
Object.keys(_types).forEach(function (key) {
|
|
13
13
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -53,7 +53,7 @@ function cloneCustomDepositData(customDepositData) {
|
|
|
53
53
|
deposit_policy_data: Array.isArray(customDepositData.deposit_policy_data) ? [...customDepositData.deposit_policy_data] : []
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
class VenueBookingImpl extends
|
|
56
|
+
class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
|
|
57
57
|
defaultName = 'venueBooking';
|
|
58
58
|
defaultVersion = '1.0.0';
|
|
59
59
|
isSolution = true;
|
|
@@ -220,6 +220,64 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
220
220
|
constructor(name, version) {
|
|
221
221
|
super(name, version);
|
|
222
222
|
}
|
|
223
|
+
getRegisteredModuleNames() {
|
|
224
|
+
return ['scanOrderLogger', 'products', 'order', 'salesSummary', 'venueProducts', 'addonProducts', 'date', 'schedule', 'quotation', 'openData'];
|
|
225
|
+
}
|
|
226
|
+
createSubModule(moduleName) {
|
|
227
|
+
switch (moduleName) {
|
|
228
|
+
case 'scanOrderLogger':
|
|
229
|
+
return (0, _types2.createModule)('scanOrderLogger', this.name);
|
|
230
|
+
case 'venueProducts':
|
|
231
|
+
return new _ProductList.ProductList(`${this.name}_venueProducts`);
|
|
232
|
+
case 'addonProducts':
|
|
233
|
+
return new _ProductList.ProductList(`${this.name}_addonProducts`);
|
|
234
|
+
case 'date':
|
|
235
|
+
return new _Date.DateModule(`${this.name}_date`);
|
|
236
|
+
case 'openData':
|
|
237
|
+
return new _OpenData.OpenDataModule(`${this.name}_openData`);
|
|
238
|
+
default:
|
|
239
|
+
return super.createSubModule(moduleName);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
attachProductOriginToTempOrder(tempOrder, productUid, origin) {
|
|
243
|
+
if (!productUid || !origin) return;
|
|
244
|
+
tempOrder._extend = {
|
|
245
|
+
...(tempOrder._extend || {}),
|
|
246
|
+
productsByUid: {
|
|
247
|
+
...(tempOrder._extend?.productsByUid || {}),
|
|
248
|
+
[productUid]: {
|
|
249
|
+
...(tempOrder._extend?.productsByUid?.[productUid] || {}),
|
|
250
|
+
origin
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
readProductOriginFromTempOrder(tempOrder, product) {
|
|
256
|
+
const uid = product.metadata?.unique_identification_number || product.identity_key;
|
|
257
|
+
if (uid && tempOrder._extend?.productsByUid?.[uid]?.origin) {
|
|
258
|
+
return tempOrder._extend.productsByUid[uid].origin;
|
|
259
|
+
}
|
|
260
|
+
return product._origin;
|
|
261
|
+
}
|
|
262
|
+
normalizeVenueProductTitle(value) {
|
|
263
|
+
if (typeof value === 'string') {
|
|
264
|
+
const text = value.trim();
|
|
265
|
+
return text ? {
|
|
266
|
+
auto: text
|
|
267
|
+
} : undefined;
|
|
268
|
+
}
|
|
269
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined;
|
|
270
|
+
const source = value;
|
|
271
|
+
const normalized = {};
|
|
272
|
+
Object.entries(source).forEach(([key, text]) => {
|
|
273
|
+
if (typeof text === 'string') normalized[key] = text;
|
|
274
|
+
});
|
|
275
|
+
if (!normalized.auto) {
|
|
276
|
+
const fallback = normalized.original || normalized.en || normalized['zh-CN'] || normalized['zh-HK'];
|
|
277
|
+
if (fallback) normalized.auto = fallback;
|
|
278
|
+
}
|
|
279
|
+
return Object.values(normalized).some(text => String(text || '').trim()) ? normalized : undefined;
|
|
280
|
+
}
|
|
223
281
|
normalizeCustomerId(value) {
|
|
224
282
|
const customerId = Number(value);
|
|
225
283
|
if (!Number.isFinite(customerId) || customerId <= 0) return null;
|
|
@@ -350,8 +408,6 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
350
408
|
}
|
|
351
409
|
async initialize(core, options = {}) {
|
|
352
410
|
this.logMethodStart('initialize');
|
|
353
|
-
this.core = core;
|
|
354
|
-
this.initializeOptions = options || {};
|
|
355
411
|
this.store = {
|
|
356
412
|
...this.store,
|
|
357
413
|
...options.store
|
|
@@ -379,17 +435,17 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
379
435
|
passed: null,
|
|
380
436
|
failures: []
|
|
381
437
|
};
|
|
382
|
-
|
|
383
|
-
this.
|
|
384
|
-
|
|
385
|
-
this.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
438
|
+
await super.initialize(core, options);
|
|
439
|
+
if (this.store.scanOrderLogger) {
|
|
440
|
+
this.store.scanOrderLogger.setProvider(this.otherParams?.loggerProvider || 'feishu');
|
|
441
|
+
this.store.scanOrderLogger.setProviderConfig(this.otherParams?.loggerConfig || {
|
|
442
|
+
feishu: {
|
|
443
|
+
webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
|
|
444
|
+
errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
this.store.scanOrderLogger.setContext(this.getLoggerContext());
|
|
391
448
|
}
|
|
392
|
-
|
|
393
449
|
// 注册基础模块(order, salesSummary, products, logger)
|
|
394
450
|
const baseModules = ['scanOrderLogger', 'products', 'order', 'salesSummary'];
|
|
395
451
|
baseModules.forEach(step => {
|
|
@@ -401,10 +457,10 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
401
457
|
} : {};
|
|
402
458
|
const loggerProvider = this.otherParams?.loggerProvider || 'feishu';
|
|
403
459
|
const loggerConfig = this.otherParams?.loggerConfig || {
|
|
404
|
-
feishu: {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
460
|
+
// feishu: {
|
|
461
|
+
// webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
|
|
462
|
+
// errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d',
|
|
463
|
+
// },
|
|
408
464
|
};
|
|
409
465
|
this.core.registerModule(targetModule, {
|
|
410
466
|
initialState,
|
|
@@ -510,9 +566,6 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
510
566
|
cacheId: this.otherParams?.cacheId
|
|
511
567
|
}
|
|
512
568
|
});
|
|
513
|
-
if (this.store.scanOrderLogger) {
|
|
514
|
-
this.store.scanOrderLogger.setContext(this.getLoggerContext());
|
|
515
|
-
}
|
|
516
569
|
this.registerCustomerLoginListeners();
|
|
517
570
|
try {
|
|
518
571
|
await this.store.order?.recalculateSummary({
|
|
@@ -1130,6 +1183,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1130
1183
|
const endMoment = (0, _dayjs.default)(group.endTime, 'YYYY-MM-DD HH:mm');
|
|
1131
1184
|
const duration = endMoment.diff(startMoment, 'minute');
|
|
1132
1185
|
const customDepositData = cloneCustomDepositData(venueProduct?.custom_deposit_data);
|
|
1186
|
+
const productTitle = this.normalizeVenueProductTitle(venueProduct?.product_title) || this.normalizeVenueProductTitle(venueProduct?.title) || this.normalizeVenueProductTitle(mapping.productTitle);
|
|
1133
1187
|
const resourceEntry = {
|
|
1134
1188
|
relation_type: 'form',
|
|
1135
1189
|
like_status: 'common',
|
|
@@ -1155,7 +1209,45 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1155
1209
|
metadata: {}
|
|
1156
1210
|
}));
|
|
1157
1211
|
}
|
|
1158
|
-
|
|
1212
|
+
const venueProductOrigin = {
|
|
1213
|
+
name: mapping.productTitle,
|
|
1214
|
+
product_title: productTitle,
|
|
1215
|
+
cover: venueProduct?.cover || '',
|
|
1216
|
+
custom_deposit_data: customDepositData,
|
|
1217
|
+
id: 0,
|
|
1218
|
+
number: 1,
|
|
1219
|
+
registration_type: 'all',
|
|
1220
|
+
relation_products: [],
|
|
1221
|
+
is_all: false,
|
|
1222
|
+
product: {
|
|
1223
|
+
product_id: mapping.productId,
|
|
1224
|
+
product_variant_id: 0,
|
|
1225
|
+
num: 1,
|
|
1226
|
+
product_bundle: [],
|
|
1227
|
+
product_sku: {
|
|
1228
|
+
option: []
|
|
1229
|
+
},
|
|
1230
|
+
discount_list: [],
|
|
1231
|
+
custom_deposit_data: customDepositData,
|
|
1232
|
+
metadata: {}
|
|
1233
|
+
},
|
|
1234
|
+
sub_type: 'minutes',
|
|
1235
|
+
duration,
|
|
1236
|
+
like_status: 'common',
|
|
1237
|
+
resources: [resourceEntry],
|
|
1238
|
+
schedule_id: 0,
|
|
1239
|
+
select_date: startMoment.format('YYYY-MM-DD'),
|
|
1240
|
+
start_date: startMoment.format('YYYY-MM-DD'),
|
|
1241
|
+
start_time: startMoment.format('HH:mm'),
|
|
1242
|
+
end_date: endMoment.format('YYYY-MM-DD'),
|
|
1243
|
+
end_time: endMoment.format('HH:mm'),
|
|
1244
|
+
metadata: {
|
|
1245
|
+
venue_booking: true,
|
|
1246
|
+
slot_count: group.slotCount
|
|
1247
|
+
},
|
|
1248
|
+
holder: null
|
|
1249
|
+
};
|
|
1250
|
+
const normalizedVenueOrderProduct = (0, _utils.normalizeOrderProduct)({
|
|
1159
1251
|
product_id: mapping.productId,
|
|
1160
1252
|
product_variant_id: 0,
|
|
1161
1253
|
identity_key: identityKey,
|
|
@@ -1165,6 +1257,9 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1165
1257
|
is_charge_tax: venueProduct?.is_charge_tax ?? 0,
|
|
1166
1258
|
metadata: {
|
|
1167
1259
|
venue_booking: true,
|
|
1260
|
+
...(productTitle ? {
|
|
1261
|
+
product_title: productTitle
|
|
1262
|
+
} : {}),
|
|
1168
1263
|
resource_id: resourceId,
|
|
1169
1264
|
resource_form_id: mapping.formId,
|
|
1170
1265
|
resource_name: mapping.resourceName,
|
|
@@ -1174,48 +1269,18 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1174
1269
|
booking_uid: bookingUuid,
|
|
1175
1270
|
price_breakdown: (0, _slotMerge.buildPriceBreakdown)({
|
|
1176
1271
|
group,
|
|
1177
|
-
productId: mapping.productId
|
|
1272
|
+
productId: mapping.productId,
|
|
1273
|
+
quotation: this.store.quotation
|
|
1178
1274
|
})
|
|
1179
1275
|
},
|
|
1180
|
-
_origin:
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
is_all: false,
|
|
1189
|
-
product: {
|
|
1190
|
-
product_id: mapping.productId,
|
|
1191
|
-
product_variant_id: 0,
|
|
1192
|
-
num: 1,
|
|
1193
|
-
product_bundle: [],
|
|
1194
|
-
product_option_item: [],
|
|
1195
|
-
discount_list: [],
|
|
1196
|
-
custom_deposit_data: customDepositData,
|
|
1197
|
-
metadata: {},
|
|
1198
|
-
holder_config: venueProduct?.holder_config,
|
|
1199
|
-
bookingUuid: bookingUuid,
|
|
1200
|
-
shop_id: venueProduct?.shop_id || 0
|
|
1201
|
-
},
|
|
1202
|
-
sub_type: 'minutes',
|
|
1203
|
-
duration,
|
|
1204
|
-
like_status: 'common',
|
|
1205
|
-
resources: [resourceEntry],
|
|
1206
|
-
schedule_id: 0,
|
|
1207
|
-
select_date: startMoment.format('YYYY-MM-DD'),
|
|
1208
|
-
start_date: startMoment.format('YYYY-MM-DD'),
|
|
1209
|
-
start_time: startMoment.format('HH:mm'),
|
|
1210
|
-
end_date: endMoment.format('YYYY-MM-DD'),
|
|
1211
|
-
end_time: endMoment.format('HH:mm'),
|
|
1212
|
-
metadata: {
|
|
1213
|
-
venue_booking: true,
|
|
1214
|
-
slot_count: group.slotCount
|
|
1215
|
-
},
|
|
1216
|
-
holder: null
|
|
1217
|
-
}
|
|
1218
|
-
}));
|
|
1276
|
+
_origin: venueProductOrigin
|
|
1277
|
+
});
|
|
1278
|
+
const venueOrderProduct = productTitle ? {
|
|
1279
|
+
...normalizedVenueOrderProduct,
|
|
1280
|
+
product_title: productTitle
|
|
1281
|
+
} : normalizedVenueOrderProduct;
|
|
1282
|
+
this.attachProductOriginToTempOrder(tempOrder, identityKey, venueProductOrigin);
|
|
1283
|
+
tempOrder.products.push(venueOrderProduct);
|
|
1219
1284
|
const booking = (0, _slotMerge.buildVenueBookingEntry)({
|
|
1220
1285
|
group,
|
|
1221
1286
|
resourceId,
|
|
@@ -1294,15 +1359,15 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1294
1359
|
const result = this.store.order?.getTempOrder() || null;
|
|
1295
1360
|
return result;
|
|
1296
1361
|
}
|
|
1297
|
-
updateTempOrderNote(note) {
|
|
1362
|
+
updateTempOrderNote(note, sync = false) {
|
|
1298
1363
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1299
|
-
return this.store.order.updateTempOrderNote(note);
|
|
1364
|
+
return this.store.order.updateTempOrderNote(note, sync);
|
|
1300
1365
|
}
|
|
1301
1366
|
updateTempOrderContactsInfo(contactsInfo) {
|
|
1302
1367
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1303
1368
|
return this.store.order.updateTempOrderContactsInfo(contactsInfo);
|
|
1304
1369
|
}
|
|
1305
|
-
|
|
1370
|
+
ensureVenueTempOrder() {
|
|
1306
1371
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1307
1372
|
return this.store.order.ensureTempOrder();
|
|
1308
1373
|
}
|
|
@@ -1462,7 +1527,8 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1462
1527
|
// 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
|
|
1463
1528
|
// 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
|
|
1464
1529
|
for (const product of tempOrder.products) {
|
|
1465
|
-
|
|
1530
|
+
const origin = this.readProductOriginFromTempOrder(tempOrder, product);
|
|
1531
|
+
if (origin?.isManualDiscount) continue;
|
|
1466
1532
|
|
|
1467
1533
|
// 1. 把 product.discount_list 和当前选中的 discount 对齐(剔除已取消的券)
|
|
1468
1534
|
product.discount_list = (product.discount_list || []).filter(pd => {
|
|
@@ -1473,7 +1539,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1473
1539
|
// 2. 以 source_product_price 为券作用基准:券作用于 source(不含 option),
|
|
1474
1540
|
// 再把 option 加回得到含 option 的 main_product_selling_price,最后合成 composite。
|
|
1475
1541
|
const totalPerUnitDiscount = (product.discount_list || []).reduce((sum, pd) => sum + (pd.amount || 0), 0);
|
|
1476
|
-
const optionSum = (0, _utils3.sumOptionUnitPrice)(
|
|
1542
|
+
const optionSum = (0, _utils3.sumOptionUnitPrice)((0, _utils3.getProductSkuOptions)(product));
|
|
1477
1543
|
const sourcePrice = product.metadata?.source_product_price ?? (product.metadata?.main_product_original_price != null ? new _decimal.default(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : product.original_price ?? '0');
|
|
1478
1544
|
const newSourceSellingPrice = new _decimal.default(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
1479
1545
|
const newMainSellingPrice = new _decimal.default(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
@@ -1520,13 +1586,14 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1520
1586
|
}
|
|
1521
1587
|
getOrderProducts() {
|
|
1522
1588
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1523
|
-
|
|
1589
|
+
const products = this.store.order.getOrderProducts();
|
|
1590
|
+
return products;
|
|
1524
1591
|
}
|
|
1525
1592
|
async getSummary() {
|
|
1526
1593
|
this.logMethodStart('getSummary');
|
|
1527
1594
|
try {
|
|
1528
1595
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1529
|
-
const summary = await this.store.order.
|
|
1596
|
+
const summary = await this.store.order.getOrderSummary();
|
|
1530
1597
|
this.logMethodSuccess('getSummary', {
|
|
1531
1598
|
totalAmount: summary.total_amount
|
|
1532
1599
|
});
|
|
@@ -1616,22 +1683,22 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1616
1683
|
throw error;
|
|
1617
1684
|
}
|
|
1618
1685
|
}
|
|
1619
|
-
async
|
|
1620
|
-
this.logMethodStart('
|
|
1686
|
+
async updateOrderProduct(params) {
|
|
1687
|
+
this.logMethodStart('updateOrderProduct', {
|
|
1621
1688
|
product_id: params.product_id,
|
|
1622
1689
|
product_variant_id: params.product_variant_id
|
|
1623
1690
|
});
|
|
1624
1691
|
try {
|
|
1625
1692
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
1626
|
-
const products = await this.store.order.
|
|
1693
|
+
const products = await this.store.order.updateOrderProduct(params);
|
|
1627
1694
|
await this.refreshItemRuleQuantityLimits();
|
|
1628
1695
|
await this.refreshCartValidationPassed();
|
|
1629
|
-
this.logMethodSuccess('
|
|
1696
|
+
this.logMethodSuccess('updateOrderProduct', {
|
|
1630
1697
|
productCount: products.length
|
|
1631
1698
|
});
|
|
1632
1699
|
return products;
|
|
1633
1700
|
} catch (error) {
|
|
1634
|
-
this.logMethodError('
|
|
1701
|
+
this.logMethodError('updateOrderProduct', error);
|
|
1635
1702
|
throw error;
|
|
1636
1703
|
}
|
|
1637
1704
|
}
|
|
@@ -1810,7 +1877,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1810
1877
|
return [];
|
|
1811
1878
|
}
|
|
1812
1879
|
const businessData = (0, _utils.buildItemRuleBusinessData)({
|
|
1813
|
-
tempOrder: this.
|
|
1880
|
+
tempOrder: this.ensureVenueTempOrder(),
|
|
1814
1881
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
1815
1882
|
itemRuleConfigs: this.itemRuleConfigs
|
|
1816
1883
|
});
|
|
@@ -1832,7 +1899,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1832
1899
|
const strategyConfigs = await this.ensureItemRuleConfigsLoaded();
|
|
1833
1900
|
if (!strategyConfigs.length) return;
|
|
1834
1901
|
const businessData = (0, _utils.buildItemRuleBusinessData)({
|
|
1835
|
-
tempOrder: this.
|
|
1902
|
+
tempOrder: this.ensureVenueTempOrder(),
|
|
1836
1903
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
1837
1904
|
itemRuleConfigs: this.itemRuleConfigs
|
|
1838
1905
|
});
|
|
@@ -1842,7 +1909,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1842
1909
|
return;
|
|
1843
1910
|
}
|
|
1844
1911
|
const productSourceMap = await this.buildPrefillProductSourceMap();
|
|
1845
|
-
const tempOrder = this.
|
|
1912
|
+
const tempOrder = this.ensureVenueTempOrder();
|
|
1846
1913
|
let hasChanges = false;
|
|
1847
1914
|
for (const prefillItem of prefillItems) {
|
|
1848
1915
|
const productId = Number(prefillItem.product_id);
|
|
@@ -1857,7 +1924,12 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1857
1924
|
});
|
|
1858
1925
|
if (productIndex === -1) {
|
|
1859
1926
|
const sellingPrice = (0, _utils.toPriceString)(sourceItem?.price ?? sourceItem?.selling_price, '0.00');
|
|
1860
|
-
|
|
1927
|
+
const origin = {
|
|
1928
|
+
...(sourceItem || {}),
|
|
1929
|
+
item_rule_prefill: true,
|
|
1930
|
+
item_rule_id: prefillItem.ruleId
|
|
1931
|
+
};
|
|
1932
|
+
const product = (0, _utils.normalizeOrderProduct)({
|
|
1861
1933
|
product_id: productId,
|
|
1862
1934
|
product_variant_id: productVariantId,
|
|
1863
1935
|
num: targetQuantity,
|
|
@@ -1867,16 +1939,20 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1867
1939
|
item_rule_prefill: true,
|
|
1868
1940
|
item_rule_id: prefillItem.ruleId
|
|
1869
1941
|
},
|
|
1870
|
-
_origin:
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
}));
|
|
1942
|
+
_origin: origin
|
|
1943
|
+
});
|
|
1944
|
+
const productUid = String(product.metadata?.unique_identification_number || '');
|
|
1945
|
+
this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
|
|
1946
|
+
tempOrder.products.push(product);
|
|
1876
1947
|
hasChanges = true;
|
|
1877
1948
|
continue;
|
|
1878
1949
|
}
|
|
1879
1950
|
const targetProduct = tempOrder.products[productIndex];
|
|
1951
|
+
const previousOrigin = this.readProductOriginFromTempOrder(tempOrder, targetProduct);
|
|
1952
|
+
const nextOrigin = sourceItem ? {
|
|
1953
|
+
...(previousOrigin || {}),
|
|
1954
|
+
...sourceItem
|
|
1955
|
+
} : previousOrigin;
|
|
1880
1956
|
const existedQuantity = (0, _utils.toNonNegativeInt)(targetProduct.num);
|
|
1881
1957
|
const delta = targetQuantity - existedQuantity;
|
|
1882
1958
|
const nextProduct = {
|
|
@@ -1888,13 +1964,11 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1888
1964
|
...(targetProduct.metadata || {}),
|
|
1889
1965
|
item_rule_prefill: true,
|
|
1890
1966
|
item_rule_id: prefillItem.ruleId
|
|
1891
|
-
}
|
|
1892
|
-
_origin: sourceItem ? {
|
|
1893
|
-
...(targetProduct._origin || {}),
|
|
1894
|
-
...sourceItem
|
|
1895
|
-
} : targetProduct._origin
|
|
1967
|
+
}
|
|
1896
1968
|
};
|
|
1897
|
-
if (delta > 0 || Boolean(sourceItem && (!
|
|
1969
|
+
if (delta > 0 || Boolean(sourceItem && (!previousOrigin || previousOrigin?.price !== sourceItem?.price))) {
|
|
1970
|
+
const productUid = String(nextProduct.metadata?.unique_identification_number || '');
|
|
1971
|
+
this.attachProductOriginToTempOrder(tempOrder, productUid, nextOrigin);
|
|
1898
1972
|
tempOrder.products[productIndex] = nextProduct;
|
|
1899
1973
|
hasChanges = true;
|
|
1900
1974
|
}
|
|
@@ -1927,7 +2001,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
1927
2001
|
failures: []
|
|
1928
2002
|
};
|
|
1929
2003
|
const businessData = (0, _utils.buildItemRuleBusinessData)({
|
|
1930
|
-
tempOrder: this.
|
|
2004
|
+
tempOrder: this.ensureVenueTempOrder(),
|
|
1931
2005
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
1932
2006
|
itemRuleConfigs: this.itemRuleConfigs
|
|
1933
2007
|
});
|
|
@@ -2057,11 +2131,12 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
|
|
|
2057
2131
|
booking.holder = holder;
|
|
2058
2132
|
}
|
|
2059
2133
|
for (const product of tempOrder.products) {
|
|
2060
|
-
const
|
|
2134
|
+
const runtimeProduct = product;
|
|
2135
|
+
const productBookingUid = runtimeProduct.metadata?.booking_uid ?? runtimeProduct._origin?.product?.bookingUuid;
|
|
2061
2136
|
if (String(productBookingUid) !== String(bookingUid)) continue;
|
|
2062
|
-
const origin =
|
|
2137
|
+
const origin = runtimeProduct._origin && typeof runtimeProduct._origin === 'object' ? runtimeProduct._origin : {};
|
|
2063
2138
|
origin.holder = holder;
|
|
2064
|
-
|
|
2139
|
+
runtimeProduct._origin = origin;
|
|
2065
2140
|
}
|
|
2066
2141
|
this.store.order.notifyTempOrderChanged();
|
|
2067
2142
|
}
|
|
@@ -71,8 +71,6 @@
|
|
|
71
71
|
"num__comment": "数量;int;↕;必填。统一使用 num,不再使用 product_quantity。",
|
|
72
72
|
"product_variant_id": 0,
|
|
73
73
|
"product_variant_id__comment": "多规格 ID;int;↕;可选。",
|
|
74
|
-
"product_option_item": [],
|
|
75
|
-
"product_option_item__comment": "选项配置;array;↕;可选。",
|
|
76
74
|
"selling_price": "50.00",
|
|
77
75
|
"selling_price__comment": "销售单价(交易快照);string;←;服务端返回,不能依赖基准数据回填。",
|
|
78
76
|
"original_price": "60.00",
|
|
@@ -11,7 +11,7 @@ export declare enum VenueBookingHooks {
|
|
|
11
11
|
/** 登录客户的智能定价、营销配置与订单汇总已完成刷新 */
|
|
12
12
|
onSmartPricingUpdated = "venueBooking:onSmartPricingUpdated"
|
|
13
13
|
}
|
|
14
|
-
export type VenueBookingStatus = 'idle' | 'initializing' | 'ready' | 'error';
|
|
14
|
+
export declare type VenueBookingStatus = 'idle' | 'initializing' | 'ready' | 'error';
|
|
15
15
|
export interface VenueBookingEntryContext {
|
|
16
16
|
biz: string;
|
|
17
17
|
venueId?: string;
|
|
@@ -5,6 +5,12 @@ export declare function mergeConsecutiveSlots(slots: VenueSlotSelection[]): Merg
|
|
|
5
5
|
export declare function buildPriceBreakdown(params: {
|
|
6
6
|
group: MergedSlotGroup;
|
|
7
7
|
productId: number;
|
|
8
|
+
quotation?: {
|
|
9
|
+
getQuotationShelfId: (p: {
|
|
10
|
+
productId: number;
|
|
11
|
+
datetime: string;
|
|
12
|
+
}) => number;
|
|
13
|
+
};
|
|
8
14
|
}): PriceBreakdownEntry[];
|
|
9
15
|
export interface BuildVenueBookingParams {
|
|
10
16
|
group: MergedSlotGroup;
|
|
@@ -55,16 +55,22 @@ function mergeConsecutiveSlots(slots) {
|
|
|
55
55
|
}
|
|
56
56
|
function buildPriceBreakdown(params) {
|
|
57
57
|
const {
|
|
58
|
-
group
|
|
58
|
+
group,
|
|
59
|
+
productId,
|
|
60
|
+
quotation
|
|
59
61
|
} = params;
|
|
60
62
|
if (!group.slots.length) return [];
|
|
61
63
|
const entries = [];
|
|
62
64
|
for (const slot of group.slots) {
|
|
63
65
|
const unitPrice = Number(slot.price || '0');
|
|
66
|
+
const shelfId = quotation ? quotation.getQuotationShelfId({
|
|
67
|
+
productId,
|
|
68
|
+
datetime: slot.startTime
|
|
69
|
+
}) : 0;
|
|
64
70
|
const startHm = (0, _dayjs.default)(slot.startTime, 'YYYY-MM-DD HH:mm').format('YYYY-MM-DD HH:mm');
|
|
65
71
|
const endHm = (0, _dayjs.default)(slot.endTime, 'YYYY-MM-DD HH:mm').format('YYYY-MM-DD HH:mm');
|
|
66
72
|
const last = entries[entries.length - 1];
|
|
67
|
-
if (last && last.unit_price === unitPrice && last.quotation_shelf_id ===
|
|
73
|
+
if (last && last.unit_price === unitPrice && last.quotation_shelf_id === shelfId && last.end_time === startHm) {
|
|
68
74
|
last.end_time = endHm;
|
|
69
75
|
last.quantity += 1;
|
|
70
76
|
} else {
|
|
@@ -72,7 +78,7 @@ function buildPriceBreakdown(params) {
|
|
|
72
78
|
start_time: startHm,
|
|
73
79
|
end_time: endHm,
|
|
74
80
|
unit_price: unitPrice,
|
|
75
|
-
quotation_shelf_id:
|
|
81
|
+
quotation_shelf_id: shelfId,
|
|
76
82
|
quantity: 1
|
|
77
83
|
});
|
|
78
84
|
}
|
package/lib/solution/index.d.ts
CHANGED
package/lib/solution/index.js
CHANGED
|
@@ -91,6 +91,17 @@ Object.keys(_ScanOrder).forEach(function (key) {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
|
+
var _BaseSales = require("./BaseSales");
|
|
95
|
+
Object.keys(_BaseSales).forEach(function (key) {
|
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
|
97
|
+
if (key in exports && exports[key] === _BaseSales[key]) return;
|
|
98
|
+
Object.defineProperty(exports, key, {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return _BaseSales[key];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
94
105
|
var _VenueBooking = require("./VenueBooking");
|
|
95
106
|
Object.keys(_VenueBooking).forEach(function (key) {
|
|
96
107
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -101,4 +112,15 @@ Object.keys(_VenueBooking).forEach(function (key) {
|
|
|
101
112
|
return _VenueBooking[key];
|
|
102
113
|
}
|
|
103
114
|
});
|
|
115
|
+
});
|
|
116
|
+
var _UnifiedBookingSales = require("./UnifiedBookingSales");
|
|
117
|
+
Object.keys(_UnifiedBookingSales).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (key in exports && exports[key] === _UnifiedBookingSales[key]) return;
|
|
120
|
+
Object.defineProperty(exports, key, {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _UnifiedBookingSales[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
104
126
|
});
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,6 +15,16 @@ export interface Module {
|
|
|
15
15
|
name: string;
|
|
16
16
|
version: string;
|
|
17
17
|
initialize: (core: PisellCore, options: ModuleOptions) => Promise<void> | void;
|
|
18
|
+
/**
|
|
19
|
+
* 父级解决方案运行时更新 otherParams 后,显式通知子模块刷新自己的运行态参数。
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await module.updateOtherParams?.({ channel: 'pos' }, { changedParams: { channel: 'pos' } });
|
|
23
|
+
*/
|
|
24
|
+
updateOtherParams?: (params: Record<string, any>, meta?: {
|
|
25
|
+
changedParams?: Record<string, any>;
|
|
26
|
+
cover?: boolean;
|
|
27
|
+
}) => Promise<void> | void;
|
|
18
28
|
destroy?: () => Promise<void> | void;
|
|
19
29
|
exports?: Record<string, any>;
|
|
20
30
|
isSolution?: boolean;
|
|
@@ -28,7 +38,7 @@ export interface ModuleOptions {
|
|
|
28
38
|
initialState?: Record<string, any>;
|
|
29
39
|
otherParams?: Record<string, any>;
|
|
30
40
|
}
|
|
31
|
-
export type EventHandler = (data?: any) => void;
|
|
41
|
+
export declare type EventHandler = (data?: any) => void;
|
|
32
42
|
export interface PisellCore {
|
|
33
43
|
registerPlugin: (plugin: Plugin, options?: PluginOptions) => void;
|
|
34
44
|
getPlugin: <T extends Plugin>(name: string) => T | null;
|
|
@@ -39,7 +49,7 @@ export interface PisellCore {
|
|
|
39
49
|
getModuleExports: <T = any>(name: string) => T | null;
|
|
40
50
|
hasModule: (name: string) => boolean;
|
|
41
51
|
effects: {
|
|
42
|
-
on: (event: string, callback: (payload: any) => void
|
|
52
|
+
on: (event: string, callback: (payload: any) => void) => () => void;
|
|
43
53
|
once: (event: string, callback: (payload: any) => void, force?: boolean) => void;
|
|
44
54
|
only: (event: string, callback: (payload: any) => void) => () => void;
|
|
45
55
|
off: (event: string, callback: (payload: any) => void) => void;
|
package/lib/utils/task.d.ts
CHANGED
package/lib/utils/watch.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* 监听模块
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
|
-
export type WatchEventCallback = (...args: any[]) => void;
|
|
6
|
-
export type WatchEventItem = {
|
|
5
|
+
export declare type WatchEventCallback = (...args: any[]) => void;
|
|
6
|
+
export declare type WatchEventItem = {
|
|
7
7
|
key: string;
|
|
8
8
|
callback: WatchEventCallback;
|
|
9
9
|
};
|