@lookiero/checkout 8.14.0-beta.2 → 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.
Files changed (225) hide show
  1. package/.eslintrc.js +1 -1
  2. package/cypress/integration/checkout.spec.ts +259 -0
  3. package/cypress/support/e2e.ts +3 -0
  4. package/cypress/support/index.d.ts +8 -0
  5. package/cypress/support/interceptBlockCheckoutBooking.ts +4 -0
  6. package/cypress/support/interceptGiveCheckoutFeedback.ts +4 -0
  7. package/cypress/support/interceptKeepCheckoutItem.ts +4 -0
  8. package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +9 -0
  9. package/cypress/support/interceptListReturnQuestionsByCheckoutItemId.ts +9 -0
  10. package/cypress/support/interceptPayment.ts +23 -0
  11. package/cypress/support/interceptReplaceCheckoutItem.ts +4 -0
  12. package/cypress/support/interceptReturnCheckoutItem.ts +4 -0
  13. package/cypress/support/interceptSubmitCheckout.ts +4 -0
  14. package/cypress/support/interceptViewBookedProductsVariantsForCheckoutItem.ts +9 -0
  15. package/cypress/support/interceptViewCheckoutById.ts +6 -0
  16. package/cypress/support/interceptViewFirstAvailableCheckoutByCustomerId.ts +9 -0
  17. package/cypress/support/interceptViewFiveItemsDiscountByCustomerId.ts +6 -0
  18. package/cypress/support/interceptViewIsSizeChangeEnabledByCheckoutId.ts +6 -0
  19. package/cypress/support/interceptViewPaymentFlowPayloadByCheckoutId.ts +9 -0
  20. package/cypress/support/interceptViewPricingByCheckoutId.ts +6 -0
  21. package/cypress/tsconfig.json +8 -0
  22. package/cypress.config.ts +50 -0
  23. package/dist/src/ExpoRoot.js +2 -2
  24. package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
  25. package/dist/src/infrastructure/ui/Root.d.ts +0 -2
  26. package/dist/src/infrastructure/ui/Root.js +2 -2
  27. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +0 -5
  28. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +5 -3
  29. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +0 -5
  30. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
  31. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +2 -1
  32. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +3 -3
  33. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +4 -8
  34. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +2 -1
  35. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +1 -0
  36. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +2 -1
  37. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +8 -6
  38. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +2 -1
  39. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -1
  40. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +2 -1
  41. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -3
  42. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
  43. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
  44. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +2 -1
  45. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +2 -1
  46. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +2 -1
  47. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +7 -5
  48. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +1 -3
  49. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +6 -4
  50. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +2 -1
  51. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
  52. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +2 -1
  53. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +6 -5
  54. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +2 -1
  55. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +2 -1
  56. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +2 -1
  57. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -1
  58. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +18 -9
  59. package/dist/src/infrastructure/ui/routing/Routing.d.ts +0 -7
  60. package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
  61. package/dist/src/infrastructure/ui/views/App.d.ts +0 -8
  62. package/dist/src/infrastructure/ui/views/App.js +6 -8
  63. package/dist/src/infrastructure/ui/views/item/Item.d.ts +0 -5
  64. package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
  65. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +0 -2
  66. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
  67. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
  68. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
  69. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +1 -5
  70. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
  71. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +0 -5
  72. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +3 -3
  73. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -3
  74. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
  75. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
  76. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
  77. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +0 -2
  78. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
  79. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +0 -5
  80. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
  81. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +0 -5
  82. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
  83. package/dist/src/infrastructure/ui/views/return/Return.d.ts +0 -5
  84. package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
  85. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -5
  86. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +15 -13
  87. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +6 -2
  88. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +6 -2
  89. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -2
  90. package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +9 -0
  91. package/dist/src/projection/returnQuestion/returnQuestion.constants.js +10 -0
  92. package/dist/src/projection/returnQuestion/returnQuestion.d.ts +23 -16
  93. package/dist/src/projection/returnQuestion/returnQuestion.js +1 -11
  94. package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +12 -0
  95. package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +1 -0
  96. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +5 -0
  97. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +10 -0
  98. package/dist/src/version.d.ts +1 -1
  99. package/dist/src/version.js +1 -1
  100. package/jest.setup.js +0 -20
  101. package/package.json +9 -8
  102. package/src/ExpoRoot.tsx +2 -2
  103. package/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.test.ts +1 -1
  104. package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
  105. package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +4 -9
  106. package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +72 -117
  107. package/src/infrastructure/ui/Root.tsx +1 -4
  108. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +10 -12
  109. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +11 -22
  110. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +10 -9
  111. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +1 -8
  112. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +2 -1
  113. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +7 -9
  114. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
  115. package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +4 -9
  116. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +7 -13
  117. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +4 -2
  118. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +8 -14
  119. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +13 -7
  120. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +7 -5
  121. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
  122. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +10 -14
  123. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +8 -7
  124. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +5 -5
  125. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +43 -36
  126. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +10 -9
  127. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +13 -14
  128. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +8 -14
  129. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +6 -4
  130. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +8 -7
  131. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +23 -25
  132. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +5 -3
  133. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +9 -29
  134. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +7 -5
  135. package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +5 -4
  136. package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +32 -18
  137. package/src/infrastructure/ui/routing/Routing.tsx +5 -13
  138. package/src/infrastructure/ui/views/App.tsx +11 -21
  139. package/src/infrastructure/ui/views/item/Item.tsx +2 -8
  140. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
  141. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +3 -9
  142. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +7 -0
  143. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +1 -8
  144. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +5 -16
  145. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
  146. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -6
  147. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +7 -0
  148. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +3 -4
  149. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +7 -0
  150. package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +2 -12
  151. package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +4 -14
  152. package/src/infrastructure/ui/views/return/Return.tsx +1 -8
  153. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +6 -2
  154. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +39 -34
  155. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -2
  156. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +2 -2
  157. package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +4 -12
  158. package/src/projection/returnQuestion/returnQuestion.constants.ts +10 -0
  159. package/src/projection/returnQuestion/returnQuestion.metadata.ts +17 -0
  160. package/src/projection/returnQuestion/returnQuestion.ts +42 -20
  161. package/src/projection/returnQuestion/returnQuestion.typeguard.ts +24 -0
  162. package/dist/pact.config.d.ts +0 -13
  163. package/dist/pact.config.js +0 -9
  164. package/dist/public/public/assets/adaptive-icon.png +0 -0
  165. package/dist/public/public/assets/favicon.png +0 -0
  166. package/dist/public/public/assets/icon.png +0 -0
  167. package/dist/public/public/assets/splash.png +0 -0
  168. package/dist/public/public/images/not-found.png +0 -0
  169. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -3
  170. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +0 -27
  171. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
  172. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -48
  173. package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +0 -19
  174. package/dist/src/infrastructure/projection/checkout/checkout.mock.js +0 -21
  175. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
  176. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -109
  177. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
  178. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -49
  179. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
  180. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -44
  181. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
  182. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -44
  183. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
  184. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -44
  185. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -3
  186. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +0 -6
  187. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
  188. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -49
  189. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -15
  190. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +0 -43
  191. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
  192. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -50
  193. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
  194. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
  195. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
  196. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -48
  197. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
  198. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -109
  199. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +0 -6
  200. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +0 -183
  201. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
  202. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -48
  203. package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +0 -9
  204. package/dist/src/infrastructure/projection/pricing/pricing.mock.js +0 -42
  205. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
  206. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -48
  207. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -3
  208. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +0 -400
  209. package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
  210. package/dist/src/infrastructure/ui/views/App.style.js +0 -7
  211. package/pact.config.ts +0 -31
  212. package/pact.publish.js +0 -32
  213. package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +0 -62
  214. package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +0 -128
  215. package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +0 -63
  216. package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +0 -57
  217. package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +0 -57
  218. package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +0 -57
  219. package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +0 -63
  220. package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +0 -64
  221. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +0 -62
  222. package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +0 -136
  223. package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +0 -62
  224. package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +0 -62
  225. package/src/infrastructure/ui/views/App.style.ts +0 -9
