@lookiero/checkout 8.14.0-beta.102 → 8.14.0-beta.2

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 (178) hide show
  1. package/dist/pact.config.d.ts +4 -12
  2. package/dist/pact.config.js +4 -11
  3. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -1
  4. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +24 -24
  5. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +33 -40
  6. package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +6 -6
  7. package/dist/src/infrastructure/projection/checkout/checkout.mock.js +12 -15
  8. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +82 -89
  9. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +33 -40
  10. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +31 -38
  11. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +31 -38
  12. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +31 -38
  13. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -1
  14. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +3 -3
  15. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +33 -40
  16. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +6 -10
  17. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +38 -39
  18. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +33 -40
  19. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -1
  20. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +96 -97
  21. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +33 -40
  22. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +83 -94
  23. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +1 -7
  24. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +173 -178
  25. package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
  26. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +33 -40
  27. package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +2 -3
  28. package/dist/src/infrastructure/projection/pricing/pricing.mock.js +34 -35
  29. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +33 -40
  30. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -1
  31. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +377 -378
  32. package/dist/src/infrastructure/ui/Root.d.ts +2 -0
  33. package/dist/src/infrastructure/ui/Root.js +2 -2
  34. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +5 -0
  35. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
  36. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +5 -0
  37. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
  38. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +5 -0
  39. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
  40. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
  41. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
  42. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -1
  43. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -2
  44. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +3 -1
  45. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -3
  46. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -4
  47. package/dist/src/infrastructure/ui/routing/Routing.d.ts +7 -0
  48. package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
  49. package/dist/src/infrastructure/ui/views/App.d.ts +8 -0
  50. package/dist/src/infrastructure/ui/views/App.js +4 -4
  51. package/dist/src/infrastructure/ui/views/App.style.d.ts +3 -3
  52. package/dist/src/infrastructure/ui/views/App.style.js +3 -4
  53. package/dist/src/infrastructure/ui/views/item/Item.d.ts +5 -0
  54. package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
  55. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +2 -0
  56. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
  57. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
  58. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
  59. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +5 -1
  60. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
  61. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +5 -0
  62. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  63. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -3
  64. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
  65. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
  66. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
  67. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +2 -0
  68. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
  69. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +5 -0
  70. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
  71. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +5 -0
  72. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
  73. package/dist/src/infrastructure/ui/views/return/Return.d.ts +5 -0
  74. package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
  75. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +5 -0
  76. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +12 -14
  77. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +2 -6
  78. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -6
  79. package/dist/src/version.d.ts +1 -1
  80. package/dist/src/version.js +1 -1
  81. package/jest.setup.js +20 -0
  82. package/package.json +5 -4
  83. package/pact.config.ts +31 -0
  84. package/pact.publish.js +32 -0
  85. package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +62 -0
  86. package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +128 -0
  87. package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +63 -0
  88. package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +57 -0
  89. package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +57 -0
  90. package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +57 -0
  91. package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +63 -0
  92. package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +64 -0
  93. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +62 -0
  94. package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +136 -0
  95. package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
  96. package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +62 -0
  97. package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +62 -0
  98. package/src/infrastructure/ui/Root.tsx +4 -1
  99. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +14 -1
  100. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +8 -1
  101. package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +6 -0
  102. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
  103. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +2 -1
  104. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +2 -0
  105. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -0
  106. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +5 -2
  107. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +3 -2
  108. package/src/infrastructure/ui/routing/Routing.tsx +13 -5
  109. package/{dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js → src/infrastructure/ui/views/App.style.ts} +2 -7
  110. package/src/infrastructure/ui/views/App.tsx +14 -7
  111. package/src/infrastructure/ui/views/item/Item.tsx +8 -2
  112. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
  113. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +9 -3
  114. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +8 -1
  115. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +12 -3
  116. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
  117. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -6
  118. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -3
  119. package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +12 -2
  120. package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +14 -4
  121. package/src/infrastructure/ui/views/return/Return.tsx +8 -1
  122. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +2 -6
  123. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +33 -38
  124. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
  125. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
  126. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
  127. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
  128. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
  129. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
  130. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
  131. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
  132. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
  133. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
  134. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
  135. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
  136. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
  137. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
  138. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
  139. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
  140. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
  141. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
  142. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
  143. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
  144. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
  145. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
  146. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
  147. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
  148. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
  149. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
  150. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
  151. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
  152. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
  153. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
  154. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
  155. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
  156. package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
  157. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
  158. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
  159. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
  160. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
  161. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
  162. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
  163. package/dist/src/projection/shared/country.d.ts +0 -14
  164. package/dist/src/projection/shared/country.js +0 -15
  165. package/dist/src/projection/shared/customer.d.ts +0 -9
  166. package/dist/src/projection/shared/customer.js +0 -1
  167. package/dist/src/projection/shared/locale.d.ts +0 -12
  168. package/dist/src/projection/shared/locale.js +0 -13
  169. package/dist/src/projection/shared/order.d.ts +0 -6
  170. package/dist/src/projection/shared/order.js +0 -1
  171. package/dist/src/projection/shared/price.d.ts +0 -11
  172. package/dist/src/projection/shared/price.js +0 -1
  173. package/dist/src/projection/shared/size.d.ts +0 -21
  174. package/dist/src/projection/shared/size.js +0 -4
  175. package/dist/src/projection/shared/subscription.d.ts +0 -2
  176. package/dist/src/projection/shared/subscription.js +0 -1
  177. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
  178. package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
