@lookiero/checkout 12.0.0 → 12.1.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 (95) hide show
  1. package/dist/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.d.ts +2 -0
  2. package/dist/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.js +3 -2
  3. package/dist/src/infrastructure/tracking/useTrackChangeFeedback.d.ts +2 -0
  4. package/dist/src/infrastructure/tracking/useTrackChangeFeedback.js +3 -2
  5. package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +2 -0
  6. package/dist/src/infrastructure/tracking/useTrackCheckout.js +3 -1
  7. package/dist/src/infrastructure/tracking/useTrackImageView.d.ts +2 -0
  8. package/dist/src/infrastructure/tracking/useTrackImageView.js +3 -2
  9. package/dist/src/infrastructure/tracking/useTrackItemPageView.d.ts +2 -0
  10. package/dist/src/infrastructure/tracking/useTrackItemPageView.js +3 -1
  11. package/dist/src/infrastructure/tracking/useTrackKeepItem.d.ts +2 -0
  12. package/dist/src/infrastructure/tracking/useTrackKeepItem.js +3 -2
  13. package/dist/src/infrastructure/tracking/useTrackPageView.d.ts +2 -0
  14. package/dist/src/infrastructure/tracking/useTrackPageView.js +3 -2
  15. package/dist/src/infrastructure/tracking/useTrackPressBack.d.ts +2 -0
  16. package/dist/src/infrastructure/tracking/useTrackPressBack.js +3 -2
  17. package/dist/src/infrastructure/tracking/useTrackPressContinue.d.ts +2 -0
  18. package/dist/src/infrastructure/tracking/useTrackPressContinue.js +3 -2
  19. package/dist/src/infrastructure/tracking/useTrackPressItem.d.ts +2 -0
  20. package/dist/src/infrastructure/tracking/useTrackPressItem.js +3 -2
  21. package/dist/src/infrastructure/tracking/useTrackPressNext.d.ts +2 -0
  22. package/dist/src/infrastructure/tracking/useTrackPressNext.js +3 -2
  23. package/dist/src/infrastructure/tracking/useTrackPressPrevious.d.ts +2 -0
  24. package/dist/src/infrastructure/tracking/useTrackPressPrevious.js +3 -2
  25. package/dist/src/infrastructure/tracking/useTrackPressPricing.d.ts +2 -0
  26. package/dist/src/infrastructure/tracking/useTrackPressPricing.js +3 -2
  27. package/dist/src/infrastructure/tracking/useTrackReplaceItem.d.ts +2 -0
  28. package/dist/src/infrastructure/tracking/useTrackReplaceItem.js +3 -2
  29. package/dist/src/infrastructure/tracking/useTrackResetItem.d.ts +2 -0
  30. package/dist/src/infrastructure/tracking/useTrackResetItem.js +3 -2
  31. package/dist/src/infrastructure/tracking/useTrackReturnItem.d.ts +2 -0
  32. package/dist/src/infrastructure/tracking/useTrackReturnItem.js +3 -2
  33. package/dist/src/infrastructure/tracking/useTrackTabView.d.ts +3 -1
  34. package/dist/src/infrastructure/tracking/useTrackTabView.js +3 -2
  35. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +2 -1
  36. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +2 -2
  37. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +4 -1
  38. package/dist/src/infrastructure/ui/views/feedback/Feedback.js +4 -1
  39. package/dist/src/infrastructure/ui/views/item/Item.js +5 -1
  40. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +3 -2
  41. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +4 -2
  42. package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.d.ts +2 -0
  43. package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +2 -1
  44. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +5 -2
  45. package/dist/src/infrastructure/ui/views/summary/Summary.js +4 -1
  46. package/dist/src/infrastructure/ui/views/summaryTabs/SummaryTabs.js +4 -1
  47. package/dist/src/version.d.ts +1 -1
  48. package/dist/src/version.js +1 -1
  49. package/package.json +3 -3
  50. package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.test.ts +4 -0
  51. package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.ts +5 -1
  52. package/src/infrastructure/tracking/useTrackChangeFeedback.test.tsx +4 -0
  53. package/src/infrastructure/tracking/useTrackChangeFeedback.ts +5 -2
  54. package/src/infrastructure/tracking/useTrackCheckout.test.tsx +4 -0
  55. package/src/infrastructure/tracking/useTrackCheckout.ts +5 -0
  56. package/src/infrastructure/tracking/useTrackImageView.test.tsx +4 -0
  57. package/src/infrastructure/tracking/useTrackImageView.ts +5 -1
  58. package/src/infrastructure/tracking/useTrackItemPageView.test.tsx +4 -0
  59. package/src/infrastructure/tracking/useTrackItemPageView.ts +5 -0
  60. package/src/infrastructure/tracking/useTrackKeepItem.test.tsx +4 -0
  61. package/src/infrastructure/tracking/useTrackKeepItem.ts +12 -2
  62. package/src/infrastructure/tracking/useTrackPageView.test.tsx +4 -0
  63. package/src/infrastructure/tracking/useTrackPageView.ts +5 -2
  64. package/src/infrastructure/tracking/useTrackPressBack.test.tsx +4 -0
  65. package/src/infrastructure/tracking/useTrackPressBack.ts +5 -2
  66. package/src/infrastructure/tracking/useTrackPressContinue.test.tsx +4 -0
  67. package/src/infrastructure/tracking/useTrackPressContinue.ts +5 -2
  68. package/src/infrastructure/tracking/useTrackPressItem.test.tsx +4 -0
  69. package/src/infrastructure/tracking/useTrackPressItem.ts +5 -2
  70. package/src/infrastructure/tracking/useTrackPressNext.test.tsx +4 -0
  71. package/src/infrastructure/tracking/useTrackPressNext.ts +5 -2
  72. package/src/infrastructure/tracking/useTrackPressPrevious.test.tsx +4 -0
  73. package/src/infrastructure/tracking/useTrackPressPrevious.ts +5 -2
  74. package/src/infrastructure/tracking/useTrackPressPricing.test.tsx +4 -0
  75. package/src/infrastructure/tracking/useTrackPressPricing.ts +5 -2
  76. package/src/infrastructure/tracking/useTrackReplaceItem.test.tsx +4 -0
  77. package/src/infrastructure/tracking/useTrackReplaceItem.ts +5 -1
  78. package/src/infrastructure/tracking/useTrackResetItem.test.tsx +4 -0
  79. package/src/infrastructure/tracking/useTrackResetItem.ts +12 -2
  80. package/src/infrastructure/tracking/useTrackReturnItem.test.tsx +4 -0
  81. package/src/infrastructure/tracking/useTrackReturnItem.ts +12 -2
  82. package/src/infrastructure/tracking/useTrackTabView.test.tsx +4 -0
  83. package/src/infrastructure/tracking/useTrackTabView.ts +5 -1
  84. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +2 -0
  85. package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +2 -2
  86. package/src/infrastructure/ui/views/checkout/Checkout.tsx +4 -0
  87. package/src/infrastructure/ui/views/feedback/Feedback.tsx +4 -0
  88. package/src/infrastructure/ui/views/item/Item.tsx +5 -0
  89. package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +3 -0
  90. package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +4 -0
  91. package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.test.tsx +2 -0
  92. package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.tsx +4 -0
  93. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +5 -2
  94. package/src/infrastructure/ui/views/summary/Summary.tsx +4 -0
  95. package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.tsx +4 -0
