@lookiero/checkout 12.3.0 → 12.5.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 (159) hide show
  1. package/cypress/integration/checkout.spec.ts +14 -9
  2. package/cypress/support/interceptViewCheckoutFeedbackDefinitionByCheckoutId.ts +6 -0
  3. package/dist/public/public/assets/adaptive-icon.png +0 -0
  4. package/dist/public/public/assets/favicon.png +0 -0
  5. package/dist/public/public/assets/icon.png +0 -0
  6. package/dist/public/public/assets/splash.png +0 -0
  7. package/dist/public/public/images/not-found.png +0 -0
  8. package/dist/src/ExpoRoot.js +2 -2
  9. package/dist/src/domain/checkoutItem/model/currency.d.ts +6 -0
  10. package/dist/src/domain/checkoutItem/model/currency.js +7 -0
  11. package/dist/src/domain/uiSetting/command/updateUiSetting.d.ts +15 -0
  12. package/dist/src/domain/uiSetting/command/updateUiSetting.js +10 -0
  13. package/dist/src/domain/uiSetting/model/uiSetting.d.ts +9 -0
  14. package/dist/src/domain/uiSetting/model/uiSetting.js +11 -0
  15. package/dist/src/domain/uiSetting/model/uiSettingUpdated.d.ts +15 -0
  16. package/dist/src/domain/uiSetting/model/uiSettingUpdated.js +8 -0
  17. package/dist/src/domain/uiSetting/model/uiSettings.d.ts +7 -0
  18. package/dist/src/domain/uiSetting/model/uiSettings.js +1 -0
  19. package/dist/src/infrastructure/delivery/baseBootstrap.d.ts +2 -2
  20. package/dist/src/infrastructure/delivery/baseBootstrap.js +4 -4
  21. package/dist/src/infrastructure/delivery/bootstrap.js +2 -2
  22. package/dist/src/infrastructure/delivery/bootstrap.mock.js +3 -3
  23. package/dist/src/infrastructure/domain/uiSetting/model/storageUiSettings.d.ts +17 -0
  24. package/dist/src/infrastructure/domain/uiSetting/model/storageUiSettings.js +20 -0
  25. package/dist/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +18 -0
  26. package/dist/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.js +22 -0
  27. package/dist/src/infrastructure/integration/useRedirect.d.ts +7 -0
  28. package/dist/src/infrastructure/integration/useRedirect.js +1 -0
  29. package/dist/src/infrastructure/persistence/asyncStorageStorage.d.ts +5 -0
  30. package/dist/src/infrastructure/persistence/asyncStorageStorage.js +7 -0
  31. package/dist/src/infrastructure/persistence/uiSettingData.d.ts +6 -0
  32. package/dist/src/infrastructure/persistence/uiSettingData.js +1 -0
  33. package/dist/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.d.ts +3 -0
  34. package/dist/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.js +107 -0
  35. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.d.ts +12 -0
  36. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.js +10 -0
  37. package/dist/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.d.ts +10 -0
  38. package/dist/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.js +9 -0
  39. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +47 -58
  40. package/dist/src/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.d.ts +10 -0
  41. package/dist/src/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.js +11 -0
  42. package/dist/src/infrastructure/projection/uiSetting/storageUiSettingByKeyView.d.ts +13 -0
  43. package/dist/src/infrastructure/projection/uiSetting/storageUiSettingByKeyView.js +15 -0
  44. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.d.ts +2 -2
  45. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +4 -2
  46. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.d.ts +2 -2
  47. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.d.ts +5 -5
  48. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.js +1 -1
  49. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.d.ts +5 -4
  50. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.d.ts +2 -1
  51. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -1
  52. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.d.ts +2 -1
  53. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +2 -1
  54. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.d.ts +2 -1
  55. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +2 -1
  56. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.d.ts +2 -3
  57. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +5 -7
  58. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.d.ts +2 -1
  59. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +2 -1
  60. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +1 -2
  61. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.d.ts +4 -0
  62. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.js +17 -0
  63. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.style.d.ts +11 -0
  64. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.style.js +16 -0
  65. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +1 -1
  66. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +3 -5
  67. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +2 -3
  68. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +2 -4
  69. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +27 -0
  70. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +97 -0
  71. package/dist/src/infrastructure/ui/routing/useBasePath.d.ts +8 -0
  72. package/dist/src/infrastructure/ui/routing/useBasePath.js +9 -0
  73. package/dist/src/infrastructure/ui/settings/UISettings.d.ts +3 -0
  74. package/dist/src/infrastructure/ui/settings/UISettings.js +4 -0
  75. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.d.ts +12 -0
  76. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +90 -0
  77. package/dist/src/infrastructure/ui/views/feedback/Feedback.js +10 -9
  78. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.d.ts +2 -3
  79. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +17 -9
  80. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -0
  81. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +3 -1
  82. package/dist/src/projection/checkoutFeedback/checkoutFeedback.constants.d.ts +11 -0
  83. package/dist/src/projection/checkoutFeedback/checkoutFeedback.constants.js +10 -0
  84. package/dist/src/projection/checkoutFeedback/checkoutFeedback.d.ts +22 -2
  85. package/dist/src/projection/checkoutFeedback/checkoutFeedback.metadata.d.ts +21 -0
  86. package/dist/src/projection/checkoutFeedback/checkoutFeedback.metadata.js +1 -0
  87. package/dist/src/projection/checkoutFeedback/checkoutFeedback.typeguards.d.ts +3 -0
  88. package/dist/src/projection/checkoutFeedback/checkoutFeedback.typeguards.js +7 -0
  89. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.d.ts +25 -0
  90. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.js +8 -0
  91. package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +1 -0
  92. package/dist/src/projection/returnQuestion/returnQuestion.constants.js +1 -0
  93. package/dist/src/projection/returnQuestion/returnQuestion.d.ts +2 -2
  94. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +2 -4
  95. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +2 -2
  96. package/dist/src/projection/uiSetting/viewUiSettingByKey.d.ts +29 -0
  97. package/dist/src/projection/uiSetting/viewUiSettingByKey.js +8 -0
  98. package/dist/src/version.d.ts +1 -1
  99. package/dist/src/version.js +1 -1
  100. package/package.json +1 -1
  101. package/src/ExpoRoot.tsx +2 -2
  102. package/src/infrastructure/delivery/baseBootstrap.ts +9 -9
  103. package/src/infrastructure/delivery/bootstrap.mock.ts +5 -4
  104. package/src/infrastructure/delivery/bootstrap.ts +2 -2
  105. package/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.ts +110 -0
  106. package/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.test.ts +52 -0
  107. package/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.ts +30 -0
  108. package/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.test.ts +58 -0
  109. package/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.ts +25 -0
  110. package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +47 -58
  111. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.test.tsx +25 -30
  112. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.tsx +12 -13
  113. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.test.tsx +19 -26
  114. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.tsx +3 -3
  115. package/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.test.tsx +26 -26
  116. package/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.tsx +6 -6
  117. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.ts +5 -4
  118. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.test.tsx +7 -11
  119. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +6 -4
  120. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +6 -4
  121. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultReturnQuestionItem.test.tsx +16 -10
  122. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.test.tsx +16 -22
  123. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +6 -4
  124. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.test.tsx +16 -14
  125. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.tsx +13 -14
  126. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.test.tsx +9 -19
  127. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +7 -5
  128. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +1 -2
  129. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.style.ts +19 -0
  130. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.tsx +36 -0
  131. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.test.tsx +46 -0
  132. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +7 -12
  133. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +6 -5
  134. package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +22 -2
  135. package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +2 -7
  136. package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +11 -5
  137. package/src/infrastructure/ui/views/feedback/Feedback.tsx +10 -9
  138. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.test.tsx +2 -2
  139. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +20 -13
  140. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +1 -0
  141. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +3 -1
  142. package/src/projection/checkoutFeedback/checkoutFeedback.constants.ts +16 -0
  143. package/src/projection/checkoutFeedback/checkoutFeedback.metadata.ts +28 -0
  144. package/src/projection/checkoutFeedback/checkoutFeedback.ts +38 -2
  145. package/src/projection/checkoutFeedback/checkoutFeedback.typeguards.ts +13 -0
  146. package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.test.ts +52 -0
  147. package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.ts +61 -0
  148. package/src/projection/returnQuestion/returnQuestion.constants.ts +1 -0
  149. package/src/projection/returnQuestion/returnQuestion.ts +6 -2
  150. package/src/projection/returnQuestion/returnQuestion.typeguard.ts +3 -11
  151. package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +0 -9
  152. package/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.ts +0 -108
  153. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.test.ts +0 -55
  154. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.ts +0 -34
  155. package/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.test.ts +0 -38
  156. package/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.ts +0 -21
  157. package/src/projection/checkoutQuestion/checkoutQuestion.ts +0 -20
  158. package/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.test.ts +0 -31
  159. package/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.ts +0 -61
