@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
|
@@ -2,36 +2,36 @@ import type { ScheduleEventResource } from '../resource/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Order 模块主键类型(对齐标准 Sales 协议的 order_id)
|
|
4
4
|
*/
|
|
5
|
-
export type OrderId = number | string;
|
|
5
|
+
export declare type OrderId = number | string;
|
|
6
6
|
/**
|
|
7
7
|
* 协议中金额类字段多为 string 快照(交易时价格不可从基准商品重算)
|
|
8
8
|
*/
|
|
9
|
-
export type OrderMoneyString = string;
|
|
9
|
+
export declare type OrderMoneyString = string;
|
|
10
10
|
/** 订单类型。文档:appointment_booking / ticket / virtual。来源:Order.type */
|
|
11
|
-
export type OrderType = 'appointment_booking' | 'ticket' | 'virtual' | string;
|
|
11
|
+
export declare type OrderType = 'appointment_booking' | 'ticket' | 'virtual' | string;
|
|
12
12
|
/**
|
|
13
13
|
* 来源平台。文档:shop / pos / kiosk / h5 / app / mini-program。
|
|
14
14
|
* 来源:Order.platform
|
|
15
15
|
*/
|
|
16
|
-
export type OrderPlatform = 'shop' | 'pos' | 'kiosk' | 'h5' | 'app' | 'mini-program' | string;
|
|
16
|
+
export declare type OrderPlatform = 'shop' | 'pos' | 'kiosk' | 'h5' | 'app' | 'mini-program' | string;
|
|
17
17
|
/** 订单状态(仅输出)。文档:open / completed / cancelled。来源:Order.status */
|
|
18
|
-
export type OrderStatus = 'open' | 'completed' | 'cancelled' | string;
|
|
18
|
+
export declare type OrderStatus = 'open' | 'completed' | 'cancelled' | string;
|
|
19
19
|
/** 支付状态。来源:Order.payment_status */
|
|
20
|
-
export type OrderPaymentStatus = 'payment_processing' | 'paid' | 'unpaid' | 'partially_paid' | string;
|
|
20
|
+
export declare type OrderPaymentStatus = 'payment_processing' | 'paid' | 'unpaid' | 'partially_paid' | string;
|
|
21
21
|
/** 发货状态(仅输出)。来源:Order.shipping_status */
|
|
22
|
-
export type OrderShippingStatus = 'unfulfilled' | 'fulfilled' | string;
|
|
22
|
+
export declare type OrderShippingStatus = 'unfulfilled' | 'fulfilled' | string;
|
|
23
23
|
/**
|
|
24
24
|
* 预约子事件状态(仅输出)。
|
|
25
25
|
* 文档:new / confirmed / arrived / started / completed / cancelled。
|
|
26
26
|
* 来源:ScheduleEvent.appointment_status
|
|
27
27
|
*/
|
|
28
|
-
export type AppointmentStatus = 'new' | 'confirmed' | 'arrived' | 'started' | 'completed' | 'cancelled' | string;
|
|
28
|
+
export declare type AppointmentStatus = 'new' | 'confirmed' | 'arrived' | 'started' | 'completed' | 'cancelled' | string;
|
|
29
29
|
/** 折扣类型:shop(整单)/ product(商品)。来源:Discount.type */
|
|
30
|
-
export type OrderProductDiscountType = 'shop' | 'product' | string;
|
|
30
|
+
export declare type OrderProductDiscountType = 'shop' | 'product' | string;
|
|
31
31
|
/** 支付记录状态:paid / voided / payment_pending 等。来源:OrderPayment.status */
|
|
32
|
-
export type OrderPaymentRecordStatus = 'paid' | 'voided' | 'payment_pending' | string;
|
|
32
|
+
export declare type OrderPaymentRecordStatus = 'paid' | 'voided' | 'payment_pending' | string;
|
|
33
33
|
/** 附加费类型。来源:OrderSurcharge.type */
|
|
34
|
-
export type OrderSurchargeType = string;
|
|
34
|
+
export declare type OrderSurchargeType = string;
|
|
35
35
|
/** 商品折扣 metadata,常含 unique_identification_number */
|
|
36
36
|
export interface OrderProductDiscountMetadata {
|
|
37
37
|
/** 设备端本地唯一标识,用于与服务端记录对齐 */
|
|
@@ -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,23 +411,28 @@ 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 以便筛选与数据源扩展 */
|
|
389
419
|
[key: string]: any;
|
|
390
420
|
}
|
|
391
421
|
/** 去掉 bookings 后的订单快照;展开预约行时挂在 {@link BookingData.order} 上 */
|
|
392
|
-
export type OrderWithoutBookings = Omit<OrderData, 'bookings'>;
|
|
422
|
+
export declare 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
|
-
export type BookingData = OrderBookingItem & {
|
|
427
|
+
export declare 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,8 +502,28 @@ export interface OrderModulePagedResult<T> {
|
|
|
466
502
|
size: number;
|
|
467
503
|
skip: number;
|
|
468
504
|
}
|
|
469
|
-
|
|
470
|
-
export
|
|
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 declare type OrderFilterResult = OrderModulePagedResult<OrderData> & {
|
|
523
|
+
/** 被过滤掉的订单及首个命中原因(与筛选短路顺序一致;不含仅分页未展示的已通过订单) */
|
|
524
|
+
rejected: OrderFilterRejectedEntry[];
|
|
525
|
+
};
|
|
526
|
+
export declare type BookingFilterResult = OrderModulePagedResult<BookingData>;
|
|
471
527
|
/**
|
|
472
528
|
* SSE 同步配置
|
|
473
529
|
*/
|
|
@@ -479,7 +535,7 @@ export interface OrderSSESyncConfig {
|
|
|
479
535
|
/**
|
|
480
536
|
* Ably 事件类型
|
|
481
537
|
*/
|
|
482
|
-
export type OrderAblyEventType = 'created' | 'updated' | 'deleted';
|
|
538
|
+
export declare type OrderAblyEventType = 'created' | 'updated' | 'deleted';
|
|
483
539
|
/**
|
|
484
540
|
* Ably 事件载荷
|
|
485
541
|
*/
|
|
@@ -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
|
*/
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
/** 去掉 bookings 后的订单快照;展开预约行时挂在 {@link BookingData.order} 上 */
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* 展开后的单条预约视图:协议 {@link OrderBookingItem} 平铺字段 + 所属订单(不含 bookings
|
|
100
|
+
* 展开后的单条预约视图:协议 {@link OrderBookingItem} 平铺字段 + 所属订单(不含 bookings)+
|
|
101
|
+
* 当前预约归属的商品行(由订单 products 按 schedule_event_id / relation_items 归集,不修改 order)
|
|
101
102
|
*/
|
|
102
103
|
|
|
103
104
|
/**
|
|
@@ -110,6 +111,10 @@
|
|
|
110
111
|
|
|
111
112
|
/** 分页筛选结果通用结构 */
|
|
112
113
|
|
|
114
|
+
/** 单条筛选未命中说明(用于排查过滤原因) */
|
|
115
|
+
|
|
116
|
+
/** 未通过筛选的订单及首个未满足条件(与过滤短路顺序一致) */
|
|
117
|
+
|
|
113
118
|
/**
|
|
114
119
|
* SSE 同步配置
|
|
115
120
|
*/
|
|
@@ -122,6 +127,14 @@
|
|
|
122
127
|
* Ably 事件载荷
|
|
123
128
|
*/
|
|
124
129
|
|
|
130
|
+
/**
|
|
131
|
+
* 订单变更广播载荷。
|
|
132
|
+
* 用于保留原有全量列表通知能力,同时让订阅方可按 changedOrders 做增量处理。
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* const changedOrders = payload.changedOrders
|
|
136
|
+
*/
|
|
137
|
+
|
|
125
138
|
/**
|
|
126
139
|
* OrderSyncMessage - pubsub 同步消息结构
|
|
127
140
|
*/
|
|
@@ -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;
|
|
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
import dayjs from 'dayjs';
|
|
12
13
|
/** 预约状态:协议 appointment_status 优先,兼容历史 status */
|
|
13
14
|
function getBookingAppointmentStatus(booking) {
|
|
14
15
|
var _ref, _booking$appointment_;
|
|
@@ -22,7 +23,23 @@ function getBookingAppointmentStatus(booking) {
|
|
|
22
23
|
function toTimestamp(value) {
|
|
23
24
|
if (value === undefined || value === null || value === '') return 0;
|
|
24
25
|
if (typeof value === 'number') return value;
|
|
25
|
-
|
|
26
|
+
// 使用 dayjs 按本地时区解析,避免 new Date("YYYY-MM-DD") 被当作 UTC 0 点
|
|
27
|
+
var d = dayjs(value);
|
|
28
|
+
return d.isValid() ? d.valueOf() : 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 日期范围端点解析:纯日期串自动对齐到当天起止边界(本地时区) */
|
|
32
|
+
var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
33
|
+
function toRangeBoundary(value, isEnd) {
|
|
34
|
+
if (value === undefined || value === null || value === '') return 0;
|
|
35
|
+
if (typeof value === 'number') return value;
|
|
36
|
+
var str = String(value).trim();
|
|
37
|
+
var d = dayjs(str);
|
|
38
|
+
if (!d.isValid()) return 0;
|
|
39
|
+
if (DATE_ONLY_RE.test(str)) {
|
|
40
|
+
return (isEnd ? d.endOf('day') : d.startOf('day')).valueOf();
|
|
41
|
+
}
|
|
42
|
+
return d.valueOf();
|
|
26
43
|
}
|
|
27
44
|
|
|
28
45
|
/**
|
|
@@ -37,10 +54,33 @@ function bookingDateTimeString(datePart, timePart) {
|
|
|
37
54
|
}
|
|
38
55
|
return "".concat(d, " ").concat(t).trim();
|
|
39
56
|
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 解析预约自身的起止时间区间,供 `sales_time_between` 做区间重叠匹配。
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* const span = resolveBookingTimeRange({ start_date: '2026-06-09', start_time: '10:00', end_date: '2026-06-15', end_time: '10:00' })
|
|
63
|
+
*/
|
|
64
|
+
function resolveBookingTimeRange(booking) {
|
|
65
|
+
var start = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
66
|
+
if (!start) return null;
|
|
67
|
+
var end = toTimestamp(bookingDateTimeString(booking.end_date || booking.start_date, booking.end_time || booking.start_time)) || start;
|
|
68
|
+
return end >= start ? [start, end] : [end, start];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 判断两个闭区间是否有交集。
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* isRangeOverlapping([1, 10], [5, 6]) // true
|
|
76
|
+
*/
|
|
77
|
+
function isRangeOverlapping(left, right) {
|
|
78
|
+
return left[0] <= right[1] && left[1] >= right[0];
|
|
79
|
+
}
|
|
40
80
|
function parseDateRange(range) {
|
|
41
81
|
if (!Array.isArray(range) || range.length < 2) return null;
|
|
42
|
-
var start =
|
|
43
|
-
var end =
|
|
82
|
+
var start = toRangeBoundary(range[0], false);
|
|
83
|
+
var end = toRangeBoundary(range[1], true);
|
|
44
84
|
if (!start && !end) return null;
|
|
45
85
|
return [start, end];
|
|
46
86
|
}
|
|
@@ -57,9 +97,16 @@ function parseNumberRange(range) {
|
|
|
57
97
|
// 供 matchOrder、matchBooking 复用,避免重复计算
|
|
58
98
|
// ─────────────────────────────────────────────────────────────────
|
|
59
99
|
|
|
100
|
+
/** 预约列表搜索兼容前端通用 `keyword` 与后端协议 `keywords` 两种字段 */
|
|
101
|
+
function resolveBookingKeyword(f) {
|
|
102
|
+
var _f$keyword;
|
|
103
|
+
var keyword = (_f$keyword = f.keyword) !== null && _f$keyword !== void 0 ? _f$keyword : f.keywords;
|
|
104
|
+
return typeof keyword === 'string' ? keyword.trim() : '';
|
|
105
|
+
}
|
|
60
106
|
function prepareFilters(f) {
|
|
61
107
|
var _f$order_payment_stat, _f$order_status, _f$order_sales_channe, _f$payment_method, _f$appointment_status, _f$form_record_ids;
|
|
62
108
|
var hasCustomerId = f.customer_id !== undefined && f.customer_id !== null;
|
|
109
|
+
var keyword = resolveBookingKeyword(f);
|
|
63
110
|
return {
|
|
64
111
|
orderPaymentStatusSet: (_f$order_payment_stat = f.order_payment_status) !== null && _f$order_payment_stat !== void 0 && _f$order_payment_stat.length ? new Set(f.order_payment_status) : null,
|
|
65
112
|
orderStatusSet: (_f$order_status = f.order_status) !== null && _f$order_status !== void 0 && _f$order_status.length ? new Set(f.order_status) : null,
|
|
@@ -76,7 +123,7 @@ function prepareFilters(f) {
|
|
|
76
123
|
updatedAtRange: parseDateRange(f.updated_at_between),
|
|
77
124
|
numberRange: parseNumberRange(f.number_between),
|
|
78
125
|
totalAmountRange: Array.isArray(f.total_amount_between) && f.total_amount_between.length === 2 ? f.total_amount_between : null,
|
|
79
|
-
keywordLower:
|
|
126
|
+
keywordLower: keyword ? keyword.toLowerCase() : '',
|
|
80
127
|
afterExecutionTimeMs: function () {
|
|
81
128
|
var raw = f.after_execution_time;
|
|
82
129
|
if (raw === undefined || raw === null || raw === '') return null;
|
|
@@ -134,7 +181,7 @@ function matchOrder(order, ctx) {
|
|
|
134
181
|
// ─────────────────────────────────────────────────────────────────
|
|
135
182
|
|
|
136
183
|
function matchBooking(booking, orderInfo, ctx) {
|
|
137
|
-
if (ctx.enableChildBookingFilter) {
|
|
184
|
+
if (ctx.enableChildBookingFilter && booking.booking_id) {
|
|
138
185
|
var _parent_id, _item_type;
|
|
139
186
|
var parentId = Number((_parent_id = booking.parent_id) !== null && _parent_id !== void 0 ? _parent_id : 0);
|
|
140
187
|
var itemType = String((_item_type = booking.item_type) !== null && _item_type !== void 0 ? _item_type : '');
|
|
@@ -143,8 +190,8 @@ function matchBooking(booking, orderInfo, ctx) {
|
|
|
143
190
|
}
|
|
144
191
|
if (ctx.appointmentStatusSet && !ctx.appointmentStatusSet.has(getBookingAppointmentStatus(booking))) return false;
|
|
145
192
|
if (ctx.bookingTimeRange) {
|
|
146
|
-
var
|
|
147
|
-
if (
|
|
193
|
+
var bookingRange = resolveBookingTimeRange(booking);
|
|
194
|
+
if (!bookingRange || !isRangeOverlapping(bookingRange, ctx.bookingTimeRange)) return false;
|
|
148
195
|
}
|
|
149
196
|
if (ctx.afterExecutionTimeMs != null) {
|
|
150
197
|
var bookingStartMs = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
@@ -180,6 +227,61 @@ function matchBooking(booking, orderInfo, ctx) {
|
|
|
180
227
|
return true;
|
|
181
228
|
}
|
|
182
229
|
|
|
230
|
+
// ─────────────────────────────────────────────────────────────────
|
|
231
|
+
// 当前预约归属商品:先按 schedule_event_id 命中,再按 relation_items.resource_id 追加(去重保序)
|
|
232
|
+
// ─────────────────────────────────────────────────────────────────
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 从整单 `order.products` 中归集属于指定 `booking` 的明细行。
|
|
236
|
+
* - 第一遍:`product.schedule_event_id === booking.schedule_event_id`(保持 products 原顺序)
|
|
237
|
+
* - 第二遍:按 `relation_items` 顺序追加 `resource_id` 与 `order_detail_id` 匹配且尚未收录的行
|
|
238
|
+
*/
|
|
239
|
+
export function productsForBooking(order, booking) {
|
|
240
|
+
var products = order.products;
|
|
241
|
+
if (!Array.isArray(products) || products.length === 0) return [];
|
|
242
|
+
var bookingEventId = booking.schedule_event_id;
|
|
243
|
+
var byDetailId = new Map();
|
|
244
|
+
for (var i = 0, len = products.length; i < len; i++) {
|
|
245
|
+
var p = products[i];
|
|
246
|
+
var oid = p.order_detail_id;
|
|
247
|
+
if (oid === undefined || oid === null) continue;
|
|
248
|
+
var detailId = Number(oid);
|
|
249
|
+
if (Number.isNaN(detailId)) continue;
|
|
250
|
+
byDetailId.set(detailId, p);
|
|
251
|
+
}
|
|
252
|
+
var seen = new Set();
|
|
253
|
+
var out = [];
|
|
254
|
+
for (var _i = 0, _len = products.length; _i < _len; _i++) {
|
|
255
|
+
var _p = products[_i];
|
|
256
|
+
var _oid = _p.order_detail_id;
|
|
257
|
+
if (_oid === undefined || _oid === null) continue;
|
|
258
|
+
var _detailId = Number(_oid);
|
|
259
|
+
if (Number.isNaN(_detailId)) continue;
|
|
260
|
+
if (bookingEventId !== undefined && bookingEventId !== null && _p.schedule_event_id !== undefined && _p.schedule_event_id !== null && Number(_p.schedule_event_id) === Number(bookingEventId)) {
|
|
261
|
+
if (!seen.has(_detailId)) {
|
|
262
|
+
seen.add(_detailId);
|
|
263
|
+
out.push(_p);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
var relationItems = booking.relation_items;
|
|
268
|
+
if (Array.isArray(relationItems) && relationItems.length > 0) {
|
|
269
|
+
for (var r = 0, rLen = relationItems.length; r < rLen; r++) {
|
|
270
|
+
var _relationItems$r;
|
|
271
|
+
var rid = (_relationItems$r = relationItems[r]) === null || _relationItems$r === void 0 ? void 0 : _relationItems$r.resource_id;
|
|
272
|
+
if (rid === undefined || rid === null) continue;
|
|
273
|
+
var _detailId2 = Number(rid);
|
|
274
|
+
if (Number.isNaN(_detailId2) || seen.has(_detailId2)) continue;
|
|
275
|
+
var line = byDetailId.get(_detailId2);
|
|
276
|
+
if (line) {
|
|
277
|
+
seen.add(_detailId2);
|
|
278
|
+
out.push(line);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return out;
|
|
283
|
+
}
|
|
284
|
+
|
|
183
285
|
// ─────────────────────────────────────────────────────────────────
|
|
184
286
|
// 转换:OrderData[] → BookingData[](独立导出,供其他场景使用)
|
|
185
287
|
// ─────────────────────────────────────────────────────────────────
|
|
@@ -194,8 +296,10 @@ export function flattenOrdersToBookings(orders) {
|
|
|
194
296
|
var _omit = order.bookings,
|
|
195
297
|
orderInfo = _objectWithoutProperties(order, _excluded);
|
|
196
298
|
for (var j = 0, bLen = bookings.length; j < bLen; j++) {
|
|
197
|
-
|
|
198
|
-
|
|
299
|
+
var booking = bookings[j];
|
|
300
|
+
result.push(_objectSpread(_objectSpread({}, booking), {}, {
|
|
301
|
+
order: orderInfo,
|
|
302
|
+
products: order.products
|
|
199
303
|
}));
|
|
200
304
|
}
|
|
201
305
|
}
|
|
@@ -256,7 +360,8 @@ export function filterBookingsFromOrders(orders, filters) {
|
|
|
256
360
|
orderInfo = _rest;
|
|
257
361
|
}
|
|
258
362
|
paginatedList.push(_objectSpread(_objectSpread({}, booking), {}, {
|
|
259
|
-
order: orderInfo
|
|
363
|
+
order: orderInfo,
|
|
364
|
+
products: order.products
|
|
260
365
|
}));
|
|
261
366
|
}
|
|
262
367
|
totalCount++;
|
|
@@ -337,7 +442,9 @@ export function filterBookings(bookings, filters) {
|
|
|
337
442
|
if (!matchOrder(order, ctx)) continue;
|
|
338
443
|
if (!matchBooking(booking, order, ctx)) continue;
|
|
339
444
|
if (totalCount >= startIndex && paginatedList.length < size) {
|
|
340
|
-
paginatedList.push(booking)
|
|
445
|
+
paginatedList.push(_objectSpread(_objectSpread({}, booking), {}, {
|
|
446
|
+
products: booking.order.products
|
|
447
|
+
}));
|
|
341
448
|
}
|
|
342
449
|
totalCount++;
|
|
343
450
|
}
|