@@ -1,400 +0,0 @@
1
- import { ReturnQuestionType } from "../../../projection/returnQuestion/returnQuestion";
2
- const returnQuestions = [
3
- {
4
- id: "efe07b97-f6fb-4b6a-ba92-b68519320b2c",
5
- name: "main_title",
6
- placeholder: "",
7
- type: ReturnQuestionType.HOST_DEFAULT,
8
- children: [
9
- {
10
- id: "ed396b68-1436-48ab-842f-fbfea996fad4",
11
- name: "size",
12
- placeholder: "size_placeholder",
13
- type: ReturnQuestionType.HOST_SELECT,
14
- children: [
15
- {
16
- id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
17
- name: "size_title",
18
- placeholder: "",
19
- type: ReturnQuestionType.HOST_STACK,
20
- children: [
21
- {
22
- id: "9251dc2c-d76a-484d-9299-346929af932f",
23
- name: "size_large",
24
- placeholder: "",
25
- type: ReturnQuestionType.OPTION,
26
- children: [
27
- {
28
- id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
29
- name: "",
30
- placeholder: "",
31
- type: ReturnQuestionType.HOST_STACK,
32
- children: [
33
- {
34
- id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
35
- name: "size_overall",
36
- placeholder: "",
37
- type: ReturnQuestionType.OPTION,
38
- },
39
- {
40
- id: "85e84a77-461c-41e6-8544-95b5294d0b80",
41
- name: "size_trousers_too_long",
42
- placeholder: "",
43
- type: ReturnQuestionType.OPTION,
44
- },
45
- {
46
- id: "29441d25-8d9f-471e-a13e-a03f61c88091",
47
- name: "size_fit_cut_does_not_fit",
48
- placeholder: "",
49
- type: ReturnQuestionType.OPTION,
50
- },
51
- ],
52
- },
53
- ],
54
- },
55
- {
56
- id: "a081c3e9-1904-4a60-8899-b72c1a3a0291",
57
- name: "size_correct",
58
- placeholder: "",
59
- type: ReturnQuestionType.OPTION,
60
- },
61
- {
62
- id: "624cce3d-bd86-463a-b16b-c862ad73d5f3",
63
- name: "size_small",
64
- placeholder: "",
65
- type: ReturnQuestionType.OPTION,
66
- children: [
67
- {
68
- id: "58e5ae9a-bc0d-4d27-b267-854a51c2a79a",
69
- name: "",
70
- placeholder: "",
71
- type: ReturnQuestionType.HOST_STACK,
72
- children: [
73
- {
74
- id: "6a3d11fc-570c-4085-a850-1967228cdd4c",
75
- name: "size_overall",
76
- placeholder: "",
77
- type: ReturnQuestionType.OPTION,
78
- },
79
- {
80
- id: "c27e1936-deea-4dbe-a8f1-fe4fb8564deb",
81
- name: "size_trousers_too_short",
82
- placeholder: "",
83
- type: ReturnQuestionType.OPTION,
84
- },
85
- {
86
- id: "e77232ae-eeec-4722-b2d3-f5c0d34fd0ca",
87
- name: "size_fit_cut_does_not_fit",
88
- placeholder: "",
89
- type: ReturnQuestionType.OPTION,
90
- },
91
- ],
92
- },
93
- ],
94
- },
95
- ],
96
- },
97
- ],
98
- },
99
- {
100
- id: "6a6d3878-5561-412c-96f3-7ed79ee587bb",
101
- name: "style",
102
- placeholder: "style_placeholder",
103
- type: ReturnQuestionType.HOST_SELECT,
104
- children: [
105
- {
106
- id: "fd7ff4a0-78ed-4c0d-aa4d-64962739c322",
107
- name: "style_title",
108
- placeholder: "",
109
- type: ReturnQuestionType.HOST_STACK,
110
- children: [
111
- {
112
- id: "56631448-d33d-49fb-b3f8-4486b68b60c3",
113
- name: "style_i_love_it_but",
114
- placeholder: "",
115
- type: ReturnQuestionType.OPTION,
116
- children: [
117
- {
118
- id: "90329d91-bd5d-4439-bb0a-b338caaeff2b",
119
- name: "",
120
- placeholder: "",
121
- type: ReturnQuestionType.HOST_STACK,
122
- children: [
123
- {
124
- id: "a3d937b6-7499-4a3c-86bf-5c0af9ab2e23",
125
- name: "style_i_already_have_something_similar",
126
- placeholder: "",
127
- type: ReturnQuestionType.OPTION,
128
- },
129
- {
130
- id: "7970edd3-fb5c-42d3-afe3-ce31bcbb856c",
131
- name: "style_very_basic_simple",
132
- placeholder: "",
133
- type: ReturnQuestionType.OPTION,
134
- },
135
- {
136
- id: "bab3d4f9-0227-4550-a53f-3c125d68429c",
137
- name: "style_i_dont_need_it_at_the_moment",
138
- placeholder: "",
139
- type: ReturnQuestionType.OPTION,
140
- },
141
- ],
142
- },
143
- ],
144
- },
145
- {
146
- id: "5287d1df-a28a-42cd-9138-01f82aeea4c2",
147
- name: "style_i_like_it_but",
148
- placeholder: "",
149
- type: ReturnQuestionType.OPTION,
150
- children: [
151
- {
152
- id: "35b86395-6b6b-4a39-ab16-05511f58acdd",
153
- name: "",
154
- placeholder: "",
155
- type: ReturnQuestionType.HOST_STACK,
156
- children: [
157
- {
158
- id: "e1f6ac53-f203-4b32-9ff0-782c028d9e95",
159
- name: "style_i_already_have_something_similar",
160
- placeholder: "",
161
- type: ReturnQuestionType.OPTION,
162
- },
163
- {
164
- id: "12875926-b67a-4ad3-852c-1608c7dcc558",
165
- name: "style_very_basic_simple",
166
- placeholder: "",
167
- type: ReturnQuestionType.OPTION,
168
- },
169
- {
170
- id: "a5eb96bf-73d4-4df5-8ad8-097410b24526",
171
- name: "style_i_dont_need_it_at_the_moment",
172
- placeholder: "",
173
- type: ReturnQuestionType.OPTION,
174
- },
175
- ],
176
- },
177
- ],
178
- },
179
- {
180
- id: "757107a9-8e2d-4194-a7fe-0d55cde49c11",
181
- name: "style_not_bad_but",
182
- placeholder: "",
183
- type: ReturnQuestionType.OPTION,
184
- children: [
185
- {
186
- id: "c6f75ee3-a445-4103-a682-f0c3a742108d",
187
- name: "",
188
- placeholder: "",
189
- type: ReturnQuestionType.HOST_STACK,
190
- children: [
191
- {
192
- id: "4f46d4b1-b103-43b2-b669-be721ab46e03",
193
- name: "style_i_dont_like_the_color",
194
- placeholder: "",
195
- type: ReturnQuestionType.OPTION,
196
- },
197
- {
198
- id: "48412165-5e05-4806-8e21-ea59c41d0479",
199
- name: "style_very_basic_simple",
200
- placeholder: "",
201
- type: ReturnQuestionType.OPTION,
202
- },
203
- {
204
- id: "51262c01-eaa3-4d3a-aeb9-95dc8b0dd687",
205
- name: "style_i_dont_like_the_fabric",
206
- placeholder: "",
207
- type: ReturnQuestionType.OPTION,
208
- },
209
- {
210
- id: "9dea1c2b-4f8c-4192-a547-999df55e77e4",
211
- name: "style_i_dont_like_the_print",
212
- placeholder: "",
213
- type: ReturnQuestionType.OPTION,
214
- },
215
- {
216
- id: "b1277bf3-4bbb-487a-8e58-88efecc61c3f",
217
- name: "style_not_my_style_in_general",
218
- placeholder: "",
219
- type: ReturnQuestionType.OPTION,
220
- },
221
- ],
222
- },
223
- ],
224
- },
225
- {
226
- id: "8a9cd6f8-db4b-4904-8a48-3d9bbd6f7a69",
227
- name: "style_i_dont_like",
228
- placeholder: "",
229
- type: ReturnQuestionType.OPTION,
230
- children: [
231
- {
232
- id: "f604240d-c093-4a9e-ab85-4adc0744066a",
233
- name: "",
234
- placeholder: "",
235
- type: ReturnQuestionType.HOST_STACK,
236
- children: [
237
- {
238
- id: "42dbbb93-7808-4ac3-8431-582f812cb314",
239
- name: "style_i_dont_like_the_color",
240
- placeholder: "",
241
- type: ReturnQuestionType.OPTION,
242
- },
243
- {
244
- id: "af1ade81-7b22-4f7e-a505-2ae275a6440f",
245
- name: "style_very_basic_simple",
246
- placeholder: "",
247
- type: ReturnQuestionType.OPTION,
248
- },
249
- {
250
- id: "26d073b4-2588-4391-9b4c-e8e4a8eba2a8",
251
- name: "style_i_dont_like_the_fabric",
252
- placeholder: "",
253
- type: ReturnQuestionType.OPTION,
254
- },
255
- {
256
- id: "ee50ab07-b7a6-415e-a04a-c9f350396185",
257
- name: "style_i_dont_like_the_print",
258
- placeholder: "",
259
- type: ReturnQuestionType.OPTION,
260
- },
261
- {
262
- id: "ce3227e4-851e-47b7-98c1-c63a402e8477",
263
- name: "style_not_my_style_in_general",
264
- placeholder: "",
265
- type: ReturnQuestionType.OPTION,
266
- },
267
- ],
268
- },
269
- ],
270
- },
271
- ],
272
- },
273
- ],
274
- },
275
- {
276
- id: "a1acdb2d-62c8-467f-b7cc-dc24d967290c",
277
- name: "quality",
278
- placeholder: "quality_placeholder",
279
- type: ReturnQuestionType.HOST_SELECT,
280
- children: [
281
- {
282
- id: "405de847-188f-46c1-b66d-941c22a6b7a9",
283
- name: "quality_title",
284
- placeholder: "",
285
- type: ReturnQuestionType.HOST_STACK,
286
- children: [
287
- {
288
- id: "cce7851c-92c7-461b-8dcb-903c5de59ed1",
289
- name: "quality_good",
290
- placeholder: "",
291
- type: ReturnQuestionType.OPTION,
292
- },
293
- {
294
- id: "4bf8f27d-669b-4d36-8d39-b5599c671816",
295
- name: "quality_regular",
296
- placeholder: "",
297
- type: ReturnQuestionType.OPTION,
298
- },
299
- {
300
- id: "48bfe766-92c0-4ff5-a793-e107b60786ff",
301
- name: "quality_bad",
302
- placeholder: "",
303
- type: ReturnQuestionType.OPTION,
304
- },
305
- ],
306
- },
307
- ],
308
- },
309
- {
310
- id: "f25ccdcf-b648-479e-b4a1-86129e3e8c0b",
311
- name: "price",
312
- placeholder: "price_placeholder",
313
- type: ReturnQuestionType.HOST_SELECT,
314
- children: [
315
- {
316
- id: "b0e0463c-787f-4d6c-adf3-5151ab6fc959",
317
- name: "price_title",
318
- placeholder: "",
319
- type: ReturnQuestionType.HOST_STACK,
320
- children: [
321
- {
322
- id: "9c59e396-4135-4255-9437-22555837d686",
323
- name: "price_expensive",
324
- placeholder: "",
325
- type: ReturnQuestionType.OPTION,
326
- },
327
- {
328
- id: "10db17f8-0982-49ee-9aeb-f752d953654c",
329
- name: "price_cheap",
330
- placeholder: "",
331
- type: ReturnQuestionType.OPTION,
332
- },
333
- {
334
- id: "acf64bb3-b91b-48e7-bba1-0541620ed1c5",
335
- name: "price_fair",
336
- placeholder: "",
337
- type: ReturnQuestionType.OPTION,
338
- },
339
- ],
340
- },
341
- ],
342
- },
343
- {
344
- id: "b7ad1665-5e54-4ee4-b455-e7189f33083c",
345
- name: "others",
346
- placeholder: "others_placeholder",
347
- type: ReturnQuestionType.HOST_SELECT,
348
- children: [
349
- {
350
- id: "32cd0ef9-78d7-4605-a279-556749b36d4a",
351
- name: "others_title",
352
- placeholder: "",
353
- type: ReturnQuestionType.HOST_STACK,
354
- children: [
355
- {
356
- id: "95c4fd13-9ca3-45a6-8795-23415bbd0a5e",
357
- name: "others_i_dont_like_the_brand",
358
- placeholder: "",
359
- type: ReturnQuestionType.OPTION,
360
- },
361
- {
362
- id: "f25c63bd-42d3-4242-9b81-927025aa9d67",
363
- name: "others_different_from_preview",
364
- placeholder: "",
365
- type: ReturnQuestionType.OPTION,
366
- },
367
- {
368
- id: "0e0b16c1-a721-4a14-aea6-e0cf5c262222",
369
- name: "others_delivery_delay",
370
- placeholder: "",
371
- type: ReturnQuestionType.OPTION,
372
- },
373
- {
374
- id: "11699ae8-325d-429c-9c05-ff2d6cc45d54",
375
- name: "others_item_is_defective",
376
- placeholder: "",
377
- type: ReturnQuestionType.OPTION,
378
- },
379
- ],
380
- },
381
- ],
382
- },
383
- ],
384
- },
385
- {
386
- id: "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
387
- name: "comment_title",
388
- placeholder: "",
389
- type: ReturnQuestionType.HOST_TEXTAREA,
390
- children: [
391
- {
392
- id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
393
- name: "comment_textarea",
394
- placeholder: "comment_textarea_placeholder",
395
- type: ReturnQuestionType.TEXTAREA,
396
- },
397
- ],
398
- },
399
- ];
400
- export { returnQuestions };
@@ -1,6 +0,0 @@
1
- declare const style: {
2
- container: {
3
- flex: number;
4
- };
5
- };
6
- export { style };
@@ -1,7 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- const style = StyleSheet.create({
3
- container: {
4
- flex: 1,
5
- },
6
- });
7
- export { style };
package/pact.config.ts DELETED
@@ -1,31 +0,0 @@
1
- import { V3MockServer } from "@pact-foundation/pact";
2
-
3
- interface StringObject {
4
- readonly [k: string]: string;
5
- }
6
-
7
- const DEFAULT_PACT_OPTIONS: StringObject = { dir: ".contracts", logDir: ".pact/logs" };
8
-
9
- const AUTH_TOKEN =
10
- "eyJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6InBpY2tlcixwYWNrZXIiLCJzdWIiOiIxIiwiaWF0IjoxNjAyODQ4MzEyfQ.gCs2_vBcJsXt4EdreNSjDI8NWkOTQ5Cy4SwtrGnuJ44";
11
-
12
- const DEFAULT_REQUEST_HEADERS: StringObject = {
13
- Authorization: `Bearer ${AUTH_TOKEN}`,
14
- ["Content-Type"]: "application/json",
15
- };
16
-
17
- const DEFAULT_RESPONSE_HEADERS: StringObject = { ["Content-Type"]: "application/json" };
18
-
19
- interface FromMockServerUrlToApiUrlFunction {
20
- (mockServer: V3MockServer): string;
21
- }
22
-
23
- const fromMockServerUrlToApiUrl: FromMockServerUrlToApiUrlFunction = (mockServer) => mockServer.url.concat("/api");
24
-
25
- export {
26
- fromMockServerUrlToApiUrl,
27
- AUTH_TOKEN,
28
- DEFAULT_PACT_OPTIONS,
29
- DEFAULT_REQUEST_HEADERS,
30
- DEFAULT_RESPONSE_HEADERS,
31
- };
package/pact.publish.js DELETED
@@ -1,32 +0,0 @@
1
- const pact = require("@pact-foundation/pact-node");
2
-
3
- const path = require("path");
4
- const pwd = process.cwd();
5
-
6
- const pjson = require(`${pwd}/package.json`);
7
-
8
- const projectName = "checkout-front";
9
-
10
- const branchName =
11
- process.env.BRANCH_NAME ||
12
- (() => {
13
- throw "There is no defined branch";
14
- })();
15
-
16
- const options = {
17
- pactFilesOrDirs: [path.resolve(pwd, ".contracts")],
18
- pactBroker: "https://pact.dev.envs.lookiero.tech",
19
- consumerVersion: pjson.version,
20
- tags: [branchName, projectName],
21
- };
22
-
23
- console.log("Publishing contracts with options:", options);
24
-
25
- pact
26
- .publishPacts(options)
27
- .then(() => {
28
- console.log("Pact contract publishing complete!");
29
- })
30
- .catch((exception) => {
31
- console.log("Pact contract publishing failed: ", exception);
32
- });
@@ -1,62 +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 { BookedProductsVariantsProjection } from "../../../projection/bookedProductsVariants/bookedProductsVariants";
11
- import { bookedProductsVariants } from "./bookedProductsVariants.mock";
12
- import { httpBookedProductsVariantsForCheckoutItemView } from "./httpBookedProductsVariantsForCheckoutItemView";
13
-
14
- const provider = new PactV3({
15
- ...DEFAULT_PACT_OPTIONS,
16
- consumer: "STY-BOX_CHECKOUT-FRONT",
17
- provider: "STY-BOX_CHECKOUT-BACK_ViewBookedProductVariantsForCheckoutItem",
18
- });
19
-
20
- const checkoutItemId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
21
-
22
- const bookedProductsVariantsResponse: { result: BookedProductsVariantsProjection } = {
23
- result: bookedProductsVariants,
24
- };
25
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
26
- // @ts-ignore
27
- const EXPECTED_BODY = MatchersV3.like(bookedProductsVariantsResponse);
28
-
29
- describe("STY-BOX_CHECKOUT-BACK_ViewBookedProductVariantsForCheckoutItem API", () => {
30
- it("returns a valid booked size change product variants for the given checkout item", () => {
31
- provider
32
- .given("a valid booked size change product variants for the given checkout item")
33
- .uponReceiving("booked size change product variants projection")
34
- .withRequest({
35
- method: "POST",
36
- path: "/api/view-booked-product-variants-for-checkout-item",
37
- headers: DEFAULT_REQUEST_HEADERS,
38
- body: { checkoutItemId },
39
- })
40
- .willRespondWith({
41
- status: 200,
42
- headers: DEFAULT_RESPONSE_HEADERS,
43
- body: EXPECTED_BODY,
44
- });
45
-
46
- return provider.executeTest(async (mockserver) => {
47
- const httpPost = fetchHttpPost({
48
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
49
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
50
- device: "web",
51
- version: "1.0.0",
52
- });
53
-
54
- const response = await httpBookedProductsVariantsForCheckoutItemView({ httpPost })({
55
- checkoutItemId,
56
- signal: undefined,
57
- });
58
-
59
- expect(response).toStrictEqual(bookedProductsVariantsResponse.result);
60
- });
61
- });
62
- });
@@ -1,128 +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 { CheckoutProjection } from "../../../projection/checkout/checkout";
12
- import { CheckoutItemProductVariantProjection, MediaPerspective } from "../../../projection/checkoutItem/checkoutItem";
13
- import { checkout } from "./checkout.mock";
14
- import { httpCheckoutByIdView } from "./httpCheckoutByIdView";
15
-
16
- const provider = new PactV3({
17
- ...DEFAULT_PACT_OPTIONS,
18
- consumer: "STY-BOX_CHECKOUT-FRONT",
19
- provider: "STY-BOX_CHECKOUT-BACK_ViewCheckoutById",
20
- });
21
-
22
- const checkoutId = "e2490de5-5bd3-43d5-b7c4-526e33f71304";
23
- const replacedFor: CheckoutItemProductVariantProjection = {
24
- id: "2bf7fb8f-a283-4f53-bc27-0e7fc9466a33",
25
- media: [
26
- {
27
- id: "d7ec731b-4123-4394-829b-297b952e73e5",
28
- url: "https://cdn-catalog-back-prod.envs.lookiero.tech/1a/28/1a28f712-a76c-4172-8a11-f15002981dc0.jpg",
29
- perspective: MediaPerspective.MAIN,
30
- },
31
- {
32
- id: "8055e209-2fe9-44c5-b715-b09ad3ef741c",
33
- url: "https://cdn-catalog-back-prod.envs.lookiero.tech/15/ac/15aca112-4e71-4646-8db5-7f9723bc0130.jpg",
34
- perspective: MediaPerspective.DETAIL,
35
- },
36
- ],
37
- brand: "CKS",
38
- name: "Sari Tshirt lines",
39
- size: {
40
- id: "b3a76aea-ce7a-4ecb-82a4-6637d0ac2afd",
41
- lookiero: "S",
42
- uk: "S",
43
- it: "S",
44
- europe: "S",
45
- unique: false,
46
- },
47
- color: {
48
- id: "c228d1b0-d06d-4d5c-a7d5-953fd43af0d8",
49
- label: "black_C2",
50
- name: "black",
51
- },
52
- };
53
-
54
- const checkoutResponseWithReplacedFor: { result: CheckoutProjection } = {
55
- result: checkout({ items: [{ status: CheckoutItemStatus.KEPT, replacedFor }] }),
56
- };
57
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
58
- // @ts-ignore
59
- const EXPECTED_BODY_WITH_REPLACED_FOR = MatchersV3.like(checkoutResponseWithReplacedFor);
60
-
61
- const checkoutResponseWithoutReplacedFor: { result: CheckoutProjection } = {
62
- result: checkout({ items: [{ status: CheckoutItemStatus.KEPT }] }),
63
- };
64
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
65
- // @ts-ignore
66
- const EXPECTED_BODY_WITHOUT_REPLACED_FOR = MatchersV3.like(checkoutResponseWithoutReplacedFor);
67
-
68
- describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutById API", () => {
69
- it("returns a valid checkout with replacedFor for the given id", () => {
70
- provider
71
- .given("a valid checkout with replacedFor for the given id")
72
- .uponReceiving("checkout projection")
73
- .withRequest({
74
- method: "POST",
75
- path: "/api/view-checkout-by-id",
76
- headers: DEFAULT_REQUEST_HEADERS,
77
- body: { checkoutId },
78
- })
79
- .willRespondWith({
80
- status: 200,
81
- headers: DEFAULT_RESPONSE_HEADERS,
82
- body: EXPECTED_BODY_WITH_REPLACED_FOR,
83
- });
84
-
85
- return provider.executeTest(async (mockserver) => {
86
- const httpPost = fetchHttpPost({
87
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
88
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
89
- device: "web",
90
- version: "1.0.0",
91
- });
92
-
93
- const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
94
-
95
- expect(response).toStrictEqual(checkoutResponseWithReplacedFor.result);
96
- });
97
- });
98
-
99
- it("returns a valid checkout without replacedFor for the given id", () => {
100
- provider
101
- .given("a valid checkout without replacedFor for the given id")
102
- .uponReceiving("checkout projection")
103
- .withRequest({
104
- method: "POST",
105
- path: "/api/view-checkout-by-id",
106
- headers: DEFAULT_REQUEST_HEADERS,
107
- body: { checkoutId },
108
- })
109
- .willRespondWith({
110
- status: 200,
111
- headers: DEFAULT_RESPONSE_HEADERS,
112
- body: EXPECTED_BODY_WITHOUT_REPLACED_FOR,
113
- });
114
-
115
- return provider.executeTest(async (mockserver) => {
116
- const httpPost = fetchHttpPost({
117
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
118
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
119
- device: "web",
120
- version: "1.0.0",
121
- });
122
-
123
- const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
124
-
125
- expect(response).toStrictEqual(checkoutResponseWithoutReplacedFor.result);
126
- });
127
- });
128
- });