@@ -1,104 +1,103 @@
1
- import { CheckoutQuestionType } from "../../../projection/checkoutQuestion/checkoutQuestion";
2
-
1
+ import { CheckoutQuestionType, } from "../../../projection/checkoutQuestion/checkoutQuestion";
3
2
  const checkoutQuestions = [
4
- {
5
- id: "efe07b97-f6fb-4b6a-ba92-b68519320b2c",
6
- name: "checkout_question.selection.question",
7
- placeholder: "checkout_question.selection.placeholder",
8
- type: CheckoutQuestionType.HOST_SELECT,
9
- showCondition: [],
10
- children: [
11
- {
12
- id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
13
- name: "checkout_question.icon.bad",
14
- placeholder: "",
15
- type: CheckoutQuestionType.ICON,
16
- showCondition: [],
17
- },
18
- {
19
- id: "85e84a77-461c-41e6-8544-95b5294d0b80",
20
- name: "checkout_question.icon.regular",
21
- placeholder: "",
22
- type: CheckoutQuestionType.ICON,
23
- showCondition: [],
24
- },
25
- {
26
- id: "29441d25-8d9f-471e-a13e-a03f61c88091",
27
- name: "checkout_question.icon.good",
28
- placeholder: "",
29
- type: CheckoutQuestionType.ICON,
30
- showCondition: [],
31
- },
32
- ],
33
- },
34
- {
35
- id: "6a6d3878-5561-412c-96f3-7ed79ee587bb",
36
- name: "checkout_question.experience.question",
37
- placeholder: "checkout_question.experience.placeholder",
38
- type: CheckoutQuestionType.HOST_SELECT,
39
- showCondition: [],
40
- children: [
41
- {
42
- id: "a3d937b6-7499-4a3c-86bf-5c0af9ab2e23",
43
- name: "checkout_question.icon.bad",
44
- placeholder: "",
45
- type: CheckoutQuestionType.ICON,
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,
46
8
  showCondition: [],
47
- },
48
- {
49
- id: "7970edd3-fb5c-42d3-afe3-ce31bcbb856c",
50
- name: "checkout_question.icon.regular",
51
- placeholder: "",
52
- type: CheckoutQuestionType.ICON,
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,
53
38
  showCondition: [],
54
- },
55
- {
56
- id: "bab3d4f9-0227-4550-a53f-3c125d68429c",
57
- name: "checkout_question.icon.good",
58
- placeholder: "",
59
- type: CheckoutQuestionType.ICON,
60
- showCondition: [],
61
- },
62
- ],
63
- },
64
- {
65
- id: "a1acdb2d-62c8-467f-b7cc-dc24d967290c",
66
- name: "checkout_question.personalshopper.question",
67
- placeholder: "checkout_question.personalshopper.placeholder",
68
- type: CheckoutQuestionType.HOST_SELECT,
69
- showCondition: ["68c0bb98-b00a-4b86-af43-528fe903cb69"],
70
- children: [
71
- {
72
- id: "cce7851c-92c7-461b-8dcb-903c5de59ed1",
73
- name: "checkout_question.personalshopper.yes",
74
- placeholder: "",
75
- type: CheckoutQuestionType.BUTTON,
76
- showCondition: [],
77
- },
78
- {
79
- id: "4bf8f27d-669b-4d36-8d39-b5599c671816",
80
- name: "checkout_question.personalshopper.no",
81
- placeholder: "",
82
- type: CheckoutQuestionType.BUTTON,
83
- showCondition: [],
84
- },
85
- ],
86
- },
87
- {
88
- id: "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
89
- name: "checkout_question.comment.question",
90
- placeholder: "",
91
- type: CheckoutQuestionType.HOST_TEXTAREA,
92
- showCondition: [],
93
- children: [
94
- {
95
- id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
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",
96
88
  name: "checkout_question.comment.question",
97
- placeholder: "checkout_question.comment.placeholder",
98
- type: CheckoutQuestionType.TEXTAREA,
89
+ placeholder: "",
90
+ type: CheckoutQuestionType.HOST_TEXTAREA,
99
91
  showCondition: [],
100
- },
101
- ],
102
- },
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
+ },
103
102
  ];
