@lookiero/checkout 10.0.0-beta.2 → 10.0.0-beta.3

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.
Files changed (229) hide show
  1. package/dist/index.js +2 -1
  2. package/dist/src/ExpoRoot.js +3 -2
  3. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +2 -1
  4. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.js +3 -2
  5. package/dist/src/infrastructure/ui/components/atoms/price/Price.js +3 -0
  6. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +7 -3
  7. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +18 -2
  8. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +14 -2
  9. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +2 -1
  10. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +2 -1
  11. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +4 -3
  12. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +0 -1
  13. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +0 -1
  14. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +3 -3
  15. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +3 -2
  16. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
  17. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +3 -2
  18. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -2
  19. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
  20. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +5 -4
  21. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +6 -6
  22. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +4 -3
  23. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +0 -1
  24. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +0 -1
  25. package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +2 -2
  26. package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js +2 -2
  27. package/dist/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +2 -2
  28. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +9 -9
  29. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
  30. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +55 -22
  31. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -1
  32. package/dist/src/infrastructure/ui/i18n/i18n.js +2 -1
  33. package/dist/src/infrastructure/ui/test/render.js +4 -2
  34. package/dist/src/infrastructure/ui/views/App.js +2 -1
  35. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +3 -3
  36. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +16 -16
  37. package/dist/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js +2 -2
  38. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -2
  39. package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +3 -3
  40. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +11 -5
  41. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -4
  42. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -3
  43. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +1 -0
  44. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +2 -1
  45. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  46. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -4
  47. package/dist/src/infrastructure/ui/views/return/components/price/Price.js +3 -0
  48. package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +3 -3
  49. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +4 -4
  50. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +1 -0
  51. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -1
  52. package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
  53. package/dist/src/infrastructure/ui/views/summary/Summary.js +4 -4
  54. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +3 -2
  55. package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +8 -6
  56. package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +5 -5
  57. package/dist/src/version.d.ts +1 -1
  58. package/dist/src/version.js +1 -1
  59. package/index.ts +2 -1
  60. package/jest.config.js +2 -2
  61. package/package.json +7 -8
  62. package/src/ExpoRoot.tsx +3 -2
  63. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.ts +3 -2
  64. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx +3 -2
  65. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/__snapshots__/FiveItemsDiscountBanner.test.tsx.snap +1 -1
  66. package/src/infrastructure/ui/components/atoms/price/Price.tsx +3 -0
  67. package/src/infrastructure/ui/components/atoms/price/__snapshots__/Price.test.tsx.snap +3 -3
  68. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.ts +25 -4
  69. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +13 -7
  70. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +2 -1
  71. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +2 -1
  72. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +0 -1
  73. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +4 -2
  74. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +3 -3
  75. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +3 -2
  76. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -5
  77. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +3 -2
  78. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +3 -2
  79. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +2 -1
  80. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +6 -5
  81. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +7 -7
  82. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +0 -1
  83. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +4 -2
  84. package/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.tsx +2 -2
  85. package/src/infrastructure/ui/components/templates/header/checkoutHeader/__snapshots__/CheckoutHeader.test.tsx.snap +1 -1
  86. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.tsx +2 -2
  87. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/__snapshots__/ItemDetailHeader.test.tsx.snap +1 -1
  88. package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.tsx +2 -2
  89. package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +1 -1
  90. package/src/infrastructure/ui/hooks/useCheckoutFlow.test.tsx +302 -0
  91. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +9 -9
  92. package/src/infrastructure/ui/i18n/i18n.ts +3 -1
  93. package/src/infrastructure/ui/test/render.tsx +6 -3
  94. package/src/infrastructure/ui/views/App.tsx +2 -1
  95. package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +51 -40
  96. package/src/infrastructure/ui/views/checkout/Checkout.tsx +3 -3
  97. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.tsx +2 -2
  98. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/__snapshots__/DeliveryBanner.test.tsx.snap +1 -1
  99. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +2 -2
  100. package/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.tsx +3 -3
  101. package/src/infrastructure/ui/views/item/components/banner/__snapshots__/CustomerDecissionBanner.test.tsx.snap +3 -3
  102. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +11 -5
  103. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +160 -88
  104. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +4 -4
  105. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +244 -128
  106. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.ts +2 -1
  107. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.tsx +3 -3
  108. package/src/infrastructure/ui/views/item/components/productVariantDescription/__snapshots__/ProductVariantDescription.test.tsx.snap +10 -8
  109. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +30 -30
  110. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -2
  111. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +1 -1
  112. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -4
  113. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +75 -41
  114. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +105 -102
  115. package/src/infrastructure/ui/views/return/components/price/Price.tsx +3 -0
  116. package/src/infrastructure/ui/views/return/components/price/__snapshots__/Price.test.tsx.snap +3 -3
  117. package/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.tsx +3 -3
  118. package/src/infrastructure/ui/views/return/components/productVariantPreview/__snapshots__/ProductVariantPreview.test.tsx.snap +1 -1
  119. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +2 -1
  120. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +4 -4
  121. package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.tsx +4 -4
  122. package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +30 -30
  123. package/src/infrastructure/ui/views/summary/Summary.tsx +4 -4
  124. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +3 -2
  125. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +154 -82
  126. package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +8 -6
  127. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +5 -5
  128. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +62 -62
  129. package/dist/pact.config.d.ts +0 -21
  130. package/dist/pact.config.js +0 -16
  131. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
  132. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -55
  133. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
  134. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -116
  135. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
  136. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -56
  137. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
  138. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -51
  139. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
  140. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -51
  141. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
  142. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -51
  143. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
  144. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
  145. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
  146. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -56
  147. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
  148. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -57
  149. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
  150. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -55
  151. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
  152. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -120
  153. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
  154. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -55
  155. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
  156. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -55
  157. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
  158. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
  159. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
  160. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
  161. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
  162. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
  163. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
  164. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
  165. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
  166. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
  167. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
  168. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -14
  169. package/dist/src/infrastructure/ui/components/templates/footer/Footer.d.ts +0 -3
  170. package/dist/src/infrastructure/ui/components/templates/footer/Footer.js +0 -13
  171. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
  172. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
  173. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
  174. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
  175. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
  176. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
  177. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
  178. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
  179. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
  180. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
  181. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
  182. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
  183. package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
  184. package/dist/src/infrastructure/ui/views/App.style.js +0 -8
  185. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
  186. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
  187. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
  188. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
  189. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
  190. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
  191. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
  192. package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
  193. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
  194. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
  195. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
  196. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
  197. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
  198. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
  199. package/dist/src/projection/shared/country.d.ts +0 -14
  200. package/dist/src/projection/shared/country.js +0 -15
  201. package/dist/src/projection/shared/customer.d.ts +0 -9
  202. package/dist/src/projection/shared/customer.js +0 -1
  203. package/dist/src/projection/shared/locale.d.ts +0 -12
  204. package/dist/src/projection/shared/locale.js +0 -13
  205. package/dist/src/projection/shared/order.d.ts +0 -6
  206. package/dist/src/projection/shared/order.js +0 -1
  207. package/dist/src/projection/shared/price.d.ts +0 -11
  208. package/dist/src/projection/shared/price.js +0 -1
  209. package/dist/src/projection/shared/size.d.ts +0 -21
  210. package/dist/src/projection/shared/size.js +0 -4
  211. package/dist/src/projection/shared/subscription.d.ts +0 -2
  212. package/dist/src/projection/shared/subscription.js +0 -1
  213. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +0 -15
  214. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +0 -16
  215. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
  216. package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
  217. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +0 -14
  218. package/dist/src/shared/ui/components/atoms/field/Field.js +0 -29
  219. package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +0 -16
  220. package/dist/src/shared/ui/components/atoms/field/Field.style.js +0 -19
  221. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +0 -24
  222. package/dist/src/shared/ui/components/molecules/inputField/InputField.js +0 -28
  223. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -29
  224. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +0 -37
  225. package/src/infrastructure/ui/components/templates/footer/Footer.test.tsx +0 -15
  226. package/src/infrastructure/ui/components/templates/footer/Footer.tsx +0 -19
  227. package/src/infrastructure/ui/components/templates/footer/__snapshots__/Footer.test.tsx.snap +0 -1127
  228. package/src/infrastructure/ui/hooks/useCheckoutFlow.test.ts +0 -297
  229. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +0 -126