@@ -6,76 +6,65 @@ const returnQuestions = [
6
6
  type: ReturnQuestionType.HOST_DEFAULT,
7
7
  children: [
8
8
  {
9
- id: "ed396b68-1436-48ab-842f-fbfea996fad4",
10
- translationKey: "size",
11
- type: ReturnQuestionType.HOST_SELECT,
12
- metadata: {
13
- placeholder: "size_placeholder",
14
- },
9
+ id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
10
+ type: ReturnQuestionType.HOST_RADIO_GROUP,
15
11
  children: [
16
12
  {
17
- id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
18
- translationKey: "size_title",
19
- type: ReturnQuestionType.HOST_STACK,
13
+ id: "9251dc2c-d76a-484d-9299-346929af932f",
14
+ translationKey: "size_large",
15
+ type: ReturnQuestionType.OPTION,
20
16
  children: [
21
17
  {
22
- id: "9251dc2c-d76a-484d-9299-346929af932f",
23
- translationKey: "size_large",
24
- type: ReturnQuestionType.OPTION,
18
+ id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
19
+ type: ReturnQuestionType.HOST_STACK,
25
20
  children: [
26
21
  {
27
- id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
28
- type: ReturnQuestionType.HOST_STACK,
29
- children: [
30
- {
31
- id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
32
- translationKey: "size_overall",
33
- type: ReturnQuestionType.OPTION,
34
- },
35
- {
36
- id: "85e84a77-461c-41e6-8544-95b5294d0b80",
37
- translationKey: "size_trousers_too_long",
38
- type: ReturnQuestionType.OPTION,
39
- },
40
- {
41
- id: "29441d25-8d9f-471e-a13e-a03f61c88091",
42
- translationKey: "size_fit_cut_does_not_fit",
43
- type: ReturnQuestionType.OPTION,
44
- },
45
- ],
22
+ id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
23
+ translationKey: "size_overall",
24
+ type: ReturnQuestionType.OPTION,
25
+ },
26
+ {
27
+ id: "85e84a77-461c-41e6-8544-95b5294d0b80",
28
+ translationKey: "size_trousers_too_long",
29
+ type: ReturnQuestionType.OPTION,
30
+ },
31
+ {
32
+ id: "29441d25-8d9f-471e-a13e-a03f61c88091",
33
+ translationKey: "size_fit_cut_does_not_fit",
34
+ type: ReturnQuestionType.OPTION,
46
35
  },
47
36
  ],
48
37
  },
38
+ ],
39
+ },
40
+ {
41
+ id: "a081c3e9-1904-4a60-8899-b72c1a3a0291",
42
+ translationKey: "size_correct",
43
+ type: ReturnQuestionType.OPTION,
44
+ },
45
+ {
46
+ id: "624cce3d-bd86-463a-b16b-c862ad73d5f3",
47
+ translationKey: "size_small",
48
+ type: ReturnQuestionType.OPTION,
49
+ children: [
49
50
  {
50
- id: "a081c3e9-1904-4a60-8899-b72c1a3a0291",
51
- translationKey: "size_correct",
52
- type: ReturnQuestionType.OPTION,
53
- },
54
- {
55
- id: "624cce3d-bd86-463a-b16b-c862ad73d5f3",
56
- translationKey: "size_small",
57
- type: ReturnQuestionType.OPTION,
51
+ id: "58e5ae9a-bc0d-4d27-b267-854a51c2a79a",
52
+ type: ReturnQuestionType.HOST_STACK,
58
53
  children: [
59
54
  {
60
- id: "58e5ae9a-bc0d-4d27-b267-854a51c2a79a",
61
- type: ReturnQuestionType.HOST_STACK,
62
- children: [
63
- {
64
- id: "6a3d11fc-570c-4085-a850-1967228cdd4c",
65
- translationKey: "size_overall",
66
- type: ReturnQuestionType.OPTION,
67
- },
68
- {
69
- id: "c27e1936-deea-4dbe-a8f1-fe4fb8564deb",
70
- translationKey: "size_trousers_too_short",
71
- type: ReturnQuestionType.OPTION,
72
- },
73
- {
74
- id: "e77232ae-eeec-4722-b2d3-f5c0d34fd0ca",
75
- translationKey: "size_fit_cut_does_not_fit",
76
- type: ReturnQuestionType.OPTION,
77
- },
78
- ],
55
+ id: "6a3d11fc-570c-4085-a850-1967228cdd4c",
56
+ translationKey: "size_overall",
57
+ type: ReturnQuestionType.OPTION,
58
+ },
59
+ {
60
+ id: "c27e1936-deea-4dbe-a8f1-fe4fb8564deb",
61
+ translationKey: "size_trousers_too_short",
62
+ type: ReturnQuestionType.OPTION,
63
+ },
64
+ {
65
+ id: "e77232ae-eeec-4722-b2d3-f5c0d34fd0ca",
66
+ translationKey: "size_fit_cut_does_not_fit",
67
+ type: ReturnQuestionType.OPTION,
79
68
  },
80
69
  ],
81
70
  },
@@ -0,0 +1,10 @@
1
+ import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
+ import { UiSettingProjection } from "../../../../projection/uiSetting/viewUiSettingByKey";
3
+ interface UseViewUiSettingByKeyFunctionArgs {
4
+ readonly key: string;
5
+ }
6
+ interface UseViewUiSettingByKeyFunction {
7
+ (args: UseViewUiSettingByKeyFunctionArgs): UseQueryFunctionResult<UiSettingProjection>;
8
+ }
9
+ declare const useViewUiSettingByKey: UseViewUiSettingByKeyFunction;
10
+ export { useViewUiSettingByKey };
@@ -0,0 +1,11 @@
1
+ import { useQuery } from "@lookiero/messaging-react";
2
+ import { isUiSettingUpdated } from "../../../../domain/uiSetting/model/uiSettingUpdated";
3
+ import { viewUiSettingByKey } from "../../../../projection/uiSetting/viewUiSettingByKey";
4
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
+ const useViewUiSettingByKey = ({ key }) => useQuery({
6
+ query: viewUiSettingByKey({ key }),
7
+ contextId: MESSAGING_CONTEXT_ID,
8
+ invalidation: isUiSettingUpdated,
9
+ options: { refetchOnMount: "always", staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
10
+ });
11
+ export { useViewUiSettingByKey };
@@ -0,0 +1,13 @@
1
+ import { UiSettingByKeyView } from "../../../projection/uiSetting/viewUiSettingByKey";
2
+ import { ReadFunction } from "../../persistence/storage";
3
+ import { UiSettingDto } from "../../persistence/uiSettingData";
4
+ interface StorageUiSettingByKeyView extends UiSettingByKeyView {
5
+ }
6
+ interface StorageUiSettingByKeyViewFunctionArgs {
7
+ readonly read: ReadFunction<UiSettingDto>;
8
+ }
9
+ interface StorageUiSettingByKeyViewFunction {
10
+ (args: StorageUiSettingByKeyViewFunctionArgs): StorageUiSettingByKeyView;
11
+ }
12
+ declare const storageUiSettingByKeyView: StorageUiSettingByKeyViewFunction;
13
+ export { storageUiSettingByKeyView };
@@ -0,0 +1,15 @@
1
+ const toUiSettingProjection = (uiSettingDto) => ({
2
+ id: uiSettingDto.id,
3
+ key: uiSettingDto.key,
4
+ value: uiSettingDto.value,
5
+ });
6
+ const storageUiSettingByKeyView = ({ read }) => async ({ key }) => {
7
+ try {
8
+ const uiSettingDto = await read(key);
9
+ return uiSettingDto ? toUiSettingProjection(uiSettingDto) : null;
10
+ }
11
+ catch (ignored) {
12
+ throw new Error("Could not fetch the uiSetting");
13
+ }
14
+ };
15
+ export { storageUiSettingByKeyView };
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { CheckoutQuestionProjection } from "../../../../../projection/checkoutQuestion/checkoutQuestion";
2
+ import { CheckoutFeedbackQuestionProjection } from "../../../../../projection/checkoutFeedback/checkoutFeedback";
3
3
  interface CheckoutQuestionProps {
4
4
  readonly checkoutQuestionParentId: string;
5
- readonly checkoutQuestion: CheckoutQuestionProjection;
5
+ readonly checkoutQuestion: CheckoutFeedbackQuestionProjection;
6
6
  }
7
7
  declare const _default: React.NamedExoticComponent<CheckoutQuestionProps>;
8
8
  export default _default;
@@ -1,7 +1,9 @@
1
1
  import React, { memo } from "react";
2
+ import { checkoutFeedbackQuestionHasChildren } from "../../../../../projection/checkoutFeedback/checkoutFeedback.typeguards";
2
3
  import { useCheckoutQuestionItem } from "./behaviors/useCheckoutQuestionItem";
3
- const CheckoutQuestion = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
4
+ const CheckoutQuestion = ({ checkoutQuestion, checkoutQuestionParentId }) => {
4
5
  const Item = useCheckoutQuestionItem({ type: checkoutQuestion.type });
5
- return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId, testID: checkoutQuestion.id }, checkoutQuestion.children?.map((childCheckoutQuestion) => (React.createElement(CheckoutQuestion, { key: childCheckoutQuestion.id, checkoutQuestion: childCheckoutQuestion, checkoutQuestionParentId: checkoutQuestion.id })))));
6
+ return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId, testID: checkoutQuestion.id }, checkoutFeedbackQuestionHasChildren(checkoutQuestion) &&
7
+ checkoutQuestion.children.map((childCheckoutQuestion) => (React.createElement(CheckoutQuestion, { key: childCheckoutQuestion.id, checkoutQuestion: childCheckoutQuestion, checkoutQuestionParentId: checkoutQuestion.id })))));
6
8
  };
7
9
  export default memo(CheckoutQuestion);
@@ -1,7 +1,7 @@
1
1
  import { FC } from "react";
2
- import { CheckoutQuestionProjection } from "../../../../../projection/checkoutQuestion/checkoutQuestion";
2
+ import { CheckoutFeedbackQuestionProjection } from "../../../../../projection/checkoutFeedback/checkoutFeedback";
3
3
  interface CheckoutQuestionsProps {
4
- readonly checkoutQuestions: CheckoutQuestionProjection[];
4
+ readonly checkoutQuestions: CheckoutFeedbackQuestionProjection[];
5
5
  }
6
6
  declare const CheckoutQuestions: FC<CheckoutQuestionsProps>;
7
7
  export { CheckoutQuestions };
@@ -1,17 +1,17 @@
1
1
  import { FC, ReactNode } from "react";
2
- import { CheckoutQuestionType } from "../../../../../../projection/checkoutQuestion/checkoutQuestion";
2
+ import { CheckoutFeedbackQuestionType } from "../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
3
3
  import { CheckoutQuestionItem } from "../components/CheckoutQuestionItem";
4
- type CheckoutQuestionItems = Record<CheckoutQuestionType, CheckoutQuestionItem>;
4
+ type CheckoutQuestionItems = Record<CheckoutFeedbackQuestionType, CheckoutQuestionItem<CheckoutFeedbackQuestionType>>;
5
5
  interface CheckoutQuestionItemContextProviderProps {
6
6
  readonly checkoutQuestionItems: CheckoutQuestionItems;
7
7
  readonly children: ReactNode;
8
8
  }
9
9
  declare const CheckoutQuestionItemProvider: FC<CheckoutQuestionItemContextProviderProps>;
10
- interface UseCheckoutQuestionItemFunctionArgs {
11
- readonly type: CheckoutQuestionType;
10
+ interface UseCheckoutQuestionItemFunctionArgs<QT extends CheckoutFeedbackQuestionType> {
11
+ readonly type: QT;
12
12
  }
13
13
  interface UseCheckoutQuestionItemFunction {
14
- (args: UseCheckoutQuestionItemFunctionArgs): CheckoutQuestionItem;
14
+ <QT extends CheckoutFeedbackQuestionType>(args: UseCheckoutQuestionItemFunctionArgs<QT>): CheckoutQuestionItem<QT>;
15
15
  }
16
16
  declare const useCheckoutQuestionItem: UseCheckoutQuestionItemFunction;
17
17
  export type { CheckoutQuestionItems };
@@ -6,7 +6,7 @@ const useCheckoutQuestionItem = ({ type }) => {
6
6
  const items = useContext(CheckoutQuestionItemContext);
7
7
  const item = useMemo(() => items[type], [items, type]);
8
8
  invariant(items, "Your are trying to use the useCheckoutQuestionItem hook without wrapping your app with the <CheckoutQuestionItemProvider>.");
9
- invariant(item, `The provided CheckoutQuestionType (${type}) is NOT SUPPORTED`);
9
+ invariant(item, `The provided CheckoutFeedbackQuestionType (${type}) is NOT SUPPORTED`);
10
10
  return item;
11
11
  };
12
12
  export { useCheckoutQuestionItem, CheckoutQuestionItemProvider };
@@ -1,11 +1,12 @@
1
1
  import { FC, ReactNode } from "react";
2
- import { CheckoutQuestionProjection } from "../../../../../../projection/checkoutQuestion/checkoutQuestion";
3
- interface CheckoutQuestionItemProps {
4
- readonly checkoutQuestion: CheckoutQuestionProjection;
2
+ import { CheckoutFeedbackQuestionProjection } from "../../../../../../projection/checkoutFeedback/checkoutFeedback";
3
+ import { CheckoutFeedbackQuestionType } from "../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
4
+ interface CheckoutQuestionItemProps<CFQT extends CheckoutFeedbackQuestionType> {
5
+ readonly checkoutQuestion: CheckoutFeedbackQuestionProjection<CFQT>;
5
6
  readonly checkoutQuestionParentId: string;
6
7
  readonly children?: ReactNode;
7
8
  readonly portalHostName?: string;
8
9
  readonly testID?: string;
9
10
  }
10
- type CheckoutQuestionItem = FC<CheckoutQuestionItemProps>;
11
+ type CheckoutQuestionItem<CFQT extends CheckoutFeedbackQuestionType> = FC<CheckoutQuestionItemProps<CFQT>>;
11
12
  export type { CheckoutQuestionItem, CheckoutQuestionItemProps };
@@ -1,3 +1,4 @@
1
+ import { CheckoutFeedbackQuestionType } from "../../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
1
2
  import { CheckoutQuestionItem } from "../CheckoutQuestionItem";
2
- declare const ButtonCheckoutQuestionItem: CheckoutQuestionItem;
3
+ declare const ButtonCheckoutQuestionItem: CheckoutQuestionItem<CheckoutFeedbackQuestionType.BUTTON>;
3
4
  export { ButtonCheckoutQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback, useMemo } from "react";
2
3
  import { TouchableOpacity } from "react-native";
3
4
  import { Text } from "@lookiero/aurora";
@@ -8,7 +9,7 @@ import { style as buttonCheckoutQuestionItemStyle } from "./ButtonCheckoutQuesti
8
9
  const ACTIVE_OPACITY = 0.6;
9
10
  const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
10
11
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
11
- const optionText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
12
+ const optionText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.translationKey });
12
13
  const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
13
14
  const style = useMemo(() => buttonCheckoutQuestionItemStyle(), []);
14
15
  const checked = feedback === checkoutQuestion.id;
@@ -1,3 +1,4 @@
1
+ import { CheckoutFeedbackQuestionType } from "../../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
1
2
  import { CheckoutQuestionItem } from "../CheckoutQuestionItem";
2
- declare const HostDefaultCheckoutQuestionItem: CheckoutQuestionItem;
3
+ declare const HostDefaultCheckoutQuestionItem: CheckoutQuestionItem<CheckoutFeedbackQuestionType.HOST_DEFAULT>;
3
4
  export { HostDefaultCheckoutQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useMemo } from "react";
2
3
  import { View } from "react-native";
3
4
  import { Text } from "@lookiero/aurora";
@@ -5,7 +6,7 @@ import { useI18nMessage } from "@lookiero/i18n-react";
5
6
  import { DOMAIN } from "../../../../../i18n/i18n";
6
7
  import { style as hostDefaultCheckoutQuestionItemStyle } from "./HostDefaultCheckoutQuestionItem.style";
7
8
  const HostDefaultCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
8
- const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
9
+ const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.translationKey });
9
10
  const style = useMemo(() => hostDefaultCheckoutQuestionItemStyle(), []);