@@ -1,7 +1,7 @@
1
1
  import { useCallback } from "react";
2
2
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
3
3
  import { PROJECT, TrackingEventName, TrackingEventCategory } from "./tracking";
4
- const useTrackTabView = ({ page, country, segment, checkoutId, }) => {
4
+ const useTrackTabView = ({ page, country, segment, checkoutId, tradename, }) => {
5
5
  const emitUserEvent = useEmitUserEvent();
6
6
  const tabView = useCallback(({ tab }) => {
7
7
  if (!checkoutId) {
@@ -14,10 +14,11 @@ const useTrackTabView = ({ page, country, segment, checkoutId, }) => {
14
14
  store: country,
15
15
  segment,
16
16
  checkoutId,
17
+ tradename,
17
18
  tab,
18
19
  };
19
20
  emitUserEvent(tabViewTrackingEvent);
20
- }, [checkoutId, country, emitUserEvent, page, segment]);
21
+ }, [checkoutId, tradename, country, emitUserEvent, page, segment]);
21
22
  return tabView;
22
23
  };
23
24
  export { useTrackTabView };
@@ -19,7 +19,7 @@ import { useStaticInfo } from "./useStaticInfo";
19
19
  const useCheckoutFlow = ({ checkout: checkoutProjection, order: orderProjection, subscription: subscriptionProjection, getAuthToken, onSuccess, }) => {
20
20
  const logger = useLogger();
21
21
  const queryBus = useQueryBus();
22
- const { customer: { customerId, country, segment, name, email }, basePath, } = useStaticInfo();
22
+ const { customer: { customerId, country, segment, name, email }, basePath, tradename, } = useStaticInfo();
23
23
  const paymentFlowRef = useRef(null);
24
24
  const [paymentFlowPayload] = useViewPaymentFlowPayloadByCheckoutId({
25
25
  checkoutId: checkoutProjection?.id,
@@ -53,6 +53,7 @@ const useCheckoutFlow = ({ checkout: checkoutProjection, order: orderProjection,
53
53
  userId: customerId,
54
54
  country,
55
55
  segment,
56
+ tradename,
56
57
  });
57
58
  const checkoutFlow = useCallback(async () => {
58
59
  try {
@@ -55,7 +55,7 @@ const CheckoutMiddleware = ({ customerId, onNotAccessible, loader = React.create
55
55
  */
56
56
  const itemWithoutCustomerDecision = checkout?.items.find((item) => item.status === CheckoutItemStatus.INITIAL &&
57
57
  checkoutItemsRef.current?.find((previousItem) => previousItem.id === item.id && previousItem.status !== CheckoutItemStatus.INITIAL)) || checkout?.items.find((item) => item.status === CheckoutItemStatus.INITIAL);
58
- if (checkout) {
58
+ if (checkout?.items) {
59
59
  checkoutItemsRef.current = checkout.items;
60
60
  }
61
61
  /* Navigate to the summary if required */
@@ -73,7 +73,7 @@ const CheckoutMiddleware = ({ customerId, onNotAccessible, loader = React.create
73
73
  });
74
74
  }
75
75
  }
76
- }, [basePath, checkout?.status, checkout?.items]);
76
+ }, [basePath, checkout?.items, checkout?.status]);
77
77
  if (checkout === undefined) {
78
78
  return loader;
79
79
  }
@@ -25,7 +25,7 @@ import { style as checkoutStyle } from "./Checkout.style";
25
25
  import { DeliveryBanner } from "./components/deliveryBanner/DeliveryBanner";
26
26
  import { PaymentInstrument } from "./components/paymentInstrument/PaymentInstrument";
27
27
  const Checkout = ({ layout: Layout, order, subscription, getAuthToken, useRedirect, onCheckoutFlowSuccess, }) => {
28
- const { customer: { customerId, country, segment }, basePath, } = useStaticInfo();
28
+ const { customer: { customerId, country, segment }, basePath, tradename, } = useStaticInfo();
29
29
  const screenSize = useScreenSize();
30
30
  const isDektopScreen = screenSize === "L";
31
31
  const style = useMemo(() => checkoutStyle(), []);
@@ -46,6 +46,7 @@ const Checkout = ({ layout: Layout, order, subscription, getAuthToken, useRedire
46
46
  page: TrackingPage.CHECKOUT,
47
47
  country,
48
48
  segment,
49
+ tradename,
49
50
  checkoutId: checkout?.id,
50
51
  });
51
52
  const navigate = useNavigate();
@@ -53,6 +54,7 @@ const Checkout = ({ layout: Layout, order, subscription, getAuthToken, useRedire
53
54
  page: TrackingPage.CHECKOUT,
54
55
  country,
55
56
  segment,
57
+ tradename,
56
58
  checkoutId: checkout?.id,
57
59
  });
58
60
  const handleOnSubmit = useCallback(async () => {
@@ -65,6 +67,7 @@ const Checkout = ({ layout: Layout, order, subscription, getAuthToken, useRedire
65
67
  page: TrackingPage.CHECKOUT,
66
68
  country,
67
69
  segment,
70
+ tradename,
68
71
  checkoutId: checkout?.id,
69
72
  });
70
73
  const handleOnBack = useCallback(() => {
@@ -20,7 +20,7 @@ const Feedback = ({ layout: Layout }) => {
20
20
  const logger = useLogger();
21
21
  const screenSize = useScreenSize();
22
22
  const isDesktop = screenSize === "L";
23
- const { customer: { customerId, country, segment }, } = useStaticInfo();
23
+ const { customer: { customerId, country, segment }, tradename, } = useStaticInfo();
24
24
  const style = useMemo(() => feedbackStyle(), []);
25
25
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
26
26
  const [checkoutQuestions, checkoutQuestionsStatus] = useListCheckoutQuestionsByCheckoutId({
@@ -31,12 +31,14 @@ const Feedback = ({ layout: Layout }) => {
31
31
  country,
32
32
  segment,
33
33
  checkoutId: checkout?.id,
34
+ tradename,
34
35
  });
35
36
  const trackChangeFeedback = useTrackChangeFeedback({
36
37
  page: TrackingPage.FEEDBACK,
37
38
  country,
38
39
  segment,
39
40
  checkoutId: checkout?.id,
41
+ tradename,
40
42
  });
41
43
  const handleOnChangedFeedback = useCallback(({ checkoutQuestionId, checkoutQuestionFeedback, hasFeedback }) => {
42
44
  const question = checkoutQuestions?.find((question) => question.id === checkoutQuestionId);
@@ -59,6 +61,7 @@ const Feedback = ({ layout: Layout }) => {
59
61
  country,
60
62
  segment,
61
63
  checkoutId: checkout?.id,
64
+ tradename,
62
65
  });
63
66
  const handleOnSubmit = useCallback(async (feedbacks) => {
64
67
  try {
@@ -28,7 +28,7 @@ import { ItemWithoutCustomerDecission, } from "./views/itemWithoutCustomerDeciss
28
28
  const Item = ({ layout: Layout }) => {
29
29
  const logger = useLogger();
30
30
  const navigate = useNavigate();
31
- const { customer: { customerId, country, segment }, basePath, } = useStaticInfo();
31
+ const { customer: { customerId, country, segment }, basePath, tradename, } = useStaticInfo();
32
32
  const style = useMemo(() => itemStyle(), []);
33
33
  const screenSize = useScreenSize();
34
34
  const isDesktopScreen = screenSize !== "S";
@@ -83,6 +83,7 @@ const Item = ({ layout: Layout }) => {
83
83
  page: TrackingPage.ITEM,
84
84
  country,
85
85
  segment,
86
+ tradename,
86
87
  checkoutId: checkout?.id,
87
88
  checkoutItemId: checkoutItem.id,
88
89
  status: checkoutItem.status,
@@ -94,6 +95,7 @@ const Item = ({ layout: Layout }) => {
94
95
  page: TrackingPage.ITEM,
95
96
  country,
96
97
  segment,
98
+ tradename,
97
99
  checkoutId: checkout?.id,
98
100
  });
99
101
  const handleOnNext = useCallback(({ from, to }) => trackPressNext({ from, to }), [trackPressNext]);
@@ -101,6 +103,7 @@ const Item = ({ layout: Layout }) => {
101
103
  page: TrackingPage.ITEM,
102
104
  country,
103
105
  segment,
106
+ tradename,
104
107
  checkoutId: checkout?.id,
105
108
  });
106
109
  const handleOnPrevious = useCallback(({ from, to }) => trackPressPrevious({ from, to }), [trackPressPrevious]);
@@ -108,6 +111,7 @@ const Item = ({ layout: Layout }) => {
108
111
  page: TrackingPage.ITEM,
109
112
  country,
110
113
  segment,
114
+ tradename,
111
115
  checkoutId: checkout?.id,
112
116
  });
113
117
  const handleOnBack = useCallback(() => {
@@ -19,7 +19,7 @@ const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions,
19
19
  const screenSize = useScreenSize();
20
20
  const isMobile = screenSize === "S";
21
21
  const logger = useLogger();
22
- const { customer: { country, segment }, } = useStaticInfo();
22
+ const { customer: { country, segment }, tradename, } = useStaticInfo();
23
23
  /* ResetCheckoutItem */
24
24
  const [resetCheckoutItem, resetCheckoutItemStatus] = useResetCheckoutItem({
25
25
  checkoutItemId: checkoutItem.id,
@@ -29,6 +29,7 @@ const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions,
29
29
  page: TrackingPage.ITEM,
30
30
  country,
31
31
  segment,
32
+ tradename,
32
33
  checkoutId,
33
34
  checkoutItemId: checkoutItem.id,
34
35
  });
@@ -42,7 +43,7 @@ const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions,
42
43
  return React.createElement(Spinner, { testID: "spinner" });
43
44
  }
44
45
  return (React.createElement(Body, { style: { row: style.container } },
45
- React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, customerDecissionBanner: React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: resetItem }) }, checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: [style.feedbackContainer, isMobile ? style.feedbackContainerMobile : undefined] },
46
+ React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, tradename: tradename, customerDecissionBanner: React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: resetItem }) }, checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: [style.feedbackContainer, isMobile ? style.feedbackContainerMobile : undefined] },
46
47
  React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions, onEditFeedback: onEditFeedback }))))));
47
48
  };
