@lookiero/checkout 12.0.0 → 12.1.1

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 +3 -5
  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 +3 -5
  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
@@ -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 { PressPricingTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
  import { PROJECT, TrackingPage } from "./tracking";
7
8
 
@@ -17,12 +18,13 @@ interface UseTrackPressPricingFunctionArgs {
17
18
  readonly country: Country;
18
19
  readonly segment: Segment;
19
20
  readonly checkoutId: string | undefined;
21
+ readonly tradename: Tradename;
20
22
  }
21
23
  interface UseTrackPressPricingFunction {
22
24
  (agrs: UseTrackPressPricingFunctionArgs): PressPricingFunction;
23
25
  }
24
26
 
25
- const useTrackPressPricing: UseTrackPressPricingFunction = ({ page, country, segment, checkoutId }) => {
27
+ const useTrackPressPricing: UseTrackPressPricingFunction = ({ page, country, segment, checkoutId, tradename }) => {
26
28
  const emitUserEvent = useEmitUserEvent<PressPricingTrackingEvent>();
27
29
 
28
30
  const pressPricing: PressPricingFunction = useCallback(
@@ -38,12 +40,13 @@ const useTrackPressPricing: UseTrackPressPricingFunction = ({ page, country, seg
38
40
  store: country,
39
41
  segment,
40
42
  checkoutId,
43
+ tradename,
41
44
  collapse,
42
45
  };
43
46
 
44
47
  emitUserEvent(pressPricingTrackingEvent);
45
48
  },
46
- [checkoutId, country, emitUserEvent, page, segment],
49
+ [checkoutId, tradename, country, emitUserEvent, page, segment],
47
50
  );
48
51
 
49
52
  return pressPricing;
@@ -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 { TrackingPage, ReplaceItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
  import { useTrackReplaceItem as sut } from "./useTrackReplaceItem";
7
8
 
@@ -10,6 +11,7 @@ jest.mock("@lookiero/sty-psp-tracking");
10
11
 
11
12
  const country = Country.ES;
12
13
  const segment = Segment.WOMEN;
14
+ const tradename = Tradename.LOOKIERO;
13
15
 
14
16
  const event: ReplaceItemTrackingEvent = {
15
17
  event: TrackingEventName.REPLACE_ITEM,
@@ -17,6 +19,7 @@ const event: ReplaceItemTrackingEvent = {
17
19
  section: "checkout_item",
18
20
  store: country,
19
21
  segment,
22
+ tradename,
20
23
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
21
24
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
22
25
  productVariantId: "5e9dd5b8-b17e-42e4-9824-91a5b9e8745a",
@@ -32,6 +35,7 @@ describe("useTrackReplaceItem custom hook", () => {
32
35
  page: TrackingPage.ITEM,
33
36
  country,
34
37
  segment,
38
+ tradename,
35
39
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
36
40
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
37
41
  productVariantId: "5e9dd5b8-b17e-42e4-9824-91a5b9e8745a",
@@ -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, ReplaceItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
 
7
8
  interface ReplaceItemFunctionArgs {
@@ -18,6 +19,7 @@ interface UseTrackReplaceItemFunctionArgs {
18
19
  readonly checkoutId: string | undefined;
19
20
  readonly checkoutItemId: string;
20
21
  readonly productVariantId: string;
22
+ readonly tradename: Tradename;
21
23
  }
22
24
  interface UseTrackReplaceItemFunction {
23
25
  (agrs: UseTrackReplaceItemFunctionArgs): ReplaceItemFunction;
@@ -30,6 +32,7 @@ const useTrackReplaceItem: UseTrackReplaceItemFunction = ({
30
32
  checkoutId,
31
33
  checkoutItemId,
32
34
  productVariantId,
35
+ tradename,
33
36
  }) => {
34
37
  const emitUserEvent = useEmitUserEvent<ReplaceItemTrackingEvent>();
35
38
 
@@ -48,12 +51,13 @@ const useTrackReplaceItem: UseTrackReplaceItemFunction = ({
48
51
  checkoutId,
49
52
  checkoutItemId,
50
53
  productVariantId,
54
+ tradename,
51
55
  replaceFor,
52
56
  };
53
57
 
54
58
  emitUserEvent(replaceItemTrackingEvent);
55
59
  },
56
- [checkoutId, checkoutItemId, country, emitUserEvent, page, productVariantId, segment],
60
+ [checkoutId, checkoutItemId, country, emitUserEvent, page, productVariantId, tradename, segment],
57
61
  );
58
62
 
59
63
  return replaceItem;
@@ -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 { TrackingPage, ResetItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
  import { useTrackResetItem as sut } from "./useTrackResetItem";
7
8
 
@@ -10,6 +11,7 @@ jest.mock("@lookiero/sty-psp-tracking");
10
11
 
11
12
  const country = Country.ES;
12
13
  const segment = Segment.WOMEN;
14
+ const tradename = Tradename.LOOKIERO;
13
15
 
14
16
  const event: ResetItemTrackingEvent = {
15
17
  event: TrackingEventName.RESET_ITEM,
@@ -17,6 +19,7 @@ const event: ResetItemTrackingEvent = {
17
19
  section: "checkout_item",
18
20
  store: country,
19
21
  segment,
22
+ tradename,
20
23
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
21
24
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
22
25
  };
@@ -30,6 +33,7 @@ describe("useTrackResetItem custom hook", () => {
30
33
  page: TrackingPage.ITEM,
31
34
  country,
32
35
  segment,
36
+ tradename,
33
37
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
34
38
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
35
39
  }),
@@ -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, ResetItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
 
7
8
  interface ResetItemFunction {
@@ -14,12 +15,20 @@ interface UseTrackResetItemFunctionArgs {
14
15
  readonly segment: Segment;
15
16
  readonly checkoutId: string | undefined;
16
17
  readonly checkoutItemId: string;
18
+ readonly tradename: Tradename;
17
19
  }
18
20
  interface UseTrackResetItemFunction {
19
21
  (agrs: UseTrackResetItemFunctionArgs): ResetItemFunction;
20
22
  }
21
23
 
22
- const useTrackResetItem: UseTrackResetItemFunction = ({ page, country, segment, checkoutId, checkoutItemId }) => {
24
+ const useTrackResetItem: UseTrackResetItemFunction = ({
25
+ page,
26
+ country,
27
+ segment,
28
+ checkoutId,
29
+ tradename,
30
+ checkoutItemId,
31
+ }) => {
23
32
  const emitUserEvent = useEmitUserEvent<ResetItemTrackingEvent>();
24
33
 
25
34
  const resetItem: ResetItemFunction = useCallback(() => {
@@ -34,11 +43,12 @@ const useTrackResetItem: UseTrackResetItemFunction = ({ page, country, segment,
34
43
  store: country,
35
44
  segment,
36
45
  checkoutId,
46
+ tradename,
37
47
  checkoutItemId,
38
48
  };
39
49
 
40
50
  emitUserEvent(resetItemTrackingEvent);
41
- }, [checkoutId, checkoutItemId, country, emitUserEvent, page, segment]);
51
+ }, [checkoutId, tradename, checkoutItemId, country, emitUserEvent, page, segment]);
42
52
 
43
53
  return resetItem;
44
54
  };
@@ -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 { TrackingPage, ReturnItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
  import { useTrackReturnItem as sut } from "./useTrackReturnItem";
7
8
 
@@ -10,6 +11,7 @@ jest.mock("@lookiero/sty-psp-tracking");
10
11
 
11
12
  const country = Country.ES;
12
13
  const segment = Segment.WOMEN;
14
+ const tradename = Tradename.LOOKIERO;
13
15
 
14
16
  const event: ReturnItemTrackingEvent = {
15
17
  event: TrackingEventName.RETURN_ITEM,
@@ -17,6 +19,7 @@ const event: ReturnItemTrackingEvent = {
17
19
  section: "checkout_item",
18
20
  store: country,
19
21
  segment,
22
+ tradename,
20
23
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
21
24
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
22
25
  };
@@ -30,6 +33,7 @@ describe("useTrackReturnItem custom hook", () => {
30
33
  page: TrackingPage.ITEM,
31
34
  country,
32
35
  segment,
36
+ tradename,
33
37
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
34
38
  checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
35
39
  }),
@@ -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, ReturnItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
 
7
8
  interface ReturnItemFunction {
@@ -14,12 +15,20 @@ interface UseTrackReturnItemFunctionArgs {
14
15
  readonly segment: Segment;
15
16
  readonly checkoutId: string | undefined;
16
17
  readonly checkoutItemId: string;
18
+ readonly tradename: Tradename;
17
19
  }
18
20
  interface UseTrackReturnItemFunction {
19
21
  (agrs: UseTrackReturnItemFunctionArgs): ReturnItemFunction;
20
22
  }
21
23
 
22
- const useTrackReturnItem: UseTrackReturnItemFunction = ({ page, country, segment, checkoutId, checkoutItemId }) => {
24
+ const useTrackReturnItem: UseTrackReturnItemFunction = ({
25
+ page,
26
+ country,
27
+ segment,
28
+ checkoutId,
29
+ tradename,
30
+ checkoutItemId,
31
+ }) => {
23
32
  const emitUserEvent = useEmitUserEvent<ReturnItemTrackingEvent>();
24
33
 
25
34
  const returnItem: ReturnItemFunction = useCallback(() => {
@@ -34,11 +43,12 @@ const useTrackReturnItem: UseTrackReturnItemFunction = ({ page, country, segment
34
43
  store: country,
35
44
  segment,
36
45
  checkoutId,
46
+ tradename,
37
47
  checkoutItemId,
38
48
  };
39
49
 
40
50
  emitUserEvent(returnItemTrackingEvent);
41
- }, [checkoutId, checkoutItemId, country, emitUserEvent, page, segment]);
51
+ }, [checkoutId, tradename, checkoutItemId, country, emitUserEvent, page, segment]);
42
52
 
43
53
  return returnItem;
44
54
  };
@@ -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 { TrackingPage, TabViewTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
  import { useTrackTabView as sut } from "./useTrackTabView";
7
8
 
@@ -10,6 +11,7 @@ jest.mock("@lookiero/sty-psp-tracking");
10
11
 
11
12
  const country = Country.ES;
12
13
  const segment = Segment.WOMEN;
14
+ const tradename = Tradename.LOOKIERO;
13
15
 
14
16
  type Tab = "tab";
15
17
  const event: TabViewTrackingEvent<Tab> = {
@@ -18,6 +20,7 @@ const event: TabViewTrackingEvent<Tab> = {
18
20
  section: "checkout_item",
19
21
  store: country,
20
22
  segment,
23
+ tradename,
21
24
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
22
25
  tab: "tab",
23
26
  };
@@ -31,6 +34,7 @@ describe("useTrackTabView custom hook", () => {
31
34
  page: TrackingPage.ITEM,
32
35
  country,
33
36
  segment,
37
+ tradename,
34
38
  checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
35
39
  }),
36
40
  );
@@ -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, TabViewTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
6
7
 
7
8
  interface TabViewFunctionArgs<T> {
@@ -16,6 +17,7 @@ interface UseTrackTabViewFunctionArgs {
16
17
  readonly country: Country;
17
18
  readonly segment: Segment;
18
19
  readonly checkoutId: string | undefined;
20
+ readonly tradename: Tradename;
19
21
  }
20
22
 
21
23
  const useTrackTabView = <T>({
@@ -23,6 +25,7 @@ const useTrackTabView = <T>({
23
25
  country,
24
26
  segment,
25
27
  checkoutId,
28
+ tradename,
26
29
  }: UseTrackTabViewFunctionArgs): TabViewFunction<T> => {
27
30
  const emitUserEvent = useEmitUserEvent<TabViewTrackingEvent<T>>();
28
31
 
@@ -39,12 +42,13 @@ const useTrackTabView = <T>({
39
42
  store: country,
40
43
  segment,
41
44
  checkoutId,
45
+ tradename,
42
46
  tab,
43
47
  };
44
48
 
45
49
  emitUserEvent(tabViewTrackingEvent);
46
50
  },
47
- [checkoutId, country, emitUserEvent, page, segment],
51
+ [checkoutId, tradename, country, emitUserEvent, page, segment],
48
52
  );
49
53
 
50
54
  return tabView;
@@ -61,6 +61,7 @@ const useCheckoutFlow: UseCheckoutFlowFunction = ({
61
61
  const {
62
62
  customer: { customerId, country, segment, name, email },
63
63
  basePath,
64
+ tradename,
64
65
  } = useStaticInfo();
65
66
  const paymentFlowRef = useRef<PaymentFlowRef>(null);
66
67
  const [paymentFlowPayload] = useViewPaymentFlowPayloadByCheckoutId({
@@ -95,6 +96,7 @@ const useCheckoutFlow: UseCheckoutFlowFunction = ({
95
96
  userId: customerId,
96
97
  country,
97
98
  segment,
99
+ tradename,
98
100
  });
99
101
 
100
102
  const checkoutFlow: CheckoutFlowFunction = useCallback(async () => {
@@ -50,7 +50,7 @@ const CheckoutMiddleware: FC<CheckoutMiddlewareProps> = ({
50
50
  feedbackRouteMatchRef.current = feedbackRouteMatch;
51
51
 
52
52
  const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
53
- const checkoutItemsRef = useRef<CheckoutItemProjection[]>([]);
53
+ const checkoutItemsRef = useRef<CheckoutItemProjection[] | undefined>(undefined);
54
54
 
55
55
  /* This hook is mounted at this level, although not being used directly, for optimization (regarding cache) */
56
56
  useViewIsSizeChangeEnabledByCheckoutId({ checkoutId: checkout?.id });
@@ -84,9 +84,7 @@ const CheckoutMiddleware: FC<CheckoutMiddlewareProps> = ({
84
84
  ),
85
85
  ) || checkout?.items.find((item) => item.status === CheckoutItemStatus.INITIAL);
86
86
 
87
- if (checkout) {
88
- checkoutItemsRef.current = checkout.items;
89
- }
87
+ checkoutItemsRef.current = checkout?.items;
90
88
 
91
89
  /* Navigate to the summary if required */
92
90
  if (
@@ -110,7 +108,7 @@ const CheckoutMiddleware: FC<CheckoutMiddlewareProps> = ({
110
108
  });
111
109
  }
112
110
  }
113
- }, [basePath, checkout?.status, checkout?.items]);
111
+ }, [basePath, checkout?.items, checkout?.status]);
114
112
 
115
113
  if (checkout === undefined) {
116
114
  return loader;
@@ -47,6 +47,7 @@ const Checkout: FC<CheckoutProps> = ({
47
47
  const {
48
48
  customer: { customerId, country, segment },
49
49
  basePath,
50
+ tradename,
50
51
  } = useStaticInfo();
51
52
  const screenSize = useScreenSize();
52
53
  const isDektopScreen = screenSize === "L";
@@ -73,6 +74,7 @@ const Checkout: FC<CheckoutProps> = ({
73
74
  page: TrackingPage.CHECKOUT,
74
75
  country,
75
76
  segment,
77
+ tradename,
76
78
  checkoutId: checkout?.id,
77
79
  });
78
80
 
@@ -81,6 +83,7 @@ const Checkout: FC<CheckoutProps> = ({
81
83
  page: TrackingPage.CHECKOUT,
82
84
  country,
83
85
  segment,
86
+ tradename,
84
87
  checkoutId: checkout?.id,
85
88
  });
86
89
  const handleOnSubmit = useCallback(async () => {
@@ -106,6 +109,7 @@ const Checkout: FC<CheckoutProps> = ({
106
109
  page: TrackingPage.CHECKOUT,
107
110
  country,
108
111
  segment,
112
+ tradename,
109
113
  checkoutId: checkout?.id,
110
114
  });
111
115
  const handleOnBack = useCallback(() => {
@@ -37,6 +37,7 @@ const Feedback: FC<FeedbackProps> = ({ layout: Layout }) => {
37
37
  const isDesktop = screenSize === "L";
38
38
  const {
39
39
  customer: { customerId, country, segment },
40
+ tradename,
40
41
  } = useStaticInfo();
41
42
 
42
43
  const style = useMemo(() => feedbackStyle(), []);
@@ -51,6 +52,7 @@ const Feedback: FC<FeedbackProps> = ({ layout: Layout }) => {
51
52
  country,
52
53
  segment,
53
54
  checkoutId: checkout?.id,
55
+ tradename,
54
56
  });
55
57
 
56
58
  const trackChangeFeedback = useTrackChangeFeedback({
@@ -58,6 +60,7 @@ const Feedback: FC<FeedbackProps> = ({ layout: Layout }) => {
58
60
  country,
59
61
  segment,
60
62
  checkoutId: checkout?.id,
63
+ tradename,
61
64
  });
62
65
  const handleOnChangedFeedback: HandleOnChangedFeedbackFunction = useCallback(
63
66
  ({ checkoutQuestionId, checkoutQuestionFeedback, hasFeedback }) => {
@@ -86,6 +89,7 @@ const Feedback: FC<FeedbackProps> = ({ layout: Layout }) => {
86
89
  country,
87
90
  segment,
88
91
  checkoutId: checkout?.id,
92
+ tradename,
89
93
  });
90
94
  const handleOnSubmit = useCallback(
91
95
  async (feedbacks: CheckoutFeedbackProjection) => {
@@ -63,6 +63,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
63
63
  const {
64
64
  customer: { customerId, country, segment },
65
65
  basePath,
66
+ tradename,
66
67
  } = useStaticInfo();
67
68
 
68
69
  const style = useMemo(() => itemStyle(), []);
@@ -133,6 +134,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
133
134
  page: TrackingPage.ITEM,
134
135
  country,
135
136
  segment,
137
+ tradename,
136
138
  checkoutId: checkout?.id,
137
139
  checkoutItemId: checkoutItem.id,
138
140
  status: checkoutItem.status,
@@ -145,6 +147,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
145
147
  page: TrackingPage.ITEM,
146
148
  country,
147
149
  segment,
150
+ tradename,
148
151
  checkoutId: checkout?.id,
149
152
  });
150
153
  const handleOnNext: HandleOnNextFunction = useCallback(
@@ -155,6 +158,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
155
158
  page: TrackingPage.ITEM,
156
159
  country,
157
160
  segment,
161
+ tradename,
158
162
  checkoutId: checkout?.id,
159
163
  });
160
164
  const handleOnPrevious: HandleOnPreviousFunction = useCallback(
@@ -165,6 +169,7 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
165
169
  page: TrackingPage.ITEM,
166
170
  country,
167
171
  segment,
172
+ tradename,
168
173
  checkoutId: checkout?.id,
169
174
  });
170
175
  const handleOnBack = useCallback(() => {
@@ -47,6 +47,7 @@ const ItemWithCustomerDecission: FC<ItemWithCustomerDecissionProps> = ({
47
47
  const logger = useLogger();
48
48
  const {
49
49
  customer: { country, segment },
50
+ tradename,
50
51
  } = useStaticInfo();
51
52
 
52
53
  /* ResetCheckoutItem */
@@ -58,6 +59,7 @@ const ItemWithCustomerDecission: FC<ItemWithCustomerDecissionProps> = ({
58
59
  page: TrackingPage.ITEM,
59
60
  country,
60
61
  segment,
62
+ tradename,
61
63
  checkoutId,
62
64
  checkoutItemId: checkoutItem.id,
63
65
  });
@@ -81,6 +83,7 @@ const ItemWithCustomerDecission: FC<ItemWithCustomerDecissionProps> = ({
81
83
  country={country}
82
84
  currentProductVariant={currentProductVariant}
83
85
  segment={segment}
86
+ tradename={tradename}
84
87
  customerDecissionBanner={
85
88
  <CustomerDecissionBanner
86
89
  checkoutItemStatus={checkoutItem.status as CustomerDecissionBannerStatus}
@@ -44,6 +44,7 @@ const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
44
44
  const logger = useLogger();
45
45
  const {
46
46
  customer: { country, segment },
47
+ tradename,
47
48
  } = useStaticInfo();
48
49
 
49
50
  const style = useMemo(() => itemWithoutCustomerDecissionStyle(), []);
@@ -54,6 +55,7 @@ const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
54
55
  page: TrackingPage.ITEM,
55
56
  country,
56
57
  segment,
58
+ tradename,
57
59
  checkoutId,
58
60
  checkoutItemId: checkoutItem.id,
59
61
  });
@@ -72,6 +74,7 @@ const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
72
74
  page: TrackingPage.ITEM,
73
75
  country,
74
76
  segment,
77
+ tradename,
75
78
  checkoutId,
76
79
  checkoutItemId: checkoutItem.id,
77
80
  productVariantId: checkoutItem.productVariant.id,
@@ -111,6 +114,7 @@ const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
111
114
  country={country}
112
115
  currentProductVariant={currentProductVariant}
113
116
  segment={segment}
117
+ tradename={tradename}
114
118
  style={{
115
119
  content: { paddingBottom: Platform.OS === "web" ? style.productVariantPaddingBottom : stickyHeight },
116
120
  }}
@@ -2,6 +2,7 @@ import { RenderAPI, fireEvent } from "@testing-library/react-native";
2
2
  import React from "react";
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 { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
6
7
  import { ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
7
8
  import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
@@ -58,6 +59,7 @@ const renderProductVariant: RenderProductVariantFunction = ({ checkoutItem, curr
58
59
  country={Country.ES}
59
60
  currentProductVariant={currentProductVariant}
60
61
  segment={Segment.WOMEN}
62
+ tradename={Tradename.LOOKIERO}
61
63
  />,
62
64
  );
63
65
 
@@ -3,6 +3,7 @@ import { StyleProp, View, ViewStyle } from "react-native";
3
3
  import { Country } from "@lookiero/sty-psp-locale";
4
4
  import { Segment } from "@lookiero/sty-psp-segment";
5
5
  import { useScreenSize } from "@lookiero/sty-psp-ui";
6
+ import { Tradename } from "@lookiero/sty-sp-tradename";
6
7
  import { ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
7
8
  import {
8
9
  CheckoutItemProjection,
@@ -18,6 +19,7 @@ import { style as productVariantStyle } from "./ProductVariant.style";
18
19
  type ProductVariantStyle = "content";
19
20
 
20
21
  interface ProductVariantProps {
22
+ readonly tradename: Tradename;
21
23
  readonly country: Country;
22
24
  readonly segment: Segment;
23
25
  readonly checkoutId: string;
@@ -29,6 +31,7 @@ interface ProductVariantProps {
29
31
  }
30
32
 
31
33
  const ProductVariant: FC<ProductVariantProps> = ({
34
+ tradename,
32
35
  country,
33
36
  segment,
34
37
  checkoutId,
@@ -47,6 +50,7 @@ const ProductVariant: FC<ProductVariantProps> = ({
47
50
  page: TrackingPage.ITEM,
48
51
  country,
49
52
  segment,
53
+ tradename,
50
54
  checkoutId,
51
55
  checkoutItemId: checkoutItem.id,
52
56
  productVariantId: checkoutItem.productVariant.id,
@@ -65,7 +65,7 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
65
65
  segment,
66
66
  }) => {
67
67
  const navigate = useNavigate();
68
- const { basePath } = useStaticInfo();
68
+ const { basePath, tradename } = useStaticInfo();
69
69
  const logger = useLogger();
70
70
  const screenSize = useScreenSize();
71
71
  const isDektopScreen = screenSize === "L";
@@ -90,16 +90,18 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
90
90
  page: TrackingPage.RETURN,
91
91
  country,
92
92
  segment,
93
+ tradename,
93
94
  checkoutId: checkout.id,
94
95
  checkoutItemId: checkoutItem.id,
95
96
  });
96
97
 
97
- useTrackPageView({ checkoutId: checkout.id, country, segment, page: TrackingPage.RETURN });
98
+ useTrackPageView({ checkoutId: checkout.id, country, segment, tradename, page: TrackingPage.RETURN });
98
99
 
99
100
  const trackPressBack = useTrackPressBack({
100
101
  page: TrackingPage.ITEM,
101
102
  country,
102
103
  segment,
104
+ tradename,
103
105
  checkoutId: checkout?.id,
104
106
  });
105
107
  const handleOnBack = useCallback(() => {
@@ -111,6 +113,7 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
111
113
  page: TrackingPage.ITEM,
112
114
  country,
113
115
  segment,
116
+ tradename,
114
117
  checkoutId: checkout.id,
115
118
  });
116
119
 
@@ -30,6 +30,7 @@ const Summary: FC<SummaryProps> = ({ layout: Layout, children }) => {
30
30
  const {
31
31
  customer: { customerId, country, segment },
32
32
  basePath,
33
+ tradename,
33
34
  } = useStaticInfo();
34
35
  const screenSize = useScreenSize();
35
36
  const isDesktopScreen = screenSize === "L";
@@ -55,6 +56,7 @@ const Summary: FC<SummaryProps> = ({ layout: Layout, children }) => {
55
56
  page: TrackingPage.SUMMARY,
56
57
  country,
57
58
  segment,
59
+ tradename,
58
60
  checkoutId: checkout?.id,
59
61
  });
60
62
  const handleOnPricingLayout = useCallback(({ height }: LayoutRectangle) => setPricingHeight(height), []);
@@ -81,6 +83,7 @@ const Summary: FC<SummaryProps> = ({ layout: Layout, children }) => {
81
83
  page: TrackingPage.SUMMARY,
82
84
  country,
83
85
  segment,
86
+ tradename,
84
87
  checkoutId: checkout?.id,
85
88
  });
86
89
 
@@ -88,6 +91,7 @@ const Summary: FC<SummaryProps> = ({ layout: Layout, children }) => {
88
91
  page: TrackingPage.SUMMARY,
89
92
  country,
90
93
  segment,
94
+ tradename,
91
95
  checkoutId: checkout?.id,
92
96
  });
93
97
  const handleOnSubmit = useCallback(() => {