@pisell/pisellos 0.0.568 → 0.10.1
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/core/index.js +10 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
- package/dist/model/strategy/adapter/walletPass/evaluator.js +7 -5
- package/dist/model/strategy/adapter/walletPass/example.js +26 -3
- package/dist/model/strategy/adapter/walletPass/index.js +5 -5
- package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +24 -96
- package/dist/model/strategy/strategy-example.js +19 -5
- package/dist/modules/BaseModule.d.ts +2 -2
- package/dist/modules/BaseModule.js +12 -14
- 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/index.js +3 -0
- package/dist/modules/Cart/utils/cartProduct.js +27 -5
- package/dist/modules/Cart/utils/cartResource.js +0 -2
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +20 -0
- package/dist/modules/Customer/index.js +172 -83
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Date/index.js +5 -1
- package/dist/modules/Discount/index.d.ts +2 -2
- package/dist/modules/Discount/index.js +43 -30
- package/dist/modules/Discount/types.d.ts +1 -1
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +38 -16
- package/dist/modules/Order/index.d.ts +449 -24
- package/dist/modules/Order/index.js +5460 -574
- 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 +573 -746
- package/dist/modules/Payment/types.d.ts +44 -24
- package/dist/modules/Payment/utils.d.ts +1 -1
- package/dist/modules/Payment/utils.js +4 -3
- package/dist/modules/Payment/walletpass.d.ts +0 -2
- package/dist/modules/Payment/walletpass.js +49 -33
- package/dist/modules/Product/types.d.ts +29 -7
- package/dist/modules/ProductList/index.d.ts +17 -13
- package/dist/modules/ProductList/index.js +182 -81
- package/dist/modules/ProductList/types.d.ts +16 -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 +324 -513
- package/dist/modules/Rules/types.d.ts +14 -3
- package/dist/modules/SalesSummary/index.d.ts +23 -26
- package/dist/modules/SalesSummary/index.js +152 -46
- package/dist/modules/SalesSummary/types.d.ts +9 -1
- package/dist/modules/SalesSummary/utils.d.ts +3 -22
- package/dist/modules/SalesSummary/utils.js +804 -165
- package/dist/modules/Schedule/getDateIsInSchedule.js +14 -12
- package/dist/modules/Schedule/index.d.ts +18 -5
- package/dist/modules/Schedule/index.js +79 -24
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/Schedule/utils.js +1 -0
- package/dist/modules/Step/index.js +1 -0
- package/dist/modules/Summary/index.js +4 -3
- package/dist/modules/Summary/utils.js +22 -43
- package/dist/modules/SurchargeList/index.d.ts +18 -0
- package/dist/modules/SurchargeList/index.js +185 -0
- package/dist/modules/SurchargeList/types.d.ts +15 -0
- package/dist/modules/SurchargeList/types.js +1 -0
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +4 -1
- package/dist/plugins/app.d.ts +2 -0
- package/dist/plugins/request.d.ts +1 -0
- package/dist/plugins/request.js +4 -1
- package/dist/plugins/window.js +6 -2
- package/dist/server/index.d.ts +462 -8
- package/dist/server/index.js +6168 -680
- 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/index.js +41 -32
- package/dist/server/modules/order/index.d.ts +207 -14
- package/dist/server/modules/order/index.js +2328 -379
- package/dist/server/modules/order/types.d.ts +76 -5
- package/dist/server/modules/order/types.js +14 -1
- package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/dist/server/modules/order/utils/filterBookings.js +118 -11
- package/dist/server/modules/order/utils/filterOrders.js +242 -14
- package/dist/server/modules/payment/index.d.ts +28 -0
- package/dist/server/modules/payment/index.js +305 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/payment/types.js +1 -0
- package/dist/server/modules/products/index.d.ts +105 -14
- package/dist/server/modules/products/index.js +1416 -521
- package/dist/server/modules/products/types.d.ts +34 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/server/modules/quotation/index.d.ts +39 -0
- package/dist/server/modules/quotation/index.js +298 -77
- package/dist/server/modules/resource/index.d.ts +2 -3
- package/dist/server/modules/resource/index.js +109 -86
- package/dist/server/modules/schedule/index.d.ts +6 -4
- package/dist/server/modules/schedule/index.js +145 -106
- package/dist/server/test.json +713 -0
- package/dist/server/types.d.ts +2 -0
- package/dist/server/utils/product.js +3 -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 +4009 -0
- package/dist/solution/BaseSales/types.d.ts +394 -0
- package/dist/solution/BaseSales/types.js +40 -0
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
- package/dist/solution/BaseSales/utils.d.ts +40 -0
- package/dist/solution/BaseSales/utils.js +263 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +60 -11
- package/dist/solution/BookingByStep/utils/capacity.js +11 -1
- package/dist/solution/BookingByStep/utils/resources.js +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +43 -2
- package/dist/solution/BookingTicket/index.d.ts +393 -24
- package/dist/solution/BookingTicket/index.js +2508 -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 +42 -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 +42 -28
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +30 -14
- 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/BuyTickets/index.js +12 -9
- package/dist/solution/Checkout/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +275 -209
- package/dist/solution/Checkout/utils/index.js +20 -8
- package/dist/solution/RegisterAndLogin/config.js +2 -10
- package/dist/solution/RegisterAndLogin/index.js +76 -30
- package/dist/solution/Sales/index.d.ts +50 -5
- package/dist/solution/Sales/index.js +484 -92
- package/dist/solution/Sales/types.d.ts +26 -2
- package/dist/solution/ScanOrder/index.d.ts +27 -21
- package/dist/solution/ScanOrder/index.js +519 -444
- package/dist/solution/ScanOrder/types.d.ts +33 -11
- package/dist/solution/ScanOrder/types.js +4 -5
- package/dist/solution/ScanOrder/utils.d.ts +4 -1
- package/dist/solution/ScanOrder/utils.js +109 -34
- package/dist/solution/ShopDiscount/index.js +18 -19
- package/dist/solution/ShopDiscount/types.d.ts +4 -5
- package/dist/solution/ShopDiscount/utils.d.ts +0 -9
- package/dist/solution/ShopDiscount/utils.js +0 -9
- 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 +32 -51
- package/dist/solution/VenueBooking/index.js +741 -808
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/dist/solution/VenueBooking/types.d.ts +1 -3
- package/dist/solution/VenueBooking/types.js +0 -1
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/dist/solution/VenueBooking/utils/dateSummary.js +25 -12
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/dist/solution/VenueBooking/utils/timeSlot.js +4 -9
- 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.js +18 -15
- package/dist/utils/watch.js +1 -0
- package/lib/apis/picoding.js +0 -2
- package/lib/core/index.js +132 -130
- package/lib/effects/index.js +57 -46
- package/lib/index.d.ts +0 -1
- package/lib/index.js +50 -92
- package/lib/model/index.js +21 -14
- package/lib/model/strategy/adapter/dataVariant/adapter.js +50 -38
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +236 -162
- package/lib/model/strategy/adapter/dataVariant/examples.js +237 -229
- package/lib/model/strategy/adapter/dataVariant/index.js +34 -39
- package/lib/model/strategy/adapter/dataVariant/type.js +28 -57
- package/lib/model/strategy/adapter/index.js +64 -100
- package/lib/model/strategy/adapter/itemRule/adapter.js +144 -156
- package/lib/model/strategy/adapter/itemRule/evaluator.js +48 -36
- package/lib/model/strategy/adapter/itemRule/examples.js +225 -295
- package/lib/model/strategy/adapter/itemRule/index.js +57 -83
- package/lib/model/strategy/adapter/itemRule/type.js +36 -97
- package/lib/model/strategy/adapter/promotion/adapter.js +63 -84
- package/lib/model/strategy/adapter/promotion/evaluator.js +233 -382
- package/lib/model/strategy/adapter/promotion/examples.js +159 -139
- package/lib/model/strategy/adapter/promotion/index.js +0 -1
- package/lib/model/strategy/adapter/promotion/type.js +35 -199
- package/lib/model/strategy/adapter/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/evaluator.js +152 -180
- package/lib/model/strategy/adapter/walletPass/example.js +190 -217
- package/lib/model/strategy/adapter/walletPass/index.js +51 -75
- package/lib/model/strategy/adapter/walletPass/locales.js +58 -36
- package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/lib/model/strategy/adapter/walletPass/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/lib/model/strategy/adapter/walletPass/utils.js +383 -676
- package/lib/model/strategy/engine.js +168 -270
- package/lib/model/strategy/index.js +34 -49
- package/lib/model/strategy/strategy-example.js +239 -243
- package/lib/model/strategy/type.js +40 -100
- package/lib/modules/Account/index.js +53 -39
- package/lib/modules/Account/types.js +33 -20
- package/lib/modules/AccountList/index.js +154 -116
- package/lib/modules/AccountList/types.js +31 -30
- package/lib/modules/AccountList/utils.js +30 -18
- package/lib/modules/BaseModule.d.ts +2 -2
- package/lib/modules/BaseModule.js +50 -29
- package/lib/modules/BookingContext/index.d.ts +48 -0
- package/lib/modules/BookingContext/index.js +368 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +34 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +298 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +155 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +222 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +80 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +43 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +90 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +283 -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 +46 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +377 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
- package/lib/modules/Cart/index.js +124 -170
- package/lib/modules/Cart/types.js +51 -46
- package/lib/modules/Cart/utils/cartAccount.js +39 -40
- package/lib/modules/Cart/utils/cartDate.js +61 -56
- package/lib/modules/Cart/utils/cartDiscount.js +33 -28
- package/lib/modules/Cart/utils/cartNote.js +32 -27
- package/lib/modules/Cart/utils/cartProduct.js +261 -309
- package/lib/modules/Cart/utils/cartRelationForms.js +35 -29
- package/lib/modules/Cart/utils/cartResource.js +78 -72
- package/lib/modules/Cart/utils/changePrice.js +59 -31
- package/lib/modules/Cart/utils/index.js +48 -106
- package/lib/modules/Customer/constants.js +34 -13
- package/lib/modules/Customer/index.d.ts +20 -0
- package/lib/modules/Customer/index.js +207 -217
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Customer/types.js +35 -38
- package/lib/modules/Date/index.js +115 -116
- package/lib/modules/Date/types.js +28 -16
- package/lib/modules/Date/utils.js +123 -174
- package/lib/modules/Discount/index.d.ts +2 -2
- package/lib/modules/Discount/index.js +133 -119
- package/lib/modules/Discount/types.d.ts +1 -1
- package/lib/modules/Discount/types.js +31 -9
- package/lib/modules/Guests/index.js +56 -30
- package/lib/modules/Guests/types.js +33 -23
- package/lib/modules/Holder/index.js +189 -209
- package/lib/modules/Holder/types.js +16 -4
- package/lib/modules/Holder/utils.js +49 -20
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +88 -63
- package/lib/modules/OpenData/types.js +16 -4
- package/lib/modules/OpenData/utils.js +78 -44
- package/lib/modules/Order/index.d.ts +449 -24
- package/lib/modules/Order/index.js +4184 -514
- package/lib/modules/Order/types.d.ts +693 -88
- package/lib/modules/Order/types.js +35 -24
- package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/lib/modules/Order/utils/bundleDiscountHydration.js +139 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +415 -0
- package/lib/modules/Order/utils.d.ts +167 -18
- package/lib/modules/Order/utils.js +1085 -414
- package/lib/modules/Payment/cash.js +33 -20
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +76 -145
- package/lib/modules/Payment/eftpos.js +30 -16
- package/lib/modules/Payment/index.d.ts +10 -9
- package/lib/modules/Payment/index.js +402 -636
- package/lib/modules/Payment/mx51.js +0 -1
- package/lib/modules/Payment/types.d.ts +44 -24
- package/lib/modules/Payment/types.js +107 -216
- package/lib/modules/Payment/utils.d.ts +1 -1
- package/lib/modules/Payment/utils.js +50 -52
- package/lib/modules/Payment/walletpass.d.ts +0 -2
- package/lib/modules/Payment/walletpass.js +216 -221
- package/lib/modules/Product/index.js +46 -51
- package/lib/modules/Product/types.d.ts +29 -7
- package/lib/modules/Product/types.js +16 -4
- package/lib/modules/Product/utils.js +33 -32
- package/lib/modules/ProductList/index.d.ts +17 -13
- package/lib/modules/ProductList/index.js +161 -120
- package/lib/modules/ProductList/types.d.ts +16 -0
- package/lib/modules/ProductList/types.js +31 -9
- package/lib/modules/Quotation/index.d.ts +22 -2
- package/lib/modules/Quotation/index.js +154 -64
- package/lib/modules/Quotation/types.d.ts +19 -0
- package/lib/modules/Quotation/types.js +16 -4
- package/lib/modules/Resource/index.js +59 -27
- package/lib/modules/Resource/types.js +32 -22
- package/lib/modules/Resource/utils.js +38 -30
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.d.ts +8 -10
- package/lib/modules/Rules/index.js +960 -1440
- package/lib/modules/Rules/types.d.ts +14 -3
- package/lib/modules/Rules/types.js +40 -17
- package/lib/modules/SalesSummary/index.d.ts +23 -26
- package/lib/modules/SalesSummary/index.js +134 -61
- package/lib/modules/SalesSummary/types.d.ts +9 -1
- package/lib/modules/SalesSummary/types.js +16 -4
- package/lib/modules/SalesSummary/utils.d.ts +3 -22
- package/lib/modules/SalesSummary/utils.js +814 -233
- package/lib/modules/ScanOrderLogger/index.js +79 -59
- package/lib/modules/ScanOrderLogger/providers/feishu.js +78 -54
- package/lib/modules/ScanOrderLogger/providers/grafana.js +36 -13
- package/lib/modules/ScanOrderLogger/types.js +16 -4
- package/lib/modules/Schedule/getDateIsInSchedule.js +169 -338
- package/lib/modules/Schedule/index.d.ts +18 -5
- package/lib/modules/Schedule/index.js +153 -104
- package/lib/modules/Schedule/type.js +16 -4
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/Schedule/types.js +16 -4
- package/lib/modules/Schedule/utils.js +291 -433
- package/lib/modules/Step/index.js +52 -40
- package/lib/modules/Step/tyeps.js +16 -4
- package/lib/modules/Summary/index.js +71 -66
- package/lib/modules/Summary/types.js +16 -4
- package/lib/modules/Summary/utils.js +418 -791
- package/lib/modules/SurchargeList/index.d.ts +18 -0
- package/lib/modules/SurchargeList/index.js +109 -0
- package/lib/modules/SurchargeList/types.d.ts +15 -0
- package/lib/modules/SurchargeList/types.js +17 -0
- package/lib/modules/index.d.ts +3 -0
- package/lib/modules/index.js +63 -212
- package/lib/plugins/app.d.ts +2 -0
- package/lib/plugins/app.js +16 -4
- package/lib/plugins/index.js +25 -36
- package/lib/plugins/request.d.ts +1 -0
- package/lib/plugins/request.js +126 -137
- package/lib/plugins/shopStore.js +16 -4
- package/lib/plugins/user.js +16 -4
- package/lib/plugins/window.js +179 -171
- package/lib/server/index.d.ts +462 -8
- package/lib/server/index.js +4520 -1162
- package/lib/server/modules/floor-plan/index.d.ts +39 -0
- package/lib/server/modules/floor-plan/index.js +327 -0
- package/lib/server/modules/floor-plan/types.d.ts +43 -0
- package/lib/server/modules/floor-plan/types.js +34 -0
- package/lib/server/modules/index.d.ts +7 -2
- package/lib/server/modules/index.js +67 -84
- package/lib/server/modules/menu/index.js +122 -146
- package/lib/server/modules/menu/types.js +31 -18
- package/lib/server/modules/order/index.d.ts +207 -14
- package/lib/server/modules/order/index.js +1543 -285
- package/lib/server/modules/order/types.d.ts +76 -5
- package/lib/server/modules/order/types.js +32 -107
- package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/lib/server/modules/order/utils/filterBookings.js +259 -176
- package/lib/server/modules/order/utils/filterOrders.js +293 -94
- package/lib/server/modules/payment/index.d.ts +28 -0
- package/lib/server/modules/payment/index.js +192 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/payment/types.js +17 -0
- package/lib/server/modules/products/index.d.ts +105 -14
- package/lib/server/modules/products/index.js +850 -475
- package/lib/server/modules/products/types.d.ts +34 -1
- package/lib/server/modules/products/types.js +34 -41
- package/lib/server/modules/quotation/index.d.ts +39 -0
- package/lib/server/modules/quotation/index.js +254 -75
- package/lib/server/modules/quotation/types.js +31 -21
- package/lib/server/modules/resource/index.d.ts +2 -3
- package/lib/server/modules/resource/index.js +240 -243
- package/lib/server/modules/resource/types.js +33 -42
- package/lib/server/modules/schedule/index.d.ts +6 -4
- package/lib/server/modules/schedule/index.js +146 -147
- package/lib/server/modules/schedule/types.js +21 -14
- package/lib/server/modules/schedule/utils.js +163 -334
- package/lib/server/test.json +713 -0
- package/lib/server/types.d.ts +2 -0
- package/lib/server/types.js +16 -4
- package/lib/server/utils/index.js +23 -25
- package/lib/server/utils/product.js +140 -197
- package/lib/server/utils/schedule.js +41 -34
- package/lib/server/utils/small-ticket.d.ts +71 -0
- package/lib/server/utils/small-ticket.js +904 -0
- package/lib/server/utils/time.js +49 -40
- package/lib/solution/BaseSales/index.d.ts +378 -0
- package/lib/solution/BaseSales/index.js +2533 -0
- package/lib/solution/BaseSales/types.d.ts +394 -0
- package/lib/solution/BaseSales/types.js +43 -0
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +1004 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +160 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +289 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +256 -0
- package/lib/solution/BaseSales/utils.d.ts +40 -0
- package/lib/solution/BaseSales/utils.js +244 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1340 -1530
- package/lib/solution/BookingByStep/types.js +99 -40
- package/lib/solution/BookingByStep/utils/capacity.js +160 -192
- package/lib/solution/BookingByStep/utils/products.js +52 -42
- package/lib/solution/BookingByStep/utils/resources.js +330 -527
- package/lib/solution/BookingByStep/utils/stock.js +44 -65
- package/lib/solution/BookingByStep/utils/timeslots.js +131 -129
- package/lib/solution/BookingTicket/index.d.ts +393 -24
- package/lib/solution/BookingTicket/index.js +1374 -184
- package/lib/solution/BookingTicket/types.d.ts +191 -6
- package/lib/solution/BookingTicket/types.js +79 -40
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +107 -0
- package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
- package/lib/solution/BookingTicket/utils/cartView.js +184 -0
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +58 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +97 -64
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +81 -82
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +109 -91
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +43 -90
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
- package/lib/solution/BuyTickets/index.js +70 -67
- package/lib/solution/BuyTickets/types.js +38 -22
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +1169 -1463
- package/lib/solution/Checkout/types.js +61 -91
- package/lib/solution/Checkout/utils/index.js +156 -228
- package/lib/solution/PlaceOrder/index.js +0 -55
- package/lib/solution/RegisterAndLogin/config.js +462 -503
- package/lib/solution/RegisterAndLogin/index.js +630 -633
- package/lib/solution/RegisterAndLogin/types.js +76 -189
- package/lib/solution/RegisterAndLogin/utils.js +125 -183
- package/lib/solution/Sales/index.d.ts +50 -5
- package/lib/solution/Sales/index.js +498 -238
- package/lib/solution/Sales/types.d.ts +26 -2
- package/lib/solution/Sales/types.js +33 -27
- package/lib/solution/ScanOrder/index.d.ts +27 -21
- package/lib/solution/ScanOrder/index.js +936 -864
- package/lib/solution/ScanOrder/types.d.ts +33 -11
- package/lib/solution/ScanOrder/types.js +34 -34
- package/lib/solution/ScanOrder/utils.d.ts +4 -1
- package/lib/solution/ScanOrder/utils.js +422 -385
- package/lib/solution/ShopDiscount/index.js +233 -235
- package/lib/solution/ShopDiscount/types.d.ts +4 -5
- package/lib/solution/ShopDiscount/types.js +37 -15
- package/lib/solution/ShopDiscount/utils.d.ts +0 -9
- package/lib/solution/ShopDiscount/utils.js +172 -309
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1076 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +32 -51
- package/lib/solution/VenueBooking/index.js +1008 -984
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/solution/VenueBooking/types.d.ts +1 -3
- package/lib/solution/VenueBooking/types.js +39 -20
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/lib/solution/VenueBooking/utils/dateSummary.js +62 -25
- package/lib/solution/VenueBooking/utils/resource.js +54 -31
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +109 -90
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -138
- package/lib/solution/VenueBooking/utils.js +67 -130
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +41 -102
- package/lib/store/createStore.js +29 -32
- package/lib/types/index.d.ts +12 -2
- package/lib/types/index.js +16 -4
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +47 -81
- package/package.json +2 -4
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -233
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -192
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
2
8
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
-
import { searchWalletPass, searchWallet, searchProduct } from "./cloudSearch";
|
|
11
|
+
import { searchWalletPass, searchWallet, searchProduct, searchOrder } from "./cloudSearch";
|
|
6
12
|
import scanCache from "./scanCache";
|
|
7
13
|
|
|
8
14
|
/**
|
|
@@ -70,15 +76,16 @@ var handleScanFn = function handleScanFn(getRequestList, localSearch) {
|
|
|
70
76
|
case 0:
|
|
71
77
|
_ref3 = scanResult || {}, value = _ref3.value; // 本地解析识别码
|
|
72
78
|
if (!localSearch) {
|
|
73
|
-
_context2.next =
|
|
79
|
+
_context2.next = 15;
|
|
74
80
|
break;
|
|
75
81
|
}
|
|
76
82
|
_context2.prev = 2;
|
|
77
83
|
localResult = localSearch === null || localSearch === void 0 ? void 0 : localSearch(value);
|
|
78
84
|
if (!((localResult === null || localResult === void 0 ? void 0 : localResult.length) > 0)) {
|
|
79
|
-
_context2.next =
|
|
85
|
+
_context2.next = 9;
|
|
80
86
|
break;
|
|
81
87
|
}
|
|
88
|
+
console.log('本地搜索到数据>>>>>>>', localResult);
|
|
82
89
|
return _context2.abrupt("return", {
|
|
83
90
|
searchType: 'local_product',
|
|
84
91
|
response: {
|
|
@@ -87,53 +94,58 @@ var handleScanFn = function handleScanFn(getRequestList, localSearch) {
|
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
96
|
});
|
|
90
|
-
case
|
|
91
|
-
|
|
92
|
-
break;
|
|
97
|
+
case 9:
|
|
98
|
+
console.log('本地搜索无数据>>>>>>>');
|
|
93
99
|
case 10:
|
|
94
|
-
_context2.
|
|
100
|
+
_context2.next = 15;
|
|
101
|
+
break;
|
|
102
|
+
case 12:
|
|
103
|
+
_context2.prev = 12;
|
|
95
104
|
_context2.t0 = _context2["catch"](2);
|
|
96
105
|
console.error('本地搜索到数据失败>>>>>>>', _context2.t0);
|
|
97
|
-
case
|
|
98
|
-
_context2.prev =
|
|
106
|
+
case 15:
|
|
107
|
+
_context2.prev = 15;
|
|
99
108
|
if (!scanCache.has(value)) {
|
|
100
|
-
_context2.next =
|
|
109
|
+
_context2.next = 22;
|
|
101
110
|
break;
|
|
102
111
|
}
|
|
103
112
|
result = scanCache.get(value);
|
|
113
|
+
console.log('缓存中搜索到数据>>>>>>>', result);
|
|
104
114
|
return _context2.abrupt("return", result);
|
|
105
|
-
case
|
|
106
|
-
|
|
115
|
+
case 22:
|
|
116
|
+
console.log('缓存中无数据>>>>>>>');
|
|
117
|
+
case 23:
|
|
118
|
+
_context2.next = 28;
|
|
107
119
|
break;
|
|
108
|
-
case
|
|
109
|
-
_context2.prev =
|
|
110
|
-
_context2.t1 = _context2["catch"](
|
|
120
|
+
case 25:
|
|
121
|
+
_context2.prev = 25;
|
|
122
|
+
_context2.t1 = _context2["catch"](15);
|
|
111
123
|
console.error('缓存中搜索数据失败>>>>>>>', _context2.t1);
|
|
112
|
-
case
|
|
124
|
+
case 28:
|
|
113
125
|
requestList = (getRequestList === null || getRequestList === void 0 ? void 0 : getRequestList(value)) || [];
|
|
114
126
|
if (!(requestList.length === 0)) {
|
|
115
|
-
_context2.next =
|
|
127
|
+
_context2.next = 31;
|
|
116
128
|
break;
|
|
117
129
|
}
|
|
118
130
|
throw new Error('requestList is empty');
|
|
119
|
-
case
|
|
120
|
-
_context2.prev =
|
|
121
|
-
_context2.next =
|
|
131
|
+
case 31:
|
|
132
|
+
_context2.prev = 31;
|
|
133
|
+
_context2.next = 34;
|
|
122
134
|
return promiseAny(requestList);
|
|
123
|
-
case
|
|
135
|
+
case 34:
|
|
124
136
|
_result = _context2.sent;
|
|
125
137
|
// 将结果缓存
|
|
126
138
|
scanCache.set(value, _result);
|
|
127
139
|
return _context2.abrupt("return", _result);
|
|
128
|
-
case
|
|
129
|
-
_context2.prev =
|
|
130
|
-
_context2.t2 = _context2["catch"](
|
|
140
|
+
case 39:
|
|
141
|
+
_context2.prev = 39;
|
|
142
|
+
_context2.t2 = _context2["catch"](31);
|
|
131
143
|
throw _context2.t2;
|
|
132
|
-
case
|
|
144
|
+
case 42:
|
|
133
145
|
case "end":
|
|
134
146
|
return _context2.stop();
|
|
135
147
|
}
|
|
136
|
-
}, _callee2, null, [[2,
|
|
148
|
+
}, _callee2, null, [[2, 12], [15, 25], [31, 39]]);
|
|
137
149
|
}));
|
|
138
150
|
return function (_x2) {
|
|
139
151
|
return _ref2.apply(this, arguments);
|
|
@@ -144,16 +156,18 @@ var handleScanFn = function handleScanFn(getRequestList, localSearch) {
|
|
|
144
156
|
/**
|
|
145
157
|
* 处理全局扫码
|
|
146
158
|
* @param request 请求插件
|
|
159
|
+
* @param localSearch 本地商品搜索
|
|
160
|
+
* @param channel 当前销售渠道
|
|
147
161
|
* @returns 处理结果
|
|
148
162
|
*/
|
|
149
|
-
export var handleGlobalScan = function handleGlobalScan(request, localSearch) {
|
|
163
|
+
export var handleGlobalScan = function handleGlobalScan(request, localSearch, channel) {
|
|
150
164
|
var getRequestList = function getRequestList(value) {
|
|
151
165
|
var requestList = [];
|
|
152
166
|
// 如果value是已WL开头的,则认为是钱包识别码
|
|
153
167
|
if (value.startsWith('WL')) {
|
|
154
168
|
requestList = [searchWallet(request, value)];
|
|
155
169
|
} else {
|
|
156
|
-
requestList = [searchWalletPass(request, value), searchWallet(request, value), searchProduct(request, value)];
|
|
170
|
+
requestList = [].concat(_toConsumableArray(channel === 'kiosk' ? [] : [searchOrder(request, value)]), [searchWalletPass(request, value), searchWallet(request, value), searchProduct(request, value)]);
|
|
157
171
|
}
|
|
158
172
|
return requestList;
|
|
159
173
|
};
|
|
@@ -14,12 +14,17 @@ declare enum ScanResultType {
|
|
|
14
14
|
NativeScanner = "nativeScanner"
|
|
15
15
|
}
|
|
16
16
|
export default class Scan {
|
|
17
|
+
private static scanInstances;
|
|
18
|
+
private static peripheralsListenerMounted;
|
|
17
19
|
private solution;
|
|
18
20
|
private watchKey;
|
|
19
21
|
private listenerConfig;
|
|
20
22
|
constructor(solution: BookingTicketImpl, watchKey: string);
|
|
21
23
|
/**
|
|
22
24
|
* 初始化外设扫码结果监听
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* scan.initPeripheralsListener();
|
|
23
28
|
*/
|
|
24
29
|
initPeripheralsListener(): void;
|
|
25
30
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _class;
|
|
1
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
3
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
4
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
@@ -24,6 +25,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
24
25
|
_defineProperty(this, "listenerConfig", new Map());
|
|
25
26
|
this.solution = solution;
|
|
26
27
|
this.watchKey = watchKey;
|
|
28
|
+
Scan.scanInstances.add(this);
|
|
27
29
|
|
|
28
30
|
// 初始化扫码监听
|
|
29
31
|
// this.initPeripheralsListener();
|
|
@@ -31,17 +33,23 @@ var Scan = /*#__PURE__*/function () {
|
|
|
31
33
|
|
|
32
34
|
/**
|
|
33
35
|
* 初始化外设扫码结果监听
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* scan.initPeripheralsListener();
|
|
34
39
|
*/
|
|
35
40
|
_createClass(Scan, [{
|
|
36
41
|
key: "initPeripheralsListener",
|
|
37
42
|
value: function initPeripheralsListener() {
|
|
38
|
-
var _this$solution,
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
var _this$solution, _this$solution$mountF;
|
|
44
|
+
if (Scan.peripheralsListenerMounted) return;
|
|
45
|
+
Scan.peripheralsListenerMounted = true;
|
|
41
46
|
(_this$solution = this.solution) === null || _this$solution === void 0 || (_this$solution = _this$solution.window) === null || _this$solution === void 0 || (_this$solution = _this$solution.interaction) === null || _this$solution === void 0 || (_this$solution = _this$solution.utils) === null || _this$solution === void 0 || (_this$solution$mountF = _this$solution.mountFunction) === null || _this$solution$mountF === void 0 || _this$solution$mountF.call(_this$solution, 'global', 'peripheralsResult', function (strVal) {
|
|
42
47
|
try {
|
|
43
48
|
var _result = JSON.parse(strVal);
|
|
44
|
-
|
|
49
|
+
console.log('nativeScannerResult>>>>>>>', _result);
|
|
50
|
+
Scan.scanInstances.forEach(function (instance) {
|
|
51
|
+
instance.handleScan(_result);
|
|
52
|
+
});
|
|
45
53
|
} catch (err) {
|
|
46
54
|
console.error(err);
|
|
47
55
|
}
|
|
@@ -60,8 +68,9 @@ var Scan = /*#__PURE__*/function () {
|
|
|
60
68
|
if (lastEnableEventKey) {
|
|
61
69
|
var listenerConfig = this.listenerConfig.get(lastEnableEventKey);
|
|
62
70
|
if (listenerConfig) {
|
|
71
|
+
var taskUuid = this.generateUuid();
|
|
63
72
|
listenerConfig.task.addTask({
|
|
64
|
-
uuid:
|
|
73
|
+
uuid: taskUuid,
|
|
65
74
|
type: lastEnableEventKey,
|
|
66
75
|
actionParams: {
|
|
67
76
|
scanResult: result
|
|
@@ -90,7 +99,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
90
99
|
}, {
|
|
91
100
|
key: "addListener",
|
|
92
101
|
value: function addListener(event, scanCallback) {
|
|
93
|
-
var
|
|
102
|
+
var _this = this;
|
|
94
103
|
// 订阅事件
|
|
95
104
|
watch.subscribe(this.watchKey, event);
|
|
96
105
|
// 创建任务
|
|
@@ -99,7 +108,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
99
108
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
100
109
|
args[_key] = arguments[_key];
|
|
101
110
|
}
|
|
102
|
-
return
|
|
111
|
+
return _this.scanTaskAction.apply(_this, [event.key].concat(args));
|
|
103
112
|
});
|
|
104
113
|
|
|
105
114
|
// 创建监听配置
|
|
@@ -109,7 +118,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
109
118
|
});
|
|
110
119
|
return {
|
|
111
120
|
remove: function remove() {
|
|
112
|
-
|
|
121
|
+
_this.removeListener(event);
|
|
113
122
|
}
|
|
114
123
|
};
|
|
115
124
|
}
|
|
@@ -135,6 +144,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
135
144
|
key: "removeAllListeners",
|
|
136
145
|
value: function removeAllListeners() {
|
|
137
146
|
var _this$listenerConfig, _this$listenerConfig$2, _this$listenerConfig2, _this$listenerConfig3;
|
|
147
|
+
Scan.scanInstances.delete(this);
|
|
138
148
|
watch.clearEvent(this.watchKey);
|
|
139
149
|
(_this$listenerConfig = this.listenerConfig) === null || _this$listenerConfig === void 0 || (_this$listenerConfig$2 = _this$listenerConfig.forEach) === null || _this$listenerConfig$2 === void 0 || _this$listenerConfig$2.call(_this$listenerConfig, function (item) {
|
|
140
150
|
var _item$task;
|
|
@@ -174,6 +184,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
174
184
|
}, {
|
|
175
185
|
key: "clearTaskQueue",
|
|
176
186
|
value: function clearTaskQueue(eventKey) {
|
|
187
|
+
console.log('clearTaskQueue>>>>>>>', eventKey);
|
|
177
188
|
if (eventKey) {
|
|
178
189
|
var _this$listenerConfig$3;
|
|
179
190
|
(_this$listenerConfig$3 = this.listenerConfig.get(eventKey)) === null || _this$listenerConfig$3 === void 0 || _this$listenerConfig$3.task.clearTaskQueue();
|
|
@@ -232,7 +243,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
232
243
|
taskItemUuid = other === null || other === void 0 ? void 0 : other.uuid;
|
|
233
244
|
_ref2 = this.getListenerConfig(eventKey) || {}, scanCallback = _ref2.scanCallback, task = _ref2.task;
|
|
234
245
|
if (!scanCallback) {
|
|
235
|
-
_context.next =
|
|
246
|
+
_context.next = 18;
|
|
236
247
|
break;
|
|
237
248
|
}
|
|
238
249
|
_context.prev = 6;
|
|
@@ -243,6 +254,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
243
254
|
});
|
|
244
255
|
case 9:
|
|
245
256
|
_result2 = _context.sent;
|
|
257
|
+
console.log("".concat(eventKey, "_result>>>>>>>"), _result2);
|
|
246
258
|
// 如果任务存在,则发布结果
|
|
247
259
|
if (taskItemUuid && task !== null && task !== void 0 && task.isTaskExist(taskItemUuid)) {
|
|
248
260
|
watch.publishByEventKey(this.watchKey, eventKey, {
|
|
@@ -256,11 +268,12 @@ var Scan = /*#__PURE__*/function () {
|
|
|
256
268
|
} else {
|
|
257
269
|
console.warn("".concat(eventKey, "_result_task_not_exist>>>>>>>"), task);
|
|
258
270
|
}
|
|
259
|
-
_context.next =
|
|
271
|
+
_context.next = 18;
|
|
260
272
|
break;
|
|
261
|
-
case
|
|
262
|
-
_context.prev =
|
|
273
|
+
case 14:
|
|
274
|
+
_context.prev = 14;
|
|
263
275
|
_context.t0 = _context["catch"](6);
|
|
276
|
+
console.log("".concat(eventKey, "_result_error>>>>>>>"), _context.t0);
|
|
264
277
|
// 如果任务存在,则发布结果
|
|
265
278
|
if (taskItemUuid && task !== null && task !== void 0 && task.isTaskExist(taskItemUuid)) {
|
|
266
279
|
watch.publishByEventKey(this.watchKey, eventKey, {
|
|
@@ -273,11 +286,11 @@ var Scan = /*#__PURE__*/function () {
|
|
|
273
286
|
} else {
|
|
274
287
|
console.warn("".concat(eventKey, "_result_error_task_not_exist>>>>>>>"), task);
|
|
275
288
|
}
|
|
276
|
-
case
|
|
289
|
+
case 18:
|
|
277
290
|
case "end":
|
|
278
291
|
return _context.stop();
|
|
279
292
|
}
|
|
280
|
-
}, _callee, this, [[6,
|
|
293
|
+
}, _callee, this, [[6, 14]]);
|
|
281
294
|
}));
|
|
282
295
|
function scanTaskAction() {
|
|
283
296
|
return _scanTaskAction.apply(this, arguments);
|
|
@@ -287,4 +300,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
287
300
|
}]);
|
|
288
301
|
return Scan;
|
|
289
302
|
}();
|
|
303
|
+
_class = Scan;
|
|
304
|
+
_defineProperty(Scan, "scanInstances", new Set());
|
|
305
|
+
_defineProperty(Scan, "peripheralsListenerMounted", false);
|
|
290
306
|
export { Scan as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 扫码商品条码预选规格纯函数(对齐 ticketBooking addServiceVariant/utils)。
|
|
3
|
+
*/
|
|
4
|
+
/** 套餐商品 */
|
|
5
|
+
export declare function isScanProductBundle(item: any): boolean;
|
|
6
|
+
/** 单规格 / 选项组商品 */
|
|
7
|
+
export declare function isScanProductOption(item: any): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 根据条码匹配 variant,生成 cartDetailValue(对齐 ticketBooking `genValues`)。
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const values = genScanProductValues(catalogItem, '6901234567890');
|
|
14
|
+
* const itemWithSelection = { ...catalogItem, cartDetailValue: values };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function genScanProductValues(item: any, code: string): Record<string, any>;
|
|
18
|
+
/**
|
|
19
|
+
* 统计条码命中的 variant 数量(多命中时需弹窗选择)。
|
|
20
|
+
*/
|
|
21
|
+
export declare function countScanVariantMatches(item: any, code: string): number;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
/**
|
|
11
|
+
* 扫码商品条码预选规格纯函数(对齐 ticketBooking addServiceVariant/utils)。
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** 套餐商品 */
|
|
15
|
+
export function isScanProductBundle(item) {
|
|
16
|
+
return ((item === null || item === void 0 ? void 0 : item.bundle_group_count) || 0) > 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** 单规格 / 选项组商品 */
|
|
20
|
+
export function isScanProductOption(item) {
|
|
21
|
+
var _item$option_group;
|
|
22
|
+
return ((item === null || item === void 0 ? void 0 : item.option_group_count) || 0) > 0 || ((item === null || item === void 0 || (_item$option_group = item.option_group) === null || _item$option_group === void 0 ? void 0 : _item$option_group.length) || 0) > 0;
|
|
23
|
+
}
|
|
24
|
+
function formatVariantGroupTitle(title) {
|
|
25
|
+
var variantGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
26
|
+
try {
|
|
27
|
+
return variantGroup.map(function (group) {
|
|
28
|
+
var value = title === null || title === void 0 ? void 0 : title[group === null || group === void 0 ? void 0 : group.position_id];
|
|
29
|
+
return value ? "".concat((group === null || group === void 0 ? void 0 : group.name) || '-', ": ").concat(value) : '';
|
|
30
|
+
}).filter(Boolean).join(', ');
|
|
31
|
+
} catch (_unused) {
|
|
32
|
+
return '';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function formatDataKey(data) {
|
|
36
|
+
var _next$option, _next$bundle;
|
|
37
|
+
var next = _objectSpread({}, data);
|
|
38
|
+
var key = "".concat(next.product_id);
|
|
39
|
+
var rowKey = key;
|
|
40
|
+
if (next.product_variant_id) {
|
|
41
|
+
var str = "_".concat(next.product_variant_id);
|
|
42
|
+
key += str;
|
|
43
|
+
rowKey += str;
|
|
44
|
+
}
|
|
45
|
+
if (next !== null && next !== void 0 && (_next$option = next.option) !== null && _next$option !== void 0 && _next$option.length) {
|
|
46
|
+
var _iterator = _createForOfIteratorHelper(next.option),
|
|
47
|
+
_step;
|
|
48
|
+
try {
|
|
49
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
50
|
+
var item = _step.value;
|
|
51
|
+
var _str = "_".concat(item.option_group_id, "_").concat(item.product_option_item_id);
|
|
52
|
+
key += _str;
|
|
53
|
+
rowKey += "".concat(_str, "_").concat(item.quantity || item.num);
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_iterator.e(err);
|
|
57
|
+
} finally {
|
|
58
|
+
_iterator.f();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (next !== null && next !== void 0 && (_next$bundle = next.bundle) !== null && _next$bundle !== void 0 && _next$bundle.length) {
|
|
62
|
+
var _iterator2 = _createForOfIteratorHelper(next.bundle),
|
|
63
|
+
_step2;
|
|
64
|
+
try {
|
|
65
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
66
|
+
var _item = _step2.value;
|
|
67
|
+
var _str2 = "_".concat(_item.group_id, "_").concat(_item.bundle_product_id);
|
|
68
|
+
key += _str2;
|
|
69
|
+
rowKey += "".concat(_str2, "_").concat(_item.quantity || _item.num);
|
|
70
|
+
if (_item !== null && _item !== void 0 && _item.option) {
|
|
71
|
+
var _iterator3 = _createForOfIteratorHelper(_item.option),
|
|
72
|
+
_step3;
|
|
73
|
+
try {
|
|
74
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
75
|
+
var opt = _step3.value;
|
|
76
|
+
var optStr = "_".concat(opt.option_group_id, "_").concat(opt.product_option_item_id);
|
|
77
|
+
key += optStr;
|
|
78
|
+
rowKey += "".concat(optStr, "_").concat(opt.quantity || opt.num);
|
|
79
|
+
}
|
|
80
|
+
} catch (err) {
|
|
81
|
+
_iterator3.e(err);
|
|
82
|
+
} finally {
|
|
83
|
+
_iterator3.f();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} catch (err) {
|
|
88
|
+
_iterator2.e(err);
|
|
89
|
+
} finally {
|
|
90
|
+
_iterator2.f();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (next !== null && next !== void 0 && next.session) {
|
|
94
|
+
var _next$session;
|
|
95
|
+
var _str3 = "_".concat((_next$session = next.session) === null || _next$session === void 0 ? void 0 : _next$session.key);
|
|
96
|
+
key += _str3;
|
|
97
|
+
rowKey += _str3;
|
|
98
|
+
}
|
|
99
|
+
if (next !== null && next !== void 0 && next.schedule) {
|
|
100
|
+
var _next$schedule;
|
|
101
|
+
var _str4 = "_".concat((_next$schedule = next.schedule) === null || _next$schedule === void 0 ? void 0 : _next$schedule.key);
|
|
102
|
+
key += _str4;
|
|
103
|
+
rowKey += _str4;
|
|
104
|
+
}
|
|
105
|
+
next.key = key;
|
|
106
|
+
next.rowKey = rowKey;
|
|
107
|
+
return next;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 根据条码匹配 variant,生成 cartDetailValue(对齐 ticketBooking `genValues`)。
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const values = genScanProductValues(catalogItem, '6901234567890');
|
|
116
|
+
* const itemWithSelection = { ...catalogItem, cartDetailValue: values };
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export function genScanProductValues(item, code) {
|
|
120
|
+
var _item$variant_group, _item$option_group2;
|
|
121
|
+
var params = {
|
|
122
|
+
bundle: [],
|
|
123
|
+
option: [],
|
|
124
|
+
product_id: item.id,
|
|
125
|
+
product_variant_id: 0,
|
|
126
|
+
quantity: 1,
|
|
127
|
+
rowKey: '',
|
|
128
|
+
session: null
|
|
129
|
+
};
|
|
130
|
+
if (item !== null && item !== void 0 && (_item$variant_group = item.variant_group) !== null && _item$variant_group !== void 0 && _item$variant_group.length || item !== null && item !== void 0 && (_item$option_group2 = item.option_group) !== null && _item$option_group2 !== void 0 && _item$option_group2.length) {
|
|
131
|
+
var variantItem = (item.variant || []).find(function (v) {
|
|
132
|
+
return (v === null || v === void 0 ? void 0 : v.code) === code || (v === null || v === void 0 ? void 0 : v.barcode) === code;
|
|
133
|
+
});
|
|
134
|
+
if (variantItem) {
|
|
135
|
+
params.price = Number((variantItem === null || variantItem === void 0 ? void 0 : variantItem.price) || 0);
|
|
136
|
+
params.product_variant_id = variantItem.id;
|
|
137
|
+
params.product_option_string = formatVariantGroupTitle(variantItem === null || variantItem === void 0 ? void 0 : variantItem.title, (item === null || item === void 0 ? void 0 : item.variant_group) || []);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return formatDataKey(params);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 统计条码命中的 variant 数量(多命中时需弹窗选择)。
|
|
145
|
+
*/
|
|
146
|
+
export function countScanVariantMatches(item, code) {
|
|
147
|
+
return ((item === null || item === void 0 ? void 0 : item.variant) || []).filter(function (v) {
|
|
148
|
+
return (v === null || v === void 0 ? void 0 : v.code) === code || (v === null || v === void 0 ? void 0 : v.barcode) === code;
|
|
149
|
+
}).length;
|
|
150
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ProductData } from '../../../modules/Product/types';
|
|
2
|
+
export interface SessionCatalogStaleInfo {
|
|
3
|
+
productId: number | string | null;
|
|
4
|
+
productTitle: string | null;
|
|
5
|
+
sessionDay: string | null;
|
|
6
|
+
timeBarDay: string | null;
|
|
7
|
+
bookingDate: unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 判断 session 商品 catalog 中的 session 日历日是否与当前 TimeBar / bookingDate 不一致。
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* isSessionCatalogDateStale(product, '2026-06-05 19:01:18');
|
|
14
|
+
* // session 为 2026-06-04 → true;一致或无 session 快照 → false
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSessionCatalogDateStale(product: ProductData & Record<string, any>, bookingDate: unknown): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 组装 session catalog 日期不一致时的日志 metadata。
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* buildSessionCatalogStaleInfo(product, '2026-06-05 19:01:18');
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildSessionCatalogStaleInfo(product: ProductData & Record<string, any>, bookingDate: unknown): SessionCatalogStaleInfo;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
var SESSION_EXTENSION_TYPES = ['session_product', 'session_ticket'];
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 是否为 session 商品。
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* getIsSessionProduct({ extension_type: 'session_ticket' }); // true
|
|
9
|
+
*/
|
|
10
|
+
function getIsSessionProduct(product) {
|
|
11
|
+
return SESSION_EXTENSION_TYPES.includes(product === null || product === void 0 ? void 0 : product.extension_type);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 从 session 快照解析日历日 YYYY-MM-DD。
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* resolveSessionCalendarDay({ start_at: '2026-06-05 10:00:00' }); // '2026-06-05'
|
|
19
|
+
*/
|
|
20
|
+
function resolveSessionCalendarDay(session) {
|
|
21
|
+
var _session$start_at;
|
|
22
|
+
if (!session) return null;
|
|
23
|
+
var raw = (_session$start_at = session.start_at) !== null && _session$start_at !== void 0 ? _session$start_at : session.end_at;
|
|
24
|
+
if (!raw) return null;
|
|
25
|
+
var parsed = dayjs(raw);
|
|
26
|
+
return parsed.isValid() ? parsed.format('YYYY-MM-DD') : null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 将 booking / TimeBar 日期规范为 YYYY-MM-DD。
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* formatScheduleCalendarDay('2026-06-05 19:01:18'); // '2026-06-05'
|
|
34
|
+
*/
|
|
35
|
+
function formatScheduleCalendarDay(date) {
|
|
36
|
+
if (date == null || date === '') return null;
|
|
37
|
+
var parsed = dayjs(date);
|
|
38
|
+
return parsed.isValid() ? parsed.format('YYYY-MM-DD') : null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 判断 session 商品 catalog 中的 session 日历日是否与当前 TimeBar / bookingDate 不一致。
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* isSessionCatalogDateStale(product, '2026-06-05 19:01:18');
|
|
45
|
+
* // session 为 2026-06-04 → true;一致或无 session 快照 → false
|
|
46
|
+
*/
|
|
47
|
+
export function isSessionCatalogDateStale(product, bookingDate) {
|
|
48
|
+
var _product$cartDetailVa;
|
|
49
|
+
if (!getIsSessionProduct(product)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
var timeBarDay = formatScheduleCalendarDay(bookingDate);
|
|
53
|
+
if (!timeBarDay) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
var sessionDay = resolveSessionCalendarDay((_product$cartDetailVa = product.cartDetailValue) === null || _product$cartDetailVa === void 0 ? void 0 : _product$cartDetailVa.session);
|
|
57
|
+
if (!sessionDay) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return sessionDay !== timeBarDay;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 组装 session catalog 日期不一致时的日志 metadata。
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* buildSessionCatalogStaleInfo(product, '2026-06-05 19:01:18');
|
|
68
|
+
*/
|
|
69
|
+
export function buildSessionCatalogStaleInfo(product, bookingDate) {
|
|
70
|
+
var _product$id, _ref, _product$title, _product$cartDetailVa2;
|
|
71
|
+
return {
|
|
72
|
+
productId: (_product$id = product === null || product === void 0 ? void 0 : product.id) !== null && _product$id !== void 0 ? _product$id : null,
|
|
73
|
+
productTitle: (_ref = (_product$title = product === null || product === void 0 ? void 0 : product.title) !== null && _product$title !== void 0 ? _product$title : product === null || product === void 0 ? void 0 : product.name) !== null && _ref !== void 0 ? _ref : null,
|
|
74
|
+
sessionDay: resolveSessionCalendarDay((_product$cartDetailVa2 = product.cartDetailValue) === null || _product$cartDetailVa2 === void 0 ? void 0 : _product$cartDetailVa2.session),
|
|
75
|
+
timeBarDay: formatScheduleCalendarDay(bookingDate),
|
|
76
|
+
bookingDate: bookingDate
|
|
77
|
+
};
|
|
78
|
+
}
|