@lookiero/checkout 12.2.0 → 12.4.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 (118) hide show
  1. package/cypress/integration/checkout.spec.ts +14 -9
  2. package/cypress/support/interceptViewCheckoutFeedbackDefinitionByCheckoutId.ts +6 -0
  3. package/dist/src/ExpoRoot.js +2 -2
  4. package/dist/src/domain/checkoutItem/model/price.d.ts +1 -1
  5. package/dist/src/infrastructure/delivery/baseBootstrap.d.ts +2 -2
  6. package/dist/src/infrastructure/delivery/baseBootstrap.js +4 -4
  7. package/dist/src/infrastructure/delivery/bootstrap.js +2 -2
  8. package/dist/src/infrastructure/delivery/bootstrap.mock.js +3 -3
  9. package/dist/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.d.ts +3 -0
  10. package/dist/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.js +107 -0
  11. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.d.ts +12 -0
  12. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.js +10 -0
  13. package/dist/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.d.ts +10 -0
  14. package/dist/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.js +9 -0
  15. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +1 -1
  16. package/dist/src/infrastructure/projection/pricing/pricing.mock.js +1 -1
  17. package/dist/src/infrastructure/tracking/tracking.d.ts +1 -1
  18. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.d.ts +2 -2
  19. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +4 -2
  20. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.d.ts +2 -2
  21. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.d.ts +5 -5
  22. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.js +1 -1
  23. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.d.ts +5 -4
  24. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.d.ts +2 -1
  25. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -1
  26. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.d.ts +2 -1
  27. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +2 -1
  28. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.d.ts +2 -1
  29. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +2 -1
  30. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.d.ts +2 -3
  31. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +5 -7
  32. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.d.ts +2 -1
  33. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +2 -1
  34. package/dist/src/infrastructure/ui/views/feedback/Feedback.js +10 -9
  35. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.d.ts +2 -3
  36. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +17 -9
  37. package/dist/src/projection/checkoutFeedback/checkoutFeedback.constants.d.ts +11 -0
  38. package/dist/src/projection/checkoutFeedback/checkoutFeedback.constants.js +10 -0
  39. package/dist/src/projection/checkoutFeedback/checkoutFeedback.d.ts +22 -2
  40. package/dist/src/projection/checkoutFeedback/checkoutFeedback.metadata.d.ts +21 -0
  41. package/dist/src/projection/checkoutFeedback/checkoutFeedback.metadata.js +1 -0
  42. package/dist/src/projection/checkoutFeedback/checkoutFeedback.typeguards.d.ts +3 -0
  43. package/dist/src/projection/checkoutFeedback/checkoutFeedback.typeguards.js +7 -0
  44. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.d.ts +25 -0
  45. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.js +8 -0
  46. package/dist/src/projection/price/price.d.ts +1 -1
  47. package/dist/src/version.d.ts +1 -1
  48. package/dist/src/version.js +1 -1
  49. package/package.json +5 -5
  50. package/src/ExpoRoot.tsx +2 -2
  51. package/src/domain/checkoutItem/model/price.ts +1 -1
  52. package/src/infrastructure/delivery/baseBootstrap.ts +9 -9
  53. package/src/infrastructure/delivery/bootstrap.mock.ts +5 -4
  54. package/src/infrastructure/delivery/bootstrap.ts +2 -2
  55. package/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.ts +110 -0
  56. package/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.test.ts +52 -0
  57. package/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.ts +30 -0
  58. package/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.test.ts +58 -0
  59. package/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.ts +25 -0
  60. package/src/infrastructure/projection/checkoutItem/checkoutItem.mock.ts +1 -1
  61. package/src/infrastructure/projection/pricing/pricing.mock.ts +1 -1
  62. package/src/infrastructure/tracking/tracking.ts +1 -1
  63. package/src/infrastructure/tracking/useTrackCheckout.test.tsx +1 -2
  64. package/src/infrastructure/tracking/useTrackCheckout.ts +1 -2
  65. package/src/infrastructure/ui/components/atoms/price/Price.test.tsx +1 -1
  66. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.test.tsx +25 -30
  67. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.tsx +12 -13
  68. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.test.tsx +19 -26
  69. package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.tsx +3 -3
  70. package/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.test.tsx +26 -26
  71. package/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.tsx +6 -6
  72. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.ts +5 -4
  73. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.test.tsx +7 -11
  74. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +6 -4
  75. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +6 -4
  76. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultReturnQuestionItem.test.tsx +16 -10
  77. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.test.tsx +16 -22
  78. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +6 -4
  79. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.test.tsx +16 -14
  80. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.tsx +13 -14
  81. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.test.tsx +9 -19
  82. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +7 -5
  83. package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +11 -5
  84. package/src/infrastructure/ui/views/feedback/Feedback.tsx +10 -9
  85. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.test.tsx +2 -2
  86. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +20 -13
  87. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.test.tsx +1 -2
  88. package/src/infrastructure/ui/views/return/components/price/Price.test.tsx +1 -1
  89. package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.test.tsx +1 -2
  90. package/src/projection/checkoutFeedback/checkoutFeedback.constants.ts +16 -0
  91. package/src/projection/checkoutFeedback/checkoutFeedback.metadata.ts +28 -0
  92. package/src/projection/checkoutFeedback/checkoutFeedback.ts +38 -2
  93. package/src/projection/checkoutFeedback/checkoutFeedback.typeguards.ts +13 -0
  94. package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.test.ts +52 -0
  95. package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.ts +61 -0
  96. package/src/projection/price/price.ts +1 -1
  97. package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +0 -9
  98. package/dist/src/domain/checkoutItem/model/currency.d.ts +0 -6
  99. package/dist/src/domain/checkoutItem/model/currency.js +0 -7
  100. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
  101. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
  102. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.d.ts +0 -12
  103. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.js +0 -10
  104. package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.d.ts +0 -10
  105. package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.js +0 -9
  106. package/dist/src/projection/checkoutQuestion/checkoutQuestion.d.ts +0 -18
  107. package/dist/src/projection/checkoutQuestion/checkoutQuestion.js +0 -10
  108. package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.d.ts +0 -25
  109. package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.js +0 -8
  110. package/src/domain/checkoutItem/model/currency.ts +0 -7
  111. package/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.ts +0 -108
  112. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.test.ts +0 -55
  113. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.ts +0 -34
  114. package/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.test.ts +0 -38
  115. package/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.ts +0 -21
  116. package/src/projection/checkoutQuestion/checkoutQuestion.ts +0 -20
  117. package/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.test.ts +0 -31
  118. package/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.ts +0 -61