104
103
  export { checkoutQuestions };
@@ -1,55 +1,48 @@
1
1
  import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
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";
3
+ import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
10
4
  import { checkoutQuestions } from "./checkoutQuestions.mock";
11
5
  import { httpCheckoutQuestionsByCheckoutIdView } from "./httpCheckoutQuestionsByCheckoutIdView";
12
-
13
6
  const provider = new PactV3({
14
- ...DEFAULT_PACT_OPTIONS,
15
- consumer: "STY-BOX_CHECKOUT-FRONT",
16
- provider: "STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId",
7
+ ...DEFAULT_PACT_OPTIONS,
8
+ consumer: "STY-BOX_CHECKOUT-FRONT",
9
+ provider: "STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId",
17
10
  });
18
11
  const checkoutId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
19
12
  const checkoutQuestionsResponse = {
20
- result: checkoutQuestions,
13
+ result: checkoutQuestions,
21
14
  };
22
15
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
16
  // @ts-ignore
24
17
  const EXPECTED_BODY = MatchersV3.like(checkoutQuestionsResponse);
25
18
  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);
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
+ });
53
47
  });
54
- });
55
48
  });
@@ -1,33 +1,22 @@
1
1
  import { MatchersV3, PactV3 } from "@pact-foundation/pact";
2
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";
3
+ import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
10
4
  import { httpPaymentFlowPayloadByCheckoutIdView } from "./httpPaymentFlowPayloadByCheckoutIdView";
11
- import {
12
- paymentFlowPayloadForKeptItems,
13
- paymentFlowPayloadForReturnedItems,
14
- paymentFlowPayloadForReplacedItems,
15
- } from "./paymentFlowPayload.mock";
16
-
5
+ import { paymentFlowPayloadForKeptItems, paymentFlowPayloadForReturnedItems, paymentFlowPayloadForReplacedItems, } from "./paymentFlowPayload.mock";
17
6
  const provider = new PactV3({
18
- ...DEFAULT_PACT_OPTIONS,
19
- consumer: "STY-BOX_CHECKOUT-FRONT",
20
- provider: "STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId",
7
+ ...DEFAULT_PACT_OPTIONS,
8
+ consumer: "STY-BOX_CHECKOUT-FRONT",
9
+ provider: "STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId",
21
10
  });
22
11
  const checkoutId = "e2490de5-5bd3-43d5-b7c4-526e33f71304";
23
12
  const paymentFlowPayloadForKeptItemsResponse = {
24
- result: paymentFlowPayloadForKeptItems,
13
+ result: paymentFlowPayloadForKeptItems,
25
14
  };
