@lookiero/checkout 11.5.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.
- package/dist/index.d.ts +1 -2
- package/dist/src/ExpoRoot.d.ts +0 -1
- package/dist/src/ExpoRoot.js +2 -3
- package/dist/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackChangeFeedback.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackChangeFeedback.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackCheckout.js +3 -1
- package/dist/src/infrastructure/tracking/useTrackImageView.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackImageView.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackItemPageView.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackItemPageView.js +3 -1
- package/dist/src/infrastructure/tracking/useTrackKeepItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackKeepItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPageView.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPageView.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressBack.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressBack.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressContinue.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressContinue.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressNext.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressNext.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressPrevious.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressPrevious.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressPricing.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressPricing.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackReplaceItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackReplaceItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackResetItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackResetItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackReturnItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackReturnItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackTabView.d.ts +3 -1
- package/dist/src/infrastructure/tracking/useTrackTabView.js +3 -2
- package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +2 -1
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.d.ts +1 -1
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +5 -3
- package/dist/src/infrastructure/ui/test/render.js +1 -1
- package/dist/src/infrastructure/ui/views/App.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +4 -1
- package/dist/src/infrastructure/ui/views/feedback/Feedback.js +4 -1
- package/dist/src/infrastructure/ui/views/item/Item.js +5 -1
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +3 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +4 -2
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.d.ts +2 -0
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +2 -1
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +5 -2
- package/dist/src/infrastructure/ui/views/summary/Summary.js +4 -1
- package/dist/src/infrastructure/ui/views/summaryTabs/SummaryTabs.js +4 -1
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +2 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/index.ts +1 -1
- package/jest.config.js +0 -3
- package/jest.setup.js +9 -1
- package/package.json +22 -20
- package/src/ExpoRoot.tsx +2 -3
- package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.test.ts +4 -0
- package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.ts +5 -1
- package/src/infrastructure/tracking/useTrackChangeFeedback.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackChangeFeedback.ts +5 -2
- package/src/infrastructure/tracking/useTrackCheckout.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackCheckout.ts +5 -0
- package/src/infrastructure/tracking/useTrackImageView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackImageView.ts +5 -1
- package/src/infrastructure/tracking/useTrackItemPageView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackItemPageView.ts +5 -0
- package/src/infrastructure/tracking/useTrackKeepItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackKeepItem.ts +12 -2
- package/src/infrastructure/tracking/useTrackPageView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPageView.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressBack.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressBack.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressContinue.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressContinue.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressItem.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressNext.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressNext.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressPrevious.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressPrevious.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressPricing.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressPricing.ts +5 -2
- package/src/infrastructure/tracking/useTrackReplaceItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackReplaceItem.ts +5 -1
- package/src/infrastructure/tracking/useTrackResetItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackResetItem.ts +12 -2
- package/src/infrastructure/tracking/useTrackReturnItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackReturnItem.ts +12 -2
- package/src/infrastructure/tracking/useTrackTabView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackTabView.ts +5 -1
- package/src/infrastructure/ui/hooks/useCheckoutFlow.test.tsx +11 -1
- package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +2 -0
- package/src/infrastructure/ui/hooks/useQueryBus.test.tsx +1 -1
- package/src/infrastructure/ui/hooks/useStaticInfo.test.tsx +1 -1
- package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +6 -4
- package/src/infrastructure/ui/test/render.tsx +1 -1
- package/src/infrastructure/ui/views/App.tsx +1 -1
- package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +9 -2
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +4 -0
- package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +7 -1
- package/src/infrastructure/ui/views/feedback/Feedback.tsx +4 -0
- package/src/infrastructure/ui/views/item/Item.test.tsx +7 -1
- package/src/infrastructure/ui/views/item/Item.tsx +5 -0
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +76 -99
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.test.tsx +7 -1
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +3 -0
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.test.tsx +7 -1
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +4 -0
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.test.tsx +2 -0
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.tsx +4 -0
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +228 -297
- package/src/infrastructure/ui/views/return/Return.test.tsx +8 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.test.tsx +2 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +5 -2
- package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +26 -32
- package/src/infrastructure/ui/views/summary/Summary.test.tsx +7 -1
- package/src/infrastructure/ui/views/summary/Summary.tsx +4 -0
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +16 -24
- package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.test.tsx +7 -1
- package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.tsx +4 -0
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +105 -135
|
@@ -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, PressItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
|
|
7
8
|
interface PressItemFunctionArgs {
|
|
@@ -16,12 +17,13 @@ interface UseTrackPressItemFunctionArgs {
|
|
|
16
17
|
readonly country: Country;
|
|
17
18
|
readonly segment: Segment;
|
|
18
19
|
readonly checkoutId: string | undefined;
|
|
20
|
+
readonly tradename: Tradename;
|
|
19
21
|
}
|
|
20
22
|
interface UseTrackPressItemFunction {
|
|
21
23
|
(agrs: UseTrackPressItemFunctionArgs): PressItemFunction;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
const useTrackPressItem: UseTrackPressItemFunction = ({ page, country, segment, checkoutId }) => {
|
|
26
|
+
const useTrackPressItem: UseTrackPressItemFunction = ({ page, country, segment, checkoutId, tradename }) => {
|
|
25
27
|
const emitUserEvent = useEmitUserEvent<PressItemTrackingEvent>();
|
|
26
28
|
|
|
27
29
|
const pressItem: PressItemFunction = useCallback(
|
|
@@ -37,12 +39,13 @@ const useTrackPressItem: UseTrackPressItemFunction = ({ page, country, segment,
|
|
|
37
39
|
store: country,
|
|
38
40
|
segment,
|
|
39
41
|
checkoutId,
|
|
42
|
+
tradename,
|
|
40
43
|
checkoutItemId,
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
emitUserEvent(pressItemTrackingEvent);
|
|
44
47
|
},
|
|
45
|
-
[checkoutId, country, emitUserEvent, page, segment],
|
|
48
|
+
[checkoutId, tradename, country, emitUserEvent, page, segment],
|
|
46
49
|
);
|
|
47
50
|
|
|
48
51
|
return pressItem;
|
|
@@ -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, PressNextTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { useTrackPressNext as sut } from "./useTrackPressNext";
|
|
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: PressNextTrackingEvent = {
|
|
15
17
|
event: TrackingEventName.PRESS_NEXT,
|
|
@@ -17,6 +19,7 @@ const event: PressNextTrackingEvent = {
|
|
|
17
19
|
section: "checkout_item",
|
|
18
20
|
store: country,
|
|
19
21
|
segment,
|
|
22
|
+
tradename,
|
|
20
23
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
21
24
|
from: "faaf6ce4-8b7b-4cbd-a50b-32dd23388112",
|
|
22
25
|
to: "b5555baf-fec7-4ab2-bb6f-1d482acee8b2",
|
|
@@ -31,6 +34,7 @@ describe("useTrackPressNext 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, PressNextTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
|
|
7
8
|
interface PressNextFunctionArgs {
|
|
@@ -17,13 +18,14 @@ interface UseTrackPressNextFunctionArgs {
|
|
|
17
18
|
readonly country: Country;
|
|
18
19
|
readonly segment: Segment;
|
|
19
20
|
readonly checkoutId: string | undefined;
|
|
21
|
+
readonly tradename: Tradename;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
interface UseTrackPressNextFunction {
|
|
23
25
|
(args: UseTrackPressNextFunctionArgs): PressNextFunction;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
const useTrackPressNext: UseTrackPressNextFunction = ({ page, country, segment, checkoutId }) => {
|
|
28
|
+
const useTrackPressNext: UseTrackPressNextFunction = ({ page, country, segment, checkoutId, tradename }) => {
|
|
27
29
|
const emitUserEvent = useEmitUserEvent<PressNextTrackingEvent>();
|
|
28
30
|
|
|
29
31
|
const pressNext: PressNextFunction = useCallback(
|
|
@@ -39,13 +41,14 @@ const useTrackPressNext: UseTrackPressNextFunction = ({ page, country, segment,
|
|
|
39
41
|
store: country,
|
|
40
42
|
segment,
|
|
41
43
|
checkoutId,
|
|
44
|
+
tradename,
|
|
42
45
|
from,
|
|
43
46
|
to,
|
|
44
47
|
};
|
|
45
48
|
|
|
46
49
|
emitUserEvent(pressNextTrackingEvent);
|
|
47
50
|
},
|
|
48
|
-
[checkoutId, country, emitUserEvent, page, segment],
|
|
51
|
+
[checkoutId, tradename, country, emitUserEvent, page, segment],
|
|
49
52
|
);
|
|
50
53
|
|
|
51
54
|
return pressNext;
|
|
@@ -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, PressPreviousTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { useTrackPressPrevious as sut } from "./useTrackPressPrevious";
|
|
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: PressPreviousTrackingEvent = {
|
|
15
17
|
event: TrackingEventName.PRESS_PREVIOUS,
|
|
@@ -17,6 +19,7 @@ const event: PressPreviousTrackingEvent = {
|
|
|
17
19
|
section: "checkout_item",
|
|
18
20
|
store: country,
|
|
19
21
|
segment,
|
|
22
|
+
tradename,
|
|
20
23
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
21
24
|
from: "faaf6ce4-8b7b-4cbd-a50b-32dd23388112",
|
|
22
25
|
to: "b5555baf-fec7-4ab2-bb6f-1d482acee8b2",
|
|
@@ -31,6 +34,7 @@ describe("useTrackPressPrevious 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 {
|
|
6
7
|
PROJECT,
|
|
7
8
|
TrackingPage,
|
|
@@ -23,13 +24,14 @@ interface UseTrackPressPreviousFunctionArgs {
|
|
|
23
24
|
readonly country: Country;
|
|
24
25
|
readonly segment: Segment;
|
|
25
26
|
readonly checkoutId: string | undefined;
|
|
27
|
+
readonly tradename: Tradename;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
interface UseTrackPressPreviousFunction {
|
|
29
31
|
(args: UseTrackPressPreviousFunctionArgs): PressPreviousFunction;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
const useTrackPressPrevious: UseTrackPressPreviousFunction = ({ page, country, segment, checkoutId }) => {
|
|
34
|
+
const useTrackPressPrevious: UseTrackPressPreviousFunction = ({ page, country, segment, checkoutId, tradename }) => {
|
|
33
35
|
const emitUserEvent = useEmitUserEvent<PressPreviousTrackingEvent>();
|
|
34
36
|
|
|
35
37
|
const pressPrevious: PressPreviousFunction = useCallback(
|
|
@@ -45,13 +47,14 @@ const useTrackPressPrevious: UseTrackPressPreviousFunction = ({ page, country, s
|
|
|
45
47
|
store: country,
|
|
46
48
|
segment,
|
|
47
49
|
checkoutId,
|
|
50
|
+
tradename,
|
|
48
51
|
from,
|
|
49
52
|
to,
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
emitUserEvent(pressPreviousTrackingEvent);
|
|
53
56
|
},
|
|
54
|
-
[checkoutId, country, emitUserEvent, page, segment],
|
|
57
|
+
[checkoutId, tradename, country, emitUserEvent, page, segment],
|
|
55
58
|
);
|
|
56
59
|
|
|
57
60
|
return pressPrevious;
|
|
@@ -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, PressPricingTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { useTrackPressPricing as sut } from "./useTrackPressPricing";
|
|
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: PressPricingTrackingEvent = {
|
|
15
17
|
event: TrackingEventName.PRESS_PRICING,
|
|
@@ -17,6 +19,7 @@ const event: PressPricingTrackingEvent = {
|
|
|
17
19
|
section: "checkout_item",
|
|
18
20
|
store: country,
|
|
19
21
|
segment,
|
|
22
|
+
tradename,
|
|
20
23
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
21
24
|
collapse: false,
|
|
22
25
|
};
|
|
@@ -30,6 +33,7 @@ describe("useTrackPressPricing 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
|
}),
|
|
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 { 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 = ({
|
|
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 = ({
|
|
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;
|
|
@@ -6,6 +6,7 @@ import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp
|
|
|
6
6
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
7
7
|
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
8
8
|
import { CheckoutBookingProjection } from "../../../projection/checkoutBooking/checkoutBooking";
|
|
9
|
+
import { Customer } from "../../../projection/customer/customer";
|
|
9
10
|
import { OrderProjection } from "../../../projection/order/order";
|
|
10
11
|
import { SubscriptionProjection } from "../../../projection/subscription/subscription";
|
|
11
12
|
import { useSubmitCheckout } from "../../domain/checkout/react/useSubmitCheckout";
|
|
@@ -45,8 +46,17 @@ const country = Country.ES;
|
|
|
45
46
|
const email = "email@example.com";
|
|
46
47
|
const name = "Adèle Léonce Émilie";
|
|
47
48
|
const segment = Segment.WOMEN;
|
|
49
|
+
|
|
50
|
+
const mockCustomer: Customer = {
|
|
51
|
+
customerId,
|
|
52
|
+
country,
|
|
53
|
+
segment,
|
|
54
|
+
name,
|
|
55
|
+
email,
|
|
56
|
+
};
|
|
57
|
+
|
|
48
58
|
jest.mock("./useStaticInfo", () => ({
|
|
49
|
-
useStaticInfo: () => ({ customer:
|
|
59
|
+
useStaticInfo: () => ({ customer: mockCustomer, basePath }),
|
|
50
60
|
}));
|
|
51
61
|
|
|
52
62
|
// const errorChargeStatuses = Object.values(ChargeStatus).filter((status) => status !== ChargeStatus.EXECUTED);
|
|
@@ -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 () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { renderHook, waitFor } from "@testing-library/react-native";
|
|
2
2
|
import { mockFn } from "jest-mock-extended";
|
|
3
|
-
import React, { FC } from "react";
|
|
3
|
+
import React, { FC, JSX } from "react";
|
|
4
4
|
import { QueryBus } from "@lookiero/messaging";
|
|
5
5
|
import { QueryBusProvider, useQueryBus as sut } from "./useQueryBus";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderHook, waitFor } from "@testing-library/react-native";
|
|
2
|
-
import React, { FC } from "react";
|
|
2
|
+
import React, { FC, JSX } from "react";
|
|
3
3
|
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
4
4
|
import { Customer } from "../../../projection/customer/customer";
|
|
5
5
|
import { KameleoonEnvironment } from "../../ab-testing/kameleoonEnvironment";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC, useEffect, useRef } from "react";
|
|
1
|
+
import React, { FC, JSX, useEffect, useRef } from "react";
|
|
2
2
|
import { generatePath, useMatch, useNavigate } from "react-router-native";
|
|
3
3
|
import { Spinner } from "@lookiero/aurora";
|
|
4
4
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
@@ -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[]>([]);
|
|
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,7 +84,9 @@ const CheckoutMiddleware: FC<CheckoutMiddlewareProps> = ({
|
|
|
84
84
|
),
|
|
85
85
|
) || checkout?.items.find((item) => item.status === CheckoutItemStatus.INITIAL);
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
if (checkout?.items) {
|
|
88
|
+
checkoutItemsRef.current = checkout.items;
|
|
89
|
+
}
|
|
88
90
|
|
|
89
91
|
/* Navigate to the summary if required */
|
|
90
92
|
if (
|
|
@@ -108,7 +110,7 @@ const CheckoutMiddleware: FC<CheckoutMiddlewareProps> = ({
|
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
|
-
}, [basePath, checkout?.
|
|
113
|
+
}, [basePath, checkout?.items, checkout?.status]);
|
|
112
114
|
|
|
113
115
|
if (checkout === undefined) {
|
|
114
116
|
return loader;
|
|
@@ -26,7 +26,7 @@ const renderWrapper: RenderWrapperFunction =
|
|
|
26
26
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
27
27
|
({ children }) => (
|
|
28
28
|
<Aurora>
|
|
29
|
-
<I18nProvider locale={locale as string} messages={messages} onError={() =>
|
|
29
|
+
<I18nProvider locale={locale as string} messages={messages} onError={() => {}} onWarn={() => {}}>
|
|
30
30
|
<LoggerProvider logger={logger}>
|
|
31
31
|
<Wrapper>{children}</Wrapper>
|
|
32
32
|
</LoggerProvider>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PortalHost } from "@gorhom/portal";
|
|
2
|
-
import React, { FC } from "react";
|
|
2
|
+
import React, { FC, JSX } from "react";
|
|
3
3
|
import { StatusBar } from "react-native";
|
|
4
4
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
5
5
|
import { Notifications } from "@lookiero/sty-psp-notifications";
|