@lookiero/checkout 0.3.26 → 0.4.0-beta.0
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/domain/checkout/command/startCheckout.d.ts +13 -0
- package/dist/domain/checkout/command/startCheckout.js +4 -0
- package/dist/domain/checkout/model/checkout.d.ts +18 -0
- package/dist/domain/checkout/model/checkout.js +20 -0
- package/dist/domain/checkout/model/checkoutStarted.d.ts +13 -0
- package/dist/domain/checkout/model/checkoutStarted.js +4 -0
- package/dist/domain/checkout/model/checkouts.d.ts +7 -0
- package/dist/domain/checkout/model/checkouts.js +1 -0
- package/dist/domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem.d.ts +15 -0
- package/dist/domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem.js +7 -0
- package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.d.ts +15 -0
- package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.js +7 -0
- package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +9 -0
- package/dist/domain/checkoutBooking/model/checkoutBooking.js +9 -0
- package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +14 -0
- package/dist/domain/checkoutBooking/model/checkoutBookingBooked.js +7 -0
- package/dist/domain/checkoutBooking/model/checkoutBookings.d.ts +7 -0
- package/dist/domain/checkoutBooking/model/checkoutBookings.js +1 -0
- package/dist/domain/checkoutItem/command/keepCheckoutItem.d.ts +13 -0
- package/dist/domain/checkoutItem/command/keepCheckoutItem.js +4 -0
- package/dist/domain/checkoutItem/command/replaceCheckoutItem.d.ts +14 -0
- package/dist/domain/checkoutItem/command/replaceCheckoutItem.js +7 -0
- package/dist/domain/checkoutItem/command/returnCheckoutItem.d.ts +15 -0
- package/dist/domain/checkoutItem/command/returnCheckoutItem.js +7 -0
- package/dist/domain/checkoutItem/model/checkoutItem.d.ts +24 -0
- package/dist/domain/checkoutItem/model/checkoutItem.js +40 -0
- package/dist/domain/checkoutItem/model/checkoutItemKept.d.ts +13 -0
- package/dist/domain/checkoutItem/model/checkoutItemKept.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItemReplaced.d.ts +13 -0
- package/dist/domain/checkoutItem/model/checkoutItemReplaced.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItemReturned.d.ts +13 -0
- package/dist/domain/checkoutItem/model/checkoutItemReturned.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItems.d.ts +7 -0
- package/dist/domain/checkoutItem/model/checkoutItems.js +1 -0
- package/dist/domain/checkoutItem/model/currency.d.ts +5 -0
- package/dist/domain/checkoutItem/model/currency.js +6 -0
- package/dist/domain/checkoutItem/model/feedbacks.d.ts +3 -0
- package/dist/domain/checkoutItem/model/feedbacks.js +1 -0
- package/dist/domain/checkoutItem/model/price.d.ts +10 -0
- package/dist/domain/checkoutItem/model/price.js +1 -0
- package/dist/domain/uiSetting/command/updateUiSetting.d.ts +15 -0
- package/dist/domain/uiSetting/command/updateUiSetting.js +10 -0
- package/dist/domain/uiSetting/model/uiSetting.d.ts +9 -0
- package/dist/domain/uiSetting/model/uiSetting.js +11 -0
- package/dist/domain/uiSetting/model/uiSettingUpdated.d.ts +14 -0
- package/dist/domain/uiSetting/model/uiSettingUpdated.js +7 -0
- package/dist/domain/uiSetting/model/uiSettings.d.ts +7 -0
- package/dist/domain/uiSetting/model/uiSettings.js +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +19 -0
- package/dist/infrastructure/delivery/baseBootstrap.d.ts +56 -0
- package/dist/infrastructure/delivery/baseBootstrap.js +55 -0
- package/dist/infrastructure/delivery/bootstrap.d.ts +10 -0
- package/dist/infrastructure/delivery/bootstrap.js +44 -0
- package/dist/infrastructure/delivery/http/fetchHttpClient.d.ts +14 -0
- package/dist/infrastructure/delivery/http/fetchHttpClient.js +20 -0
- package/dist/infrastructure/delivery/http/httpClient.d.ts +16 -0
- package/dist/infrastructure/delivery/http/httpClient.js +1 -0
- package/dist/infrastructure/delivery/mock/checkoutBookingDataSource.d.ts +14 -0
- package/dist/infrastructure/delivery/mock/checkoutBookingDataSource.js +12 -0
- package/dist/infrastructure/delivery/mock/checkoutDataSource.d.ts +17 -0
- package/dist/infrastructure/delivery/mock/checkoutDataSource.js +18 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutBookings.d.ts +14 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutBookings.js +21 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutItems.d.ts +14 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutItems.js +25 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckouts.d.ts +11 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckouts.js +27 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckouts.d.ts +16 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckouts.js +19 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsStart.d.ts +5 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsStart.js +13 -0
- package/dist/infrastructure/domain/checkout/react/useStartCheckout.d.ts +13 -0
- package/dist/infrastructure/domain/checkout/react/useStartCheckout.js +10 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.d.ts +16 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +15 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBook.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBook.js +18 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +15 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +15 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +15 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +14 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItems.d.ts +16 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItems.js +26 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsKeep.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsKeep.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReplace.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReplace.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReturn.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReturn.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.d.ts +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.js +12 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.d.ts +16 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.d.ts +17 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.js +13 -0
- package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.d.ts +17 -0
- package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.js +20 -0
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +10 -0
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +11 -0
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +14 -0
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.js +15 -0
- package/dist/infrastructure/persistence/asyncStorageStorage.d.ts +5 -0
- package/dist/infrastructure/persistence/asyncStorageStorage.js +7 -0
- package/dist/infrastructure/persistence/storage.d.ts +7 -0
- package/dist/infrastructure/persistence/storage.js +1 -0
- package/dist/infrastructure/persistence/uiSettingData.d.ts +6 -0
- package/dist/infrastructure/persistence/uiSettingData.js +1 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +12 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +9 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +10 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +9 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/bookedSizeReplaceableProductVariants.mock.d.ts +3 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/bookedSizeReplaceableProductVariants.mock.js +17 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.d.ts +34 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.js +26 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +10 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.js +9 -0
- package/dist/infrastructure/projection/checkout/checkout.d.ts +18 -0
- package/dist/infrastructure/projection/checkout/checkout.js +5 -0
- package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.js +10 -0
- package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.js +10 -0
- package/dist/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.js +8 -0
- package/dist/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.js +8 -0
- package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.d.ts +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.js +14 -0
- package/dist/infrastructure/projection/checkout/react/useViewFiveItemsDiscountByCustomerId.d.ts +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewFiveItemsDiscountByCustomerId.js +9 -0
- package/dist/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +9 -0
- package/dist/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.js +9 -0
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.d.ts +45 -0
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.js +40 -0
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.js +9 -0
- package/dist/infrastructure/projection/feedback/feedback.mock.d.ts +3 -0
- package/dist/infrastructure/projection/feedback/feedback.mock.js +6 -0
- package/dist/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.d.ts +12 -0
- package/dist/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.js +9 -0
- package/dist/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.d.ts +10 -0
- package/dist/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.js +9 -0
- package/dist/infrastructure/projection/returnQuestion/returnQuestion.d.ts +14 -0
- package/dist/infrastructure/projection/returnQuestion/returnQuestion.js +9 -0
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +7 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +9 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.d.ts +10 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.js +12 -0
- package/dist/infrastructure/projection/uiSetting/storageUiSettingByKeyView.d.ts +13 -0
- package/dist/infrastructure/projection/uiSetting/storageUiSettingByKeyView.js +15 -0
- package/dist/infrastructure/ui/Root.d.ts +20 -0
- package/dist/infrastructure/ui/Root.js +11 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.d.ts +12 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.js +28 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.style.d.ts +13 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.style.js +16 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.d.ts +9 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.js +7 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.style.d.ts +7 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.style.js +8 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.d.ts +26 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.js +47 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.style.d.ts +32 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.style.js +35 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +9 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +4 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback.d.ts +29 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback.js +27 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +18 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +10 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.js +1 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.d.ts +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.js +11 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +34 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +11 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +14 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +27 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.d.ts +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.js +15 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +15 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.d.ts +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.js +15 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +26 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.d.ts +10 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.js +13 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +13 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.d.ts +22 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +58 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +8 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +14 -0
- package/dist/infrastructure/ui/hooks/useMediaImage.d.ts +7 -0
- package/dist/infrastructure/ui/hooks/useMediaImage.js +12 -0
- package/dist/infrastructure/ui/i18n/i18n.d.ts +39 -0
- package/dist/infrastructure/ui/i18n/i18n.js +40 -0
- package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +9 -0
- package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +21 -0
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.d.ts +9 -0
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +47 -0
- package/dist/infrastructure/ui/routing/Routing.d.ts +12 -0
- package/dist/infrastructure/ui/routing/Routing.js +45 -0
- package/dist/infrastructure/ui/routing/router/Router.d.ts +1 -0
- package/dist/infrastructure/ui/routing/router/Router.js +1 -0
- package/dist/infrastructure/ui/routing/router/Router.native.d.ts +1 -0
- package/dist/infrastructure/ui/routing/router/Router.native.js +1 -0
- package/dist/infrastructure/ui/routing/routes.d.ts +6 -0
- package/dist/infrastructure/ui/routing/routes.js +7 -0
- package/dist/infrastructure/ui/settings/UISettings.d.ts +4 -0
- package/dist/infrastructure/ui/settings/UISettings.js +5 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.d.ts +10 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.js +5 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.style.d.ts +6 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.style.js +9 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.js +29 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.style.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.style.js +17 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.d.ts +12 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.js +7 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.d.ts +13 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.js +16 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.d.ts +11 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.js +37 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.style.d.ts +19 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.style.js +26 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.d.ts +3 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.js +8 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.style.d.ts +9 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.style.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.d.ts +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.d.ts +12 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.js +23 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.d.ts +20 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.js +79 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.d.ts +58 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.js +70 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.d.ts +6 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.d.ts +13 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.js +17 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.js +11 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.style.d.ts +23 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.style.js +27 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.d.ts +20 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.js +132 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.style.d.ts +11 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.style.js +12 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.js +12 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.style.d.ts +46 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.style.js +33 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.d.ts +16 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.js +7 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.d.ts +7 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.js +10 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.d.ts +25 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.js +26 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.style.d.ts +17 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.style.js +20 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.d.ts +26 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.js +26 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.style.d.ts +15 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.style.js +18 -0
- package/dist/infrastructure/ui/shared/hooks/useScreenSize.d.ts +4 -0
- package/dist/infrastructure/ui/shared/hooks/useScreenSize.js +9 -0
- package/dist/infrastructure/ui/theme/theme.d.ts +10 -0
- package/dist/infrastructure/ui/theme/theme.js +5 -0
- package/dist/infrastructure/ui/views/App.d.ts +6 -0
- package/dist/infrastructure/ui/views/App.js +6 -0
- package/dist/infrastructure/ui/views/intro/Intro.d.ts +6 -0
- package/dist/infrastructure/ui/views/intro/Intro.js +51 -0
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +52 -0
- package/dist/infrastructure/ui/views/intro/Intro.style.js +55 -0
- package/dist/infrastructure/ui/views/item/Item.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/Item.js +97 -0
- package/dist/infrastructure/ui/views/item/Item.style.d.ts +15 -0
- package/dist/infrastructure/ui/views/item/Item.style.js +18 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.d.ts +10 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +21 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.d.ts +17 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.js +20 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +8 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +34 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +19 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +22 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +18 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +33 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.d.ts +21 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.js +24 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +13 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +30 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +23 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +27 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.d.ts +12 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +26 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +19 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +22 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +22 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.d.ts +25 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.js +29 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +10 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +32 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +12 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +15 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +15 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +46 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +11 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +14 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +25 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +16 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +19 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +25 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +16 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +19 -0
- package/dist/infrastructure/ui/views/summary/Summary.d.ts +6 -0
- package/dist/infrastructure/ui/views/summary/Summary.js +18 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +7 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +20 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +9 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +12 -0
- package/dist/package.json +1 -1
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +13 -0
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +1 -0
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +25 -0
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +8 -0
- package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +33 -0
- package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.js +8 -0
- package/dist/projection/checkout/checkout.d.ts +12 -0
- package/dist/projection/checkout/checkout.js +1 -0
- package/dist/projection/checkout/viewCheckoutById.d.ts +25 -0
- package/dist/projection/checkout/viewCheckoutById.js +8 -0
- package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.d.ts +25 -0
- package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.js +8 -0
- package/dist/projection/checkout/viewFiveItemsDiscountByCustomerId.d.ts +24 -0
- package/dist/projection/checkout/viewFiveItemsDiscountByCustomerId.js +8 -0
- package/dist/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +17 -0
- package/dist/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +13 -0
- package/dist/projection/checkout/viewIsCheckoutEnabledByCustomerId.d.ts +24 -0
- package/dist/projection/checkout/viewIsCheckoutEnabledByCustomerId.js +8 -0
- package/dist/projection/checkoutBooking/checkoutBooking.d.ts +6 -0
- package/dist/projection/checkoutBooking/checkoutBooking.js +1 -0
- package/dist/projection/checkoutBooking/viewCheckoutBookingById.d.ts +25 -0
- package/dist/projection/checkoutBooking/viewCheckoutBookingById.js +8 -0
- package/dist/projection/checkoutItem/checkoutItem.d.ts +53 -0
- package/dist/projection/checkoutItem/checkoutItem.js +17 -0
- package/dist/projection/checkoutItem/viewCheckoutItemById.d.ts +25 -0
- package/dist/projection/checkoutItem/viewCheckoutItemById.js +8 -0
- package/dist/projection/feedback/feedback.d.ts +3 -0
- package/dist/projection/feedback/feedback.js +1 -0
- package/dist/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.d.ts +25 -0
- package/dist/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.js +8 -0
- package/dist/projection/returnQuestion/returnQuestion.d.ts +17 -0
- package/dist/projection/returnQuestion/returnQuestion.js +11 -0
- package/dist/projection/shared/size.d.ts +10 -0
- package/dist/projection/shared/size.js +1 -0
- package/dist/projection/uiSetting/viewUiSettingByKey.d.ts +29 -0
- package/dist/projection/uiSetting/viewUiSettingByKey.js +8 -0
- package/dist/src/ExpoRoot.js +10 -2
- package/dist/src/domain/checkout/model/checkout.d.ts +2 -3
- package/dist/src/domain/checkout/model/checkout.js +0 -1
- package/dist/src/domain/checkoutBooking/model/checkoutBooking.d.ts +1 -5
- package/dist/src/domain/checkoutBooking/model/checkoutBooking.js +1 -17
- package/dist/src/domain/checkoutItem/command/replaceCheckoutItem.d.ts +1 -1
- package/dist/src/domain/checkoutItem/model/checkoutItem.d.ts +1 -1
- package/dist/src/domain/checkoutItem/model/checkoutItem.js +2 -2
- package/dist/src/infrastructure/delivery/baseBootstrap.d.ts +0 -2
- package/dist/src/infrastructure/delivery/baseBootstrap.js +2 -8
- package/dist/src/infrastructure/delivery/bootstrap.js +0 -2
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckoutBookings.js +1 -5
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckoutItems.js +0 -2
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckouts.js +2 -2
- package/dist/src/infrastructure/domain/checkout/model/httpCheckouts.js +1 -1
- package/dist/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +2 -9
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +13 -0
- package/dist/src/infrastructure/domain/checkoutBooking/react/{useBookCheckoutBookingForCheckoutItem.js → useBookCheckouBookingForCheckoutItem.js} +2 -2
- package/dist/src/infrastructure/domain/checkoutItem/model/httpCheckoutItems.js +1 -1
- package/dist/src/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReplace.js +2 -2
- package/dist/src/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.d.ts +1 -1
- package/dist/src/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.js +2 -2
- package/dist/src/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +1 -1
- package/dist/src/infrastructure/projection/checkout/checkout.d.ts +1 -1
- package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +1 -9
- package/dist/src/infrastructure/ui/Root.d.ts +2 -0
- package/dist/src/infrastructure/ui/Root.js +2 -2
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +9 -7
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +2 -0
- package/dist/src/infrastructure/ui/routing/Routing.js +2 -2
- package/dist/src/infrastructure/ui/views/App.d.ts +2 -0
- package/dist/src/infrastructure/ui/views/App.js +2 -2
- package/dist/src/infrastructure/ui/views/header/Header.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/header/Header.js +8 -6
- package/dist/src/infrastructure/ui/views/item/Item.js +25 -49
- package/dist/src/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +4 -7
- package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +2 -2
- package/dist/src/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +1 -0
- package/dist/src/projection/checkout/checkout.d.ts +1 -1
- package/dist/src/projection/checkoutBooking/checkoutBooking.d.ts +0 -2
- package/dist/src/projection/checkoutItem/checkoutItem.d.ts +1 -1
- package/dist/src/projection/pricing/pricing.d.ts +3 -3
- package/package.json +1 -1
- package/dist/src/domain/checkoutBooking/command/blockCheckoutBooking.d.ts +0 -13
- package/dist/src/domain/checkoutBooking/command/blockCheckoutBooking.js +0 -4
- package/dist/src/domain/checkoutBooking/model/checkoutBookingBlocked.d.ts +0 -13
- package/dist/src/domain/checkoutBooking/model/checkoutBookingBlocked.js +0 -4
- package/dist/src/domain/checkoutBooking/model/checkoutBookingExpired.d.ts +0 -13
- package/dist/src/domain/checkoutBooking/model/checkoutBookingExpired.js +0 -4
- package/dist/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBlock.d.ts +0 -5
- package/dist/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBlock.js +0 -15
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +0 -13
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +0 -12
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem.d.ts +0 -13
|
@@ -3,7 +3,7 @@ import { useCallback } from "react";
|
|
|
3
3
|
import { v4 as uuid } from "uuid";
|
|
4
4
|
import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
|
|
5
5
|
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
6
|
-
const
|
|
6
|
+
const useBookCheckouBookingForCheckoutItem = ({ checkoutItemId }) => {
|
|
7
7
|
const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
|
|
8
8
|
const book = useCallback(() => commandBus(bookCheckoutBookingForCheckoutItem({
|
|
9
9
|
aggregateId: uuid(),
|
|
@@ -11,4 +11,4 @@ const useBookCheckoutBookingForCheckoutItem = ({ checkoutItemId }) => {
|
|
|
11
11
|
})), [checkoutItemId, commandBus]);
|
|
12
12
|
return [book, status];
|
|
13
13
|
};
|
|
14
|
-
export {
|
|
14
|
+
export { useBookCheckouBookingForCheckoutItem };
|
|
@@ -10,7 +10,7 @@ const toDomain = (checkoutItem) => {
|
|
|
10
10
|
status: checkoutItem.status,
|
|
11
11
|
price: checkoutItem.price,
|
|
12
12
|
feedbacks: checkoutItem.feedbacks,
|
|
13
|
-
|
|
13
|
+
replacedFor: checkoutItem.replacedFor,
|
|
14
14
|
aggregateId: checkoutItem.id,
|
|
15
15
|
domainEvents: [],
|
|
16
16
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CHECKOUT_ITEM_REPLACED, } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
|
|
2
2
|
const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
|
|
3
|
-
const httpCheckoutItemsReplace = ({ httpPost }) => async ({ aggregateId,
|
|
3
|
+
const httpCheckoutItemsReplace = ({ httpPost }) => async ({ aggregateId, replacedFor, domainEvents }) => {
|
|
4
4
|
const checkoutItemReplaced = domainEvents.find(isCheckoutItemReplaced);
|
|
5
5
|
if (!checkoutItemReplaced) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
await httpPost({
|
|
9
9
|
endpoint: "/replace-checkout-item",
|
|
10
|
-
body: { checkoutItemId: aggregateId, replacedFor
|
|
10
|
+
body: { checkoutItemId: aggregateId, replacedFor },
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
13
|
export { httpCheckoutItemsReplace };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
2
|
interface ReplaceCheckoutItemFunctionArgs {
|
|
3
|
-
readonly
|
|
3
|
+
readonly replacedFor: string;
|
|
4
4
|
}
|
|
5
5
|
interface ReplaceCheckoutItemFunction {
|
|
6
6
|
(args: ReplaceCheckoutItemFunctionArgs): Promise<void>;
|
|
@@ -4,9 +4,9 @@ import { replaceCheckoutItem } from "../../../../domain/checkoutItem/command/rep
|
|
|
4
4
|
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
5
5
|
const useReplaceCheckoutItem = ({ checkoutItemId }) => {
|
|
6
6
|
const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
|
|
7
|
-
const replace = useCallback(({
|
|
7
|
+
const replace = useCallback(({ replacedFor }) => commandBus(replaceCheckoutItem({
|
|
8
8
|
aggregateId: checkoutItemId,
|
|
9
|
-
|
|
9
|
+
replacedFor,
|
|
10
10
|
})), [checkoutItemId, commandBus]);
|
|
11
11
|
return [replace, status];
|
|
12
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
|
|
2
2
|
const response = await httpPost({
|
|
3
|
-
endpoint: "/view-booked-product-variants-for-checkout-item",
|
|
3
|
+
endpoint: "/view-booked-size-change-product-variants-for-checkout-item",
|
|
4
4
|
body: { checkoutItemId },
|
|
5
5
|
signal,
|
|
6
6
|
});
|
|
@@ -5,7 +5,7 @@ interface CheckoutDto {
|
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly customerId: string;
|
|
7
7
|
readonly boxId: string;
|
|
8
|
-
readonly
|
|
8
|
+
readonly bookingId: string;
|
|
9
9
|
readonly status: CheckoutStatus;
|
|
10
10
|
readonly expiresOn: string;
|
|
11
11
|
readonly items: CheckoutItemProjection[];
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { useQuery } from "@lookiero/messaging-react";
|
|
2
|
-
import { CHECKOUT_ITEM_KEPT } from "../../../../domain/checkoutItem/model/checkoutItemKept";
|
|
3
|
-
import { CHECKOUT_ITEM_REPLACED, } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
|
|
4
|
-
import { CHECKOUT_ITEM_RETURNED, } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
|
|
5
2
|
import { viewPricingByCheckoutId } from "../../../../projection/pricing/viewPricingByCheckoutId";
|
|
6
3
|
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
7
|
-
const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
|
|
8
|
-
const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
|
|
9
|
-
const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
|
|
10
|
-
const shouldInvalidate = (event) => isCheckoutItemKept(event) || isCheckoutItemReplaced(event) || isCheckoutItemReturned(event);
|
|
11
4
|
const useViewPricingByCheckoutId = ({ checkoutId }) => useQuery({
|
|
12
5
|
query: viewPricingByCheckoutId({ checkoutId }),
|
|
13
6
|
contextId: MESSAGING_CONTEXT_ID,
|
|
14
|
-
|
|
15
|
-
options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false, refetchOnMount: "always" },
|
|
7
|
+
options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
|
|
16
8
|
});
|
|
17
9
|
export { useViewPricingByCheckoutId };
|
|
@@ -2,6 +2,7 @@ import { I18n } from "@lookiero/i18n-react";
|
|
|
2
2
|
import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
|
|
3
3
|
import { FC } from "react";
|
|
4
4
|
import { NotificationsRoot } from "../../shared/notifications";
|
|
5
|
+
import { Menu } from "./views/header/Header";
|
|
5
6
|
interface RootFunctionArgs {
|
|
6
7
|
readonly Messaging: MessagingRoot;
|
|
7
8
|
readonly Notifications: NotificationsRoot;
|
|
@@ -16,6 +17,7 @@ interface RootProps {
|
|
|
16
17
|
readonly basePath: string;
|
|
17
18
|
readonly locale?: string;
|
|
18
19
|
readonly customerId: string | undefined;
|
|
20
|
+
readonly menu: Menu;
|
|
19
21
|
readonly onNotAccessible: () => void;
|
|
20
22
|
readonly useRedirect: () => Record<string, string>;
|
|
21
23
|
}
|
|
@@ -3,10 +3,10 @@ import { Platform } from "react-native";
|
|
|
3
3
|
import { Routing } from "./routing/Routing";
|
|
4
4
|
const root = ({ Messaging, I18n, Notifications, authToken, development }) =>
|
|
5
5
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
6
|
-
({ basePath, locale = "en", customerId, onNotAccessible, useRedirect }) => {
|
|
6
|
+
({ basePath, locale = "en", customerId, menu, onNotAccessible, useRedirect }) => {
|
|
7
7
|
const handleOnI18nError = useCallback(() => void 0, []);
|
|
8
8
|
return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
|
|
9
9
|
React.createElement(Notifications, { includeReactQueryDevTools: Platform.OS === "web" },
|
|
10
|
-
React.createElement(Routing, { I18n: I18n, authToken: authToken, basePath: basePath, customerId: customerId, locale: locale, useRedirect: useRedirect, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible }))));
|
|
10
|
+
React.createElement(Routing, { I18n: I18n, authToken: authToken, basePath: basePath, customerId: customerId, locale: locale, menu: menu, useRedirect: useRedirect, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible }))));
|
|
11
11
|
};
|
|
12
12
|
export { root };
|
|
@@ -23,7 +23,7 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
23
23
|
const notFoundRouteMatch = useMatch(`${basePath}/${Routes.NOT_FOUND}`);
|
|
24
24
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
25
25
|
const dependenciesLoaded = dependenciesLoadedStatuses.includes(shouldIntroBeShownStatus) &&
|
|
26
|
-
|
|
26
|
+
dependenciesLoadedStatuses.includes(checkoutStatus);
|
|
27
27
|
if (!dependenciesLoaded) {
|
|
28
28
|
return loader;
|
|
29
29
|
}
|
|
@@ -35,6 +35,13 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
35
35
|
if (checkout?.status === CheckoutStatus.PAID && !feedbackRouteMatch) {
|
|
36
36
|
return React.createElement(Navigate, { to: `${basePath}/${Routes.FEEDBACK}`, replace: true });
|
|
37
37
|
}
|
|
38
|
+
/* Navigate to the summary if required */
|
|
39
|
+
if (checkout?.status !== CheckoutStatus.PAID &&
|
|
40
|
+
checkout?.status !== CheckoutStatus.COMPLETED &&
|
|
41
|
+
firstItemWithoutCustomerDecision === undefined &&
|
|
42
|
+
!(summaryRouteMatch || itemDetailRouteMatch || checkoutRouteMatch)) {
|
|
43
|
+
return React.createElement(Navigate, { to: `${basePath}/${Routes.SUMMARY}`, replace: true });
|
|
44
|
+
}
|
|
38
45
|
/* Navigate to the Intro if required */
|
|
39
46
|
if (shouldIntroBeShown && !introShown.current && firstItemWithoutCustomerDecision !== undefined) {
|
|
40
47
|
if (introRouteMatch) {
|
|
@@ -54,14 +61,9 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
54
61
|
}
|
|
55
62
|
/* Navigate to the first item without customer's decission */
|
|
56
63
|
if (firstItemWithoutCustomerDecision && !itemRouteMatch) {
|
|
64
|
+
console.log("navigate to first item...", firstItemWithoutCustomerDecision.id);
|
|
57
65
|
return (React.createElement(Navigate, { to: generatePath(`${basePath}/${Routes.ITEM}`, { id: firstItemWithoutCustomerDecision.id }), replace: true }));
|
|
58
66
|
}
|
|
59
|
-
/* Navigate to the summary if required */
|
|
60
|
-
if (firstItemWithoutCustomerDecision === undefined &&
|
|
61
|
-
!(summaryRouteMatch || itemDetailRouteMatch || checkoutRouteMatch) &&
|
|
62
|
-
checkout?.status !== CheckoutStatus.PAID) {
|
|
63
|
-
return React.createElement(Navigate, { to: `${basePath}/${Routes.SUMMARY}`, replace: true });
|
|
64
|
-
}
|
|
65
67
|
}
|
|
66
68
|
return children;
|
|
67
69
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { I18n } from "@lookiero/i18n-react";
|
|
2
2
|
import { FC } from "react";
|
|
3
|
+
import { Menu } from "../views/header/Header";
|
|
3
4
|
interface RoutingProps {
|
|
4
5
|
readonly basePath?: string;
|
|
5
6
|
readonly customerId: string | undefined;
|
|
6
7
|
readonly locale: string;
|
|
7
8
|
readonly I18n: I18n;
|
|
8
9
|
readonly authToken: string;
|
|
10
|
+
readonly menu: Menu;
|
|
9
11
|
readonly onNotAccessible: () => void;
|
|
10
12
|
readonly onI18nError?: (err: Error) => void;
|
|
11
13
|
readonly useRedirect: () => Record<string, string>;
|
|
@@ -11,7 +11,7 @@ const Item = lazy(() => import("../views/item/Item").then((module) => ({ default
|
|
|
11
11
|
const Summary = lazy(() => import("../views/summary/Summary").then((module) => ({ default: module.Summary })));
|
|
12
12
|
const Checkout = lazy(() => import("../views/checkout/Checkout").then((module) => ({ default: module.Checkout })));
|
|
13
13
|
const Feedback = lazy(() => import("../views/feedback/Feedback").then((module) => ({ default: module.Feedback })));
|
|
14
|
-
const Routing = ({ basePath = "", customerId, locale, I18n, authToken, onI18nError, onNotAccessible, useRedirect, }) => {
|
|
14
|
+
const Routing = ({ basePath = "", customerId, locale, I18n, authToken, menu, onI18nError, onNotAccessible, useRedirect, }) => {
|
|
15
15
|
const routes = useRoutes([
|
|
16
16
|
{
|
|
17
17
|
path: "",
|
|
@@ -19,7 +19,7 @@ const Routing = ({ basePath = "", customerId, locale, I18n, authToken, onI18nErr
|
|
|
19
19
|
React.createElement(CheckoutAccessibilityMiddleware, { customerId: customerId, onNotAccessible: onNotAccessible },
|
|
20
20
|
React.createElement(I18n, { loader: React.createElement(Spinner, null), locale: locale, onError: onI18nError },
|
|
21
21
|
React.createElement(CheckoutMiddleware, { customerId: customerId },
|
|
22
|
-
React.createElement(App, { customerId: customerId },
|
|
22
|
+
React.createElement(App, { customerId: customerId, menu: menu },
|
|
23
23
|
React.createElement(Outlet, null))))))),
|
|
24
24
|
children: [
|
|
25
25
|
{
|
|
@@ -5,8 +5,8 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
|
5
5
|
import { Notifications } from "../../../shared/notifications/infrastructure/ui/views/Notifications";
|
|
6
6
|
import { style } from "./App.style";
|
|
7
7
|
import { Header } from "./header/Header";
|
|
8
|
-
const App = ({ customerId, children }) => (React.createElement(SafeAreaProvider, null,
|
|
9
|
-
React.createElement(Header, { customerId: customerId, style: style.header }),
|
|
8
|
+
const App = ({ customerId, menu, children }) => (React.createElement(SafeAreaProvider, null,
|
|
9
|
+
React.createElement(Header, { customerId: customerId, menu: menu, style: style.header }),
|
|
10
10
|
React.createElement(Notifications, null),
|
|
11
11
|
React.createElement(PortalProvider, null,
|
|
12
12
|
React.createElement(View, { style: style.body }, children))));
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
interface MenuProps {
|
|
4
|
+
readonly visible: boolean;
|
|
5
|
+
readonly onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
type Menu = FC<MenuProps>;
|
|
3
8
|
interface HeaderProps {
|
|
4
9
|
readonly customerId: string;
|
|
10
|
+
readonly menu: Menu;
|
|
5
11
|
readonly style?: StyleProp<ViewStyle>;
|
|
6
12
|
}
|
|
7
13
|
declare const Header: FC<HeaderProps>;
|
|
14
|
+
export type { Menu };
|
|
8
15
|
export { Header };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
-
import React, { useCallback } from "react";
|
|
3
|
+
import React, { useCallback, useState } from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
6
|
import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
|
|
@@ -57,7 +57,7 @@ const CheckoutHeader = ({ style: customStyle }) => {
|
|
|
57
57
|
React.createElement(Text, { level: 3, style: style.title, detail: true }, title),
|
|
58
58
|
React.createElement(ButtonIconPlaceholder, null)));
|
|
59
59
|
};
|
|
60
|
-
const Header = ({ customerId, style: customStyle }) => {
|
|
60
|
+
const Header = ({ customerId, menu: Menu, style: customStyle }) => {
|
|
61
61
|
const { top: safeAreaInsetTop } = useSafeAreaInsets();
|
|
62
62
|
const { id: itemId } = useParams();
|
|
63
63
|
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
@@ -66,9 +66,9 @@ const Header = ({ customerId, style: customStyle }) => {
|
|
|
66
66
|
const itemRouteMatch = useMatch(`${basePath}/${Routes.ITEM}`);
|
|
67
67
|
const itemDetailRouteMatch = useMatch(`${basePath}/${Routes.ITEM_DETAIL}`);
|
|
68
68
|
const checkoutRouteMatch = useMatch(`${basePath}/${Routes.CHECKOUT}`);
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
const [menuVisible, setMenuVisible] = useState(false);
|
|
70
|
+
const handleOnOpenMenu = useCallback(() => setMenuVisible(true), []);
|
|
71
|
+
const handleOnCloseMenu = useCallback(() => setMenuVisible(false), []);
|
|
72
72
|
let header;
|
|
73
73
|
if (checkout?.items && currentItem) {
|
|
74
74
|
if (itemRouteMatch) {
|
|
@@ -84,6 +84,8 @@ const Header = ({ customerId, style: customStyle }) => {
|
|
|
84
84
|
else {
|
|
85
85
|
header = React.createElement(DefaultHeader, { style: style.header, onOpenMenu: handleOnOpenMenu });
|
|
86
86
|
}
|
|
87
|
-
return (React.createElement(SafeAreaView, { edges: ["top"], style: [style.container, { paddingTop: safeAreaInsetTop }, customStyle] },
|
|
87
|
+
return (React.createElement(SafeAreaView, { edges: ["top"], style: [style.container, { paddingTop: safeAreaInsetTop }, customStyle] },
|
|
88
|
+
header,
|
|
89
|
+
React.createElement(Menu, { visible: menuVisible, onClose: handleOnCloseMenu })));
|
|
88
90
|
};
|
|
89
91
|
export { Header };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
|
-
import {
|
|
4
|
+
import { useParams } from "react-router-native";
|
|
5
5
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
6
|
import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
7
7
|
import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
|
|
8
|
-
import {
|
|
8
|
+
import { useBookCheckouBookingForCheckoutItem } from "../../../domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem";
|
|
9
9
|
import { useKeepCheckoutItem } from "../../../domain/checkoutItem/react/useKeepCheckoutItem";
|
|
10
10
|
import { useReplaceCheckoutItem } from "../../../domain/checkoutItem/react/useReplaceCheckoutItem";
|
|
11
11
|
import { useReturnCheckoutItem } from "../../../domain/checkoutItem/react/useReturnCheckoutItem";
|
|
@@ -15,8 +15,6 @@ import { useListReturnQuestionsByCheckoutItemId } from "../../../projection/retu
|
|
|
15
15
|
import { Body } from "../../components/layouts/body/Body";
|
|
16
16
|
import { ReturnQuestionFeedbackProvider } from "../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
|
|
17
17
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
18
|
-
import { Routes } from "../../routing/routes";
|
|
19
|
-
import { useBasePath } from "../../routing/useBasePath";
|
|
20
18
|
import { style } from "./Item.style";
|
|
21
19
|
import { CustomerDecissionBanner } from "./components/banner/CustomerDecissionBanner";
|
|
22
20
|
import { ItemActions } from "./components/itemActions/ItemActions";
|
|
@@ -30,60 +28,33 @@ const Item = ({ customerId }) => {
|
|
|
30
28
|
const { id } = useParams();
|
|
31
29
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
32
30
|
const checkoutItem = checkout?.items.find((checkoutItem) => checkoutItem.id === id);
|
|
33
|
-
const
|
|
34
|
-
const itemRouteMatch = useMatch(`${basePath}/${Routes.ITEM}`);
|
|
35
|
-
const firstItemWithoutCustomerDecision = checkout?.items.find((item) => [CheckoutItemStatus.EXPIRED, CheckoutItemStatus.INITIAL].includes(item.status));
|
|
36
|
-
const navigate = useNavigate();
|
|
37
|
-
const navigateToNextItem = useCallback(() => {
|
|
38
|
-
if (itemRouteMatch && firstItemWithoutCustomerDecision) {
|
|
39
|
-
navigate(generatePath(`${basePath}/${Routes.ITEM}`, { id: firstItemWithoutCustomerDecision.id }));
|
|
40
|
-
}
|
|
41
|
-
}, [basePath, firstItemWithoutCustomerDecision, itemRouteMatch, navigate]);
|
|
42
|
-
const [customerDecissionMade, setCustomerDecissionMade] = useState(false);
|
|
31
|
+
const [customerDecissionMade, setCustomerDecissionMade] = useState(() => checkoutItem.status === CheckoutItemStatus.INITIAL || checkoutItem.status === CheckoutItemStatus.EXPIRED);
|
|
43
32
|
const handleOnBannerPress = useCallback(() => setCustomerDecissionMade(!customerDecissionMade), [customerDecissionMade]);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
setCustomerDecissionMade(checkoutItem.status === CheckoutItemStatus.INITIAL || checkoutItem.status === CheckoutItemStatus.EXPIRED);
|
|
46
|
-
}, [checkoutItem]);
|
|
47
|
-
const [keepCheckoutItem, keepCheckoutItemStatus] = useKeepCheckoutItem({ checkoutItemId: checkoutItem.id });
|
|
48
|
-
const [returnCheckoutItem, returnCheckoutItemStatus] = useReturnCheckoutItem({
|
|
49
|
-
checkoutItemId: checkoutItem.id,
|
|
50
|
-
});
|
|
51
|
-
const [replaceCheckoutItem, replaceCheckoutItemStatus] = useReplaceCheckoutItem({
|
|
52
|
-
checkoutItemId: checkoutItem.id,
|
|
53
|
-
});
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (keepCheckoutItemStatus === CommandStatus.SUCCESS) {
|
|
56
|
-
navigateToNextItem();
|
|
57
|
-
}
|
|
58
|
-
}, [keepCheckoutItemStatus, navigateToNextItem]);
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
if (returnCheckoutItemStatus === CommandStatus.SUCCESS) {
|
|
61
|
-
navigateToNextItem();
|
|
62
|
-
}
|
|
63
|
-
}, [returnCheckoutItemStatus, navigateToNextItem]);
|
|
64
33
|
const [sizeWithoutStockModalVisible, setSizeWithoutStockModalVisible] = useState(false);
|
|
65
34
|
const handleOnShowSizeWithoutStockModal = useCallback(() => setSizeWithoutStockModalVisible(true), []);
|
|
66
35
|
const handleOnHideSizeWithoutStockModal = useCallback(() => setSizeWithoutStockModalVisible(false), []);
|
|
67
36
|
const [sizeChangeModalVisible, setSizeChangeModalVisible] = useState(false);
|
|
68
37
|
const handleOnShowSizeChangeModal = useCallback(() => setSizeChangeModalVisible(true), []);
|
|
69
|
-
const handleOnHideSizeChangeModal = useCallback(() =>
|
|
70
|
-
setSizeChangeModalVisible(false);
|
|
71
|
-
if (replaceCheckoutItemStatus === CommandStatus.SUCCESS) {
|
|
72
|
-
navigateToNextItem();
|
|
73
|
-
}
|
|
74
|
-
}, [navigateToNextItem, replaceCheckoutItemStatus]);
|
|
38
|
+
const handleOnHideSizeChangeModal = useCallback(() => setSizeChangeModalVisible(false), []);
|
|
75
39
|
const [bookedSizeChangeProductsVariants, bookedSizeChangeProductsVariantsStatus] = useViewBookedSizeChangeProductsVariantsForCheckoutItem({
|
|
76
40
|
checkoutItemId: checkoutItem.id,
|
|
77
41
|
});
|
|
78
|
-
const [bookCheckouBooking] =
|
|
42
|
+
const [bookCheckouBooking] = useBookCheckouBookingForCheckoutItem({
|
|
79
43
|
checkoutItemId: checkoutItem.id,
|
|
80
44
|
});
|
|
81
45
|
useEffect(() => {
|
|
82
|
-
|
|
83
|
-
}, [bookCheckouBooking,
|
|
46
|
+
bookedSizeChangeProductsVariants === null && bookCheckouBooking();
|
|
47
|
+
}, [bookCheckouBooking, bookedSizeChangeProductsVariants, bookedSizeChangeProductsVariants?.bookingId]);
|
|
84
48
|
const [returnQuestions, returnQuestionsStatus] = useListReturnQuestionsByCheckoutItemId({
|
|
85
49
|
checkoutItemId: checkoutItem.id,
|
|
86
50
|
});
|
|
51
|
+
const [keepCheckoutItem, keepCheckoutItemStatus] = useKeepCheckoutItem({ checkoutItemId: checkoutItem.id });
|
|
52
|
+
const [returnCheckoutItem, returnCheckoutItemStatus] = useReturnCheckoutItem({
|
|
53
|
+
checkoutItemId: checkoutItem.id,
|
|
54
|
+
});
|
|
55
|
+
const [replaceCheckoutItem, replaceCheckoutItemStatus] = useReplaceCheckoutItem({
|
|
56
|
+
checkoutItemId: checkoutItem.id,
|
|
57
|
+
});
|
|
87
58
|
const [stickyHeight, setStickyHeight] = useState(0);
|
|
88
59
|
const handleOnStickyLayout = useCallback(({ height }) => setStickyHeight(height), []);
|
|
89
60
|
const [returnQuestionsVisible, setReturnQuestionsVisible] = useState(false);
|
|
@@ -94,17 +65,22 @@ const Item = ({ customerId }) => {
|
|
|
94
65
|
handleOnHideReturnQuestions();
|
|
95
66
|
returnCheckoutItem({ feedbacks });
|
|
96
67
|
}, [handleOnHideReturnQuestions, returnCheckoutItem]);
|
|
97
|
-
const handleOnReplace = useCallback((
|
|
68
|
+
const handleOnReplace = useCallback((replacedFor) => {
|
|
98
69
|
handleOnShowSizeChangeModal();
|
|
99
|
-
replaceCheckoutItem({
|
|
70
|
+
replaceCheckoutItem({ replacedFor });
|
|
100
71
|
}, [handleOnShowSizeChangeModal, replaceCheckoutItem]);
|
|
101
72
|
const handleOnReturn = useCallback(() => handleOnShowReturnQuestions(), [handleOnShowReturnQuestions]);
|
|
102
|
-
const productVariantSelected = useMemo(() => checkoutItem.
|
|
103
|
-
?
|
|
104
|
-
: { id: checkoutItem.productVariant.id, size: checkoutItem.productVariant.size }, [
|
|
73
|
+
const productVariantSelected = useMemo(() => checkoutItem.replacedFor
|
|
74
|
+
? bookedSizeChangeProductsVariants?.productVariants.find((productVariant) => productVariant.id === checkoutItem.replacedFor)
|
|
75
|
+
: { id: checkoutItem.productVariant.id, size: checkoutItem.productVariant.size }, [
|
|
76
|
+
bookedSizeChangeProductsVariants?.productVariants,
|
|
77
|
+
checkoutItem.productVariant.id,
|
|
78
|
+
checkoutItem.productVariant.size,
|
|
79
|
+
checkoutItem.replacedFor,
|
|
80
|
+
]);
|
|
105
81
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
106
82
|
const dependenciesLoaded = dependenciesLoadedStatuses.includes(returnQuestionsStatus) &&
|
|
107
|
-
|
|
83
|
+
dependenciesLoadedStatuses.includes(checkoutStatus) &&
|
|
108
84
|
dependenciesLoadedStatuses.includes(bookedSizeChangeProductsVariantsStatus);
|
|
109
85
|
if (!dependenciesLoaded)
|
|
110
86
|
return React.createElement(Spinner, null);
|
package/dist/src/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js
CHANGED
|
@@ -2,13 +2,12 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
|
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
|
-
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
5
|
import { Tabs } from "../../../../components/layouts/tabs/Tabs";
|
|
7
6
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
7
|
import { ProductVariant } from "../../../item/components/productVariant/ProductVariant";
|
|
9
8
|
import { style } from "./CheckoutItemsTabs.style";
|
|
10
|
-
const CheckoutItem = ({
|
|
11
|
-
React.createElement(ProductVariant, { brand:
|
|
9
|
+
const CheckoutItem = ({ checkoutItem, discarded = false, testID, style: customStyle, onPress, }) => (React.createElement(View, { style: style.checkoutItem, testID: testID },
|
|
10
|
+
React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, discarded: discarded, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, size: checkoutItem.productVariant.size, status: checkoutItem.status, style: customStyle, onPress: onPress })));
|
|
12
11
|
const CheckoutItemsTabs = ({ checkoutItemsKept, checkoutItemsReturned, onPressItem }) => {
|
|
13
12
|
const keepTabText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_TAB });
|
|
14
13
|
const returnTabText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_TAB });
|
|
@@ -16,9 +15,7 @@ const CheckoutItemsTabs = ({ checkoutItemsKept, checkoutItemsReturned, onPressIt
|
|
|
16
15
|
const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
|
|
17
16
|
const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
|
|
18
17
|
return (React.createElement(Tabs, { style: { sliderContainer: style.sliderContainer }, tabLabels: [`${keepTabText} (${checkoutItemsKept.length})`, `${returnTabText} (${checkoutItemsReturned.length})`] },
|
|
19
|
-
React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text, null, keepEmptyText)) : (checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id,
|
|
20
|
-
|
|
21
|
-
: checkoutItem.productVariant, onPress: () => handleOnPressItem(checkoutItem.id) }))))),
|
|
22
|
-
React.createElement(React.Fragment, null, checkoutItemsReturned.length === 0 ? (React.createElement(Text, null, returnEmptyText)) : (checkoutItemsReturned.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemProductVariant: checkoutItem.productVariant, checkoutItemStatus: checkoutItem.status, style: { image: style.returnCheckoutItem }, testID: "return-checkout-item", discarded: true, onPress: () => handleOnPressItem(checkoutItem.id) })))))));
|
|
18
|
+
React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text, null, keepEmptyText)) : (checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItem: checkoutItem, testID: "keep-checkout-item", onPress: () => handleOnPressItem(checkoutItem.id) }))))),
|
|
19
|
+
React.createElement(React.Fragment, null, checkoutItemsReturned.length === 0 ? (React.createElement(Text, null, returnEmptyText)) : (checkoutItemsReturned.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItem: checkoutItem, style: { image: style.returnCheckoutItem }, testID: "return-checkout-item", discarded: true, onPress: () => handleOnPressItem(checkoutItem.id) })))))));
|
|
23
20
|
};
|
|
24
21
|
export { CheckoutItemsTabs };
|
|
@@ -44,9 +44,9 @@ const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPerc
|
|
|
44
44
|
React.createElement(Button, { busy: busy, small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
|
|
45
45
|
React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
|
|
46
46
|
React.createElement(Price, { price: subtotal, variant: "subtotal" })),
|
|
47
|
-
discount &&
|
|
47
|
+
discount && (React.createElement(Row, { text: discountText },
|
|
48
48
|
React.createElement(Price, { price: discount, variant: "subtotal" }))),
|
|
49
|
-
balanceDiscount &&
|
|
49
|
+
balanceDiscount && (React.createElement(Row, { text: creditText },
|
|
50
50
|
React.createElement(Price, { price: balanceDiscount, variant: "subtotal" }))),
|
|
51
51
|
React.createElement(Row, { text: feeText }, isPSServiceFree ? (React.createElement(Text, { level: 3, style: style.uppercase, action: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
|
|
52
52
|
React.createElement(View, { style: style.divider }),
|
package/dist/src/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface ProductVariantProjection {
|
|
|
4
4
|
readonly size: SizeProjection;
|
|
5
5
|
}
|
|
6
6
|
interface BookedSizeChangeProductsVariantsProjection {
|
|
7
|
+
readonly bookingId: string;
|
|
7
8
|
readonly productVariants: ProductVariantProjection[];
|
|
8
9
|
}
|
|
9
10
|
export type { BookedSizeChangeProductsVariantsProjection, ProductVariantProjection };
|
|
@@ -4,7 +4,7 @@ interface CheckoutProjection {
|
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly customerId: string;
|
|
6
6
|
readonly boxId: string;
|
|
7
|
-
readonly
|
|
7
|
+
readonly bookingId: string;
|
|
8
8
|
readonly status: CheckoutStatus;
|
|
9
9
|
readonly expiresOn: Date;
|
|
10
10
|
readonly items: CheckoutItemProjection[];
|
|
@@ -37,7 +37,7 @@ interface CheckoutItemProjection {
|
|
|
37
37
|
readonly id: string;
|
|
38
38
|
readonly status: CheckoutItemStatus;
|
|
39
39
|
readonly price: PriceProjection;
|
|
40
|
-
readonly replacedFor
|
|
40
|
+
readonly replacedFor?: string;
|
|
41
41
|
readonly productVariant: CheckoutItemProductVariantProjection;
|
|
42
42
|
readonly feedbacks: FeedbackProjection;
|
|
43
43
|
}
|
|
@@ -9,9 +9,9 @@ interface ServiceProjection {
|
|
|
9
9
|
interface PricingProjection {
|
|
10
10
|
readonly orderTotal: PriceProjection;
|
|
11
11
|
readonly subtotal: PriceProjection;
|
|
12
|
-
readonly balanceDiscount
|
|
13
|
-
readonly discount
|
|
14
|
-
readonly discountPercentage
|
|
12
|
+
readonly balanceDiscount?: PriceProjection;
|
|
13
|
+
readonly discount?: PriceProjection;
|
|
14
|
+
readonly discountPercentage?: number;
|
|
15
15
|
readonly service: ServiceProjection;
|
|
16
16
|
}
|
|
17
17
|
export type { PricingProjection, ServiceProjection };
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Command } from "@lookiero/messaging";
|
|
2
|
-
declare const BLOCK_CHECKOUT_BOOKING = "block_checkout_booking";
|
|
3
|
-
interface BlockCheckoutBookingPayload {
|
|
4
|
-
readonly aggregateId: string;
|
|
5
|
-
}
|
|
6
|
-
interface BlockCheckoutBooking extends Command<typeof BLOCK_CHECKOUT_BOOKING>, BlockCheckoutBookingPayload {
|
|
7
|
-
}
|
|
8
|
-
interface BlockCheckoutBookingFunction {
|
|
9
|
-
(payload: BlockCheckoutBookingPayload): BlockCheckoutBooking;
|
|
10
|
-
}
|
|
11
|
-
declare const blockCheckoutBooking: BlockCheckoutBookingFunction;
|
|
12
|
-
export type { BlockCheckoutBooking };
|
|
13
|
-
export { BLOCK_CHECKOUT_BOOKING, blockCheckoutBooking };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DomainEvent } from "@lookiero/messaging";
|
|
2
|
-
declare const CHECKOUT_BOOKING_BLOCKED = "checkout_booking_blocked";
|
|
3
|
-
interface CheckoutBookingBlokedPaylcoad {
|
|
4
|
-
readonly aggregateId: string;
|
|
5
|
-
}
|
|
6
|
-
interface CheckoutBookingBlocked extends DomainEvent<typeof CHECKOUT_BOOKING_BLOCKED>, CheckoutBookingBlokedPaylcoad {
|
|
7
|
-
}
|
|
8
|
-
interface CheckoutBookingBlokedFunctcion {
|
|
9
|
-
(payload: CheckoutBookingBlokedPaylcoad): CheckoutBookingBlocked;
|
|
10
|
-
}
|
|
11
|
-
declare const checkoutBookingBlocked: CheckoutBookingBlokedFunctcion;
|
|
12
|
-
export type { CheckoutBookingBlocked };
|
|
13
|
-
export { CHECKOUT_BOOKING_BLOCKED, checkoutBookingBlocked };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { domainEvent } from "@lookiero/messaging";
|
|
2
|
-
const CHECKOUT_BOOKING_BLOCKED = "checkout_booking_blocked";
|
|
3
|
-
const checkoutBookingBlocked = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_BOOKING_BLOCKED });
|
|
4
|
-
export { CHECKOUT_BOOKING_BLOCKED, checkoutBookingBlocked };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DomainEvent } from "@lookiero/messaging";
|
|
2
|
-
declare const CHECKOUT_BOOKING_EXPIRED = "checkout_booking_expired";
|
|
3
|
-
interface CheckoutBookingExpiredPayload {
|
|
4
|
-
readonly aggregateId: string;
|
|
5
|
-
}
|
|
6
|
-
interface CheckoutBookingExpired extends DomainEvent<typeof CHECKOUT_BOOKING_EXPIRED>, CheckoutBookingExpiredPayload {
|
|
7
|
-
}
|
|
8
|
-
interface CheckoutBookingExpiredFunction {
|
|
9
|
-
(payload: CheckoutBookingExpiredPayload): CheckoutBookingExpired;
|
|
10
|
-
}
|
|
11
|
-
declare const checkoutBookingExpired: CheckoutBookingExpiredFunction;
|
|
12
|
-
export type { CheckoutBookingExpired };
|
|
13
|
-
export { CHECKOUT_BOOKING_EXPIRED, checkoutBookingExpired };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { domainEvent } from "@lookiero/messaging";
|
|
2
|
-
const CHECKOUT_BOOKING_EXPIRED = "checkout_booking_expired";
|
|
3
|
-
const checkoutBookingExpired = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_BOOKING_EXPIRED });
|
|
4
|
-
export { CHECKOUT_BOOKING_EXPIRED, checkoutBookingExpired };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { HttpCheckoutBookingsSaveFunction } from "./httpCheckoutBookings";
|
|
2
|
-
interface HttpCheckoutBookingsBlockFunction extends HttpCheckoutBookingsSaveFunction {
|
|
3
|
-
}
|
|
4
|
-
declare const httpCheckoutBookingsBlock: HttpCheckoutBookingsBlockFunction;
|
|
5
|
-
export { httpCheckoutBookingsBlock };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CHECKOUT_BOOKING_BLOCKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBlocked";
|
|
2
|
-
const isCheckoutBookingBlocked = (event) => event.name === CHECKOUT_BOOKING_BLOCKED;
|
|
3
|
-
const httpCheckoutBookingsBlock = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
|
|
4
|
-
const checkoutBookingBlocked = domainEvents.find(isCheckoutBookingBlocked);
|
|
5
|
-
if (!checkoutBookingBlocked) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
await httpPost({
|
|
9
|
-
endpoint: "/block-checkout-booking",
|
|
10
|
-
body: {
|
|
11
|
-
checkoutBookingId: aggregateId,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
export { httpCheckoutBookingsBlock };
|