@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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findNextDuration = findNextDuration;
|
|
7
|
+
exports.findNextSlice = findNextSlice;
|
|
8
|
+
Object.defineProperty(exports, "getDurationValue", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _flexible.getDurationValue;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
exports.getEndDate = getEndDate;
|
|
15
|
+
exports.sliceDayIntoFiveMinutes = sliceDayIntoFiveMinutes;
|
|
16
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
17
|
+
var _flexible = require("./flexible");
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
/**
|
|
20
|
+
* 把一天切成等长时间槽,输出 timeSlices(开始时间标签)与 durationSlicesBasedOnTime(基于切片的时长选项)。
|
|
21
|
+
*
|
|
22
|
+
* 与 info2 `sliceDayIntoFiveMinutes` 行为等价;为了不依赖 `locales`,label 输出原始时间字符串('08:00 AM' / '90'),
|
|
23
|
+
* UI 侧需要本地化展示时可基于 value 自行包装。
|
|
24
|
+
*
|
|
25
|
+
* @param config booking config `basic.service_time`,{ value: minutes }
|
|
26
|
+
* @param isDay 是否跨日预约(true 时按 1~30 天切片)
|
|
27
|
+
*/
|
|
28
|
+
function sliceDayIntoFiveMinutes(config, isDay) {
|
|
29
|
+
const startTime = (0, _dayjs.default)().startOf('day');
|
|
30
|
+
const endTime = (0, _dayjs.default)().endOf('day');
|
|
31
|
+
const timeSlice = config && config.value || 5;
|
|
32
|
+
const timeSlices = [];
|
|
33
|
+
const durationSlicesBasedOnTime = [];
|
|
34
|
+
let currentTime = startTime;
|
|
35
|
+
if (isDay) {
|
|
36
|
+
let currentDay = 1;
|
|
37
|
+
while (currentDay <= 30) {
|
|
38
|
+
timeSlices.push({
|
|
39
|
+
label: currentTime.format('hh:mm A'),
|
|
40
|
+
value: currentTime.format('HH:mm')
|
|
41
|
+
});
|
|
42
|
+
durationSlicesBasedOnTime.push({
|
|
43
|
+
label: String(currentDay),
|
|
44
|
+
value: currentDay
|
|
45
|
+
});
|
|
46
|
+
currentDay += 1;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
timeSlices,
|
|
50
|
+
durationSlicesBasedOnTime
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
while (currentTime.isBefore(endTime)) {
|
|
54
|
+
timeSlices.push({
|
|
55
|
+
label: currentTime.format('hh:mm A'),
|
|
56
|
+
value: currentTime.format('HH:mm')
|
|
57
|
+
});
|
|
58
|
+
const nextTime = currentTime.add(timeSlice, 'minute');
|
|
59
|
+
const durationValue = nextTime.diff(startTime, 'minute');
|
|
60
|
+
durationSlicesBasedOnTime.push({
|
|
61
|
+
label: String(durationValue),
|
|
62
|
+
value: durationValue
|
|
63
|
+
});
|
|
64
|
+
currentTime = nextTime;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
timeSlices,
|
|
68
|
+
durationSlicesBasedOnTime
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 取「下一个 duration 选项」:优先用 defaultValue;否则在 array 中找匹配的;找不到取第一个。
|
|
74
|
+
* 与 info2 `findNextDuration` 等价。
|
|
75
|
+
*/
|
|
76
|
+
function findNextDuration(current, array, defaultValue) {
|
|
77
|
+
if (defaultValue !== undefined && defaultValue !== null) return defaultValue;
|
|
78
|
+
if (!array || array.length === 0) return undefined;
|
|
79
|
+
for (let i = 0; i < array.length; i += 1) {
|
|
80
|
+
if (array[i].value === current?.value) return array[i].value;
|
|
81
|
+
}
|
|
82
|
+
return array[0].value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** 取首选 time slice:若指定 date(HH:mm)则找第一个 >= date 的;否则第一个。 */
|
|
86
|
+
function findNextSlice(params) {
|
|
87
|
+
const {
|
|
88
|
+
timeSlices,
|
|
89
|
+
index = 0,
|
|
90
|
+
date = ''
|
|
91
|
+
} = params;
|
|
92
|
+
const currentTimeValue = date || (0, _dayjs.default)().format('HH:mm');
|
|
93
|
+
for (let i = 0; i < timeSlices.length; i += 1) {
|
|
94
|
+
if (timeSlices[i].value !== 'now' && timeSlices[i].value >= currentTimeValue) {
|
|
95
|
+
return timeSlices[i].value;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return timeSlices[index]?.value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** 取 endDate;duration='flexible' 时取 endDate 与店铺营业时间的较小值,否则 startDate + duration 分钟。 */
|
|
102
|
+
function getEndDate(startDate, duration, endDate, shopOpeningHours) {
|
|
103
|
+
if (duration === 'flexible') {
|
|
104
|
+
let openingDate = (0, _dayjs.default)(`${startDate.format('YYYY-MM-DD')} ${shopOpeningHours || '23:59'}`);
|
|
105
|
+
if ((0, _dayjs.default)(startDate).isAfter(openingDate)) {
|
|
106
|
+
openingDate = openingDate.add(1, 'day');
|
|
107
|
+
}
|
|
108
|
+
if (!endDate) return openingDate;
|
|
109
|
+
const endDateObj = (0, _dayjs.default)(endDate);
|
|
110
|
+
if (endDateObj.isAfter(openingDate)) return openingDate;
|
|
111
|
+
return endDateObj;
|
|
112
|
+
}
|
|
113
|
+
return startDate.add(Number(duration), 'minute');
|
|
114
|
+
}
|
|
@@ -8,6 +8,7 @@ var _decimal = _interopRequireDefault(require("decimal.js"));
|
|
|
8
8
|
var _utils = require("../../Product/utils");
|
|
9
9
|
var _utils2 = require("../../../solution/ShopDiscount/utils");
|
|
10
10
|
var _utils3 = require("../../Summary/utils");
|
|
11
|
+
var _utils4 = require("../../Order/utils");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
/** 与 Rules / ShopDiscount 一致的折扣入参,用于主价与 option 单价 */
|
|
13
14
|
const toDiscountPayload = discountItem => ({
|
|
@@ -160,7 +161,9 @@ const formatProductToCartItemOrigin = params => {
|
|
|
160
161
|
product_id: product.id,
|
|
161
162
|
product_variant_id: product_variant_id || 0,
|
|
162
163
|
product_bundle: origin.product?.product_bundle || [],
|
|
163
|
-
|
|
164
|
+
product_sku: origin.product?.product_sku || {
|
|
165
|
+
option: []
|
|
166
|
+
},
|
|
164
167
|
metadata: {
|
|
165
168
|
product_discount_difference
|
|
166
169
|
}
|
|
@@ -173,7 +176,17 @@ const formatProductToCartItemOrigin = params => {
|
|
|
173
176
|
origin.product.product_bundle = formatBundleToOrigin(bundle);
|
|
174
177
|
}
|
|
175
178
|
if (options?.length) {
|
|
176
|
-
origin.product.
|
|
179
|
+
origin.product.product_sku = {
|
|
180
|
+
...(origin.product.product_sku || {}),
|
|
181
|
+
option: formatOptionsToOrigin(options).map(option => {
|
|
182
|
+
const next = {
|
|
183
|
+
...option,
|
|
184
|
+
add_price: option.add_price ?? option.price
|
|
185
|
+
};
|
|
186
|
+
delete next.price;
|
|
187
|
+
return next;
|
|
188
|
+
})
|
|
189
|
+
};
|
|
177
190
|
}
|
|
178
191
|
}
|
|
179
192
|
return origin;
|
|
@@ -307,7 +320,7 @@ const formatOptionsToOrigin = options => {
|
|
|
307
320
|
return options.map(d => {
|
|
308
321
|
return {
|
|
309
322
|
num: d.num,
|
|
310
|
-
option_group_item_id: d.
|
|
323
|
+
option_group_item_id: d.option_group_item_id,
|
|
311
324
|
option_group_id: d.option_group_id
|
|
312
325
|
};
|
|
313
326
|
});
|
|
@@ -352,6 +365,15 @@ const formatBundleToOrigin = bundle => {
|
|
|
352
365
|
const product_discount_difference = (d?.discount_list || []).reduce((pre, cur) => {
|
|
353
366
|
return pre + (cur?.metadata?.product_discount_difference || 0);
|
|
354
367
|
}, 0);
|
|
368
|
+
const normalizedBundle = {
|
|
369
|
+
...d,
|
|
370
|
+
// 计算 markdown 净额时只传真实毛价;若仅有 bundle_selling_price,则由 helper 当历史净额兜底。
|
|
371
|
+
price: d?.price ?? d?.custom_price,
|
|
372
|
+
bundle_selling_price: d?.bundle_selling_price,
|
|
373
|
+
price_type: d?.price_type ?? d?.custom_price_type,
|
|
374
|
+
price_type_ext: d?.price_type_ext ?? d?.custom_price_type_ext,
|
|
375
|
+
option: getBundleValueByKey('option')
|
|
376
|
+
};
|
|
355
377
|
return {
|
|
356
378
|
bundle_group_id: getBundleValueByKey('group_id'),
|
|
357
379
|
bundle_id: d.id,
|
|
@@ -362,8 +384,8 @@ const formatBundleToOrigin = bundle => {
|
|
|
362
384
|
extension_type: getBundleValueByKey('extension_type'),
|
|
363
385
|
option: formatOptionsToOrigin(getBundleValueByKey('option')),
|
|
364
386
|
discount_list: d.discount_list,
|
|
365
|
-
"bundle_selling_price":
|
|
366
|
-
|
|
387
|
+
"bundle_selling_price": (0, _utils4.getBundleSellingMagnitude)(normalizedBundle).toFixed(2),
|
|
388
|
+
"custom_price": d?.price,
|
|
367
389
|
metadata: {
|
|
368
390
|
custom_product_bundle_map_id: d._id,
|
|
369
391
|
product_discount_difference
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.updateAllCartItemPrice = updateAllCartItemPrice;
|
|
7
|
-
var
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
7
|
+
var _utils = require("../../Order/utils");
|
|
9
8
|
async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCart, updateItemInitInfo) {
|
|
10
9
|
for (const item of cartItems) {
|
|
11
10
|
const targetProduct = priceData.find(n => n.id === item.id);
|
|
@@ -14,28 +13,35 @@ async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCa
|
|
|
14
13
|
if (!productInfo) {
|
|
15
14
|
productInfo = item._productOrigin;
|
|
16
15
|
}
|
|
16
|
+
|
|
17
|
+
// 查找选择的规格id
|
|
18
|
+
const variantId = item?._productOrigin?.product_variant_id ?? item?._origin?.product?.product_variant_id;
|
|
19
|
+
const targetVariant = targetProduct?.variant?.find(variant => Number(variant.id) === Number(variantId));
|
|
17
20
|
let bundle = item._bundleOrigin;
|
|
18
|
-
productInfo.price = targetProduct?.price;
|
|
19
|
-
productInfo.base_price = targetProduct?.base_price;
|
|
21
|
+
// productInfo.price = targetProduct?.price;
|
|
22
|
+
// productInfo.base_price = targetProduct?.base_price;
|
|
23
|
+
productInfo.price = targetVariant?.price ?? targetProduct?.price ?? productInfo.price;
|
|
24
|
+
productInfo.base_price = targetVariant?.base_price ?? targetProduct?.base_price ?? productInfo.base_price;
|
|
20
25
|
productInfo.product_variant_id = item._productOrigin?.product_variant_id;
|
|
21
26
|
bundle = bundle?.map(n => {
|
|
22
27
|
// 更新 bundle 的价格
|
|
23
28
|
const targetBundle = targetProduct?.bundle_group?.find(m => m.id === n.group_id);
|
|
24
29
|
if (targetBundle) {
|
|
25
30
|
const targetBundleItem = targetBundle.bundle_item.find(m => m.id === n.id);
|
|
26
|
-
if (targetBundleItem.price_type === 'markdown') {
|
|
27
|
-
targetBundleItem.price = new _decimal.default(targetBundleItem.price || 0).mul(-1).toNumber();
|
|
28
|
-
}
|
|
29
|
-
// 如果有选择 option,还需要加上 option 的价格
|
|
30
|
-
if (n.option) {
|
|
31
|
-
targetBundleItem.price = new _decimal.default(targetBundleItem.price || 0).add(n.option.reduce((pre, cur) => {
|
|
32
|
-
return pre + new _decimal.default(cur.price || 0).mul(cur.num || 1).toNumber();
|
|
33
|
-
}, 0)).toNumber();
|
|
34
|
-
}
|
|
35
31
|
if (targetBundleItem) {
|
|
36
|
-
|
|
32
|
+
const normalizedBundle = {
|
|
37
33
|
...n,
|
|
38
34
|
price: targetBundleItem.price,
|
|
35
|
+
custom_price: targetBundleItem.price,
|
|
36
|
+
price_type: targetBundleItem.price_type,
|
|
37
|
+
price_type_ext: targetBundleItem.price_type_ext
|
|
38
|
+
};
|
|
39
|
+
const bundleSellingPrice = (0, _utils.getBundleSellingMagnitude)(normalizedBundle).toFixed(2);
|
|
40
|
+
return {
|
|
41
|
+
...n,
|
|
42
|
+
custom_price: targetBundleItem.price,
|
|
43
|
+
price: targetBundleItem.price_type === 'markdown' ? bundleSellingPrice : targetBundleItem.price,
|
|
44
|
+
bundle_selling_price: bundleSellingPrice,
|
|
39
45
|
base_price: targetBundleItem.base_price
|
|
40
46
|
};
|
|
41
47
|
}
|
|
@@ -7,11 +7,25 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
7
7
|
private store;
|
|
8
8
|
private request;
|
|
9
9
|
private cacheId;
|
|
10
|
+
/**
|
|
11
|
+
* 判断两份选中客户的核心展示字段是否一致,用于避免重复 clone / emit。
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* this.isSameSelectedCustomer(currentCustomer, nextCustomer);
|
|
15
|
+
*/
|
|
16
|
+
private isSameSelectedCustomer;
|
|
10
17
|
private openCache;
|
|
11
18
|
private fatherModule;
|
|
12
19
|
private otherParams;
|
|
13
20
|
constructor(name?: string, version?: string);
|
|
14
21
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
|
|
27
|
+
*/
|
|
28
|
+
updateOtherParams(params: Record<string, any>): void;
|
|
15
29
|
/**
|
|
16
30
|
* 获取客户列表数据(内部方法)
|
|
17
31
|
* @param params 查询参数
|
|
@@ -24,6 +38,12 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
24
38
|
* @param operation 操作名称
|
|
25
39
|
*/
|
|
26
40
|
private handleCustomerListError;
|
|
41
|
+
/**
|
|
42
|
+
* 查询客户列表但不写入 customerList / pagination 状态。
|
|
43
|
+
*
|
|
44
|
+
* 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
|
|
45
|
+
*/
|
|
46
|
+
queryCustomerList(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
|
|
27
47
|
/**
|
|
28
48
|
* 获取客户列表
|
|
29
49
|
* @param params 查询参数
|
|
@@ -40,6 +40,24 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
40
40
|
};
|
|
41
41
|
request;
|
|
42
42
|
cacheId;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 判断两份选中客户的核心展示字段是否一致,用于避免重复 clone / emit。
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* this.isSameSelectedCustomer(currentCustomer, nextCustomer);
|
|
49
|
+
*/
|
|
50
|
+
isSameSelectedCustomer(current, next) {
|
|
51
|
+
const normalizedNext = !next ? _constants.DEFAULT_CUSTOMER : next;
|
|
52
|
+
const normalizedCurrent = current || null;
|
|
53
|
+
if (!normalizedCurrent) return false;
|
|
54
|
+
// Walk-In 是默认客户,展示文案 / 默认区号可能来自不同入口;同为 id=1 时视为同一客户。
|
|
55
|
+
if (String(normalizedCurrent?.id ?? '') === '1' && String(normalizedNext?.id ?? '') === '1') {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
const keys = ['id', 'name', 'phone', 'email', 'country_calling_code'];
|
|
59
|
+
return keys.every(key => String(normalizedCurrent?.[key] ?? '') === String(normalizedNext?.[key] ?? ''));
|
|
60
|
+
}
|
|
43
61
|
openCache = false;
|
|
44
62
|
fatherModule;
|
|
45
63
|
otherParams = {};
|
|
@@ -74,7 +92,7 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
74
92
|
} else {
|
|
75
93
|
this.store.currentPage = 1;
|
|
76
94
|
}
|
|
77
|
-
if (typeof options?.initialState?.pageSize === 'number') {
|
|
95
|
+
if (typeof options?.initialState?.pageSize === 'number' && options.initialState.pageSize > 1) {
|
|
78
96
|
this.store.pageSize = options.initialState.pageSize;
|
|
79
97
|
} else {
|
|
80
98
|
this.store.pageSize = _constants.DEFAULT_PAGE_SIZE;
|
|
@@ -95,6 +113,19 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
95
113
|
}
|
|
96
114
|
}
|
|
97
115
|
|
|
116
|
+
/**
|
|
117
|
+
* 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
|
|
121
|
+
*/
|
|
122
|
+
updateOtherParams(params) {
|
|
123
|
+
this.otherParams = params || {};
|
|
124
|
+
this.openCache = this.otherParams.openCache ?? false;
|
|
125
|
+
this.cacheId = this.otherParams.cacheId;
|
|
126
|
+
this.fatherModule = this.otherParams.fatherModule;
|
|
127
|
+
}
|
|
128
|
+
|
|
98
129
|
/**
|
|
99
130
|
* 获取客户列表数据(内部方法)
|
|
100
131
|
* @param params 查询参数
|
|
@@ -163,6 +194,26 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
163
194
|
await this.core.effects.emit(`${this.name}:onCustomerListError`, this.store.error);
|
|
164
195
|
}
|
|
165
196
|
|
|
197
|
+
/**
|
|
198
|
+
* 查询客户列表但不写入 customerList / pagination 状态。
|
|
199
|
+
*
|
|
200
|
+
* 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
|
|
201
|
+
*/
|
|
202
|
+
async queryCustomerList(params = {}) {
|
|
203
|
+
const {
|
|
204
|
+
customerList,
|
|
205
|
+
total,
|
|
206
|
+
page,
|
|
207
|
+
pageSize
|
|
208
|
+
} = await this.fetchCustomerListData(params);
|
|
209
|
+
return {
|
|
210
|
+
list: customerList,
|
|
211
|
+
total,
|
|
212
|
+
page,
|
|
213
|
+
pageSize
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
166
217
|
/**
|
|
167
218
|
* 获取客户列表
|
|
168
219
|
* @param params 查询参数
|
|
@@ -197,7 +248,6 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
197
248
|
|
|
198
249
|
// 设置客户列表(替换模式)
|
|
199
250
|
this.store.customerList = (0, _lodashEs.cloneDeep)(customerList);
|
|
200
|
-
await this.core.effects.emit(`${this.name}:onCustomerListUpdate`, this.store);
|
|
201
251
|
|
|
202
252
|
// 触发分页变化事件
|
|
203
253
|
this.triggerPaginationChange({
|
|
@@ -219,6 +269,7 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
219
269
|
} finally {
|
|
220
270
|
this.store.loading = false;
|
|
221
271
|
this.storeChange();
|
|
272
|
+
await this.core.effects.emit(`${this.name}:onCustomerListUpdate`, this.store);
|
|
222
273
|
}
|
|
223
274
|
}
|
|
224
275
|
|
|
@@ -240,6 +291,9 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
240
291
|
* @param customer 选择的客户
|
|
241
292
|
*/
|
|
242
293
|
setSelectedCustomer(customer) {
|
|
294
|
+
if (this.isSameSelectedCustomer(this.store.selectedCustomer, customer)) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
243
297
|
this.store.selectedCustomer = !customer ? _constants.DEFAULT_CUSTOMER : (0, _lodashEs.cloneDeep)(customer);
|
|
244
298
|
this.core.effects.emit(`${this.name}:onCustomerSelected`, this.store.selectedCustomer);
|
|
245
299
|
this.storeChange();
|
|
@@ -399,6 +453,11 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
399
453
|
try {
|
|
400
454
|
this.store.loadingMore = true;
|
|
401
455
|
this.store.error = null;
|
|
456
|
+
const loadMoreParams = {
|
|
457
|
+
skip: nextPage,
|
|
458
|
+
num: this.store.pageSize,
|
|
459
|
+
...this.store.searchParams // 使用存储的搜索条件
|
|
460
|
+
};
|
|
402
461
|
|
|
403
462
|
// 使用公共方法获取数据,传入存储的搜索条件
|
|
404
463
|
const {
|
|
@@ -406,11 +465,7 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
406
465
|
total,
|
|
407
466
|
page,
|
|
408
467
|
pageSize
|
|
409
|
-
} = await this.fetchCustomerListData(
|
|
410
|
-
skip: nextPage,
|
|
411
|
-
num: this.store.pageSize,
|
|
412
|
-
...this.store.searchParams // 使用存储的搜索条件
|
|
413
|
-
});
|
|
468
|
+
} = await this.fetchCustomerListData(loadMoreParams);
|
|
414
469
|
|
|
415
470
|
// 将新数据追加到现有列表(追加模式)
|
|
416
471
|
const updatedCustomerList = [...this.store.customerList, ...(0, _lodashEs.cloneDeep)(newCustomers)];
|
|
@@ -429,9 +484,6 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
429
484
|
hasMore: this.store.hasMore
|
|
430
485
|
});
|
|
431
486
|
|
|
432
|
-
// 触发通用更新事件
|
|
433
|
-
await this.core.effects.emit(`${this.name}:onCustomerListUpdate`, this.store);
|
|
434
|
-
|
|
435
487
|
// 触发分页变化事件
|
|
436
488
|
this.triggerPaginationChange({
|
|
437
489
|
page,
|
|
@@ -453,6 +505,7 @@ class CustomerModule extends _BaseModule.BaseModule {
|
|
|
453
505
|
} finally {
|
|
454
506
|
this.store.loadingMore = false;
|
|
455
507
|
this.storeChange();
|
|
508
|
+
await this.core.effects.emit(`${this.name}:onCustomerListUpdate`, this.store);
|
|
456
509
|
}
|
|
457
510
|
}
|
|
458
511
|
|
|
@@ -33,7 +33,7 @@ export interface ShopCustomer extends ICustomer {
|
|
|
33
33
|
* walletDetails.wallet: 用户所有wallet
|
|
34
34
|
* latestWalletDetail.wallet: 用户最新wallet
|
|
35
35
|
*/
|
|
36
|
-
type CustomerWith = 'formRecord' | 'walletDetails.wallet' | 'latestWalletDetail.wallet';
|
|
36
|
+
declare type CustomerWith = 'formRecord' | 'walletDetails.wallet' | 'latestWalletDetail.wallet';
|
|
37
37
|
/**
|
|
38
38
|
* 获取客户列表参数
|
|
39
39
|
*/
|
|
@@ -110,6 +110,8 @@ export interface CustomerState {
|
|
|
110
110
|
export interface CustomerModuleAPI {
|
|
111
111
|
/** 获取客户列表 */
|
|
112
112
|
getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
113
|
+
/** 查询客户列表但不更新列表分页状态 */
|
|
114
|
+
queryCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
113
115
|
/** 设置客户列表 */
|
|
114
116
|
setCustomerList: (customers: ShopCustomer[], total?: number) => void;
|
|
115
117
|
/** 设置当前选择的客户 */
|
|
@@ -16,6 +16,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
16
16
|
getDiscountList(): Discount[];
|
|
17
17
|
setOriginalDiscountList(originalDiscountList: Discount[]): Promise<void>;
|
|
18
18
|
getOriginalDiscountList(): Discount[];
|
|
19
|
+
private normalizePositiveNumberIds;
|
|
19
20
|
loadPrepareConfig(params: {
|
|
20
21
|
action?: 'create' | 'edit';
|
|
21
22
|
with_good_pass: 0 | 1;
|
|
@@ -25,7 +26,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
25
26
|
with_available_wallet_flag?: 0 | 1;
|
|
26
27
|
with_available_wallet_pass_flag?: 0 | 1;
|
|
27
28
|
request_timezone: string;
|
|
28
|
-
order_id?: number;
|
|
29
|
+
order_id?: number | string;
|
|
29
30
|
}): Promise<DiscountPrepareConfigResult>;
|
|
30
31
|
private extractAvailableWalletIds;
|
|
31
32
|
batchSearch(code: string, options?: {
|
|
@@ -69,9 +69,24 @@ class DiscountModule extends _BaseModule.BaseModule {
|
|
|
69
69
|
getOriginalDiscountList() {
|
|
70
70
|
return this.store.originalDiscountList || [];
|
|
71
71
|
}
|
|
72
|
+
normalizePositiveNumberIds(values) {
|
|
73
|
+
const ids = values.map(value => Number(value)).filter(value => Number.isFinite(value) && value > 0);
|
|
74
|
+
return Array.from(new Set(ids));
|
|
75
|
+
}
|
|
72
76
|
async loadPrepareConfig(params) {
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
if (typeof params.order_id === 'string' && params.order_id.startsWith('LOCAL_')) {
|
|
78
|
+
params.order_id = undefined;
|
|
79
|
+
}
|
|
80
|
+
const prepareConfig = await this.request.post(`/order/prepare/config`, {
|
|
81
|
+
...params,
|
|
82
|
+
with_available_wallet_flag: params.with_available_wallet_flag ?? 1,
|
|
83
|
+
with_available_wallet_pass_flag: params.with_available_wallet_pass_flag ?? 1
|
|
84
|
+
});
|
|
85
|
+
const rawDiscountList = [...(prepareConfig?.data?.good_pass_list || []), ...(prepareConfig?.data?.discount_card_list || [])];
|
|
86
|
+
const availableWalletList = [...(prepareConfig?.data?.avaiable_wallet_list || []), ...(prepareConfig?.data?.available_wallet_list || [])];
|
|
87
|
+
const availableWalletPassList = prepareConfig?.data?.available_wallet_pass_list || [];
|
|
88
|
+
const availableWalletIds = this.normalizePositiveNumberIds([...availableWalletList.map(item => item?.wallet_id), ...availableWalletPassList.map(item => item?.product_id)]);
|
|
89
|
+
const goodPassList = this.filterEnabledDiscountList(rawDiscountList) || [];
|
|
75
90
|
|
|
76
91
|
// this.setDiscountList(goodPassList);
|
|
77
92
|
|
|
@@ -276,6 +291,7 @@ class DiscountModule extends _BaseModule.BaseModule {
|
|
|
276
291
|
this.store.discountList = [];
|
|
277
292
|
this.core.effects.offByModuleDestroy(this.name);
|
|
278
293
|
await this.core.effects.emit(`${this.name}:onDestroy`, {});
|
|
294
|
+
super.destroy();
|
|
279
295
|
}
|
|
280
296
|
async clear() {
|
|
281
297
|
this.store.discountList = [];
|
|
@@ -63,7 +63,7 @@ interface UsageCreditsValue {
|
|
|
63
63
|
max_per_week: number;
|
|
64
64
|
max_per_month: number;
|
|
65
65
|
}
|
|
66
|
-
export type DiscountFilterRejectKey = 'total_credits' | 'per_user_limit' | 'max_per_day' | 'max_per_week' | 'max_per_month';
|
|
66
|
+
export declare type DiscountFilterRejectKey = 'total_credits' | 'per_user_limit' | 'max_per_day' | 'max_per_week' | 'max_per_month';
|
|
67
67
|
export interface DiscountWithReason {
|
|
68
68
|
discountList: Discount[];
|
|
69
69
|
unavailableReasonKey: DiscountFilterRejectKey | null;
|
|
@@ -145,6 +145,7 @@ export interface Discount {
|
|
|
145
145
|
appliedProductDetails: ApplicableProductDetails[];
|
|
146
146
|
isDisabledForProductUsed?: boolean;
|
|
147
147
|
amount?: number;
|
|
148
|
+
customer_id?: number | string | null;
|
|
148
149
|
extension_data?: ExtensionData[];
|
|
149
150
|
total_order_behavior_count?: number;
|
|
150
151
|
today_order_behavior_count?: number;
|
|
@@ -39,7 +39,7 @@ export interface IFormItemData {
|
|
|
39
39
|
/**
|
|
40
40
|
* form_id 为 key 的 map 结构,如 948: { records: [], form: {} }
|
|
41
41
|
*/
|
|
42
|
-
export type HolderFormMap = Record<string, IFormItemData>;
|
|
42
|
+
export declare type HolderFormMap = Record<string, IFormItemData>;
|
|
43
43
|
/**
|
|
44
44
|
* Holder 模块 reactive store,仅 holderMap 会触发 changed 事件
|
|
45
45
|
*/
|
|
@@ -9,6 +9,7 @@ export declare class OpenDataModule extends BaseModule implements Module {
|
|
|
9
9
|
protected defaultVersion: string;
|
|
10
10
|
private request;
|
|
11
11
|
private window;
|
|
12
|
+
private appPlugin;
|
|
12
13
|
private store;
|
|
13
14
|
private cacheId;
|
|
14
15
|
private openCache;
|
|
@@ -16,6 +17,13 @@ export declare class OpenDataModule extends BaseModule implements Module {
|
|
|
16
17
|
private otherParams;
|
|
17
18
|
constructor(name?: string, version?: string);
|
|
18
19
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
|
|
25
|
+
*/
|
|
26
|
+
updateOtherParams(params: Record<string, any>): void;
|
|
19
27
|
fetchOpenData(params: OpenDataFetchParams): Promise<OpenDataConfig>;
|
|
20
28
|
getOpenData(): OpenDataConfig | null;
|
|
21
29
|
getLastFetchedAt(): number | null;
|
|
@@ -33,6 +33,7 @@ class OpenDataModule extends _BaseModule.BaseModule {
|
|
|
33
33
|
defaultVersion = '1.0.0';
|
|
34
34
|
request;
|
|
35
35
|
window;
|
|
36
|
+
appPlugin;
|
|
36
37
|
store;
|
|
37
38
|
cacheId;
|
|
38
39
|
openCache = false;
|
|
@@ -56,13 +57,28 @@ class OpenDataModule extends _BaseModule.BaseModule {
|
|
|
56
57
|
}
|
|
57
58
|
this.request = core.getPlugin('request');
|
|
58
59
|
this.window = core.getPlugin('window');
|
|
60
|
+
this.appPlugin = core.getPlugin('app');
|
|
59
61
|
if (!this.request) throw new Error('OpenDataModule 需要 request 插件支持');
|
|
60
62
|
if (!this.window) throw new Error('OpenDataModule 需要 window 插件支持');
|
|
61
63
|
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
|
|
70
|
+
*/
|
|
71
|
+
updateOtherParams(params) {
|
|
72
|
+
this.otherParams = params || {};
|
|
73
|
+
this.openCache = this.otherParams.openCache ?? false;
|
|
74
|
+
this.cacheId = this.otherParams.cacheId;
|
|
75
|
+
this.fatherModule = this.otherParams.fatherModule;
|
|
76
|
+
}
|
|
62
77
|
async fetchOpenData(params) {
|
|
63
|
-
const
|
|
78
|
+
const getData = this.appPlugin?.getData?.();
|
|
79
|
+
const shopId = getData?.('shop_id');
|
|
64
80
|
if (!shopId) throw new Error('[OpenDataModule] 无法获取 shop_id');
|
|
65
|
-
const tenantId =
|
|
81
|
+
const tenantId = getData?.('tenant_id');
|
|
66
82
|
const headers = {};
|
|
67
83
|
if (tenantId) headers['Tenant-Id'] = String(tenantId);
|
|
68
84
|
const response = await this.request.post(`/open/my-pisell/${shopId}/setting`, {
|
|
@@ -71,6 +87,8 @@ class OpenDataModule extends _BaseModule.BaseModule {
|
|
|
71
87
|
section_code: params.section_code
|
|
72
88
|
}, {
|
|
73
89
|
pisell2: true,
|
|
90
|
+
isPisell2: true,
|
|
91
|
+
prefix: false,
|
|
74
92
|
headers
|
|
75
93
|
});
|
|
76
94
|
if (response?.status === false) {
|
|
@@ -88,7 +106,7 @@ class OpenDataModule extends _BaseModule.BaseModule {
|
|
|
88
106
|
return this.store.lastFetchedAt ?? null;
|
|
89
107
|
}
|
|
90
108
|
checkAvailability(scheduleModule) {
|
|
91
|
-
const scheduleList = scheduleModule ? scheduleModule
|
|
109
|
+
const scheduleList = scheduleModule ? scheduleModule?.getScheduleListByIds(this.store.data?.['availability.operating_hours'] || []) : undefined;
|
|
92
110
|
return (0, _utils.computeAvailability)({
|
|
93
111
|
config: this.store.data,
|
|
94
112
|
scheduleList
|
|
@@ -61,7 +61,7 @@ export interface OpenDataApiResponse {
|
|
|
61
61
|
message: string;
|
|
62
62
|
data: OpenDataConfig;
|
|
63
63
|
}
|
|
64
|
-
export type OpenDataUnavailableReason = 'shop_disabled' | 'paused' | 'closed' | 'reservation_disabled';
|
|
64
|
+
export declare type OpenDataUnavailableReason = 'shop_disabled' | 'paused' | 'closed' | 'reservation_disabled';
|
|
65
65
|
export interface OpenDataAvailabilityResult {
|
|
66
66
|
available: boolean;
|
|
67
67
|
reason: OpenDataUnavailableReason | null;
|