48
49
  export { ItemWithCustomerDecission };
@@ -17,7 +17,7 @@ import { ProductVariant } from "../productVariant/ProductVariant";
17
17
  import { style as itemWithoutCustomerDecissionStyle } from "./ItemWithoutCustomerDecission.style";
18
18
  const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProductsVariants, currentProductVariant, onReturn, }) => {
19
19
  const logger = useLogger();
20
- const { customer: { country, segment }, } = useStaticInfo();
20
+ const { customer: { country, segment }, tradename, } = useStaticInfo();
21
21
  const style = useMemo(() => itemWithoutCustomerDecissionStyle(), []);
22
22
  /* KeepCheckoutItem */
23
23
  const [keepCheckoutItem, keepCheckoutItemStatus] = useKeepCheckoutItem({ checkoutItemId: checkoutItem.id, logger });
@@ -25,6 +25,7 @@ const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProducts
25
25
  page: TrackingPage.ITEM,
26
26
  country,
27
27
  segment,
28
+ tradename,
28
29
  checkoutId,
29
30
  checkoutItemId: checkoutItem.id,
30
31
  });
@@ -42,6 +43,7 @@ const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProducts
42
43
  page: TrackingPage.ITEM,
43
44
  country,
44
45
  segment,
46
+ tradename,
45
47
  checkoutId,