@@ -1,31 +0,0 @@
1
- import { mock } from "jest-mock-extended";
2
- import { QueryBus } from "@lookiero/messaging";
3
- import { CheckoutQuestionProjection, CheckoutQuestionType } from "./checkoutQuestion";
4
- import {
5
- listCheckoutQuestionsByCheckoutId,
6
- listCheckoutQuestionsByCheckoutIdHandler as sut,
7
- } from "./listCheckoutQuestionsByCheckoutId";
8
-
9
- const checkoutId = "29790d24-b139-4ab8-b618-d796d101e974";
10
- const checkoutQuestionsProjection: CheckoutQuestionProjection[] = [
11
- {
12
- id: "efe07b97-f6fb-4b6a-ba92-b68519320b2c",
13
- name: "main_title",
14
- placeholder: "",
15
- type: CheckoutQuestionType.HOST_DEFAULT,
16
- showCondition: [],
17
- },
18
- ];
19
- const queryBus = mock<QueryBus>();
20
- const signal = mock<AbortSignal>();
21
-
22
- describe("listCheckoutQuestionsByCheckoutId", () => {
23
- it("returns checkout questions by checkout id", async () => {
24
- const query = listCheckoutQuestionsByCheckoutId({ checkoutId });
25
- const view = jest.fn(() => Promise.resolve(checkoutQuestionsProjection));
26
-
27
- const checkoutQuestionsProjectionResult = await sut({ view, queryBus, signal })(query);
28
-
29
- expect(checkoutQuestionsProjectionResult).toBe(checkoutQuestionsProjection);
30
- });
31
- });
@@ -1,61 +0,0 @@
1
- import {
2
- CancelableQueryViewArgs,
3
- query,
4
- Query,
5
- QueryHandlerFunction,
6
- QueryHandlerFunctionArgs,
7
- } from "@lookiero/messaging";
8
- import { CheckoutQuestionProjection } from "./checkoutQuestion";
9
-
10
- const LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID = "list_checkout_questions_by_checkout_id";
11
-
12
- interface ListCheckoutQuestionsByCheckoutIdPayload {
13
- readonly checkoutId: string;
14
- }
15
-
16
- interface ListCheckoutQuestionsByCheckoutId
17
- extends Query<typeof LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID>,
18
- ListCheckoutQuestionsByCheckoutIdPayload {}
19
-
20
- interface ListCheckoutQuestionsByCheckoutIdFunction {
21
- (payload: ListCheckoutQuestionsByCheckoutIdPayload): ListCheckoutQuestionsByCheckoutId;
22
- }
23
-
24
- const listCheckoutQuestionsByCheckoutId: ListCheckoutQuestionsByCheckoutIdFunction = (payload) => ({
25
- ...query({ name: LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID }),
26
- ...payload,
27
- });
28
-
29
- type ListCheckoutQuestionsByCheckoutIdResult = CheckoutQuestionProjection[] | null;
30
-
31
- interface CheckoutQuestionsByCheckoutIdViewArgs extends CancelableQueryViewArgs {
32
- readonly checkoutId: string;
33
- }
34
-
35
- interface CheckoutQuestionsByCheckoutIdView {
36
- (args: CheckoutQuestionsByCheckoutIdViewArgs): Promise<ListCheckoutQuestionsByCheckoutIdResult>;
37
- }
38
-
39
- interface ListCheckoutQuestionsByCheckoutIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
40
- readonly view: CheckoutQuestionsByCheckoutIdView;
41
- }
42
-
43
- const listCheckoutQuestionsByCheckoutIdHandler: QueryHandlerFunction<
44
- ListCheckoutQuestionsByCheckoutId,
45
- ListCheckoutQuestionsByCheckoutIdResult,
46
- ListCheckoutQuestionsByCheckoutIdHandlerFunctionArgs
47
- > =
48
- ({ view, signal }) =>
49
- async ({ checkoutId }) =>
50
- view({ checkoutId, signal });
51
-
52
- export type {
53
- ListCheckoutQuestionsByCheckoutId,
54
- CheckoutQuestionsByCheckoutIdView,
55
- ListCheckoutQuestionsByCheckoutIdResult,
56
- };
57
- export {
58
- LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID,
59
- listCheckoutQuestionsByCheckoutId,
60
- listCheckoutQuestionsByCheckoutIdHandler,
61
- };