10
11
  return (React.createElement(React.Fragment, null,
11
12
  React.createElement(Text, { level: 3, style: style.title }, titleText),
@@ -1,3 +1,4 @@
1
+ import { CheckoutFeedbackQuestionType } from "../../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
1
2
  import { CheckoutQuestionItem } from "../CheckoutQuestionItem";
2
- declare const HostSelectCheckoutQuestionItem: CheckoutQuestionItem;
3
+ declare const HostSelectCheckoutQuestionItem: CheckoutQuestionItem<CheckoutFeedbackQuestionType.HOST_SELECT>;
3
4
  export { HostSelectCheckoutQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useMemo } from "react";
2
3
  import { View } from "react-native";
3
4
  import { Text } from "@lookiero/aurora";
@@ -5,7 +6,7 @@ import { useI18nMessage } from "@lookiero/i18n-react";
5
6
  import { DOMAIN } from "../../../../../i18n/i18n";
6
7
  import { style as hostSelectCheckoutQuestionItemStyle } from "./HostSelectCheckoutQuestionItem.style";
7
8
  const HostSelectCheckoutQuestionItem = ({ checkoutQuestion, children, }) => {
8
- const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.name });
9
+ const titleText = useI18nMessage({ domain: DOMAIN, id: checkoutQuestion.translationKey });
9
10
  const style = useMemo(() => hostSelectCheckoutQuestionItemStyle(), []);
10
11
  return (React.createElement(React.Fragment, null,
11
12
  React.createElement(Text, { level: 3, style: style.title }, titleText),
@@ -1,5 +1,4 @@
1
+ import { CheckoutFeedbackQuestionType } from "../../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
1
2
  import { CheckoutQuestionItem } from "../CheckoutQuestionItem";
2
- type IconName = "checkout_question.icon.bad" | "checkout_question.icon.regular" | "checkout_question.icon.good";
3
- declare const IconCheckoutQuestionItem: CheckoutQuestionItem;
4
- export type { IconName };
3
+ declare const IconCheckoutQuestionItem: CheckoutQuestionItem<CheckoutFeedbackQuestionType.ICON>;
5
4
  export { IconCheckoutQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback, useMemo } from "react";
2
3
  import { Pressable } from "react-native";
3
4
  import invariant from "tiny-invariant";
@@ -7,15 +8,12 @@ import { Happy } from "./icons/Happy";
7
8
  import { Normal } from "./icons/Normal";
8
9
  import { Sad } from "./icons/Sad";
9
10
  const ICON = {
10
- // eslint-disable-next-line @typescript-eslint/naming-convention
11
- "checkout_question.icon.bad": Sad,
12
- // eslint-disable-next-line @typescript-eslint/naming-convention
13
- "checkout_question.icon.regular": Normal,
14
- // eslint-disable-next-line @typescript-eslint/naming-convention
15
- "checkout_question.icon.good": Happy,
11
+ ["checkout_feedback.icon.bad"]: Sad,
12
+ ["checkout_feedback.icon.regular"]: Normal,
13
+ ["checkout_feedback.icon.good"]: Happy,
16
14
  };
17
15
  const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
18
- const Icon = ICON[checkoutQuestion.name];
16
+ const Icon = ICON[checkoutQuestion.metadata.icon];
19
17
  const style = useMemo(() => iconCheckoutQuestionItemStyle(), []);
20
18
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
21
19
  const isSelected = feedback === checkoutQuestion.id;
@@ -1,3 +1,4 @@
1
+ import { CheckoutFeedbackQuestionType } from "../../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
1
2
  import { CheckoutQuestionItem } from "../CheckoutQuestionItem";
2
- declare const TextareaCheckoutQuestionItem: CheckoutQuestionItem;
3
+ declare const TextareaCheckoutQuestionItem: CheckoutQuestionItem<CheckoutFeedbackQuestionType.TEXTAREA>;
3
4
  export { TextareaCheckoutQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback, useMemo } from "react";
2
3
  import { useI18n } from "@lookiero/i18n-react";
3
4
  import { InputField, TextInput } from "@lookiero/sty-psp-ui";
@@ -6,7 +7,7 @@ import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQue
6
7
  import { style as textareaCheckoutQuestionItemStyle } from "./TextareaCheckoutQuestionItem.style";
7
8
  const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
8
9
  const { formatMessage } = useI18n({ domain: DOMAIN });
9
- const placeholderText = useMemo(() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""), [formatMessage, checkoutQuestion.placeholder]);
10
+ const placeholderText = useMemo(() => (checkoutQuestion.metadata.placeholder ? formatMessage({ id: checkoutQuestion.metadata.placeholder }) : ""), [formatMessage, checkoutQuestion.metadata.placeholder]);
10
11
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
11
12
  const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
12
13
  const style = useMemo(() => textareaCheckoutQuestionItemStyle(), []);
@@ -3,7 +3,6 @@ import React, { useMemo } from "react";
3
3
  import { View } from "react-native";
4
4
  import { Text } from "@lookiero/aurora";
5
5
  import { useI18n } from "@lookiero/i18n-react";
6
- import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
7
6
  import { DOMAIN, I18nMessages } from "../../../../../i18n/i18n";
8
7
  import { style as hostDefaultReturnQuestionItemStyle } from "./HostDefaultReturnQuestionItem.style";
9
8
  const HostDefaultReturnQuestionItem = ({ returnQuestion, children, }) => {
@@ -11,7 +10,7 @@ const HostDefaultReturnQuestionItem = ({ returnQuestion, children, }) => {
11
10
  const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
12
11
  const style = useMemo(() => hostDefaultReturnQuestionItemStyle(), []);
13
12
  return (React.createElement(React.Fragment, null,
14
- returnQuestionWithTranslationKey(returnQuestion) && returnQuestion.translationKey !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
13
+ returnQuestion.translationKey && returnQuestion.translationKey !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
15
14
  React.createElement(Text, { level: 3, action: true }, formatMessage({ id: returnQuestion.translationKey })))) : null,
16
15
  children));
17
16
  };
@@ -0,0 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
2
+ import { ReturnQuestionItem } from "../ReturnQuestionItem";
3
+ declare const HostLegacyRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
4
+ export { HostLegacyRadioGroupReturnQuestionItem };
@@ -0,0 +1,17 @@
1
+ /* eslint-disable react/prop-types */
2
+ import React, { useMemo } from "react";
3
+ import { View } from "react-native";
4
+ import { Text } from "@lookiero/aurora";
5
+ import { useI18n } from "@lookiero/i18n-react";
6
+ import { DOMAIN } from "../../../../../i18n/i18n";
7
+ import { style as hostLegacyRadioGroupReturnQuestionItemStyle } from "./HostLegacyRadioGroupReturnQuestionItem.style";
8
+ const HostLegacyRadioGroupReturnQuestionItem = ({ returnQuestion, children, testID, }) => {
9
+ const { formatMessage } = useI18n({ domain: DOMAIN });
10
+ const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
11
+ const style = useMemo(() => hostLegacyRadioGroupReturnQuestionItemStyle(), []);
12
+ return (React.createElement(React.Fragment, null,
13
+ React.createElement(View, { style: style.wrapper, testID: testID },
14
+ React.createElement(Text, { level: 3, style: style.title, action: true }, placeholderText),
15
+ children)));
16
+ };
17
+ export { HostLegacyRadioGroupReturnQuestionItem };
@@ -0,0 +1,11 @@
1
+ declare const style: () => {
2
+ title: {
3
+ marginBottom: number;
4
+ };
5
+ wrapper: {
6
+ backgroundColor: string;
7
+ marginBottom: number;
8
+ padding: number;
9
+ };
10
+ };
11
+ export { style };
@@ -0,0 +1,16 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "@lookiero/sty-psp-ui";
3
+ const style = () => {
4
+ const { colorBgBase, space2, space6 } = theme();
5
+ return StyleSheet.create({
6
+ title: {
7
+ marginBottom: space2,
8
+ },
9
+ wrapper: {
10
+ backgroundColor: colorBgBase,
11
+ marginBottom: space2,
12
+ padding: space6,
13
+ },
14
+ });
15
+ };
16
+ export { style };
@@ -1,4 +1,4 @@
1
1
  import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
2
2
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
3
- declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
3
+ declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_RADIO_GROUP>;
4
4
  export { HostRadioGroupReturnQuestionItem };
@@ -7,11 +7,9 @@ import { DOMAIN } from "../../../../../i18n/i18n";
7
7
  import { style as hostRadioGroupReturnQuestionItemStyle } from "./HostRadioGroupReturnQuestionItem.style";
8
8
  const HostRadioGroupReturnQuestionItem = ({ returnQuestion, children, testID, }) => {
9
9
  const { formatMessage } = useI18n({ domain: DOMAIN });
10
- const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
11
10
  const style = useMemo(() => hostRadioGroupReturnQuestionItemStyle(), []);
12
- return (React.createElement(React.Fragment, null,
13
- React.createElement(View, { style: style.wrapper, testID: testID },
14
- React.createElement(Text, { level: 3, style: style.title, action: true }, placeholderText),
15
- children)));
11
+ return (React.createElement(View, { style: style.wrapper, testID: testID },
12
+ returnQuestion.translationKey && (React.createElement(Text, { level: 3, style: style.title, action: true }, formatMessage({ id: returnQuestion.translationKey }))),
13
+ children));
16
14
  };
17
15
  export { HostRadioGroupReturnQuestionItem };
@@ -8,15 +8,14 @@ import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeed
8
8
  import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
9
9
  import { style as returnQuestionFeedbackItemStyle } from "./ReturnQuestionFeedbackItem.style";
10
10
  const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
11
- const titleText = useI18nMessage({ domain: DOMAIN, id: returnQuestion.translationKey });
11
+ const { formatMessage } = useI18n({ domain: DOMAIN });
12
12
  const unansweredText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_UNANSWERED });
