@lookiero/checkout 8.14.0-beta.3 → 8.14.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/.eslintrc.js +1 -1
- package/cypress/integration/checkout.spec.ts +259 -0
- package/cypress/support/e2e.ts +3 -0
- package/cypress/support/index.d.ts +8 -0
- package/cypress/support/interceptBlockCheckoutBooking.ts +4 -0
- package/cypress/support/interceptGiveCheckoutFeedback.ts +4 -0
- package/cypress/support/interceptKeepCheckoutItem.ts +4 -0
- package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +9 -0
- package/cypress/support/interceptListReturnQuestionsByCheckoutItemId.ts +9 -0
- package/cypress/support/interceptPayment.ts +23 -0
- package/cypress/support/interceptReplaceCheckoutItem.ts +4 -0
- package/cypress/support/interceptReturnCheckoutItem.ts +4 -0
- package/cypress/support/interceptSubmitCheckout.ts +4 -0
- package/cypress/support/interceptViewBookedProductsVariantsForCheckoutItem.ts +9 -0
- package/cypress/support/interceptViewCheckoutById.ts +6 -0
- package/cypress/support/interceptViewFirstAvailableCheckoutByCustomerId.ts +9 -0
- package/cypress/support/interceptViewFiveItemsDiscountByCustomerId.ts +6 -0
- package/cypress/support/interceptViewIsSizeChangeEnabledByCheckoutId.ts +6 -0
- package/cypress/support/interceptViewPaymentFlowPayloadByCheckoutId.ts +9 -0
- package/cypress/support/interceptViewPricingByCheckoutId.ts +6 -0
- package/cypress/tsconfig.json +8 -0
- package/cypress.config.ts +50 -0
- package/dist/src/ExpoRoot.js +2 -2
- package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
- package/dist/src/infrastructure/ui/Root.d.ts +1 -2
- package/dist/src/infrastructure/ui/Root.js +2 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +4 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +8 -6
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +5 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +6 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +18 -9
- package/dist/src/infrastructure/ui/test/render.js +1 -3
- package/dist/src/infrastructure/ui/views/App.js +7 -12
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +9 -2
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +5 -6
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -3
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +4 -3
- package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -2
- package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +9 -0
- package/dist/src/projection/returnQuestion/returnQuestion.constants.js +10 -0
- package/dist/src/projection/returnQuestion/returnQuestion.d.ts +23 -16
- package/dist/src/projection/returnQuestion/returnQuestion.js +1 -11
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +12 -0
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +1 -0
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +5 -0
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +10 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/jest.setup.js +0 -20
- package/package.json +8 -7
- package/src/ExpoRoot.tsx +2 -2
- package/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.test.ts +1 -1
- package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
- package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +4 -9
- package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +72 -117
- package/src/infrastructure/ui/Root.tsx +17 -21
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +10 -12
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +10 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +10 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +2 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +7 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +4 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +7 -13
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +4 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +8 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +13 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +7 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +10 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +9 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +5 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +43 -36
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +10 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +13 -12
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +8 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +23 -25
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +5 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +9 -29
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +7 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +5 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +32 -18
- package/src/infrastructure/ui/test/render.tsx +1 -4
- package/src/infrastructure/ui/views/App.tsx +16 -23
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +2 -3
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +10 -6
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +0 -1
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -4
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +21 -10
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +15 -5
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +2 -4
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +10 -6
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +2 -2
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +10 -4
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -2
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +2 -2
- package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +4 -12
- package/src/projection/returnQuestion/returnQuestion.constants.ts +10 -0
- package/src/projection/returnQuestion/returnQuestion.metadata.ts +17 -0
- package/src/projection/returnQuestion/returnQuestion.ts +42 -20
- package/src/projection/returnQuestion/returnQuestion.typeguard.ts +24 -0
- package/dist/pact.config.d.ts +0 -13
- package/dist/pact.config.js +0 -9
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +0 -27
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -48
- package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +0 -19
- package/dist/src/infrastructure/projection/checkout/checkout.mock.js +0 -21
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -109
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -49
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -10
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -17
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +0 -6
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -49
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -15
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +0 -43
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -50
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -109
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +0 -6
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +0 -183
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +0 -9
- package/dist/src/infrastructure/projection/pricing/pricing.mock.js +0 -42
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +0 -400
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -21
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -5
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -19
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -3
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -18
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -13
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -11
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -11
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -11
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -49
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -9
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -9
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -19
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -21
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -9
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -21
- package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
- package/dist/src/infrastructure/ui/views/App.style.js +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -10
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -11
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -40
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -15
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
- package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -43
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -13
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -9
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -10
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -17
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -13
- package/dist/src/projection/shared/country.d.ts +0 -14
- package/dist/src/projection/shared/country.js +0 -15
- package/dist/src/projection/shared/customer.d.ts +0 -8
- package/dist/src/projection/shared/customer.js +0 -1
- package/dist/src/projection/shared/locale.d.ts +0 -12
- package/dist/src/projection/shared/locale.js +0 -13
- package/dist/src/projection/shared/order.d.ts +0 -6
- package/dist/src/projection/shared/order.js +0 -1
- package/dist/src/projection/shared/price.d.ts +0 -10
- package/dist/src/projection/shared/price.js +0 -1
- package/dist/src/projection/shared/size.d.ts +0 -20
- package/dist/src/projection/shared/size.js +0 -3
- package/dist/src/projection/shared/subscription.d.ts +0 -2
- package/dist/src/projection/shared/subscription.js +0 -1
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -10
- package/dist/src/shared/ui/components/atoms/error/Error.js +0 -4
- package/pact.config.ts +0 -31
- package/pact.publish.js +0 -32
- package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +0 -62
- package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +0 -128
- package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +0 -63
- package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +0 -63
- package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +0 -64
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +0 -62
- package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +0 -136
- package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +0 -62
- package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +0 -62
- package/src/infrastructure/ui/views/App.style.ts +0 -9
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
4
|
-
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
5
|
-
import { checkout } from "./checkout.mock";
|
|
6
|
-
import { httpFirstAvailableCheckoutByCustomerIdView } from "./httpFirstAvailableCheckoutByCustomerIdView";
|
|
7
|
-
const provider = new PactV3({
|
|
8
|
-
...DEFAULT_PACT_OPTIONS,
|
|
9
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
10
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewFirstAvailableCheckoutByCustomerId",
|
|
11
|
-
});
|
|
12
|
-
const customerId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
|
|
13
|
-
const checkoutResponse = {
|
|
14
|
-
result: checkout({ items: [{ status: CheckoutItemStatus.KEPT }] }),
|
|
15
|
-
};
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
const EXPECTED_BODY = MatchersV3.like(checkoutResponse);
|
|
19
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewFirstAvailableCheckoutByCustomerId API", () => {
|
|
20
|
-
it("returns a first available checkout for the given customer id", () => {
|
|
21
|
-
provider
|
|
22
|
-
.given("a first available checkout for the given customer id")
|
|
23
|
-
.uponReceiving("checkout projection")
|
|
24
|
-
.withRequest({
|
|
25
|
-
method: "POST",
|
|
26
|
-
path: "/api/view-first-available-checkout-by-customer-id",
|
|
27
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
28
|
-
body: { customerId },
|
|
29
|
-
})
|
|
30
|
-
.willRespondWith({
|
|
31
|
-
status: 200,
|
|
32
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
33
|
-
body: EXPECTED_BODY,
|
|
34
|
-
});
|
|
35
|
-
return provider.executeTest(async (mockserver) => {
|
|
36
|
-
const httpPost = fetchHttpPost({
|
|
37
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
38
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
39
|
-
device: "web",
|
|
40
|
-
version: "1.0.0",
|
|
41
|
-
});
|
|
42
|
-
const response = await httpFirstAvailableCheckoutByCustomerIdView({ httpPost })({
|
|
43
|
-
customerId,
|
|
44
|
-
signal: undefined,
|
|
45
|
-
});
|
|
46
|
-
expect(response).toStrictEqual(checkoutResponse.result);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
});
|
package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpGet } from "@lookiero/sty-psp-http";
|
|
3
|
-
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
4
|
-
import { httpFiveItemsDiscountByCustomerIdView } from "./httpFiveItemsDiscountByCustomerIdView";
|
|
5
|
-
const provider = new PactV3({
|
|
6
|
-
...DEFAULT_PACT_OPTIONS,
|
|
7
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
8
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewFiveItemsDiscountByCustomerId",
|
|
9
|
-
});
|
|
10
|
-
const customerId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
|
|
11
|
-
const fiveItemsDiscountResponse = 25;
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
const EXPECTED_BODY = MatchersV3.number(fiveItemsDiscountResponse);
|
|
15
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewFiveItemsDiscountByCustomerId API", () => {
|
|
16
|
-
it("returns a five items discount for the given customer id", () => {
|
|
17
|
-
provider
|
|
18
|
-
.given("a five items discount for the given customer id")
|
|
19
|
-
.uponReceiving("five items discount")
|
|
20
|
-
.withRequest({
|
|
21
|
-
method: "GET",
|
|
22
|
-
path: `/api/view-five-items-discount-by-customer-id/${customerId}`,
|
|
23
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
24
|
-
})
|
|
25
|
-
.willRespondWith({
|
|
26
|
-
status: 200,
|
|
27
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
28
|
-
body: EXPECTED_BODY,
|
|
29
|
-
});
|
|
30
|
-
return provider.executeTest(async (mockserver) => {
|
|
31
|
-
const httpGet = fetchHttpGet({
|
|
32
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
33
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
34
|
-
device: "web",
|
|
35
|
-
version: "1.0.0",
|
|
36
|
-
});
|
|
37
|
-
const response = await httpFiveItemsDiscountByCustomerIdView({ httpGet })({
|
|
38
|
-
customerId,
|
|
39
|
-
signal: undefined,
|
|
40
|
-
});
|
|
41
|
-
expect(response).toStrictEqual(fiveItemsDiscountResponse);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpGet } from "@lookiero/sty-psp-http";
|
|
3
|
-
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
4
|
-
import { httpIsCheckoutEnabledByCustomerIdView } from "./httpIsCheckoutEnabledByCustomerIdView";
|
|
5
|
-
const provider = new PactV3({
|
|
6
|
-
...DEFAULT_PACT_OPTIONS,
|
|
7
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
8
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewIsCheckoutEnabledByCustomerId",
|
|
9
|
-
});
|
|
10
|
-
const customerId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
|
|
11
|
-
const isCheckoutEnabledResponse = true;
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
const EXPECTED_BODY = MatchersV3.boolean(isCheckoutEnabledResponse);
|
|
15
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewIsCheckoutEnabledByCustomerId API", () => {
|
|
16
|
-
it("returns is new checkout enabled for the given customer id", () => {
|
|
17
|
-
provider
|
|
18
|
-
.given("is new checkout enabled for the given customer id")
|
|
19
|
-
.uponReceiving("is new checkout enabled")
|
|
20
|
-
.withRequest({
|
|
21
|
-
method: "GET",
|
|
22
|
-
path: `/api/is-new-checkout-enabled/${customerId}`,
|
|
23
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
24
|
-
})
|
|
25
|
-
.willRespondWith({
|
|
26
|
-
status: 200,
|
|
27
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
28
|
-
body: EXPECTED_BODY,
|
|
29
|
-
});
|
|
30
|
-
return provider.executeTest(async (mockserver) => {
|
|
31
|
-
const httpGet = fetchHttpGet({
|
|
32
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
33
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
34
|
-
device: "web",
|
|
35
|
-
version: "1.0.0",
|
|
36
|
-
});
|
|
37
|
-
const response = await httpIsCheckoutEnabledByCustomerIdView({ httpGet })({
|
|
38
|
-
customerId,
|
|
39
|
-
signal: undefined,
|
|
40
|
-
});
|
|
41
|
-
expect(response).toStrictEqual(isCheckoutEnabledResponse);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpGet } from "@lookiero/sty-psp-http";
|
|
3
|
-
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
4
|
-
import { httpIsSizeChangeEnabledByCheckoutIdView } from "./httpIsSizeChangeEnabledByCheckoutIdView";
|
|
5
|
-
const provider = new PactV3({
|
|
6
|
-
...DEFAULT_PACT_OPTIONS,
|
|
7
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
8
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewIsSizeChangeEnabledByCheckoutId",
|
|
9
|
-
});
|
|
10
|
-
const checkoutId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
|
|
11
|
-
const isSizeChangeEnabledResponse = true;
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
const EXPECTED_BODY = MatchersV3.like(isSizeChangeEnabledResponse);
|
|
15
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewIsSizeChangeEnabledByCheckoutId API", () => {
|
|
16
|
-
it("returns is size-change enabled for the given checkout id", () => {
|
|
17
|
-
provider
|
|
18
|
-
.given("is size-change enabled for the given checkout id")
|
|
19
|
-
.uponReceiving("is size-change enabled")
|
|
20
|
-
.withRequest({
|
|
21
|
-
method: "GET",
|
|
22
|
-
path: `/api/is-size-change-enabled-by-checkout-id/${checkoutId}`,
|
|
23
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
24
|
-
})
|
|
25
|
-
.willRespondWith({
|
|
26
|
-
status: 200,
|
|
27
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
28
|
-
body: EXPECTED_BODY,
|
|
29
|
-
});
|
|
30
|
-
return provider.executeTest(async (mockserver) => {
|
|
31
|
-
const httpGet = fetchHttpGet({
|
|
32
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
33
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
34
|
-
device: "web",
|
|
35
|
-
version: "1.0.0",
|
|
36
|
-
});
|
|
37
|
-
const response = await httpIsSizeChangeEnabledByCheckoutIdView({ httpGet })({
|
|
38
|
-
checkoutId,
|
|
39
|
-
signal: undefined,
|
|
40
|
-
});
|
|
41
|
-
expect(response).toStrictEqual(isSizeChangeEnabledResponse);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { UseQueryFunctionResult } from "@lookiero/messaging-react";
|
|
2
|
-
import { IsCheckoutAccessibleByCustomerIdProjection } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
|
|
3
|
-
interface UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs {
|
|
4
|
-
readonly customerId: string | undefined;
|
|
5
|
-
}
|
|
6
|
-
interface UseViewIsCheckoutAccessibleByCustomerIdFunction {
|
|
7
|
-
(args: UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs): UseQueryFunctionResult<IsCheckoutAccessibleByCustomerIdProjection>;
|
|
8
|
-
}
|
|
9
|
-
declare const useViewIsCheckoutAccessibleByCustomerId: UseViewIsCheckoutAccessibleByCustomerIdFunction;
|
|
10
|
-
export { useViewIsCheckoutAccessibleByCustomerId };
|
package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useQuery } from "@lookiero/messaging-react";
|
|
2
|
-
import { isCheckoutFeedbackGiven } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
|
|
3
|
-
import { viewIsCheckoutAccessibleByCustomerId, } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
|
|
4
|
-
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
5
|
-
const useViewIsCheckoutAccessibleByCustomerId = ({ customerId }) => useQuery({
|
|
6
|
-
query: viewIsCheckoutAccessibleByCustomerId({ customerId }),
|
|
7
|
-
contextId: MESSAGING_CONTEXT_ID,
|
|
8
|
-
invalidation: isCheckoutFeedbackGiven,
|
|
9
|
-
options: {
|
|
10
|
-
refetchOnMount: "always",
|
|
11
|
-
staleTime: Infinity,
|
|
12
|
-
retry: false,
|
|
13
|
-
refetchOnWindowFocus: false,
|
|
14
|
-
cacheTime: 0,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
export { useViewIsCheckoutAccessibleByCustomerId };
|
package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
4
|
-
import { checkoutBooking as checkoutBookingMock } from "./checkoutBooking.mock";
|
|
5
|
-
import { httpCheckoutBookingByIdView } from "./httpCheckoutBookingByIdView";
|
|
6
|
-
const provider = new PactV3({
|
|
7
|
-
...DEFAULT_PACT_OPTIONS,
|
|
8
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
9
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewCheckoutBookingById",
|
|
10
|
-
});
|
|
11
|
-
const checkoutBookingProjection = checkoutBookingMock;
|
|
12
|
-
const checkoutBookingId = checkoutBookingProjection.id;
|
|
13
|
-
const checkoutBookingResponse = {
|
|
14
|
-
result: checkoutBookingProjection,
|
|
15
|
-
};
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
const EXPECTED_BODY = MatchersV3.like(checkoutBookingResponse);
|
|
19
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutBookingById API", () => {
|
|
20
|
-
it("returns a valid checkout booking for the given id", () => {
|
|
21
|
-
provider
|
|
22
|
-
.given("a valid checkout booking for the given id")
|
|
23
|
-
.uponReceiving("checkout booking projection")
|
|
24
|
-
.withRequest({
|
|
25
|
-
method: "POST",
|
|
26
|
-
path: "/api/view-checkout-booking-by-id",
|
|
27
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
28
|
-
body: { checkoutBookingId },
|
|
29
|
-
})
|
|
30
|
-
.willRespondWith({
|
|
31
|
-
status: 200,
|
|
32
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
33
|
-
body: EXPECTED_BODY,
|
|
34
|
-
});
|
|
35
|
-
return provider.executeTest(async (mockserver) => {
|
|
36
|
-
const httpPost = fetchHttpPost({
|
|
37
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
38
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
39
|
-
device: "web",
|
|
40
|
-
version: "1.0.0",
|
|
41
|
-
});
|
|
42
|
-
const response = await httpCheckoutBookingByIdView({ httpPost })({
|
|
43
|
-
checkoutBookingId,
|
|
44
|
-
signal: undefined,
|
|
45
|
-
});
|
|
46
|
-
expect(response).toStrictEqual(checkoutBookingResponse.result);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
2
|
-
import { CheckoutItemProductVariantProjection, CheckoutItemProjection } from "../../../projection/checkoutItem/checkoutItem";
|
|
3
|
-
import { FeedbackProjection } from "../../../projection/feedback/feedback";
|
|
4
|
-
interface CheckoutItemFunctionArgs {
|
|
5
|
-
readonly id?: string;
|
|
6
|
-
readonly status: CheckoutItemStatus;
|
|
7
|
-
readonly feedbacks?: FeedbackProjection;
|
|
8
|
-
readonly replacedFor?: CheckoutItemProductVariantProjection;
|
|
9
|
-
}
|
|
10
|
-
interface CheckoutItemFunction {
|
|
11
|
-
(args: CheckoutItemFunctionArgs): CheckoutItemProjection;
|
|
12
|
-
}
|
|
13
|
-
declare const checkoutItem: CheckoutItemFunction;
|
|
14
|
-
export type { CheckoutItemFunctionArgs };
|
|
15
|
-
export { checkoutItem };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Currency } from "../../../domain/checkoutItem/model/currency";
|
|
2
|
-
import { MediaPerspective, } from "../../../projection/checkoutItem/checkoutItem";
|
|
3
|
-
const checkoutItem = ({ id = "7b389d69-f157-4234-8531-c1a1eb17dccb", status, feedbacks = {}, replacedFor = null, }) => ({
|
|
4
|
-
id,
|
|
5
|
-
status,
|
|
6
|
-
price: {
|
|
7
|
-
amount: 3999,
|
|
8
|
-
currency: Currency.EUR,
|
|
9
|
-
},
|
|
10
|
-
feedbacks,
|
|
11
|
-
productVariant: {
|
|
12
|
-
id: "7b389d69-f157-4234-8531-c1a1eb17dccb",
|
|
13
|
-
media: [
|
|
14
|
-
{
|
|
15
|
-
id: "d7ec731b-4123-4394-829b-297b952e73e5",
|
|
16
|
-
url: "https://cdn-catalog-back-prod.envs.lookiero.tech/1a/28/1a28f712-a76c-4172-8a11-f15002981dc0.jpg",
|
|
17
|
-
perspective: MediaPerspective.MAIN,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
id: "8055e209-2fe9-44c5-b715-b09ad3ef741c",
|
|
21
|
-
url: "https://cdn-catalog-back-prod.envs.lookiero.tech/15/ac/15aca112-4e71-4646-8db5-7f9723bc0130.jpg",
|
|
22
|
-
perspective: MediaPerspective.DETAIL,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
brand: "CKS",
|
|
26
|
-
name: "Sari Tshirt lines",
|
|
27
|
-
size: {
|
|
28
|
-
id: "b26f7190-d505-4d24-aeb9-ad36e5e6ec4b",
|
|
29
|
-
lookiero: "M",
|
|
30
|
-
uk: "M",
|
|
31
|
-
it: "M",
|
|
32
|
-
europe: "M",
|
|
33
|
-
unique: false,
|
|
34
|
-
},
|
|
35
|
-
color: {
|
|
36
|
-
id: "c228d1b0-d06d-4d5c-a7d5-953fd43af0d8",
|
|
37
|
-
name: "black",
|
|
38
|
-
label: "black_C2",
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
replacedFor,
|
|
42
|
-
});
|
|
43
|
-
export { checkoutItem };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
4
|
-
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
5
|
-
import { checkoutItem } from "./checkoutItem.mock";
|
|
6
|
-
import { httpCheckoutItemByIdView } from "./httpCheckoutItemByIdView";
|
|
7
|
-
const provider = new PactV3({
|
|
8
|
-
...DEFAULT_PACT_OPTIONS,
|
|
9
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
10
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewCheckoutItemById",
|
|
11
|
-
});
|
|
12
|
-
const checkoutItemProjection = checkoutItem({ status: CheckoutItemStatus.INITIAL });
|
|
13
|
-
const checkoutItemId = checkoutItemProjection.id;
|
|
14
|
-
const checkoutItemResponse = {
|
|
15
|
-
result: checkoutItemProjection,
|
|
16
|
-
};
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
const EXPECTED_BODY = MatchersV3.like(checkoutItemResponse);
|
|
20
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutItemById API", () => {
|
|
21
|
-
it("returns a valid checkout item for the given id", () => {
|
|
22
|
-
provider
|
|
23
|
-
.given("a valid checkout item for the given id")
|
|
24
|
-
.uponReceiving("checkout item projection")
|
|
25
|
-
.withRequest({
|
|
26
|
-
method: "POST",
|
|
27
|
-
path: "/api/view-checkout-item-by-id",
|
|
28
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
29
|
-
body: { checkoutItemId },
|
|
30
|
-
})
|
|
31
|
-
.willRespondWith({
|
|
32
|
-
status: 200,
|
|
33
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
34
|
-
body: EXPECTED_BODY,
|
|
35
|
-
});
|
|
36
|
-
return provider.executeTest(async (mockserver) => {
|
|
37
|
-
const httpPost = fetchHttpPost({
|
|
38
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
39
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
40
|
-
device: "web",
|
|
41
|
-
version: "1.0.0",
|
|
42
|
-
});
|
|
43
|
-
const response = await httpCheckoutItemByIdView({ httpPost })({
|
|
44
|
-
checkoutItemId,
|
|
45
|
-
signal: undefined,
|
|
46
|
-
});
|
|
47
|
-
expect(response).toStrictEqual(checkoutItemResponse.result);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { CheckoutQuestionType, } from "../../../projection/checkoutQuestion/checkoutQuestion";
|
|
2
|
-
const checkoutQuestions = [
|
|
3
|
-
{
|
|
4
|
-
id: "efe07b97-f6fb-4b6a-ba92-b68519320b2c",
|
|
5
|
-
name: "checkout_question.selection.question",
|
|
6
|
-
placeholder: "checkout_question.selection.placeholder",
|
|
7
|
-
type: CheckoutQuestionType.HOST_SELECT,
|
|
8
|
-
showCondition: [],
|
|
9
|
-
children: [
|
|
10
|
-
{
|
|
11
|
-
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
12
|
-
name: "checkout_question.icon.bad",
|
|
13
|
-
placeholder: "",
|
|
14
|
-
type: CheckoutQuestionType.ICON,
|
|
15
|
-
showCondition: [],
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
19
|
-
name: "checkout_question.icon.regular",
|
|
20
|
-
placeholder: "",
|
|
21
|
-
type: CheckoutQuestionType.ICON,
|
|
22
|
-
showCondition: [],
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
26
|
-
name: "checkout_question.icon.good",
|
|
27
|
-
placeholder: "",
|
|
28
|
-
type: CheckoutQuestionType.ICON,
|
|
29
|
-
showCondition: [],
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: "6a6d3878-5561-412c-96f3-7ed79ee587bb",
|
|
35
|
-
name: "checkout_question.experience.question",
|
|
36
|
-
placeholder: "checkout_question.experience.placeholder",
|
|
37
|
-
type: CheckoutQuestionType.HOST_SELECT,
|
|
38
|
-
showCondition: [],
|
|
39
|
-
children: [
|
|
40
|
-
{
|
|
41
|
-
id: "a3d937b6-7499-4a3c-86bf-5c0af9ab2e23",
|
|
42
|
-
name: "checkout_question.icon.bad",
|
|
43
|
-
placeholder: "",
|
|
44
|
-
type: CheckoutQuestionType.ICON,
|
|
45
|
-
showCondition: [],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "7970edd3-fb5c-42d3-afe3-ce31bcbb856c",
|
|
49
|
-
name: "checkout_question.icon.regular",
|
|
50
|
-
placeholder: "",
|
|
51
|
-
type: CheckoutQuestionType.ICON,
|
|
52
|
-
showCondition: [],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: "bab3d4f9-0227-4550-a53f-3c125d68429c",
|
|
56
|
-
name: "checkout_question.icon.good",
|
|
57
|
-
placeholder: "",
|
|
58
|
-
type: CheckoutQuestionType.ICON,
|
|
59
|
-
showCondition: [],
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: "a1acdb2d-62c8-467f-b7cc-dc24d967290c",
|
|
65
|
-
name: "checkout_question.personalshopper.question",
|
|
66
|
-
placeholder: "checkout_question.personalshopper.placeholder",
|
|
67
|
-
type: CheckoutQuestionType.HOST_SELECT,
|
|
68
|
-
showCondition: ["68c0bb98-b00a-4b86-af43-528fe903cb69"],
|
|
69
|
-
children: [
|
|
70
|
-
{
|
|
71
|
-
id: "cce7851c-92c7-461b-8dcb-903c5de59ed1",
|
|
72
|
-
name: "checkout_question.personalshopper.yes",
|
|
73
|
-
placeholder: "",
|
|
74
|
-
type: CheckoutQuestionType.BUTTON,
|
|
75
|
-
showCondition: [],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: "4bf8f27d-669b-4d36-8d39-b5599c671816",
|
|
79
|
-
name: "checkout_question.personalshopper.no",
|
|
80
|
-
placeholder: "",
|
|
81
|
-
type: CheckoutQuestionType.BUTTON,
|
|
82
|
-
showCondition: [],
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
|
|
88
|
-
name: "checkout_question.comment.question",
|
|
89
|
-
placeholder: "",
|
|
90
|
-
type: CheckoutQuestionType.HOST_TEXTAREA,
|
|
91
|
-
showCondition: [],
|
|
92
|
-
children: [
|
|
93
|
-
{
|
|
94
|
-
id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
|
|
95
|
-
name: "checkout_question.comment.question",
|
|
96
|
-
placeholder: "checkout_question.comment.placeholder",
|
|
97
|
-
type: CheckoutQuestionType.TEXTAREA,
|
|
98
|
-
showCondition: [],
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
];
|
|
103
|
-
export { checkoutQuestions };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
4
|
-
import { checkoutQuestions } from "./checkoutQuestions.mock";
|
|
5
|
-
import { httpCheckoutQuestionsByCheckoutIdView } from "./httpCheckoutQuestionsByCheckoutIdView";
|
|
6
|
-
const provider = new PactV3({
|
|
7
|
-
...DEFAULT_PACT_OPTIONS,
|
|
8
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
9
|
-
provider: "STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId",
|
|
10
|
-
});
|
|
11
|
-
const checkoutId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
|
|
12
|
-
const checkoutQuestionsResponse = {
|
|
13
|
-
result: checkoutQuestions,
|
|
14
|
-
};
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
const EXPECTED_BODY = MatchersV3.like(checkoutQuestionsResponse);
|
|
18
|
-
describe("STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId API", () => {
|
|
19
|
-
it("returns a valid checkout questions for the given checkout id", () => {
|
|
20
|
-
provider
|
|
21
|
-
.given("a valid checkout questions for the given checkout id")
|
|
22
|
-
.uponReceiving("checkout questions projection")
|
|
23
|
-
.withRequest({
|
|
24
|
-
method: "POST",
|
|
25
|
-
path: "/api/list-checkout-questions-by-checkout-id",
|
|
26
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
27
|
-
body: { checkoutId },
|
|
28
|
-
})
|
|
29
|
-
.willRespondWith({
|
|
30
|
-
status: 200,
|
|
31
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
32
|
-
body: EXPECTED_BODY,
|
|
33
|
-
});
|
|
34
|
-
return provider.executeTest(async (mockserver) => {
|
|
35
|
-
const httpPost = fetchHttpPost({
|
|
36
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
37
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
38
|
-
device: "web",
|
|
39
|
-
version: "1.0.0",
|
|
40
|
-
});
|
|
41
|
-
const response = await httpCheckoutQuestionsByCheckoutIdView({ httpPost })({
|
|
42
|
-
checkoutId,
|
|
43
|
-
signal: undefined,
|
|
44
|
-
});
|
|
45
|
-
expect(response).toStrictEqual(checkoutQuestionsResponse.result);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|