@@ -1,16 +0,0 @@
1
- const DEFAULT_PACT_OPTIONS = { dir: ".contracts", logDir: ".pact/logs" };
2
- const AUTH_TOKEN =
3
- "eyJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6InBpY2tlcixwYWNrZXIiLCJzdWIiOiIxIiwiaWF0IjoxNjAyODQ4MzEyfQ.gCs2_vBcJsXt4EdreNSjDI8NWkOTQ5Cy4SwtrGnuJ44";
4
- const DEFAULT_REQUEST_HEADERS = {
5
- Authorization: `Bearer ${AUTH_TOKEN}`,
6
- ["Content-Type"]: "application/json",
7
- };
8
- const DEFAULT_RESPONSE_HEADERS = { ["Content-Type"]: "application/json" };
9
- const fromMockServerUrlToApiUrl = (mockServer) => mockServer.url.concat("/api");
10
- export {
11
- fromMockServerUrlToApiUrl,
12
- AUTH_TOKEN,
13
- DEFAULT_PACT_OPTIONS,
14
- DEFAULT_REQUEST_HEADERS,
15
- DEFAULT_RESPONSE_HEADERS,
16
- };
@@ -1,55 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpPost } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { bookedProductsVariants } from "./bookedProductsVariants.mock";
11
- import { httpBookedProductsVariantsForCheckoutItemView } from "./httpBookedProductsVariantsForCheckoutItemView";
12
-
13
- const provider = new PactV3({
14
- ...DEFAULT_PACT_OPTIONS,
15
- consumer: "STY-BOX_CHECKOUT-FRONT",
16
- provider: "STY-BOX_CHECKOUT-BACK_ViewBookedProductVariantsForCheckoutItem",
17
- });
18
- const checkoutItemId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
19
- const bookedProductsVariantsResponse = {
20
- result: bookedProductsVariants,
21
- };
22
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
- // @ts-ignore
24
- const EXPECTED_BODY = MatchersV3.like(bookedProductsVariantsResponse);
25
- describe("STY-BOX_CHECKOUT-BACK_ViewBookedProductVariantsForCheckoutItem API", () => {
26
- it("returns a valid booked size change product variants for the given checkout item", () => {
27
- provider
28
- .given("a valid booked size change product variants for the given checkout item")
29
- .uponReceiving("booked size change product variants projection")
30
- .withRequest({
31
- method: "POST",
32
- path: "/api/view-booked-product-variants-for-checkout-item",
33
- headers: DEFAULT_REQUEST_HEADERS,
34
- body: { checkoutItemId },
35
- })
36
- .willRespondWith({
37
- status: 200,
38
- headers: DEFAULT_RESPONSE_HEADERS,
39
- body: EXPECTED_BODY,
40
- });
41
- return provider.executeTest(async (mockserver) => {
42
- const httpPost = fetchHttpPost({
43
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
44
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
45
- device: "web",
46
- version: "1.0.0",
47
- });
48
- const response = await httpBookedProductsVariantsForCheckoutItemView({ httpPost })({
49
- checkoutItemId,
50
- signal: undefined,
51
- });
52
- expect(response).toStrictEqual(bookedProductsVariantsResponse.result);
53
- });
54
- });
55
- });
@@ -1,116 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpPost } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
11
- import { MediaPerspective } from "../../../projection/checkoutItem/checkoutItem";
12
- import { checkout } from "./checkout.mock";
13
- import { httpCheckoutByIdView } from "./httpCheckoutByIdView";
14
-
15
- const provider = new PactV3({
16
- ...DEFAULT_PACT_OPTIONS,
17
- consumer: "STY-BOX_CHECKOUT-FRONT",
18
- provider: "STY-BOX_CHECKOUT-BACK_ViewCheckoutById",
19
- });
20
- const checkoutId = "e2490de5-5bd3-43d5-b7c4-526e33f71304";
21
- const replacedFor = {
22
- id: "2bf7fb8f-a283-4f53-bc27-0e7fc9466a33",
23
- media: [
24
- {
25
- id: "d7ec731b-4123-4394-829b-297b952e73e5",
26
- url: "https://cdn-catalog-back-prod.envs.lookiero.tech/1a/28/1a28f712-a76c-4172-8a11-f15002981dc0.jpg",
27
- perspective: MediaPerspective.MAIN,
28
- },
29
- {
30
- id: "8055e209-2fe9-44c5-b715-b09ad3ef741c",
31
- url: "https://cdn-catalog-back-prod.envs.lookiero.tech/15/ac/15aca112-4e71-4646-8db5-7f9723bc0130.jpg",
32
- perspective: MediaPerspective.DETAIL,
33
- },
34
- ],
35
- brand: "CKS",
36
- name: "Sari Tshirt lines",
37
- size: {
38
- id: "b3a76aea-ce7a-4ecb-82a4-6637d0ac2afd",
39
- lookiero: "S",
40
- uk: "S",
41
- it: "S",
42
- europe: "S",
43
- unique: false,
44
- },
45
- color: {
46
- id: "c228d1b0-d06d-4d5c-a7d5-953fd43af0d8",
47
- label: "black_C2",
48
- name: "black",
49
- },
50
- };
51
- const checkoutResponseWithReplacedFor = {
52
- result: checkout({ items: [{ status: CheckoutItemStatus.KEPT, replacedFor }] }),
53
- };
54
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
55
- // @ts-ignore
56
- const EXPECTED_BODY_WITH_REPLACED_FOR = MatchersV3.like(checkoutResponseWithReplacedFor);
57
- const checkoutResponseWithoutReplacedFor = {
58
- result: checkout({ items: [{ status: CheckoutItemStatus.KEPT }] }),
59
- };
60
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
61
- // @ts-ignore
62
- const EXPECTED_BODY_WITHOUT_REPLACED_FOR = MatchersV3.like(checkoutResponseWithoutReplacedFor);
63
- describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutById API", () => {
64
- it("returns a valid checkout with replacedFor for the given id", () => {
65
- provider
66
- .given("a valid checkout with replacedFor for the given id")
67
- .uponReceiving("checkout projection")
68
- .withRequest({
69
- method: "POST",
70
- path: "/api/view-checkout-by-id",
71
- headers: DEFAULT_REQUEST_HEADERS,
72
- body: { checkoutId },
73
- })
74
- .willRespondWith({
75
- status: 200,
76
- headers: DEFAULT_RESPONSE_HEADERS,
77
- body: EXPECTED_BODY_WITH_REPLACED_FOR,
78
- });
79
- return provider.executeTest(async (mockserver) => {
80
- const httpPost = fetchHttpPost({
81
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
82
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
83
- device: "web",
84
- version: "1.0.0",
85
- });
86
- const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
87
- expect(response).toStrictEqual(checkoutResponseWithReplacedFor.result);
88
- });
89
- });
90
- it("returns a valid checkout without replacedFor for the given id", () => {
91
- provider
92
- .given("a valid checkout without replacedFor for the given id")
93
- .uponReceiving("checkout projection")
94
- .withRequest({
95
- method: "POST",
96
- path: "/api/view-checkout-by-id",
97
- headers: DEFAULT_REQUEST_HEADERS,
98
- body: { checkoutId },
99
- })
100
- .willRespondWith({
101
- status: 200,
102
- headers: DEFAULT_RESPONSE_HEADERS,
103
- body: EXPECTED_BODY_WITHOUT_REPLACED_FOR,
104
- });
105
- return provider.executeTest(async (mockserver) => {
106
- const httpPost = fetchHttpPost({
107
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
108
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
109
- device: "web",
110
- version: "1.0.0",
111
- });
112
- const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
113
- expect(response).toStrictEqual(checkoutResponseWithoutReplacedFor.result);
114
- });
115
- });
116
- });
@@ -1,56 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpPost } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
11
- import { checkout } from "./checkout.mock";
12
- import { httpFirstAvailableCheckoutByCustomerIdView } from "./httpFirstAvailableCheckoutByCustomerIdView";
13
-
14
- const provider = new PactV3({
15
- ...DEFAULT_PACT_OPTIONS,
16
- consumer: "STY-BOX_CHECKOUT-FRONT",
17
- provider: "STY-BOX_CHECKOUT-BACK_ViewFirstAvailableCheckoutByCustomerId",
18
- });
19
- const customerId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
20
- const checkoutResponse = {
21
- result: checkout({ items: [{ status: CheckoutItemStatus.KEPT }] }),
22
- };
23
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
24
- // @ts-ignore
25
- const EXPECTED_BODY = MatchersV3.like(checkoutResponse);
26
- describe("STY-BOX_CHECKOUT-BACK_ViewFirstAvailableCheckoutByCustomerId API", () => {
27
- it("returns a first available checkout for the given customer id", () => {
28
- provider
29
- .given("a first available checkout for the given customer id")
30
- .uponReceiving("checkout projection")
31
- .withRequest({
32
- method: "POST",
33
- path: "/api/view-first-available-checkout-by-customer-id",
34
- headers: DEFAULT_REQUEST_HEADERS,
35
- body: { customerId },
36
- })
37
- .willRespondWith({
38
- status: 200,
39
- headers: DEFAULT_RESPONSE_HEADERS,
40
- body: EXPECTED_BODY,
41
- });
42
- return provider.executeTest(async (mockserver) => {
43
- const httpPost = fetchHttpPost({
44
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
45
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
46
- device: "web",
47
- version: "1.0.0",
48
- });
49
- const response = await httpFirstAvailableCheckoutByCustomerIdView({ httpPost })({
50
- customerId,
51
- signal: undefined,
52
- });
53
- expect(response).toStrictEqual(checkoutResponse.result);
54
- });
55
- });
56
- });
@@ -1,51 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpGet } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { httpFiveItemsDiscountByCustomerIdView } from "./httpFiveItemsDiscountByCustomerIdView";
11
-
12
- const provider = new PactV3({
13
- ...DEFAULT_PACT_OPTIONS,
14
- consumer: "STY-BOX_CHECKOUT-FRONT",
15
- provider: "STY-BOX_CHECKOUT-BACK_ViewFiveItemsDiscountByCustomerId",
16
- });
17
- const customerId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
18
- const fiveItemsDiscountResponse = 25;
19
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20
- // @ts-ignore
21
- const EXPECTED_BODY = MatchersV3.number(fiveItemsDiscountResponse);
22
- describe("STY-BOX_CHECKOUT-BACK_ViewFiveItemsDiscountByCustomerId API", () => {
23
- it("returns a five items discount for the given customer id", () => {
24
- provider
25
- .given("a five items discount for the given customer id")
26
- .uponReceiving("five items discount")
27
- .withRequest({
28
- method: "GET",
29
- path: `/api/view-five-items-discount-by-customer-id/${customerId}`,
30
- headers: DEFAULT_REQUEST_HEADERS,
31
- })
32
- .willRespondWith({
33
- status: 200,
34
- headers: DEFAULT_RESPONSE_HEADERS,
35
- body: EXPECTED_BODY,
36
- });
37
- return provider.executeTest(async (mockserver) => {
38
- const httpGet = fetchHttpGet({
39
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
40
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
41
- device: "web",
42
- version: "1.0.0",
43
- });
44
- const response = await httpFiveItemsDiscountByCustomerIdView({ httpGet })({
45
- customerId,
46
- signal: undefined,
47
- });
48
- expect(response).toStrictEqual(fiveItemsDiscountResponse);
49
- });
50
- });
51
- });
@@ -1,51 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpGet } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { httpIsCheckoutEnabledByCustomerIdView } from "./httpIsCheckoutEnabledByCustomerIdView";
11
-
12
- const provider = new PactV3({
13
- ...DEFAULT_PACT_OPTIONS,
14
- consumer: "STY-BOX_CHECKOUT-FRONT",
15
- provider: "STY-BOX_CHECKOUT-BACK_ViewIsCheckoutEnabledByCustomerId",
16
- });
17
- const customerId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
18
- const isCheckoutEnabledResponse = true;
19
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20
- // @ts-ignore
21
- const EXPECTED_BODY = MatchersV3.boolean(isCheckoutEnabledResponse);
22
- describe("STY-BOX_CHECKOUT-BACK_ViewIsCheckoutEnabledByCustomerId API", () => {
23
- it("returns is new checkout enabled for the given customer id", () => {
24
- provider
25
- .given("is new checkout enabled for the given customer id")
26
- .uponReceiving("is new checkout enabled")
27
- .withRequest({
28
- method: "GET",
29
- path: `/api/is-new-checkout-enabled/${customerId}`,
30
- headers: DEFAULT_REQUEST_HEADERS,
31
- })
32
- .willRespondWith({
33
- status: 200,
34
- headers: DEFAULT_RESPONSE_HEADERS,
35
- body: EXPECTED_BODY,
36
- });
37
- return provider.executeTest(async (mockserver) => {
38
- const httpGet = fetchHttpGet({
39
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
40
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
41
- device: "web",
42
- version: "1.0.0",
43
- });
44
- const response = await httpIsCheckoutEnabledByCustomerIdView({ httpGet })({
45
- customerId,
46
- signal: undefined,
47
- });
48
- expect(response).toStrictEqual(isCheckoutEnabledResponse);
49
- });
50
- });
51
- });
@@ -1,51 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpGet } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { httpIsSizeChangeEnabledByCheckoutIdView } from "./httpIsSizeChangeEnabledByCheckoutIdView";
11
-
12
- const provider = new PactV3({
13
- ...DEFAULT_PACT_OPTIONS,
14
- consumer: "STY-BOX_CHECKOUT-FRONT",
15
- provider: "STY-BOX_CHECKOUT-BACK_ViewIsSizeChangeEnabledByCheckoutId",
16
- });
17
- const checkoutId = "fab61a4d-c94d-4e33-b098-1945294a5f75";
18
- const isSizeChangeEnabledResponse = true;
19
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20
- // @ts-ignore
21
- const EXPECTED_BODY = MatchersV3.like(isSizeChangeEnabledResponse);
22
- describe("STY-BOX_CHECKOUT-BACK_ViewIsSizeChangeEnabledByCheckoutId API", () => {
23
- it("returns is size-change enabled for the given checkout id", () => {
24
- provider
25
- .given("is size-change enabled for the given checkout id")
26
- .uponReceiving("is size-change enabled")
27
- .withRequest({
28
- method: "GET",
29
- path: `/api/is-size-change-enabled-by-checkout-id/${checkoutId}`,
30
- headers: DEFAULT_REQUEST_HEADERS,
31
- })
32
- .willRespondWith({
33
- status: 200,
34
- headers: DEFAULT_RESPONSE_HEADERS,
35
- body: EXPECTED_BODY,
36
- });
37
- return provider.executeTest(async (mockserver) => {
38
- const httpGet = fetchHttpGet({
39
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
40
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
41
- device: "web",
42
- version: "1.0.0",
43
- });
44
- const response = await httpIsSizeChangeEnabledByCheckoutIdView({ httpGet })({
45
- checkoutId,
46
- signal: undefined,
47
- });
48
- expect(response).toStrictEqual(isSizeChangeEnabledResponse);
49
- });
50
- });
51
- });
@@ -1,13 +0,0 @@
1
- import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
- import { IsCheckoutAccessibleByCustomerIdProjection } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
3
-
4
- interface UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs {
5
- readonly customerId: string | undefined;
6
- }
7
- interface UseViewIsCheckoutAccessibleByCustomerIdFunction {
8
- (
9
- args: UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs,
10
- ): UseQueryFunctionResult<IsCheckoutAccessibleByCustomerIdProjection>;
11
- }
12
- declare const useViewIsCheckoutAccessibleByCustomerId: UseViewIsCheckoutAccessibleByCustomerIdFunction;
13
- export { useViewIsCheckoutAccessibleByCustomerId };
@@ -1,19 +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
-
6
- const useViewIsCheckoutAccessibleByCustomerId = ({ customerId }) =>
7
- useQuery({
8
- query: viewIsCheckoutAccessibleByCustomerId({ customerId }),
9
- contextId: MESSAGING_CONTEXT_ID,
10
- invalidation: isCheckoutFeedbackGiven,
11
- options: {
12
- refetchOnMount: "always",
13
- staleTime: Infinity,
14
- retry: false,
15
- refetchOnWindowFocus: false,
16
- cacheTime: 0,
17
- },
18
- });
19
- export { useViewIsCheckoutAccessibleByCustomerId };
@@ -1,56 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpPost } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { checkoutBooking as checkoutBookingMock } from "./checkoutBooking.mock";
11
- import { httpCheckoutBookingByIdView } from "./httpCheckoutBookingByIdView";
12
-
13
- const provider = new PactV3({
14
- ...DEFAULT_PACT_OPTIONS,
15
- consumer: "STY-BOX_CHECKOUT-FRONT",
16
- provider: "STY-BOX_CHECKOUT-BACK_ViewCheckoutBookingById",
17
- });
18
- const checkoutBookingProjection = checkoutBookingMock;
19
- const checkoutBookingId = checkoutBookingProjection.id;
20
- const checkoutBookingResponse = {
21
- result: checkoutBookingProjection,
22
- };
23
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
24
- // @ts-ignore
25
- const EXPECTED_BODY = MatchersV3.like(checkoutBookingResponse);
26
- describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutBookingById API", () => {
27
- it("returns a valid checkout booking for the given id", () => {
28
- provider
29
- .given("a valid checkout booking for the given id")
30
- .uponReceiving("checkout booking projection")
31
- .withRequest({
32
- method: "POST",
33
- path: "/api/view-checkout-booking-by-id",
34
- headers: DEFAULT_REQUEST_HEADERS,
35
- body: { checkoutBookingId },
36
- })
37
- .willRespondWith({
38
- status: 200,
39
- headers: DEFAULT_RESPONSE_HEADERS,
40
- body: EXPECTED_BODY,
41
- });
42
- return provider.executeTest(async (mockserver) => {
43
- const httpPost = fetchHttpPost({
44
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
45
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
46
- device: "web",
47
- version: "1.0.0",
48
- });
49
- const response = await httpCheckoutBookingByIdView({ httpPost })({
50
- checkoutBookingId,
51
- signal: undefined,
52
- });
53
- expect(response).toStrictEqual(checkoutBookingResponse.result);
54
- });
55
- });
56
- });
@@ -1,57 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpPost } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
11
- import { checkoutItem } from "./checkoutItem.mock";
12
- import { httpCheckoutItemByIdView } from "./httpCheckoutItemByIdView";
13
-
14
- const provider = new PactV3({
15
- ...DEFAULT_PACT_OPTIONS,
16
- consumer: "STY-BOX_CHECKOUT-FRONT",
17
- provider: "STY-BOX_CHECKOUT-BACK_ViewCheckoutItemById",
18
- });
19
- const checkoutItemProjection = checkoutItem({ status: CheckoutItemStatus.INITIAL });
20
- const checkoutItemId = checkoutItemProjection.id;
21
- const checkoutItemResponse = {
22
- result: checkoutItemProjection,
23
- };
24
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
25
- // @ts-ignore
26
- const EXPECTED_BODY = MatchersV3.like(checkoutItemResponse);
27
- describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutItemById API", () => {
28
- it("returns a valid checkout item for the given id", () => {
29
- provider
30
- .given("a valid checkout item for the given id")
31
- .uponReceiving("checkout item projection")
32
- .withRequest({
33
- method: "POST",
34
- path: "/api/view-checkout-item-by-id",
35
- headers: DEFAULT_REQUEST_HEADERS,
36
- body: { checkoutItemId },
37
- })
38
- .willRespondWith({
39
- status: 200,
40
- headers: DEFAULT_RESPONSE_HEADERS,
41
- body: EXPECTED_BODY,
42
- });
43
- return provider.executeTest(async (mockserver) => {
44
- const httpPost = fetchHttpPost({
45
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
46
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
47
- device: "web",
48
- version: "1.0.0",
49
- });
50
- const response = await httpCheckoutItemByIdView({ httpPost })({
51
- checkoutItemId,
52
- signal: undefined,
53
- });
54
- expect(response).toStrictEqual(checkoutItemResponse.result);
55
- });
56
- });
57
- });
@@ -1,55 +0,0 @@
1
- import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
- import { fetchHttpPost } from "@lookiero/sty-psp-http";
3
- import {
4
- AUTH_TOKEN,
5
- DEFAULT_PACT_OPTIONS,
6
- DEFAULT_REQUEST_HEADERS,
7
- DEFAULT_RESPONSE_HEADERS,
8
- fromMockServerUrlToApiUrl,
9
- } from "../../../../pact.config";
10
- import { checkoutQuestions } from "./checkoutQuestions.mock";
11
- import { httpCheckoutQuestionsByCheckoutIdView } from "./httpCheckoutQuestionsByCheckoutIdView";
12
-
13
- const provider = new PactV3({
14
- ...DEFAULT_PACT_OPTIONS,
15
- consumer: "STY-BOX_CHECKOUT-FRONT",
16
- provider: "STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId",
17
- });
18
- const checkoutId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
19
- const checkoutQuestionsResponse = {
20
- result: checkoutQuestions,
21
- };
22
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
- // @ts-ignore
24
- const EXPECTED_BODY = MatchersV3.like(checkoutQuestionsResponse);
25
- describe("STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId API", () => {
26
- it("returns a valid checkout questions for the given checkout id", () => {
27
- provider
28
- .given("a valid checkout questions for the given checkout id")
29
- .uponReceiving("checkout questions projection")
30
- .withRequest({
31
- method: "POST",
32
- path: "/api/list-checkout-questions-by-checkout-id",
33
- headers: DEFAULT_REQUEST_HEADERS,
34
- body: { checkoutId },
35
- })
36
- .willRespondWith({
37
- status: 200,
38
- headers: DEFAULT_RESPONSE_HEADERS,
39
- body: EXPECTED_BODY,
40
- });
41
- return provider.executeTest(async (mockserver) => {
42
- const httpPost = fetchHttpPost({
43
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
44
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
45
- device: "web",
46
- version: "1.0.0",
47
- });
48
- const response = await httpCheckoutQuestionsByCheckoutIdView({ httpPost })({
49
- checkoutId,
50
- signal: undefined,
51
- });
52
- expect(response).toStrictEqual(checkoutQuestionsResponse.result);
53
- });
54
- });
55
- });