26
15
  const paymentFlowPayloadForReturnedItemsResponse = {
27
- result: paymentFlowPayloadForReturnedItems,
16
+ result: paymentFlowPayloadForReturnedItems,
28
17
  };
29
18
  const paymentFlowPayloadForReplacedItemsResponse = {
30
- result: paymentFlowPayloadForReplacedItems,
19
+ result: paymentFlowPayloadForReplacedItems,
31
20
  };
32
21
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
33
22
  // @ts-ignore
@@ -39,82 +28,82 @@ const EXPECTED_BODY_FOR_RETURNED_ITEMS = MatchersV3.like(paymentFlowPayloadForRe
39
28
  // @ts-ignore
40
29
  const EXPECTED_BODY_FOR_REPLACED_ITEMS = MatchersV3.like(paymentFlowPayloadForReplacedItemsResponse);
41
30
  describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
42
- it("returns a valid payment-flow payload for the given checkout id [KEPT items] ", () => {
43
- provider
44
- .given("a valid payment-flow payload for the given checkout id [KEPT items] ")
45
- .uponReceiving("payment-flow payload projection")
46
- .withRequest({
47
- method: "POST",
48
- path: "/api/view-payment-flow-payload-by-checkout-id",
49
- headers: DEFAULT_REQUEST_HEADERS,
50
- body: { checkoutId },
51
- })
52
- .willRespondWith({
53
- status: 200,
54
- headers: DEFAULT_RESPONSE_HEADERS,
55
- body: EXPECTED_BODY_FOR_KEPT_ITEMS,
56
- });
57
- return provider.executeTest(async (mockserver) => {
58
- const httpPost = fetchHttpPost({
59
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
60
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
61
- device: "web",
62
- version: "1.0.0",
63
- });
64
- const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
65
- expect(response).toStrictEqual(paymentFlowPayloadForKeptItemsResponse.result);
31
+ it("returns a valid payment-flow payload for the given checkout id [KEPT items] ", () => {
32
+ provider
33
+ .given("a valid payment-flow payload for the given checkout id [KEPT items] ")
34
+ .uponReceiving("payment-flow payload projection")
35
+ .withRequest({
36
+ method: "POST",
37
+ path: "/api/view-payment-flow-payload-by-checkout-id",
38
+ headers: DEFAULT_REQUEST_HEADERS,
39
+ body: { checkoutId },
40
+ })
41
+ .willRespondWith({
42
+ status: 200,
43
+ headers: DEFAULT_RESPONSE_HEADERS,
44
+ body: EXPECTED_BODY_FOR_KEPT_ITEMS,
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
+ const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
54
+ expect(response).toStrictEqual(paymentFlowPayloadForKeptItemsResponse.result);
55
+ });
66
56
  });
67
- });
68
- it("returns a valid payment-flow payload for the given checkout id [RETURNED items] ", () => {
69
- provider
70
- .given("a valid payment-flow payload for the given checkout id [RETURNED items] ")
71
- .uponReceiving("payment-flow payload projection")
72
- .withRequest({
73
- method: "POST",
74
- path: "/api/view-payment-flow-payload-by-checkout-id",
75
- headers: DEFAULT_REQUEST_HEADERS,
76
- body: { checkoutId },
77
- })
78
- .willRespondWith({
79
- status: 200,
80
- headers: DEFAULT_RESPONSE_HEADERS,
81
- body: EXPECTED_BODY_FOR_RETURNED_ITEMS,
82
- });
83
- return provider.executeTest(async (mockserver) => {
84
- const httpPost = fetchHttpPost({
85
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
86
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
87
- device: "web",
88
- version: "1.0.0",
89
- });
90
- const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
91
- expect(response).toStrictEqual(paymentFlowPayloadForReturnedItemsResponse.result);
57
+ it("returns a valid payment-flow payload for the given checkout id [RETURNED items] ", () => {
58
+ provider
59
+ .given("a valid payment-flow payload for the given checkout id [RETURNED items] ")
60
+ .uponReceiving("payment-flow payload projection")
61
+ .withRequest({
62
+ method: "POST",
63
+ path: "/api/view-payment-flow-payload-by-checkout-id",
64
+ headers: DEFAULT_REQUEST_HEADERS,
65
+ body: { checkoutId },
66
+ })
67
+ .willRespondWith({
68
+ status: 200,
69
+ headers: DEFAULT_RESPONSE_HEADERS,
70
+ body: EXPECTED_BODY_FOR_RETURNED_ITEMS,
71
+ });
72
+ return provider.executeTest(async (mockserver) => {
73
+ const httpPost = fetchHttpPost({
74
+ apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
75
+ getAuthToken: () => Promise.resolve(AUTH_TOKEN),
76
+ device: "web",
77
+ version: "1.0.0",
78
+ });
79
+ const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
80
+ expect(response).toStrictEqual(paymentFlowPayloadForReturnedItemsResponse.result);
81
+ });
92
82
  });
93
- });
94
- it("returns a valid payment-flow payload for the given checkout id [REPLACED items] ", () => {
95
- provider
96
- .given("a valid payment-flow payload for the given checkout id [REPLACED items] ")
97
- .uponReceiving("payment-flow payload projection")
98
- .withRequest({
99
- method: "POST",
100
- path: "/api/view-payment-flow-payload-by-checkout-id",
101
- headers: DEFAULT_REQUEST_HEADERS,
102
- body: { checkoutId },
103
- })
104
- .willRespondWith({
105
- status: 200,
106
- headers: DEFAULT_RESPONSE_HEADERS,
107
- body: EXPECTED_BODY_FOR_REPLACED_ITEMS,
108
- });
109
- return provider.executeTest(async (mockserver) => {
110
- const httpPost = fetchHttpPost({
111
- apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
112
- getAuthToken: () => Promise.resolve(AUTH_TOKEN),
113
- device: "web",
114
- version: "1.0.0",
115
- });
116
- const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
117
- expect(response).toStrictEqual(paymentFlowPayloadForReplacedItemsResponse.result);
83
+ it("returns a valid payment-flow payload for the given checkout id [REPLACED items] ", () => {
84
+ provider
85
+ .given("a valid payment-flow payload for the given checkout id [REPLACED items] ")
86
+ .uponReceiving("payment-flow payload projection")
87
+ .withRequest({
88
+ method: "POST",
89
+ path: "/api/view-payment-flow-payload-by-checkout-id",
90
+ headers: DEFAULT_REQUEST_HEADERS,
91
+ body: { checkoutId },
92
+ })
93
+ .willRespondWith({
94
+ status: 200,
95
+ headers: DEFAULT_RESPONSE_HEADERS,
96
+ body: EXPECTED_BODY_FOR_REPLACED_ITEMS,
97
+ });
98
+ return provider.executeTest(async (mockserver) => {
99
+ const httpPost = fetchHttpPost({
100
+ apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
101
+ getAuthToken: () => Promise.resolve(AUTH_TOKEN),
102
+ device: "web",
103
+ version: "1.0.0",
104
+ });
105
+ const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
106
+ expect(response).toStrictEqual(paymentFlowPayloadForReplacedItemsResponse.result);
107
+ });
118
108
  });
119
- });
120
109
  });
@@ -1,12 +1,6 @@
1
1
  import { PaymentFlowPayloadProjection } from "../../../projection/payment/paymentFlowPayload";
2
-
3
2
  declare const paymentFlowPayloadForKeptItems: PaymentFlowPayloadProjection;
4
3
  declare const paymentFlowPayloadForReturnedItems: PaymentFlowPayloadProjection;
5
4
  declare const paymentFlowPayloadForReplacedItems: PaymentFlowPayloadProjection;
6
5
  declare const paymentFlowPayload: PaymentFlowPayloadProjection;
7
- export {
8
- paymentFlowPayload,
9
- paymentFlowPayloadForKeptItems,
10
- paymentFlowPayloadForReturnedItems,
11
- paymentFlowPayloadForReplacedItems,
12
- };
6
+ export { paymentFlowPayload, paymentFlowPayloadForKeptItems, paymentFlowPayloadForReturnedItems, paymentFlowPayloadForReplacedItems, };