46
48
  checkoutItemId: checkoutItem.id,
47
49
  productVariantId: checkoutItem.productVariant.id,
@@ -64,7 +66,7 @@ const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProducts
64
66
  React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
65
67
  React.createElement(ScrollView, { showsVerticalScrollIndicator: false, testID: checkoutItem.id },
66
68
  React.createElement(Body, { style: { row: style.container } },
67
- React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, style: {
69
+ React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, tradename: tradename, style: {
68
70
  content: { paddingBottom: Platform.OS === "web" ? style.productVariantPaddingBottom : stickyHeight },
69
71
  } }))),
70
72
  React.createElement(ItemActions, { country: country, currentProductVariant: currentProductVariant, productVariants: bookedProductsVariants?.productVariants, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: onReturn, onShowSizeWithoutStockModal: handleOnShowSizeWithoutStockModal })));
@@ -2,10 +2,12 @@ import { FC, ReactNode } from "react";
2
2
  import { StyleProp, ViewStyle } from "react-native";
3
3
  import { Country } from "@lookiero/sty-psp-locale";
4
4
  import { Segment } from "@lookiero/sty-psp-segment";
5
+ import { Tradename } from "@lookiero/sty-sp-tradename";
5
6
  import { ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
6
7
  import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
7
8
  type ProductVariantStyle = "content";
8
9
  interface ProductVariantProps {
10
+ readonly tradename: Tradename;
9
11
  readonly country: Country;
10
12
  readonly segment: Segment;
11
13
  readonly checkoutId: string;
@@ -7,7 +7,7 @@ import { useTrackImageView } from "../../../../../tracking/useTrackImageView";
7
7
  import { ProductVariantDescription } from "../../components/productVariantDescription/ProductVariantDescription";
8
8
  import { ProductVariantSlider } from "../../components/productVariantSlider/ProductVariantSlider";
9
9
  import { style as productVariantStyle } from "./ProductVariant.style";
10
- const ProductVariant = ({ country, segment, checkoutId, checkoutItem, currentProductVariant, style: customStyle, children, customerDecissionBanner, }) => {
10
+ const ProductVariant = ({ tradename, country, segment, checkoutId, checkoutItem, currentProductVariant, style: customStyle, children, customerDecissionBanner, }) => {
11
11
  const screenSize = useScreenSize();
12
12
  const isDesktopScreen = screenSize !== "S";
13
13
  const style = useMemo(() => productVariantStyle(), []);
@@ -15,6 +15,7 @@ const ProductVariant = ({ country, segment, checkoutId, checkoutItem, currentPro
15
15
  page: TrackingPage.ITEM,
16
16
  country,
17
17
  segment,
18
+ tradename,
18
19
  checkoutId,
19
20
  checkoutItemId: checkoutItem.id,
20
21
  productVariantId: checkoutItem.productVariant.id,
@@ -41,7 +41,7 @@ const returnQuestionItems = {
41
41
  };
42
42
  const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout, segment, }) => {
43
43
  const navigate = useNavigate();
44
- const { basePath } = useStaticInfo();
44
+ const { basePath, tradename } = useStaticInfo();
45
45
  const logger = useLogger();
46
46
  const screenSize = useScreenSize();
47
47
  const isDektopScreen = screenSize === "L";
@@ -62,14 +62,16 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
62
62
  page: TrackingPage.RETURN,
63
63
  country,
64
64
  segment,
65
+ tradename,
65
66
  checkoutId: checkout.id,
66
67
  checkoutItemId: checkoutItem.id,
67
68
  });
68
- useTrackPageView({ checkoutId: checkout.id, country, segment, page: TrackingPage.RETURN });
69
+ useTrackPageView({ checkoutId: checkout.id, country, segment, tradename, page: TrackingPage.RETURN });
69
70
  const trackPressBack = useTrackPressBack({
70
71
  page: TrackingPage.ITEM,
71
72
  country,
72
73
  segment,
74
+ tradename,
73
75
  checkoutId: checkout?.id,
74
76
  });
75
77
  const handleOnBack = useCallback(() => {
@@ -80,6 +82,7 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
80
82
  page: TrackingPage.ITEM,
81
83
  country,
82
84
  segment,
85
+ tradename,
83
86
  checkoutId: checkout.id,
84
87
  });
85
88
  const handleOnSubmit = useCallback(async () => {
@@ -21,7 +21,7 @@ import { Routes } from "../../routing/routes";
21
21
  import { style as summaryStyle } from "./Summary.style";
22
22
  import { CollapsiblePricing } from "./components/collapsiblePricing/CollapsiblePricing";
23
23
  const Summary = ({ layout: Layout, children }) => {
24
- const { customer: { customerId, country, segment }, basePath, } = useStaticInfo();
24
+ const { customer: { customerId, country, segment }, basePath, tradename, } = useStaticInfo();
25
25
  const screenSize = useScreenSize();
26
26
  const isDesktopScreen = screenSize === "L";
27
27
  const style = useMemo(() => summaryStyle(), []);
@@ -40,6 +40,7 @@ const Summary = ({ layout: Layout, children }) => {
40
40
  page: TrackingPage.SUMMARY,
41
41
  country,
42
42
  segment,
43
+ tradename,
43
44
  checkoutId: checkout?.id,
44
45
  });
45
46
  const handleOnPricingLayout = useCallback(({ height }) => setPricingHeight(height), []);
@@ -61,12 +62,14 @@ const Summary = ({ layout: Layout, children }) => {
61
62
  page: TrackingPage.SUMMARY,
62
63
  country,
63
64
  segment,
65
+ tradename,
64
66
  checkoutId: checkout?.id,
65
67
  });
66
68
  const trackPressContinue = useTrackPressContinue({
67
69
  page: TrackingPage.SUMMARY,
68
70
  country,
69
71
  segment,
72
+ tradename,
70
73
  checkoutId: checkout?.id,
71
74
  });
72
75
  const handleOnSubmit = useCallback(() => {
@@ -17,7 +17,7 @@ const TAB_INDEX = {
17
17
  };
18
18
  const SummaryTabs = () => {
19
19
  const { tab } = useParams();
20
- const { customer: { customerId, country, segment }, basePath, } = useStaticInfo();
20
+ const { customer: { customerId, country, segment }, basePath, tradename, } = useStaticInfo();
21
21
  const tabIndex = useMemo(() => TAB_INDEX[tab] || 0, [tab]);
22
22
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
23
23
  const navigate = useNavigate();
@@ -25,12 +25,14 @@ const SummaryTabs = () => {
25
25
  page: TrackingPage.SUMMARY,
26
26
  country,
27
27
  segment,
28
+ tradename,
28
29
  checkoutId: checkout?.id,
29
30
  });
30
31
  const trackPressItem = useTrackPressItem({
31
32
  page: TrackingPage.SUMMARY,
32
33
  country,
33
34
  segment,
35
+ tradename,
34
36
  checkoutId: checkout?.id,
35
37
  });
36
38
  const handleOnPressItem = useCallback((checkoutItemId) => {
@@ -41,6 +43,7 @@ const SummaryTabs = () => {
41
43
  page: TrackingPage.SUMMARY,
42
44
  country,
43
45
  segment,
46
+ tradename,
44
47
  checkoutId: checkout?.id,
45
48
  });
46
49
  const handleOnChangedTab = useCallback((active) => trackTabView({ tab: active === 0 ? "keep" : "return" }), [trackTabView]);
@@ -1 +1 @@
1
- export declare const VERSION = "12.0.0";
1
+ export declare const VERSION = "12.1.0";
@@ -1 +1 @@
1
- export const VERSION = "12.0.0";
1
+ export const VERSION = "12.1.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -31,9 +31,9 @@
31
31
  "@lookiero/sty-psp-react-native": "^1.0",
32
32
  "@lookiero/sty-psp-segment": "^0.1",
33
33
  "@lookiero/sty-psp-storage": "^0.2",
34
- "@lookiero/sty-psp-tracking": "^1.0",
35
- "@lookiero/sty-psp-ui": "^2.0",
34
+ "@lookiero/sty-psp-tracking": "^2.0",
36
35
  "@lookiero/sty-psp-ui-settings": "^1.0",
36
+ "@lookiero/sty-psp-ui": "^2.0",
37
37
  "@lookiero/sty-psp-units": "^0.1",
38
38
  "@lookiero/sty-psp-uuid": "^0.2",
39
39
  "@lookiero/sty-sp-tradename": "^1.0",
@@ -3,6 +3,7 @@ import { Variation } from "@lookiero/sty-psp-ab-testing";
3
3
  import { Country } from "@lookiero/sty-psp-locale";
4
4
  import { Segment } from "@lookiero/sty-psp-segment";
5
5
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
6
+ import { Tradename } from "@lookiero/sty-sp-tradename";
6
7
  import { ABTestTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
7
8
  import { PROJECT } from "./tracking";
8
9
  import { useTrackAssignedVariationByExperiment as sut } from "./useTrackAssignedVariationByExperiment";
@@ -18,6 +19,7 @@ const assignedVariation: Variation = {
18
19
  id: 964072,
19
20
  name: "Variation 1",
20
21
  };
22
+ const tradename = Tradename.LOOKIERO;
21
23
 
22
24
  const event: ABTestTrackingEvent = {
23
25
  event: TrackingEventName.AB_TEST,
@@ -26,6 +28,7 @@ const event: ABTestTrackingEvent = {
26
28
  store: country,
27
29
  checkoutId,
28
30
  segment,
31
+ tradename,
29
32
  experiment: experimentId,
30
33
  variation: String(assignedVariation.id),
31
34
  };
@@ -40,6 +43,7 @@ describe("useTrackAssignedVariationByExperiment custom hook", () => {
40
43
  country,
41
44
  checkoutId,
42
45
  segment,
46
+ tradename,
43
47
  }),
44
48
  );
45
49
 
@@ -3,6 +3,7 @@ import { Variation } from "@lookiero/sty-psp-ab-testing";
3
3
  import { Country } from "@lookiero/sty-psp-locale";
4
4
  import { Segment } from "@lookiero/sty-psp-segment";
5
5
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
6
+ import { Tradename } from "@lookiero/sty-sp-tradename";
6
7
  import { ABTestTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
7
8
  import { PROJECT } from "./tracking";
8
9
 
@@ -19,6 +20,7 @@ interface UseTrackAssignedVariationByExperimentFunctionArgs {
19
20
  readonly country: Country;
20
21
  readonly segment: Segment;
21
22
  readonly checkoutId: string | undefined;
23
+ readonly tradename: Tradename;
22
24
  }
23
25
 
24
26
  interface UseTrackAssignedVariationByExperimentFunction {
@@ -28,6 +30,7 @@ interface UseTrackAssignedVariationByExperimentFunction {
28
30
  const useTrackAssignedVariationByExperiment: UseTrackAssignedVariationByExperimentFunction = ({
29
31
  experimentId,
30
32
  country,
33
+ tradename,
31
34
  checkoutId,
32
35
  segment,
33
36
  }) => {
@@ -44,6 +47,7 @@ const useTrackAssignedVariationByExperiment: UseTrackAssignedVariationByExperime
44
47
  eventCategory: TrackingEventCategory.NAVIGATION,
45
48
  section: PROJECT,
46
49
  store: country,
50
+ tradename,
47
51
  segment,
48
52
  checkoutId,
49
53
  experiment: experimentId,
@@ -52,7 +56,7 @@ const useTrackAssignedVariationByExperiment: UseTrackAssignedVariationByExperime
52
56
 
53
57
  emitUserEvent(abTestTrackingEvent);
54
58
  },
55
- [checkoutId, country, emitUserEvent, experimentId, segment],
59
+ [checkoutId, country, tradename, emitUserEvent, experimentId, segment],
56
60
  );
57
61
 
58
62
  return trackAssignedVariation;
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
2
2
  import { Country } from "@lookiero/sty-psp-locale";
3
3
  import { Segment } from "@lookiero/sty-psp-segment";
4
4
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
5
+ import { Tradename } from "@lookiero/sty-sp-tradename";
5
6
  import { ChangeFeedbackTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
  import { TrackingPage } from "./tracking";
7
8
  import { useTrackChangeFeedback as sut } from "./useTrackChangeFeedback";
@@ -11,6 +12,7 @@ jest.mock("@lookiero/sty-psp-tracking");
11
12
 
12
13
  const country = Country.ES;
13
14
  const segment = Segment.WOMEN;
15
+ const tradename = Tradename.LOOKIERO;
14
16
 
15
17
  const event: ChangeFeedbackTrackingEvent = {
16
18
  event: TrackingEventName.CHANGE_FEEDBACK,
@@ -18,6 +20,7 @@ const event: ChangeFeedbackTrackingEvent = {
18
20
  section: "checkout_feedback",
19
21
  store: country,
20
22
  segment,
23
+ tradename,
21
24
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
22
25
  questionId: "9a58c188-73a5-45fb-9df7-607738a5c083",
23
26
  questionName: "Question name",
@@ -34,6 +37,7 @@ describe("useTrackChangeFeedback custom hook", () => {
34
37
  country,
35
38
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
36
39
  segment,
40
+ tradename,
37
41
  }),
38
42
  );
39
43
 
@@ -2,6 +2,7 @@ import { useCallback } from "react";
2
2
  import { Country } from "@lookiero/sty-psp-locale";
3
3
  import { Segment } from "@lookiero/sty-psp-segment";
4
4
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
5
+ import { Tradename } from "@lookiero/sty-sp-tradename";
5
6
  import { PROJECT, TrackingPage } from "./tracking";
6
7
  import { ChangeFeedbackTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
7
8
 
@@ -19,12 +20,13 @@ interface UseTrackChangeFeedbackArgs {
19
20
  readonly country: Country;
20
21
  readonly checkoutId?: string;
21
22
  readonly segment: Segment;
23
+ readonly tradename: Tradename;
22
24
  }
23
25
  interface UseTrackChangeFeedback {
24
26
  (agrs: UseTrackChangeFeedbackArgs): ChangeFeedbackFunction;
25
27
  }
26
28
 
27
- const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, checkoutId, segment }) => {
29
+ const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, tradename, checkoutId, segment }) => {
28
30
  const emitUserEvent = useEmitUserEvent<ChangeFeedbackTrackingEvent>();
29
31
 
30
32
  const changeFeedback: ChangeFeedbackFunction = useCallback(
@@ -38,6 +40,7 @@ const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, checkou
38
40
  eventCategory: TrackingEventCategory.NAVIGATION,
39
41
  section: `${PROJECT}_${page}`,
40
42
  store: country,
43
+ tradename,
41
44
  segment,
42
45
  checkoutId,
43
46
  questionId,
@@ -47,7 +50,7 @@ const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, checkou
47
50
 
48
51
  emitUserEvent(changeFeedbackTrackingEvent);
49
52
  },
50
- [checkoutId, country, emitUserEvent, page, segment],
53
+ [checkoutId, country, tradename, emitUserEvent, page, segment],
51
54
  );
52
55
 
53
56
  return changeFeedback;
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
2
2
  import { Country } from "@lookiero/sty-psp-locale";
3
3
  import { Segment } from "@lookiero/sty-psp-segment";
4
4
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
5
+ import { Tradename } from "@lookiero/sty-sp-tradename";
5
6
  import { CheckoutStatus } from "../../domain/checkout/model/checkout";
6
7
  import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
7
8
  import { Currency } from "../../domain/checkoutItem/model/currency";
@@ -16,6 +17,7 @@ import { useTrackCheckout as sut } from "./useTrackCheckout";
16
17
  const mockEmitUserEvent = jest.fn();
17
18
  jest.mock("@lookiero/sty-psp-tracking");
18
19
 
20
+ const tradename = Tradename.LOOKIERO;
19
21
  const country = Country.ES;
20
22
  const segment = Segment.WOMEN;
21
23
  const userId = "80c38da1-7091-483d-a2ad-8f1642211e80";
@@ -55,6 +57,7 @@ const event: CheckoutTrackingEvent = {
55
57
  segment,
56
58
  checkoutId: checkout.id,
57
59
  userId,
60
+ tradename,
58
61
  sizeChanges: checkoutItemsReplaced,
59
62
  isFirstOrder: order.isFirstOrder,
60
63
  ecommerce: {
@@ -82,6 +85,7 @@ describe("useTrackCheckout custom hook", () => {
82
85
  pricing,
83
86
  subscription,
84
87
  userId,
88
+ tradename,
85
89
  country,
86
90
  segment,
87
91
  }),
@@ -3,6 +3,7 @@ import invariant from "tiny-invariant";
3
3
  import { Country } from "@lookiero/sty-psp-locale";
4
4
  import { Segment } from "@lookiero/sty-psp-segment";
5
5
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
6
+ import { Tradename } from "@lookiero/sty-sp-tradename";
6
7
  import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
7
8
  import { Currency } from "../../domain/checkoutItem/model/currency";
8
9
  import { CheckoutProjection } from "../../projection/checkout/checkout";
@@ -24,6 +25,7 @@ interface UseTrackCheckoutFunctionArgs {
24
25
  readonly userId: string;
25
26
  readonly country: Country;
26
27
  readonly segment: Segment;
28
+ readonly tradename: Tradename;
27
29
  }
28
30
 
29
31
  interface UseTrackCheckoutFunction {
@@ -38,6 +40,7 @@ const useTrackCheckout: UseTrackCheckoutFunction = ({
38
40
  segment,
39
41
  country,
40
42
  userId,
43
+ tradename,
41
44
  }) => {
42
45
  const emitUserEvent = useEmitUserEvent<CheckoutTrackingEvent>();
43
46
  const { coupon, isFirstOrder, orderNumber } = order;
@@ -59,6 +62,7 @@ const useTrackCheckout: UseTrackCheckoutFunction = ({
59
62
  segment,
60
63
  checkoutId: checkout.id,
61
64
  userId,
65
+ tradename,
62
66
  sizeChanges: totalReplacedFor,
63
67
  isFirstOrder,
64
68
  ecommerce: {
@@ -88,6 +92,7 @@ const useTrackCheckout: UseTrackCheckoutFunction = ({
88
92
  segment,
89
93
  subscription,
90
94
  userId,
95
+ tradename,
91
96
  ]);
92
97
 
93
98
  return trackCheckout;
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
2
2
  import { Country } from "@lookiero/sty-psp-locale";
3
3
  import { Segment } from "@lookiero/sty-psp-segment";
4
4
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
5
+ import { Tradename } from "@lookiero/sty-sp-tradename";
5
6
  import { MediaPerspective } from "../../projection/checkoutItem/checkoutItem";
6
7
  import { ImageViewTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
7
8
  import { TrackingPage } from "./tracking";
@@ -12,6 +13,7 @@ jest.mock("@lookiero/sty-psp-tracking");
12
13
 
13
14
  const country = Country.ES;
14
15
  const segment = Segment.WOMEN;
16
+ const tradename = Tradename.LOOKIERO;
15
17
 
16
18
  const event: ImageViewTrackingEvent = {
17
19
  event: TrackingEventName.IMAGE_VIEW,
@@ -19,6 +21,7 @@ const event: ImageViewTrackingEvent = {
19
21
  section: "checkout_item",
20
22
  store: country,
21
23
  segment,
24
+ tradename,
22
25
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
23
26
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
24
27
  productVariantId: "5e9dd5b8-b17e-42e4-9824-91a5b9e8745a",
@@ -34,6 +37,7 @@ describe("useTrackImageView custom hook", () => {
34
37
  page: TrackingPage.ITEM,
35
38
  country,
36
39
  segment,
40
+ tradename,
37
41
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
38
42
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
39
43
  productVariantId: "5e9dd5b8-b17e-42e4-9824-91a5b9e8745a",