@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
|
@@ -50,20 +50,19 @@ export declare class ResourceModule extends BaseModule implements Module {
|
|
|
50
50
|
/**
|
|
51
51
|
* 创建预订
|
|
52
52
|
*/
|
|
53
|
-
createBooking(booking: Partial<ResourceBooking>): ResourceBooking;
|
|
54
53
|
/**
|
|
55
54
|
* 更新预订
|
|
56
55
|
*/
|
|
57
|
-
updateBooking(id: ResourceId, data: Partial<ResourceBooking>): ResourceBooking | undefined;
|
|
58
56
|
/**
|
|
59
57
|
* 删除预订
|
|
60
58
|
*/
|
|
61
|
-
deleteBooking(id: ResourceId): boolean;
|
|
62
59
|
/**
|
|
63
60
|
* 清空缓存
|
|
64
61
|
*/
|
|
65
62
|
clear(): Promise<void>;
|
|
66
63
|
private attachBookingsToResource;
|
|
64
|
+
private normalizeIntegerIdValue;
|
|
65
|
+
private normalizeResourceIdFields;
|
|
67
66
|
private normalizeResource;
|
|
68
67
|
private safeEmit;
|
|
69
68
|
private syncResourcesMap;
|
|
@@ -106,8 +106,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
106
106
|
this.logger = app.logger;
|
|
107
107
|
}
|
|
108
108
|
this.initResourceDataSource();
|
|
109
|
-
|
|
110
|
-
case 8:
|
|
109
|
+
case 7:
|
|
111
110
|
case "end":
|
|
112
111
|
return _context.stop();
|
|
113
112
|
}
|
|
@@ -150,38 +149,41 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
150
149
|
while (1) switch (_context2.prev = _context2.next) {
|
|
151
150
|
case 0:
|
|
152
151
|
_context2.next = 2;
|
|
153
|
-
return this.
|
|
152
|
+
return this.setupResourceSync();
|
|
154
153
|
case 2:
|
|
154
|
+
_context2.next = 4;
|
|
155
|
+
return this.loadResourcesFromSQLite();
|
|
156
|
+
case 4:
|
|
155
157
|
cachedResources = _context2.sent;
|
|
156
158
|
if (!(cachedResources.length > 0)) {
|
|
157
|
-
_context2.next =
|
|
159
|
+
_context2.next = 12;
|
|
158
160
|
break;
|
|
159
161
|
}
|
|
160
162
|
this.store.list = cloneDeep(cachedResources).map(function (item) {
|
|
161
163
|
return _this3.normalizeResource(item);
|
|
162
164
|
});
|
|
163
165
|
this.syncResourcesMap();
|
|
164
|
-
_context2.next =
|
|
166
|
+
_context2.next = 10;
|
|
165
167
|
return this.safeEmit(ResourceHooks.onResourcesChanged, this.store.list);
|
|
166
|
-
case 8:
|
|
167
|
-
_context2.next = 18;
|
|
168
|
-
break;
|
|
169
168
|
case 10:
|
|
170
|
-
_context2.next =
|
|
171
|
-
|
|
169
|
+
_context2.next = 20;
|
|
170
|
+
break;
|
|
172
171
|
case 12:
|
|
172
|
+
_context2.next = 14;
|
|
173
|
+
return this.loadResourcesByServer();
|
|
174
|
+
case 14:
|
|
173
175
|
resources = _context2.sent;
|
|
174
176
|
if (!(resources.length > 0)) {
|
|
175
|
-
_context2.next =
|
|
177
|
+
_context2.next = 20;
|
|
176
178
|
break;
|
|
177
179
|
}
|
|
178
180
|
this.store.list = cloneDeep(resources).map(function (item) {
|
|
179
181
|
return _this3.normalizeResource(item);
|
|
180
182
|
});
|
|
181
183
|
this.syncResourcesMap();
|
|
182
|
-
_context2.next =
|
|
184
|
+
_context2.next = 20;
|
|
183
185
|
return this.safeEmit(ResourceHooks.onResourcesChanged, this.store.list);
|
|
184
|
-
case
|
|
186
|
+
case 20:
|
|
185
187
|
case "end":
|
|
186
188
|
return _context2.stop();
|
|
187
189
|
}
|
|
@@ -320,66 +322,57 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
320
322
|
/**
|
|
321
323
|
* 创建预订
|
|
322
324
|
*/
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
id: id
|
|
330
|
-
}, booking);
|
|
331
|
-
this.store.bookings.push(normalized);
|
|
332
|
-
var rid = (_normalized$resource_ = normalized.resource_id) !== null && _normalized$resource_ !== void 0 ? _normalized$resource_ : normalized.resourceId;
|
|
333
|
-
if (rid !== undefined) {
|
|
334
|
-
var existing = this.resourceIdIndex.get(rid) || [];
|
|
335
|
-
existing.push(normalized);
|
|
336
|
-
this.resourceIdIndex.set(rid, existing);
|
|
337
|
-
}
|
|
325
|
+
// createBooking(booking: Partial<ResourceBooking>): ResourceBooking {
|
|
326
|
+
// const id = booking?.id ?? Date.now()
|
|
327
|
+
// const normalized: ResourceBooking = {
|
|
328
|
+
// id,
|
|
329
|
+
// ...booking,
|
|
330
|
+
// } as ResourceBooking
|
|
338
331
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
332
|
+
// this.store.bookings.push(normalized)
|
|
333
|
+
|
|
334
|
+
// const rid = normalized.resource_id ?? normalized.resourceId
|
|
335
|
+
// if (rid !== undefined) {
|
|
336
|
+
// const existing = this.resourceIdIndex.get(rid) || []
|
|
337
|
+
// existing.push(normalized)
|
|
338
|
+
// this.resourceIdIndex.set(rid, existing)
|
|
339
|
+
// }
|
|
340
|
+
|
|
341
|
+
// this.saveBookingsToSQLite(this.store.bookings).catch(() => {})
|
|
342
|
+
// this.safeEmit(ResourceHooks.onBookingsChanged, this.store.bookings)
|
|
343
|
+
// return normalized
|
|
344
|
+
// }
|
|
343
345
|
|
|
344
346
|
/**
|
|
345
347
|
* 更新预订
|
|
346
348
|
*/
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
this.rebuildBookingsIndex();
|
|
361
|
-
// this.saveBookingsToSQLite(this.store.bookings).catch(() => {})
|
|
362
|
-
this.safeEmit(ResourceHooks.onBookingsChanged, this.store.bookings);
|
|
363
|
-
return updated;
|
|
364
|
-
}
|
|
349
|
+
// updateBooking(id: ResourceId, data: Partial<ResourceBooking>): ResourceBooking | undefined {
|
|
350
|
+
// const index = this.store.bookings.findIndex(b => this.getIdKey(b.id) === this.getIdKey(id))
|
|
351
|
+
// if (index === -1) return undefined
|
|
352
|
+
|
|
353
|
+
// const old = this.store.bookings[index]
|
|
354
|
+
// const updated: ResourceBooking = { ...old, ...data, id: old.id } as ResourceBooking
|
|
355
|
+
// this.store.bookings[index] = updated
|
|
356
|
+
|
|
357
|
+
// this.rebuildBookingsIndex()
|
|
358
|
+
// this.saveBookingsToSQLite(this.store.bookings).catch(() => {})
|
|
359
|
+
// this.safeEmit(ResourceHooks.onBookingsChanged, this.store.bookings)
|
|
360
|
+
// return updated
|
|
361
|
+
// }
|
|
365
362
|
|
|
366
363
|
/**
|
|
367
364
|
* 删除预订
|
|
368
365
|
*/
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
// this.saveBookingsToSQLite(this.store.bookings).catch(() => {})
|
|
380
|
-
this.safeEmit(ResourceHooks.onBookingsChanged, this.store.bookings);
|
|
381
|
-
return true;
|
|
382
|
-
}
|
|
366
|
+
// deleteBooking(id: ResourceId): boolean {
|
|
367
|
+
// const index = this.store.bookings.findIndex(b => this.getIdKey(b.id) === this.getIdKey(id))
|
|
368
|
+
// if (index === -1) return false
|
|
369
|
+
|
|
370
|
+
// this.store.bookings.splice(index, 1)
|
|
371
|
+
// this.rebuildBookingsIndex()
|
|
372
|
+
// this.saveBookingsToSQLite(this.store.bookings).catch(() => {})
|
|
373
|
+
// this.safeEmit(ResourceHooks.onBookingsChanged, this.store.bookings)
|
|
374
|
+
// return true
|
|
375
|
+
// }
|
|
383
376
|
|
|
384
377
|
/**
|
|
385
378
|
* 清空缓存
|
|
@@ -435,15 +428,41 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
435
428
|
bookings: this.getBookingsByResourceId(resource.id)
|
|
436
429
|
});
|
|
437
430
|
}
|
|
431
|
+
}, {
|
|
432
|
+
key: "normalizeIntegerIdValue",
|
|
433
|
+
value: function normalizeIntegerIdValue(value) {
|
|
434
|
+
if (typeof value !== 'string') return value;
|
|
435
|
+
var matched = value.match(/^(-?\d+)\.0+$/);
|
|
436
|
+
if (!matched) return value;
|
|
437
|
+
return matched[1];
|
|
438
|
+
}
|
|
439
|
+
}, {
|
|
440
|
+
key: "normalizeResourceIdFields",
|
|
441
|
+
value: function normalizeResourceIdFields(resource) {
|
|
442
|
+
resource.id = this.normalizeIntegerIdValue(resource.id);
|
|
443
|
+
if (resource.form_record_id !== undefined) {
|
|
444
|
+
resource.form_record_id = this.normalizeIntegerIdValue(resource.form_record_id);
|
|
445
|
+
}
|
|
446
|
+
if (resource.form_id !== undefined) {
|
|
447
|
+
resource.form_id = this.normalizeIntegerIdValue(resource.form_id);
|
|
448
|
+
}
|
|
449
|
+
if (resource.resource_form_id !== undefined) {
|
|
450
|
+
resource.resource_form_id = this.normalizeIntegerIdValue(resource.resource_form_id);
|
|
451
|
+
}
|
|
452
|
+
if (resource.resource_id !== undefined) {
|
|
453
|
+
resource.resource_id = this.normalizeIntegerIdValue(resource.resource_id);
|
|
454
|
+
}
|
|
455
|
+
return resource;
|
|
456
|
+
}
|
|
438
457
|
}, {
|
|
439
458
|
key: "normalizeResource",
|
|
440
459
|
value: function normalizeResource(resource) {
|
|
441
460
|
var _ref2,
|
|
442
461
|
_resource$id,
|
|
443
|
-
|
|
444
|
-
var normalized = _objectSpread(_objectSpread({}, resource), {}, {
|
|
445
|
-
id: (_ref2 = (_resource$id = resource === null || resource === void 0 ? void 0 : resource.id) !== null && _resource$id !== void 0 ? _resource$id : resource === null || resource === void 0 ? void 0 : resource.form_record_id) !== null && _ref2 !== void 0 ? _ref2 : ''
|
|
446
|
-
});
|
|
462
|
+
_this7 = this;
|
|
463
|
+
var normalized = this.normalizeResourceIdFields(_objectSpread(_objectSpread({}, resource), {}, {
|
|
464
|
+
id: this.normalizeIntegerIdValue((_ref2 = (_resource$id = resource === null || resource === void 0 ? void 0 : resource.id) !== null && _resource$id !== void 0 ? _resource$id : resource === null || resource === void 0 ? void 0 : resource.form_record_id) !== null && _ref2 !== void 0 ? _ref2 : '')
|
|
465
|
+
}));
|
|
447
466
|
if (normalized.form_record_id === undefined && normalized.id !== '') {
|
|
448
467
|
normalized.form_record_id = normalized.id;
|
|
449
468
|
}
|
|
@@ -469,7 +488,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
469
488
|
}
|
|
470
489
|
if (Array.isArray(normalized.children)) {
|
|
471
490
|
normalized.children = normalized.children.map(function (child) {
|
|
472
|
-
return
|
|
491
|
+
return _this7.normalizeResource(child);
|
|
473
492
|
});
|
|
474
493
|
}
|
|
475
494
|
return normalized;
|
|
@@ -560,7 +579,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
560
579
|
key: "loadResourcesByServer",
|
|
561
580
|
value: function () {
|
|
562
581
|
var _loadResourcesByServer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
563
|
-
var
|
|
582
|
+
var _this8 = this;
|
|
564
583
|
var response, resourceList, normalizedList;
|
|
565
584
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
566
585
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -581,7 +600,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
581
600
|
response = _context5.sent;
|
|
582
601
|
resourceList = Array.isArray(response === null || response === void 0 ? void 0 : response.list) ? response.list : [];
|
|
583
602
|
normalizedList = resourceList.map(function (item) {
|
|
584
|
-
return
|
|
603
|
+
return _this8.normalizeResource(item);
|
|
585
604
|
});
|
|
586
605
|
_context5.next = 10;
|
|
587
606
|
return this.saveResourcesToSQLite(normalizedList);
|
|
@@ -646,7 +665,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
646
665
|
key: "saveResourcesToSQLite",
|
|
647
666
|
value: function () {
|
|
648
667
|
var _saveResourcesToSQLite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(resourceList) {
|
|
649
|
-
var
|
|
668
|
+
var _this9 = this;
|
|
650
669
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
651
670
|
while (1) switch (_context7.prev = _context7.next) {
|
|
652
671
|
case 0:
|
|
@@ -677,7 +696,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
677
696
|
case 11:
|
|
678
697
|
_context7.next = 13;
|
|
679
698
|
return Promise.all(resourceList.map(function (r) {
|
|
680
|
-
return
|
|
699
|
+
return _this9.dbManager.add(RESOURCE_STORE_NAME, r);
|
|
681
700
|
}));
|
|
682
701
|
case 13:
|
|
683
702
|
_context7.next = 19;
|
|
@@ -738,7 +757,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
738
757
|
key: "setupResourceSync",
|
|
739
758
|
value: function () {
|
|
740
759
|
var _setupResourceSync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
741
|
-
var
|
|
760
|
+
var _this10 = this,
|
|
742
761
|
_result$data;
|
|
743
762
|
var result, _result$data2;
|
|
744
763
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
@@ -757,12 +776,12 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
757
776
|
var data = (res === null || res === void 0 ? void 0 : res.data) || res;
|
|
758
777
|
if (!data) return;
|
|
759
778
|
var channelKey = data.module || 'resource';
|
|
760
|
-
|
|
779
|
+
_this10.pendingSyncMessages.push(_objectSpread(_objectSpread({}, data), {}, {
|
|
761
780
|
_channelKey: channelKey
|
|
762
781
|
}));
|
|
763
|
-
if (
|
|
764
|
-
|
|
765
|
-
|
|
782
|
+
if (_this10.syncTimer) clearTimeout(_this10.syncTimer);
|
|
783
|
+
_this10.syncTimer = setTimeout(function () {
|
|
784
|
+
_this10.processSyncMessages();
|
|
766
785
|
}, RESOURCE_SYNC_DEBOUNCE_MS);
|
|
767
786
|
}
|
|
768
787
|
}
|
|
@@ -771,13 +790,16 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
771
790
|
});
|
|
772
791
|
case 4:
|
|
773
792
|
result = _context8.sent;
|
|
793
|
+
this.logInfo('setupResourceSync: 资源列表查询结果', {
|
|
794
|
+
result: result
|
|
795
|
+
});
|
|
774
796
|
if (!(result !== null && result !== void 0 && (_result$data = result.data) !== null && _result$data !== void 0 && (_result$data = _result$data.list) !== null && _result$data !== void 0 && _result$data.length)) {
|
|
775
|
-
_context8.next =
|
|
797
|
+
_context8.next = 9;
|
|
776
798
|
break;
|
|
777
799
|
}
|
|
778
|
-
_context8.next =
|
|
800
|
+
_context8.next = 9;
|
|
779
801
|
return this.mergeResourcesToStore(result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.list);
|
|
780
|
-
case
|
|
802
|
+
case 9:
|
|
781
803
|
case "end":
|
|
782
804
|
return _context8.stop();
|
|
783
805
|
}
|
|
@@ -958,16 +980,16 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
958
980
|
key: "removeResourcesByIds",
|
|
959
981
|
value: function () {
|
|
960
982
|
var _removeResourcesByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(ids) {
|
|
961
|
-
var
|
|
983
|
+
var _this11 = this;
|
|
962
984
|
var keySet, _iterator4, _step4, id;
|
|
963
985
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
964
986
|
while (1) switch (_context11.prev = _context11.next) {
|
|
965
987
|
case 0:
|
|
966
988
|
keySet = new Set(ids.map(function (id) {
|
|
967
|
-
return
|
|
989
|
+
return _this11.getIdKey(id);
|
|
968
990
|
}));
|
|
969
991
|
this.store.list = this.store.list.filter(function (r) {
|
|
970
|
-
return !keySet.has(
|
|
992
|
+
return !keySet.has(_this11.getIdKey(r.id));
|
|
971
993
|
});
|
|
972
994
|
this.syncResourcesMap();
|
|
973
995
|
if (!this.dbManager) {
|
|
@@ -1024,7 +1046,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1024
1046
|
key: "mergeResourcesToStore",
|
|
1025
1047
|
value: function () {
|
|
1026
1048
|
var _mergeResourcesToStore = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(freshResources) {
|
|
1027
|
-
var
|
|
1049
|
+
var _this12 = this;
|
|
1028
1050
|
var freshMap, _iterator5, _step5, r, updatedList, _iterator6, _step6, _r;
|
|
1029
1051
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1030
1052
|
while (1) switch (_context12.prev = _context12.next) {
|
|
@@ -1062,7 +1084,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1062
1084
|
return _context12.finish(16);
|
|
1063
1085
|
case 19:
|
|
1064
1086
|
updatedList = this.store.list.map(function (r) {
|
|
1065
|
-
var key =
|
|
1087
|
+
var key = _this12.getIdKey(r.id);
|
|
1066
1088
|
if (!freshMap.has(key)) return r;
|
|
1067
1089
|
var fresh = freshMap.get(key);
|
|
1068
1090
|
freshMap.delete(key);
|
|
@@ -12,6 +12,7 @@ export declare class ScheduleModuleEx extends BaseModule implements Module, Sche
|
|
|
12
12
|
private store;
|
|
13
13
|
private dbManager;
|
|
14
14
|
private logger;
|
|
15
|
+
private hasLoadedScheduleList;
|
|
15
16
|
constructor(name?: string, version?: string);
|
|
16
17
|
/**
|
|
17
18
|
* 记录信息日志
|
|
@@ -41,6 +42,7 @@ export declare class ScheduleModuleEx extends BaseModule implements Module, Sche
|
|
|
41
42
|
* 获取所有日程列表
|
|
42
43
|
*/
|
|
43
44
|
getScheduleList(): ScheduleItem[];
|
|
45
|
+
isScheduleListLoaded(): boolean;
|
|
44
46
|
/**
|
|
45
47
|
* 根据 schedule IDs 获取日程数据
|
|
46
48
|
* 使用 Map 快速查询,时间复杂度 O(m),m 为 ids 数量
|
|
@@ -64,15 +66,15 @@ export declare class ScheduleModuleEx extends BaseModule implements Module, Sche
|
|
|
64
66
|
*/
|
|
65
67
|
getDateIsInSchedule(date: string, scheduleList: (ScheduleItem | number)[]): boolean;
|
|
66
68
|
/**
|
|
67
|
-
* 从
|
|
69
|
+
* 从 SQLite 加载日程数据
|
|
68
70
|
* @private
|
|
69
71
|
*/
|
|
70
|
-
private
|
|
72
|
+
private loadScheduleFromSQLite;
|
|
71
73
|
/**
|
|
72
|
-
* 保存日程数据到
|
|
74
|
+
* 保存日程数据到 SQLite
|
|
73
75
|
* @private
|
|
74
76
|
*/
|
|
75
|
-
private
|
|
77
|
+
private saveScheduleToSQLite;
|
|
76
78
|
/**
|
|
77
79
|
* 预加载模块数据(统一接口)
|
|
78
80
|
* 在模块注册后自动调用
|