@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
|
@@ -63,6 +63,8 @@ export interface OrderProductBundleItem {
|
|
|
63
63
|
bundle_group_id?: number;
|
|
64
64
|
/** 套餐商品 ID */
|
|
65
65
|
bundle_id?: number;
|
|
66
|
+
/** 套餐子商品封面图 */
|
|
67
|
+
cover?: string | null;
|
|
66
68
|
/** 套餐商品规格 ID */
|
|
67
69
|
bundle_variant_id?: number;
|
|
68
70
|
/** 数量 */
|
|
@@ -80,6 +82,16 @@ export interface OrderProductMetadata {
|
|
|
80
82
|
unique_identification_number?: string;
|
|
81
83
|
[key: string]: unknown;
|
|
82
84
|
}
|
|
85
|
+
export interface OrderProductTitleSnapshot {
|
|
86
|
+
en: string | null;
|
|
87
|
+
ja: string | null;
|
|
88
|
+
pt: string | null;
|
|
89
|
+
auto: string | null;
|
|
90
|
+
'zh-CN': string | null;
|
|
91
|
+
'zh-HK': string | null;
|
|
92
|
+
kitchen: string | null;
|
|
93
|
+
original: string | null;
|
|
94
|
+
}
|
|
83
95
|
/**
|
|
84
96
|
* 订单级商品行(3.3 products)。
|
|
85
97
|
* 订单级别的非预约关联商品;预约关联商品在 bookings 内。
|
|
@@ -92,10 +104,12 @@ export interface OrderProductLineItem {
|
|
|
92
104
|
product_id?: number | null;
|
|
93
105
|
/** 数量。创建/更新时必填。来源:Detail.product_quantity */
|
|
94
106
|
num: number;
|
|
107
|
+
/** 商品标题快照;本地待同步订单会补齐为多语言对象。 */
|
|
108
|
+
product_title?: OrderProductTitleSnapshot | string | null;
|
|
109
|
+
/** 商品封面图 */
|
|
110
|
+
product_cover?: string | null;
|
|
95
111
|
/** 多规格 ID。来源:Detail.product_variant_id */
|
|
96
112
|
product_variant_id?: number;
|
|
97
|
-
/** 选项配置 */
|
|
98
|
-
product_option_item?: unknown[];
|
|
99
113
|
/**
|
|
100
114
|
* 销售单价(交易快照,仅输出)。
|
|
101
115
|
* 来源:Detail.selling_price
|
|
@@ -121,6 +135,8 @@ export interface OrderProductLineItem {
|
|
|
121
135
|
product_bundle?: OrderProductBundleItem[];
|
|
122
136
|
/** 元数据;含 unique_identification_number。来源:Detail.metadata */
|
|
123
137
|
metadata?: OrderProductMetadata | null;
|
|
138
|
+
/** 关联子预约 ID(仅输出,预约订单场景)。来源:Detail.schedule_event_id */
|
|
139
|
+
schedule_event_id?: number | null;
|
|
124
140
|
}
|
|
125
141
|
/** 预约条目 metadata,常含 unique_identification_number */
|
|
126
142
|
export interface OrderBookingMetadata {
|
|
@@ -188,6 +204,14 @@ export interface OrderBookingItem {
|
|
|
188
204
|
holder?: Record<string, unknown> | null;
|
|
189
205
|
/** 元数据;含 unique_identification_number。来源:ScheduleEvent.metadata */
|
|
190
206
|
metadata?: OrderBookingMetadata | null;
|
|
207
|
+
/**
|
|
208
|
+
* 与订单明细等资源的关联(如 resource_type 为订单 Detail 时 resource_id 对应 order_detail_id)。
|
|
209
|
+
* 来源:服务端 ScheduleEvent 关联表。
|
|
210
|
+
*/
|
|
211
|
+
relation_items?: {
|
|
212
|
+
resource_id?: number | null;
|
|
213
|
+
[key: string]: unknown;
|
|
214
|
+
}[];
|
|
191
215
|
}
|
|
192
216
|
/** 支付记录 metadata,常含 unique_payment_number */
|
|
193
217
|
export interface OrderPaymentMetadata {
|
|
@@ -219,8 +243,10 @@ export interface OrderPaymentItem {
|
|
|
219
243
|
rounding_amount?: OrderMoneyString;
|
|
220
244
|
/** 支付状态:paid / voided / payment_pending 等 */
|
|
221
245
|
status?: OrderPaymentRecordStatus;
|
|
222
|
-
/**
|
|
246
|
+
/** 支付时间(输入/输出均保留)。来源:OrderPayment.payment_time */
|
|
223
247
|
payment_time?: string | null;
|
|
248
|
+
/** 支付创建时间(输入/输出均保留)。来源:OrderPayment.created_at */
|
|
249
|
+
created_at?: string | null;
|
|
224
250
|
/** 手续费配置。来源:OrderPayment.service_charge */
|
|
225
251
|
service_charge?: Record<string, unknown> | null;
|
|
226
252
|
/** Wallet Pass 使用单位 */
|
|
@@ -314,6 +340,8 @@ export interface OrderData {
|
|
|
314
340
|
payment_status?: OrderPaymentStatus;
|
|
315
341
|
/** 发货状态(仅输出)。来源:Order.shipping_status */
|
|
316
342
|
shipping_status?: OrderShippingStatus;
|
|
343
|
+
/** 券列表。来源:Order.vouchers */
|
|
344
|
+
vouchers?: any[];
|
|
317
345
|
/**
|
|
318
346
|
* 客户 ID(设备端从本地客户数据取详情)。
|
|
319
347
|
* 来源:Order.customer_id
|
|
@@ -383,6 +411,8 @@ export interface OrderData {
|
|
|
383
411
|
/** 本地辅助字段 */
|
|
384
412
|
shop_id?: number;
|
|
385
413
|
create_date?: string;
|
|
414
|
+
/** 本地待同步标记:1 表示需要后续同步到云端 */
|
|
415
|
+
need_sync?: 0 | 1 | number;
|
|
386
416
|
/** 兼容:部分场景仍使用顶层 total_amount */
|
|
387
417
|
total_amount?: OrderMoneyString | number;
|
|
388
418
|
/** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
|
|
@@ -391,15 +421,18 @@ export interface OrderData {
|
|
|
391
421
|
/** 去掉 bookings 后的订单快照;展开预约行时挂在 {@link BookingData.order} 上 */
|
|
392
422
|
export type OrderWithoutBookings = Omit<OrderData, 'bookings'>;
|
|
393
423
|
/**
|
|
394
|
-
* 展开后的单条预约视图:协议 {@link OrderBookingItem} 平铺字段 + 所属订单(不含 bookings
|
|
424
|
+
* 展开后的单条预约视图:协议 {@link OrderBookingItem} 平铺字段 + 所属订单(不含 bookings)+
|
|
425
|
+
* 当前预约归属的商品行(由订单 products 按 schedule_event_id / relation_items 归集,不修改 order)
|
|
395
426
|
*/
|
|
396
427
|
export type BookingData = OrderBookingItem & {
|
|
397
428
|
order: OrderWithoutBookings;
|
|
429
|
+
products: OrderProductLineItem[];
|
|
398
430
|
};
|
|
399
431
|
/**
|
|
400
432
|
* 订单列表筛选条件(与 order.ts getFilterButtonList 等 UI 对齐)
|
|
401
433
|
*/
|
|
402
434
|
export interface OrderFilters {
|
|
435
|
+
keyword?: string;
|
|
403
436
|
order_by?: string;
|
|
404
437
|
sort?: 'desc' | 'asc';
|
|
405
438
|
status?: string[];
|
|
@@ -429,7 +462,10 @@ export interface OrderFilters {
|
|
|
429
462
|
* 预约展开列表筛选条件(订单级条件匹配 booking.order.*,预约级匹配 booking 自身)
|
|
430
463
|
*/
|
|
431
464
|
export interface BookingFilters {
|
|
465
|
+
/** RecordBoard 通用搜索字段(单数),用于本地预约过滤 */
|
|
432
466
|
keyword?: string;
|
|
467
|
+
/** `/shop/schedule/booking` 后端协议搜索字段(复数),OS Server 需兼容 */
|
|
468
|
+
keywords?: string;
|
|
433
469
|
order_by?: string;
|
|
434
470
|
order_payment_status?: string[];
|
|
435
471
|
order_status?: string[];
|
|
@@ -466,7 +502,27 @@ export interface OrderModulePagedResult<T> {
|
|
|
466
502
|
size: number;
|
|
467
503
|
skip: number;
|
|
468
504
|
}
|
|
469
|
-
|
|
505
|
+
/** 单条筛选未命中说明(用于排查过滤原因) */
|
|
506
|
+
export interface OrderFilterRejectDetail {
|
|
507
|
+
/** 对应 OrderFilters 维度的标识 */
|
|
508
|
+
field: string;
|
|
509
|
+
/** 订单上该维度的当前值 */
|
|
510
|
+
actual: unknown;
|
|
511
|
+
/** 本次筛选的期望值/区间(便于对照) */
|
|
512
|
+
expected?: unknown;
|
|
513
|
+
}
|
|
514
|
+
/** 未通过筛选的订单及首个未满足条件(与过滤短路顺序一致) */
|
|
515
|
+
export interface OrderFilterRejectedEntry {
|
|
516
|
+
order_id?: OrderId | null;
|
|
517
|
+
/** 系统订单号等,便于与业务「订单号」对照 */
|
|
518
|
+
order_number?: string;
|
|
519
|
+
/** 按筛选顺序命中的第一条未满足条件 */
|
|
520
|
+
reason: OrderFilterRejectDetail;
|
|
521
|
+
}
|
|
522
|
+
export type OrderFilterResult = OrderModulePagedResult<OrderData> & {
|
|
523
|
+
/** 被过滤掉的订单及首个命中原因(与筛选短路顺序一致;不含仅分页未展示的已通过订单) */
|
|
524
|
+
rejected: OrderFilterRejectedEntry[];
|
|
525
|
+
};
|
|
470
526
|
export type BookingFilterResult = OrderModulePagedResult<BookingData>;
|
|
471
527
|
/**
|
|
472
528
|
* SSE 同步配置
|
|
@@ -489,6 +545,21 @@ export interface OrderAblyEventPayload {
|
|
|
489
545
|
order_id?: OrderId;
|
|
490
546
|
timestamp: number;
|
|
491
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* 订单变更广播载荷。
|
|
550
|
+
* 用于保留原有全量列表通知能力,同时让订阅方可按 changedOrders 做增量处理。
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* const changedOrders = payload.changedOrders
|
|
554
|
+
*/
|
|
555
|
+
export interface OrderChangedPayload {
|
|
556
|
+
/** 当前订单 store 全量列表,兼容既有重算列表订阅 */
|
|
557
|
+
list: OrderData[];
|
|
558
|
+
/** 本次明确发生变更的订单;全量刷新等无法确定 delta 的场景可为空 */
|
|
559
|
+
changedOrders: OrderData[];
|
|
560
|
+
/** 触发来源,便于订阅者区分 pubsub / 远端覆盖 / 清空等场景 */
|
|
561
|
+
source?: string;
|
|
562
|
+
}
|
|
492
563
|
/**
|
|
493
564
|
* OrderSyncMessage - pubsub 同步消息结构
|
|
494
565
|
*/
|
|
@@ -74,7 +74,8 @@ exports.OrderHooks = void 0;
|
|
|
74
74
|
*/
|
|
75
75
|
/** 去掉 bookings 后的订单快照;展开预约行时挂在 {@link BookingData.order} 上 */
|
|
76
76
|
/**
|
|
77
|
-
* 展开后的单条预约视图:协议 {@link OrderBookingItem} 平铺字段 + 所属订单(不含 bookings
|
|
77
|
+
* 展开后的单条预约视图:协议 {@link OrderBookingItem} 平铺字段 + 所属订单(不含 bookings)+
|
|
78
|
+
* 当前预约归属的商品行(由订单 products 按 schedule_event_id / relation_items 归集,不修改 order)
|
|
78
79
|
*/
|
|
79
80
|
/**
|
|
80
81
|
* 订单列表筛选条件(与 order.ts getFilterButtonList 等 UI 对齐)
|
|
@@ -83,6 +84,8 @@ exports.OrderHooks = void 0;
|
|
|
83
84
|
* 预约展开列表筛选条件(订单级条件匹配 booking.order.*,预约级匹配 booking 自身)
|
|
84
85
|
*/
|
|
85
86
|
/** 分页筛选结果通用结构 */
|
|
87
|
+
/** 单条筛选未命中说明(用于排查过滤原因) */
|
|
88
|
+
/** 未通过筛选的订单及首个未满足条件(与过滤短路顺序一致) */
|
|
86
89
|
/**
|
|
87
90
|
* SSE 同步配置
|
|
88
91
|
*/
|
|
@@ -92,6 +95,13 @@ exports.OrderHooks = void 0;
|
|
|
92
95
|
/**
|
|
93
96
|
* Ably 事件载荷
|
|
94
97
|
*/
|
|
98
|
+
/**
|
|
99
|
+
* 订单变更广播载荷。
|
|
100
|
+
* 用于保留原有全量列表通知能力,同时让订阅方可按 changedOrders 做增量处理。
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* const changedOrders = payload.changedOrders
|
|
104
|
+
*/
|
|
95
105
|
/**
|
|
96
106
|
* OrderSyncMessage - pubsub 同步消息结构
|
|
97
107
|
*/
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type { BookingData, BookingFilters, BookingFilterResult, OrderData } from '../types';
|
|
1
|
+
import type { BookingData, BookingFilters, BookingFilterResult, OrderBookingItem, OrderData, OrderProductLineItem } from '../types';
|
|
2
2
|
export type { BookingData, BookingFilters, BookingFilterResult } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 从整单 `order.products` 中归集属于指定 `booking` 的明细行。
|
|
5
|
+
* - 第一遍:`product.schedule_event_id === booking.schedule_event_id`(保持 products 原顺序)
|
|
6
|
+
* - 第二遍:按 `relation_items` 顺序追加 `resource_id` 与 `order_detail_id` 匹配且尚未收录的行
|
|
7
|
+
*/
|
|
8
|
+
export declare function productsForBooking(order: OrderData, booking: OrderBookingItem): OrderProductLineItem[];
|
|
3
9
|
export declare function flattenOrdersToBookings(orders: OrderData[]): BookingData[];
|
|
4
10
|
export declare function filterBookingsFromOrders(orders: OrderData[], filters: BookingFilters): BookingFilterResult;
|
|
5
11
|
export declare function sortBookings(result: BookingFilterResult, filters: BookingFilters): BookingFilterResult;
|
|
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.filterBookings = filterBookings;
|
|
7
7
|
exports.filterBookingsFromOrders = filterBookingsFromOrders;
|
|
8
8
|
exports.flattenOrdersToBookings = flattenOrdersToBookings;
|
|
9
|
+
exports.productsForBooking = productsForBooking;
|
|
9
10
|
exports.sortBookings = sortBookings;
|
|
11
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
13
|
/** 预约状态:协议 appointment_status 优先,兼容历史 status */
|
|
11
14
|
function getBookingAppointmentStatus(booking) {
|
|
12
15
|
return String(booking.appointment_status ?? booking.status ?? '');
|
|
@@ -19,7 +22,23 @@ function getBookingAppointmentStatus(booking) {
|
|
|
19
22
|
function toTimestamp(value) {
|
|
20
23
|
if (value === undefined || value === null || value === '') return 0;
|
|
21
24
|
if (typeof value === 'number') return value;
|
|
22
|
-
|
|
25
|
+
// 使用 dayjs 按本地时区解析,避免 new Date("YYYY-MM-DD") 被当作 UTC 0 点
|
|
26
|
+
const d = (0, _dayjs.default)(value);
|
|
27
|
+
return d.isValid() ? d.valueOf() : 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** 日期范围端点解析:纯日期串自动对齐到当天起止边界(本地时区) */
|
|
31
|
+
const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
32
|
+
function toRangeBoundary(value, isEnd) {
|
|
33
|
+
if (value === undefined || value === null || value === '') return 0;
|
|
34
|
+
if (typeof value === 'number') return value;
|
|
35
|
+
const str = String(value).trim();
|
|
36
|
+
const d = (0, _dayjs.default)(str);
|
|
37
|
+
if (!d.isValid()) return 0;
|
|
38
|
+
if (DATE_ONLY_RE.test(str)) {
|
|
39
|
+
return (isEnd ? d.endOf('day') : d.startOf('day')).valueOf();
|
|
40
|
+
}
|
|
41
|
+
return d.valueOf();
|
|
23
42
|
}
|
|
24
43
|
|
|
25
44
|
/**
|
|
@@ -34,10 +53,33 @@ function bookingDateTimeString(datePart, timePart) {
|
|
|
34
53
|
}
|
|
35
54
|
return `${d} ${t}`.trim();
|
|
36
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 解析预约自身的起止时间区间,供 `sales_time_between` 做区间重叠匹配。
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* const span = resolveBookingTimeRange({ start_date: '2026-06-09', start_time: '10:00', end_date: '2026-06-15', end_time: '10:00' })
|
|
62
|
+
*/
|
|
63
|
+
function resolveBookingTimeRange(booking) {
|
|
64
|
+
const start = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
65
|
+
if (!start) return null;
|
|
66
|
+
const end = toTimestamp(bookingDateTimeString(booking.end_date || booking.start_date, booking.end_time || booking.start_time)) || start;
|
|
67
|
+
return end >= start ? [start, end] : [end, start];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 判断两个闭区间是否有交集。
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* isRangeOverlapping([1, 10], [5, 6]) // true
|
|
75
|
+
*/
|
|
76
|
+
function isRangeOverlapping(left, right) {
|
|
77
|
+
return left[0] <= right[1] && left[1] >= right[0];
|
|
78
|
+
}
|
|
37
79
|
function parseDateRange(range) {
|
|
38
80
|
if (!Array.isArray(range) || range.length < 2) return null;
|
|
39
|
-
const start =
|
|
40
|
-
const end =
|
|
81
|
+
const start = toRangeBoundary(range[0], false);
|
|
82
|
+
const end = toRangeBoundary(range[1], true);
|
|
41
83
|
if (!start && !end) return null;
|
|
42
84
|
return [start, end];
|
|
43
85
|
}
|
|
@@ -54,8 +96,14 @@ function parseNumberRange(range) {
|
|
|
54
96
|
// 供 matchOrder、matchBooking 复用,避免重复计算
|
|
55
97
|
// ─────────────────────────────────────────────────────────────────
|
|
56
98
|
|
|
99
|
+
/** 预约列表搜索兼容前端通用 `keyword` 与后端协议 `keywords` 两种字段 */
|
|
100
|
+
function resolveBookingKeyword(f) {
|
|
101
|
+
const keyword = f.keyword ?? f.keywords;
|
|
102
|
+
return typeof keyword === 'string' ? keyword.trim() : '';
|
|
103
|
+
}
|
|
57
104
|
function prepareFilters(f) {
|
|
58
105
|
const hasCustomerId = f.customer_id !== undefined && f.customer_id !== null;
|
|
106
|
+
const keyword = resolveBookingKeyword(f);
|
|
59
107
|
return {
|
|
60
108
|
orderPaymentStatusSet: f.order_payment_status?.length ? new Set(f.order_payment_status) : null,
|
|
61
109
|
orderStatusSet: f.order_status?.length ? new Set(f.order_status) : null,
|
|
@@ -72,7 +120,7 @@ function prepareFilters(f) {
|
|
|
72
120
|
updatedAtRange: parseDateRange(f.updated_at_between),
|
|
73
121
|
numberRange: parseNumberRange(f.number_between),
|
|
74
122
|
totalAmountRange: Array.isArray(f.total_amount_between) && f.total_amount_between.length === 2 ? f.total_amount_between : null,
|
|
75
|
-
keywordLower:
|
|
123
|
+
keywordLower: keyword ? keyword.toLowerCase() : '',
|
|
76
124
|
afterExecutionTimeMs: (() => {
|
|
77
125
|
const raw = f.after_execution_time;
|
|
78
126
|
if (raw === undefined || raw === null || raw === '') return null;
|
|
@@ -129,7 +177,7 @@ function matchOrder(order, ctx) {
|
|
|
129
177
|
// ─────────────────────────────────────────────────────────────────
|
|
130
178
|
|
|
131
179
|
function matchBooking(booking, orderInfo, ctx) {
|
|
132
|
-
if (ctx.enableChildBookingFilter) {
|
|
180
|
+
if (ctx.enableChildBookingFilter && booking.booking_id) {
|
|
133
181
|
const parentId = Number(booking.parent_id ?? 0);
|
|
134
182
|
const itemType = String(booking.item_type ?? '');
|
|
135
183
|
const isMatched = parentId !== 0 && itemType !== 'recurring_booking' || parentId === 0 && itemType === 'recurring_booking';
|
|
@@ -137,8 +185,8 @@ function matchBooking(booking, orderInfo, ctx) {
|
|
|
137
185
|
}
|
|
138
186
|
if (ctx.appointmentStatusSet && !ctx.appointmentStatusSet.has(getBookingAppointmentStatus(booking))) return false;
|
|
139
187
|
if (ctx.bookingTimeRange) {
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
188
|
+
const bookingRange = resolveBookingTimeRange(booking);
|
|
189
|
+
if (!bookingRange || !isRangeOverlapping(bookingRange, ctx.bookingTimeRange)) return false;
|
|
142
190
|
}
|
|
143
191
|
if (ctx.afterExecutionTimeMs != null) {
|
|
144
192
|
const bookingStartMs = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
@@ -175,6 +223,60 @@ function matchBooking(booking, orderInfo, ctx) {
|
|
|
175
223
|
return true;
|
|
176
224
|
}
|
|
177
225
|
|
|
226
|
+
// ─────────────────────────────────────────────────────────────────
|
|
227
|
+
// 当前预约归属商品:先按 schedule_event_id 命中,再按 relation_items.resource_id 追加(去重保序)
|
|
228
|
+
// ─────────────────────────────────────────────────────────────────
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* 从整单 `order.products` 中归集属于指定 `booking` 的明细行。
|
|
232
|
+
* - 第一遍:`product.schedule_event_id === booking.schedule_event_id`(保持 products 原顺序)
|
|
233
|
+
* - 第二遍:按 `relation_items` 顺序追加 `resource_id` 与 `order_detail_id` 匹配且尚未收录的行
|
|
234
|
+
*/
|
|
235
|
+
function productsForBooking(order, booking) {
|
|
236
|
+
const products = order.products;
|
|
237
|
+
if (!Array.isArray(products) || products.length === 0) return [];
|
|
238
|
+
const bookingEventId = booking.schedule_event_id;
|
|
239
|
+
const byDetailId = new Map();
|
|
240
|
+
for (let i = 0, len = products.length; i < len; i++) {
|
|
241
|
+
const p = products[i];
|
|
242
|
+
const oid = p.order_detail_id;
|
|
243
|
+
if (oid === undefined || oid === null) continue;
|
|
244
|
+
const detailId = Number(oid);
|
|
245
|
+
if (Number.isNaN(detailId)) continue;
|
|
246
|
+
byDetailId.set(detailId, p);
|
|
247
|
+
}
|
|
248
|
+
const seen = new Set();
|
|
249
|
+
const out = [];
|
|
250
|
+
for (let i = 0, len = products.length; i < len; i++) {
|
|
251
|
+
const p = products[i];
|
|
252
|
+
const oid = p.order_detail_id;
|
|
253
|
+
if (oid === undefined || oid === null) continue;
|
|
254
|
+
const detailId = Number(oid);
|
|
255
|
+
if (Number.isNaN(detailId)) continue;
|
|
256
|
+
if (bookingEventId !== undefined && bookingEventId !== null && p.schedule_event_id !== undefined && p.schedule_event_id !== null && Number(p.schedule_event_id) === Number(bookingEventId)) {
|
|
257
|
+
if (!seen.has(detailId)) {
|
|
258
|
+
seen.add(detailId);
|
|
259
|
+
out.push(p);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const relationItems = booking.relation_items;
|
|
264
|
+
if (Array.isArray(relationItems) && relationItems.length > 0) {
|
|
265
|
+
for (let r = 0, rLen = relationItems.length; r < rLen; r++) {
|
|
266
|
+
const rid = relationItems[r]?.resource_id;
|
|
267
|
+
if (rid === undefined || rid === null) continue;
|
|
268
|
+
const detailId = Number(rid);
|
|
269
|
+
if (Number.isNaN(detailId) || seen.has(detailId)) continue;
|
|
270
|
+
const line = byDetailId.get(detailId);
|
|
271
|
+
if (line) {
|
|
272
|
+
seen.add(detailId);
|
|
273
|
+
out.push(line);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return out;
|
|
278
|
+
}
|
|
279
|
+
|
|
178
280
|
// ─────────────────────────────────────────────────────────────────
|
|
179
281
|
// 转换:OrderData[] → BookingData[](独立导出,供其他场景使用)
|
|
180
282
|
// ─────────────────────────────────────────────────────────────────
|
|
@@ -191,9 +293,11 @@ function flattenOrdersToBookings(orders) {
|
|
|
191
293
|
...orderInfo
|
|
192
294
|
} = order;
|
|
193
295
|
for (let j = 0, bLen = bookings.length; j < bLen; j++) {
|
|
296
|
+
const booking = bookings[j];
|
|
194
297
|
result.push({
|
|
195
|
-
...
|
|
196
|
-
order: orderInfo
|
|
298
|
+
...booking,
|
|
299
|
+
order: orderInfo,
|
|
300
|
+
products: order.products
|
|
197
301
|
});
|
|
198
302
|
}
|
|
199
303
|
}
|
|
@@ -259,7 +363,8 @@ function filterBookingsFromOrders(orders, filters) {
|
|
|
259
363
|
}
|
|
260
364
|
paginatedList.push({
|
|
261
365
|
...booking,
|
|
262
|
-
order: orderInfo
|
|
366
|
+
order: orderInfo,
|
|
367
|
+
products: order.products
|
|
263
368
|
});
|
|
264
369
|
}
|
|
265
370
|
totalCount++;
|
|
@@ -341,7 +446,10 @@ function filterBookings(bookings, filters) {
|
|
|
341
446
|
if (!matchOrder(order, ctx)) continue;
|
|
342
447
|
if (!matchBooking(booking, order, ctx)) continue;
|
|
343
448
|
if (totalCount >= startIndex && paginatedList.length < size) {
|
|
344
|
-
paginatedList.push(
|
|
449
|
+
paginatedList.push({
|
|
450
|
+
...booking,
|
|
451
|
+
products: booking.order.products
|
|
452
|
+
});
|
|
345
453
|
}
|
|
346
454
|
totalCount++;
|
|
347
455
|
}
|