13
13
  const returnQuestionFeedback = useReturnQuestionFeedback();
14
- const { formatMessage } = useI18n({ domain: DOMAIN });
15
14
  const translate = useCallback((returnQuestionName) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [formatMessage]);
16
15
  const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(" / ");
17
16
  const style = useMemo(() => returnQuestionFeedbackItemStyle(), []);
18
17
  return (React.createElement(View, { style: style.container },
19
- React.createElement(Text, { level: 2, style: style.title, detailBold: true }, titleText),
18
+ returnQuestion.translationKey && (React.createElement(Text, { level: 2, style: style.title, detailBold: true }, formatMessage({ id: returnQuestion.translationKey }))),
20
19
  React.createElement(Text, { level: 1, detail: true }, feedback || unansweredText)));
21
20
  };
22
21
  export { ReturnQuestionFeedbackItem };
@@ -1,5 +1,5 @@
1
1
  import { isUuid } from "@lookiero/sty-psp-uuid";
2
- import { returnQuestionHasChildren, returnQuestionWithTranslationKey, } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
2
+ import { returnQuestionHasChildren } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
3
3
  const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc = [], }) => {
4
4
  const returnQuestionId = Object.keys(feedback).find((id) => id === returnQuestion.id);
5
5
  if (returnQuestionId) {
@@ -10,9 +10,7 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
10
10
  if (feebackReturnQuestionChild) {
11
11
  return [
12
12
  ...acc,
13
- ...(returnQuestionWithTranslationKey(feebackReturnQuestionChild)
14
- ? [translate(feebackReturnQuestionChild.translationKey)]
15
- : []),
13
+ ...(feebackReturnQuestionChild.translationKey ? [translate(feebackReturnQuestionChild.translationKey)] : []),
16
14
  ...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
17
15
  ];
18
16
  }
@@ -0,0 +1,27 @@
1
+ import { RefObject } from "react";
2
+ import { PaymentFlowRef } from "@lookiero/payments-front";
3
+ import { Logger } from "@lookiero/sty-psp-logging";
4
+ import { PaymentFlowPayloadProjection } from "../../../projection/payment/paymentFlowPayload";
5
+ type Status = "idle" | "loading" | "success" | "error";
6
+ interface SubmitCheckoutFunctionArgs {
7
+ readonly paymentFlowPayload: PaymentFlowPayloadProjection;
8
+ readonly sizeChangeEnabled: boolean;
9
+ }
10
+ interface SubmitCheckoutFunction {
11
+ (args: SubmitCheckoutFunctionArgs): Promise<void>;
12
+ }
13
+ type UseSubmitCheckoutResult = [submitCheckout: SubmitCheckoutFunction, status: Status];
14
+ interface UseSubmitCheckoutFunctionArgs {
15
+ readonly checkoutId: string;
16
+ readonly checkoutBookingId: string;
17
+ readonly paymentFlowRef: RefObject<PaymentFlowRef>;
18
+ readonly onError: () => void;
19
+ readonly onSuccess?: () => void;
20
+ readonly logger: Logger;
21
+ }
22
+ interface UseSubmitCheckoutFunction {
23
+ (args: UseSubmitCheckoutFunctionArgs): UseSubmitCheckoutResult;
24
+ }
25
+ declare const useSubmitCheckout: UseSubmitCheckoutFunction;
26
+ export type { Status, SubmitCheckoutFunction };
27
+ export { useSubmitCheckout };