@lookiero/checkout 7.0.1 → 7.2.0-beta.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/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/infrastructure/delivery/bootstrap.js +5 -2
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +2 -0
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +4 -0
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +10 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +17 -0
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +6 -0
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +2 -0
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +2 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +21 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +6 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +6 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +5 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +19 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +3 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +18 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +13 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +6 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +11 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +11 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +11 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +49 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +9 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +21 -0
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +10 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +11 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +40 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +15 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.js +43 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +13 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +9 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +10 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +17 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +13 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +3 -3
- package/src/infrastructure/delivery/bootstrap.ts +8 -2
- package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +2 -0
- package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.test.ts +1 -1
- package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +4 -0
- package/src/infrastructure/projection/checkout/httpCheckoutByIdView.test.ts +1 -1
- package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +2 -0
- package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.test.ts +1 -1
- package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +2 -0
- package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.test.ts +1 -1
- package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +2 -0
- package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.test.ts +1 -1
- package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +2 -0
- package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.test.ts +1 -1
- package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +2 -0
- package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.test.ts +1 -1
- package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +2 -0
- package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.test.ts +1 -1
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +2 -0
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.test.ts +1 -1
- package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +6 -0
- package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.test.ts +1 -1
- package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +2 -0
- package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.test.ts +1 -1
- package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +2 -0
- package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.test.ts +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
1
2
|
import { fetchHttpGet, fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
+
import { VERSION } from "../../version";
|
|
2
4
|
import { getCheckout, saveCheckout } from "../domain/checkout/model/httpCheckouts";
|
|
3
5
|
import { getCheckoutBooking, saveCheckoutBooking } from "../domain/checkoutBooking/model/httpCheckoutBookings";
|
|
4
6
|
import { getCheckoutFeedback, saveCheckoutFeedback } from "../domain/checkoutFeedback/model/httpCheckoutFeedbacks";
|
|
@@ -19,9 +21,10 @@ import { httpPricingByCheckoutIdView } from "../projection/pricing/httpPricingBy
|
|
|
19
21
|
import { httpReturnQuestionsByCheckoutItemIdView } from "../projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView";
|
|
20
22
|
import { storageUiSettingByKeyView } from "../projection/uiSetting/storageUiSettingByKeyView";
|
|
21
23
|
import { baseBootstrap } from "./baseBootstrap";
|
|
24
|
+
const device = Platform.OS;
|
|
22
25
|
const bootstrap = ({ apiUrl, getAuthToken }) => {
|
|
23
|
-
const httpGet = fetchHttpGet({ apiUrl, getAuthToken });
|
|
24
|
-
const httpPost = fetchHttpPost({ apiUrl, getAuthToken });
|
|
26
|
+
const httpGet = fetchHttpGet({ apiUrl, getAuthToken, device, version: VERSION });
|
|
27
|
+
const httpPost = fetchHttpPost({ apiUrl, getAuthToken, device, version: VERSION });
|
|
25
28
|
return baseBootstrap({
|
|
26
29
|
checkoutByIdView: httpCheckoutByIdView({ httpPost }),
|
|
27
30
|
firstAvailableCheckoutByCustomerIdView: httpFirstAvailableCheckoutByCustomerIdView({ httpPost }),
|
|
@@ -35,6 +35,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewBookedProductVariantsForCheckoutItem API", (
|
|
|
35
35
|
const httpPost = fetchHttpPost({
|
|
36
36
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
37
37
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
38
|
+
device: "web",
|
|
39
|
+
version: "1.0.0",
|
|
38
40
|
});
|
|
39
41
|
const response = await httpBookedProductsVariantsForCheckoutItemView({ httpPost })({
|
|
40
42
|
checkoutItemId,
|
|
@@ -73,6 +73,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutById API", () => {
|
|
|
73
73
|
const httpPost = fetchHttpPost({
|
|
74
74
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
75
75
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
76
|
+
device: "web",
|
|
77
|
+
version: "1.0.0",
|
|
76
78
|
});
|
|
77
79
|
const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
78
80
|
expect(response).toStrictEqual(checkoutResponseWithReplacedFor.result);
|
|
@@ -97,6 +99,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutById API", () => {
|
|
|
97
99
|
const httpPost = fetchHttpPost({
|
|
98
100
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
99
101
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
102
|
+
device: "web",
|
|
103
|
+
version: "1.0.0",
|
|
100
104
|
});
|
|
101
105
|
const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
102
106
|
expect(response).toStrictEqual(checkoutResponseWithoutReplacedFor.result);
|
|
@@ -36,6 +36,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewFirstAvailableCheckoutByCustomerId API", ()
|
|
|
36
36
|
const httpPost = fetchHttpPost({
|
|
37
37
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
38
38
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
39
|
+
device: "web",
|
|
40
|
+
version: "1.0.0",
|
|
39
41
|
});
|
|
40
42
|
const response = await httpFirstAvailableCheckoutByCustomerIdView({ httpPost })({
|
|
41
43
|
customerId,
|
package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js
CHANGED
|
@@ -31,6 +31,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewFiveItemsDiscountByCustomerId API", () => {
|
|
|
31
31
|
const httpGet = fetchHttpGet({
|
|
32
32
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
33
33
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
34
|
+
device: "web",
|
|
35
|
+
version: "1.0.0",
|
|
34
36
|
});
|
|
35
37
|
const response = await httpFiveItemsDiscountByCustomerIdView({ httpGet })({
|
|
36
38
|
customerId,
|
package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js
CHANGED
|
@@ -31,6 +31,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewIsCheckoutEnabledByCustomerId API", () => {
|
|
|
31
31
|
const httpGet = fetchHttpGet({
|
|
32
32
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
33
33
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
34
|
+
device: "web",
|
|
35
|
+
version: "1.0.0",
|
|
34
36
|
});
|
|
35
37
|
const response = await httpIsCheckoutEnabledByCustomerIdView({ httpGet })({
|
|
36
38
|
customerId,
|
package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js
CHANGED
|
@@ -31,6 +31,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewIsSizeChangeEnabledByCheckoutId API", () =>
|
|
|
31
31
|
const httpGet = fetchHttpGet({
|
|
32
32
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
33
33
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
34
|
+
device: "web",
|
|
35
|
+
version: "1.0.0",
|
|
34
36
|
});
|
|
35
37
|
const response = await httpIsSizeChangeEnabledByCheckoutIdView({ httpGet })({
|
|
36
38
|
checkoutId,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseQueryFunctionResult } from "@lookiero/messaging-react";
|
|
2
|
+
import { IsCheckoutAccessibleByCustomerIdProjection } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
|
|
3
|
+
interface UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs {
|
|
4
|
+
readonly customerId: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
interface UseViewIsCheckoutAccessibleByCustomerIdFunction {
|
|
7
|
+
(args: UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs): UseQueryFunctionResult<IsCheckoutAccessibleByCustomerIdProjection>;
|
|
8
|
+
}
|
|
9
|
+
declare const useViewIsCheckoutAccessibleByCustomerId: UseViewIsCheckoutAccessibleByCustomerIdFunction;
|
|
10
|
+
export { useViewIsCheckoutAccessibleByCustomerId };
|
package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useQuery } from "@lookiero/messaging-react";
|
|
2
|
+
import { isCheckoutFeedbackGiven } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
|
|
3
|
+
import { viewIsCheckoutAccessibleByCustomerId, } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
|
|
4
|
+
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
5
|
+
const useViewIsCheckoutAccessibleByCustomerId = ({ customerId }) => useQuery({
|
|
6
|
+
query: viewIsCheckoutAccessibleByCustomerId({ customerId }),
|
|
7
|
+
contextId: MESSAGING_CONTEXT_ID,
|
|
8
|
+
invalidation: isCheckoutFeedbackGiven,
|
|
9
|
+
options: {
|
|
10
|
+
refetchOnMount: "always",
|
|
11
|
+
staleTime: Infinity,
|
|
12
|
+
retry: false,
|
|
13
|
+
refetchOnWindowFocus: false,
|
|
14
|
+
cacheTime: 0,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export { useViewIsCheckoutAccessibleByCustomerId };
|
package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js
CHANGED
|
@@ -36,6 +36,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutBookingById API", () => {
|
|
|
36
36
|
const httpPost = fetchHttpPost({
|
|
37
37
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
38
38
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
39
|
+
device: "web",
|
|
40
|
+
version: "1.0.0",
|
|
39
41
|
});
|
|
40
42
|
const response = await httpCheckoutBookingByIdView({ httpPost })({
|
|
41
43
|
checkoutBookingId,
|
|
@@ -37,6 +37,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutItemById API", () => {
|
|
|
37
37
|
const httpPost = fetchHttpPost({
|
|
38
38
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
39
39
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
40
|
+
device: "web",
|
|
41
|
+
version: "1.0.0",
|
|
40
42
|
});
|
|
41
43
|
const response = await httpCheckoutItemByIdView({ httpPost })({
|
|
42
44
|
checkoutItemId,
|
|
@@ -35,6 +35,8 @@ describe("STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId API", () => {
|
|
|
35
35
|
const httpPost = fetchHttpPost({
|
|
36
36
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
37
37
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
38
|
+
device: "web",
|
|
39
|
+
version: "1.0.0",
|
|
38
40
|
});
|
|
39
41
|
const response = await httpCheckoutQuestionsByCheckoutIdView({ httpPost })({
|
|
40
42
|
checkoutId,
|
package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js
CHANGED
|
@@ -47,6 +47,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
|
|
|
47
47
|
const httpPost = fetchHttpPost({
|
|
48
48
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
49
49
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
50
|
+
device: "web",
|
|
51
|
+
version: "1.0.0",
|
|
50
52
|
});
|
|
51
53
|
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
52
54
|
expect(response).toStrictEqual(paymentFlowPayloadForKeptItemsResponse.result);
|
|
@@ -71,6 +73,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
|
|
|
71
73
|
const httpPost = fetchHttpPost({
|
|
72
74
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
73
75
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
76
|
+
device: "web",
|
|
77
|
+
version: "1.0.0",
|
|
74
78
|
});
|
|
75
79
|
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
76
80
|
expect(response).toStrictEqual(paymentFlowPayloadForReturnedItemsResponse.result);
|
|
@@ -95,6 +99,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
|
|
|
95
99
|
const httpPost = fetchHttpPost({
|
|
96
100
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
97
101
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
102
|
+
device: "web",
|
|
103
|
+
version: "1.0.0",
|
|
98
104
|
});
|
|
99
105
|
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
100
106
|
expect(response).toStrictEqual(paymentFlowPayloadForReplacedItemsResponse.result);
|
|
@@ -35,6 +35,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPricingByCheckoutId API", () => {
|
|
|
35
35
|
const httpPost = fetchHttpPost({
|
|
36
36
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
37
37
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
38
|
+
device: "web",
|
|
39
|
+
version: "1.0.0",
|
|
38
40
|
});
|
|
39
41
|
const response = await httpPricingByCheckoutIdView({ httpPost })({
|
|
40
42
|
checkoutId,
|
|
@@ -35,6 +35,8 @@ describe("STY-BOX_CHECKOUT-BACK_ListReturnQuestionsByCheckoutItemId API", () =>
|
|
|
35
35
|
const httpPost = fetchHttpPost({
|
|
36
36
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
37
37
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
38
|
+
device: "web",
|
|
39
|
+
version: "1.0.0",
|
|
38
40
|
});
|
|
39
41
|
const response = await httpReturnQuestionsByCheckoutItemIdView({ httpPost })({
|
|
40
42
|
checkoutItemId,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC, ReactNode, RefObject } from "react";
|
|
2
|
+
import { LayoutChangeEvent, ScrollView, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
interface LayoutStyle {
|
|
4
|
+
readonly safeAreaView: StyleProp<ViewStyle>;
|
|
5
|
+
readonly scrollView: StyleProp<ViewStyle>;
|
|
6
|
+
readonly header: StyleProp<ViewStyle>;
|
|
7
|
+
}
|
|
8
|
+
interface LayoutProps {
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
readonly header?: JSX.Element | null;
|
|
11
|
+
readonly footer?: JSX.Element | null;
|
|
12
|
+
readonly panel?: JSX.Element | null;
|
|
13
|
+
readonly stickyHeader?: boolean;
|
|
14
|
+
readonly stickyHeaderHiddenOnScroll?: boolean;
|
|
15
|
+
readonly scrollRef?: RefObject<ScrollView>;
|
|
16
|
+
readonly scrollEnabled?: boolean;
|
|
17
|
+
readonly style?: Partial<LayoutStyle>;
|
|
18
|
+
readonly onLayout?: (event: LayoutChangeEvent) => void;
|
|
19
|
+
}
|
|
20
|
+
type Layout = FC<LayoutProps>;
|
|
21
|
+
export type { Layout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Platform, StyleSheet } from "react-native";
|
|
2
|
+
import { HEADER_HEIGHT } from "../../../../templates/header/Header.style";
|
|
3
|
+
const style = StyleSheet.create({
|
|
4
|
+
header: {
|
|
5
|
+
...Platform.select({
|
|
6
|
+
web: {
|
|
7
|
+
position: "sticky",
|
|
8
|
+
top: 0,
|
|
9
|
+
zIndex: 10,
|
|
10
|
+
height: HEADER_HEIGHT,
|
|
11
|
+
},
|
|
12
|
+
native: {
|
|
13
|
+
position: "relative",
|
|
14
|
+
height: HEADER_HEIGHT,
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export { style };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { GestureHandlerRootView, ScrollView as RNGHScrollView } from "react-native-gesture-handler";
|
|
5
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
|
+
import { Footer as DefaultFooter } from "../../../templates/footer/Footer";
|
|
7
|
+
import { DefaultHeader } from "../../../templates/header/defaultHeader/DefaultHeader";
|
|
8
|
+
import { Footer } from "../components/footer/Footer";
|
|
9
|
+
import { Header } from "../components/header/Header";
|
|
10
|
+
import { style } from "./DummyLayout.style";
|
|
11
|
+
const DummyLayout = ({ children, header = React.createElement(DefaultHeader, null), footer = React.createElement(DefaultFooter, null), panel, style: customStyle, scrollEnabled, onLayout, }) => (React.createElement(SafeAreaView, { style: [style.safeAreaView, customStyle?.safeAreaView] },
|
|
12
|
+
React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
|
|
13
|
+
React.createElement(RNGHScrollView, { contentContainerStyle: [style.scrollView, customStyle?.scrollView], scrollEnabled: scrollEnabled, scrollEventThrottle: 16, showsVerticalScrollIndicator: false, stickyHeaderIndices: [0] },
|
|
14
|
+
React.createElement(Header, null, header),
|
|
15
|
+
panel,
|
|
16
|
+
React.createElement(View, { style: style.children, onLayout: onLayout }, children))),
|
|
17
|
+
React.createElement(Footer, null, footer)));
|
|
18
|
+
export { DummyLayout };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonIcon } from "@lookiero/aurora";
|
|
3
|
+
import { Header } from "../Header";
|
|
4
|
+
import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
|
|
5
|
+
import { Logo } from "../logo/Logo";
|
|
6
|
+
import { style } from "./DefaultHeader.style";
|
|
7
|
+
const DefaultHeader = ({ onPressMenu }) => (React.createElement(Header, { testID: "default-header" },
|
|
8
|
+
React.createElement(Logo, null),
|
|
9
|
+
React.createElement(ButtonIconPlaceholder, null),
|
|
10
|
+
React.createElement(ButtonIcon, { name: "menu", style: style.button, testID: "menu-button-icon", onPress: onPressMenu })));
|
|
11
|
+
export { DefaultHeader };
|
package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
const { space10 } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
button: {
|
|
6
|
+
alignSelf: "auto",
|
|
7
|
+
height: space10,
|
|
8
|
+
width: space10,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
export { style };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
declare enum NewFeedbackExperimentVariation {
|
|
3
|
+
CONTROL = "control",
|
|
4
|
+
RETURN_PAGE = "return_page"
|
|
5
|
+
}
|
|
6
|
+
interface NewFeedbackExperimentProviderProps {
|
|
7
|
+
readonly children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const NewFeedbackExperimentProvider: FC<NewFeedbackExperimentProviderProps>;
|
|
10
|
+
declare const useNewFeedbackExperiment: () => NewFeedbackExperimentVariation;
|
|
11
|
+
export { useNewFeedbackExperiment, NewFeedbackExperimentProvider, NewFeedbackExperimentVariation };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { createContext, useContext, useEffect, useMemo, useRef } from "react";
|
|
2
|
+
import invariant from "tiny-invariant";
|
|
3
|
+
import { Spinner } from "@lookiero/aurora";
|
|
4
|
+
import { useAssignedVariationByExperimentId } from "@lookiero/sty-psp-ab-testing";
|
|
5
|
+
import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
6
|
+
import { useTrackAssignedVariationByExperiment } from "../../tracking/useTrackAssignedVariationByExperiment";
|
|
7
|
+
import { useStaticInfo } from "./useStaticInfo";
|
|
8
|
+
var NewFeedbackExperimentVariation;
|
|
9
|
+
(function (NewFeedbackExperimentVariation) {
|
|
10
|
+
NewFeedbackExperimentVariation["CONTROL"] = "control";
|
|
11
|
+
NewFeedbackExperimentVariation["RETURN_PAGE"] = "return_page";
|
|
12
|
+
})(NewFeedbackExperimentVariation || (NewFeedbackExperimentVariation = {}));
|
|
13
|
+
const NewFeedbackExperimentContext = createContext(null);
|
|
14
|
+
const NewFeedbackExperimentProvider = ({ children }) => {
|
|
15
|
+
const { kameleoon: { experiments: { newFeedback: { id: newFeedbackId, variations }, }, }, customer: { customerId, country, segment }, } = useStaticInfo();
|
|
16
|
+
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
17
|
+
const { assignedVariation: newFeedbackVariation } = useAssignedVariationByExperimentId({
|
|
18
|
+
experimentId: newFeedbackId,
|
|
19
|
+
});
|
|
20
|
+
const trackAssignedVariation = useTrackAssignedVariationByExperiment({
|
|
21
|
+
checkoutId: checkout?.id,
|
|
22
|
+
country,
|
|
23
|
+
segment,
|
|
24
|
+
experimentId: newFeedbackId,
|
|
25
|
+
});
|
|
26
|
+
const value = useMemo(() => ({
|
|
27
|
+
variation: newFeedbackVariation?.id === Number(variations.v1)
|
|
28
|
+
? NewFeedbackExperimentVariation.RETURN_PAGE
|
|
29
|
+
: NewFeedbackExperimentVariation.CONTROL,
|
|
30
|
+
}), [newFeedbackVariation?.id, variations.v1]);
|
|
31
|
+
const assignedVariantTracked = useRef(false);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (assignedVariantTracked.current || !newFeedbackVariation || !checkout?.id) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
trackAssignedVariation({ assignedVariation: newFeedbackVariation });
|
|
37
|
+
assignedVariantTracked.current = true;
|
|
38
|
+
}, [checkout?.id, newFeedbackVariation, trackAssignedVariation]);
|
|
39
|
+
if (!checkout) {
|
|
40
|
+
return React.createElement(Spinner, null);
|
|
41
|
+
}
|
|
42
|
+
return React.createElement(NewFeedbackExperimentContext.Provider, { value: value }, children);
|
|
43
|
+
};
|
|
44
|
+
const useNewFeedbackExperiment = () => {
|
|
45
|
+
const newFeedbackExperiment = useContext(NewFeedbackExperimentContext);
|
|
46
|
+
invariant(newFeedbackExperiment, "Your are trying to use the useNewFeedbackExperiment hook without wrapping your app with the <NewFeedbackExperimentProvider>.");
|
|
47
|
+
return newFeedbackExperiment.variation;
|
|
48
|
+
};
|
|
49
|
+
export { useNewFeedbackExperiment, NewFeedbackExperimentProvider, NewFeedbackExperimentVariation };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
interface CheckoutAccessibilityMiddlewareProps {
|
|
3
|
+
readonly customerId: string | undefined;
|
|
4
|
+
readonly onNotAccessible: () => void;
|
|
5
|
+
readonly loader?: JSX.Element;
|
|
6
|
+
readonly children: JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
declare const CheckoutAccessibilityMiddleware: FC<CheckoutAccessibilityMiddlewareProps>;
|
|
9
|
+
export { CheckoutAccessibilityMiddleware };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import { Spinner } from "@lookiero/aurora";
|
|
3
|
+
import { QueryStatus } from "@lookiero/messaging-react";
|
|
4
|
+
import { useViewIsCheckoutAccessibleByCustomerId } from "../../projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId";
|
|
5
|
+
const CheckoutAccessibilityMiddleware = ({ customerId, onNotAccessible, loader = React.createElement(Spinner, null), children, }) => {
|
|
6
|
+
const [accessible, status] = useViewIsCheckoutAccessibleByCustomerId({ customerId });
|
|
7
|
+
const onNotAccessibleRef = useRef(onNotAccessible);
|
|
8
|
+
onNotAccessibleRef.current = onNotAccessible;
|
|
9
|
+
const notAccessible = accessible === false || status === QueryStatus.ERROR;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (notAccessible) {
|
|
12
|
+
onNotAccessibleRef.current();
|
|
13
|
+
}
|
|
14
|
+
}, [notAccessible]);
|
|
15
|
+
return accessible === undefined && [QueryStatus.IDLE, QueryStatus.LOADING].includes(status)
|
|
16
|
+
? loader
|
|
17
|
+
: accessible
|
|
18
|
+
? children
|
|
19
|
+
: null;
|
|
20
|
+
};
|
|
21
|
+
export { CheckoutAccessibilityMiddleware };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
const { space6, space8 } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
buttonContainer: {
|
|
6
|
+
paddingHorizontal: space6,
|
|
7
|
+
paddingVertical: space8,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
export { style };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
interface ReturnQuestionsFormProps {
|
|
5
|
+
readonly visible: boolean;
|
|
6
|
+
readonly returnQuestions: ReturnQuestionProjection[];
|
|
7
|
+
readonly onSubmit: (feedback: FeedbackProjection) => void;
|
|
8
|
+
readonly onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const ReturnQuestionsForm: FC<ReturnQuestionsFormProps>;
|
|
11
|
+
export { ReturnQuestionsForm };
|
package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PortalHost } from "@gorhom/portal";
|
|
2
|
+
import React, { useCallback } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { Button, Text } from "@lookiero/aurora";
|
|
5
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
|
+
import { Modal } from "@lookiero/sty-psp-ui";
|
|
7
|
+
import { ReturnQuestionType, } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
8
|
+
import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
|
|
9
|
+
import { useReturnQuestionFeedback } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
|
|
10
|
+
import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
11
|
+
import { HostDefaultReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem";
|
|
12
|
+
import { HostSelectReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem";
|
|
13
|
+
import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem";
|
|
14
|
+
import { OptionReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem";
|
|
15
|
+
import { TextareaReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem";
|
|
16
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
17
|
+
import { style } from "./ReturnQuestionsForm.style";
|
|
18
|
+
const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
|
|
19
|
+
const returnQuestionItems = {
|
|
20
|
+
[ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionItem,
|
|
21
|
+
[ReturnQuestionType.HOST_TEXTAREA]: HostDefaultReturnQuestionItem,
|
|
22
|
+
[ReturnQuestionType.HOST_SELECT]: HostSelectReturnQuestionItem,
|
|
23
|
+
[ReturnQuestionType.HOST_STACK]: HostStackReturnQuestionItem,
|
|
24
|
+
[ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
|
|
25
|
+
[ReturnQuestionType.OPTION]: OptionReturnQuestionItem,
|
|
26
|
+
};
|
|
27
|
+
const ReturnQuestionsForm = ({ returnQuestions, visible, onSubmit, onClose }) => {
|
|
28
|
+
const titleText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_TITLE });
|
|
29
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.RETURN_QUESTIONS_SUBMIT_BUTTON });
|
|
30
|
+
const feedback = useReturnQuestionFeedback();
|
|
31
|
+
const handleOnSubmit = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
|
|
32
|
+
return (React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
33
|
+
React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
|
|
34
|
+
React.createElement(Modal, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, testID: "return-questions-form-modal", visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
35
|
+
React.createElement(View, { style: style.modalContent },
|
|
36
|
+
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
37
|
+
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
|
|
38
|
+
React.createElement(Button, { style: style.submit, testID: "return-questions-button", onPress: handleOnSubmit }, submitButtonText)))));
|
|
39
|
+
};
|
|
40
|
+
export { ReturnQuestionsForm };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
const { space6, space8 } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
modalContent: {
|
|
6
|
+
paddingHorizontal: space6,
|
|
7
|
+
},
|
|
8
|
+
submit: {
|
|
9
|
+
marginTop: space8,
|
|
10
|
+
},
|
|
11
|
+
title: {
|
|
12
|
+
marginBottom: space6,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export { style };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
description: {
|
|
3
|
+
color: string;
|
|
4
|
+
};
|
|
5
|
+
desktopInfo: {
|
|
6
|
+
borderTopLeftRadius: number;
|
|
7
|
+
borderTopRightRadius: number;
|
|
8
|
+
};
|
|
9
|
+
desktopLayoutSpacing: {
|
|
10
|
+
paddingVertical: number;
|
|
11
|
+
};
|
|
12
|
+
headerWrapper: {
|
|
13
|
+
display: "flex";
|
|
14
|
+
flexDirection: "column";
|
|
15
|
+
};
|
|
16
|
+
info: {
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
paddingBottom: number;
|
|
19
|
+
paddingHorizontal: number;
|
|
20
|
+
paddingTop: number;
|
|
21
|
+
};
|
|
22
|
+
layout: {
|
|
23
|
+
flex: number;
|
|
24
|
+
justifyContent: "center";
|
|
25
|
+
};
|
|
26
|
+
safeAreaView: {
|
|
27
|
+
backgroundColor: string;
|
|
28
|
+
flex: number;
|
|
29
|
+
};
|
|
30
|
+
scrollView: {
|
|
31
|
+
flex: number;
|
|
32
|
+
};
|
|
33
|
+
submit: {
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
borderBottomLeftRadius: number;
|
|
36
|
+
borderBottomRightRadius: number;
|
|
37
|
+
padding: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export { style };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
description: {
|
|
6
|
+
color: colorTextMedium,
|
|
7
|
+
},
|
|
8
|
+
desktopInfo: {
|
|
9
|
+
borderTopLeftRadius: borderRadius5,
|
|
10
|
+
borderTopRightRadius: borderRadius5,
|
|
11
|
+
},
|
|
12
|
+
desktopLayoutSpacing: {
|
|
13
|
+
paddingVertical: space8,
|
|
14
|
+
},
|
|
15
|
+
headerWrapper: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
},
|
|
19
|
+
info: {
|
|
20
|
+
backgroundColor: colorBgBase,
|
|
21
|
+
paddingBottom: space4,
|
|
22
|
+
paddingHorizontal: space6,
|
|
23
|
+
paddingTop: space8,
|
|
24
|
+
},
|
|
25
|
+
layout: {
|
|
26
|
+
flex: 1,
|
|
27
|
+
justifyContent: "center",
|
|
28
|
+
},
|
|
29
|
+
safeAreaView: {
|
|
30
|
+
backgroundColor: colorBgPrimaryLight,
|
|
31
|
+
flex: 1,
|
|
32
|
+
},
|
|
33
|
+
scrollView: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
},
|
|
36
|
+
submit: {
|
|
37
|
+
backgroundColor: colorBgBase,
|
|
38
|
+
borderBottomLeftRadius: borderRadius5,
|
|
39
|
+
borderBottomRightRadius: borderRadius5,
|
|
40
|
+
padding: space6,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export { style };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { LayoutRectangle } from "react-native";
|
|
3
|
+
import { PricingProjection } from "../../../../../../projection/pricing/pricing";
|
|
4
|
+
interface StickyPricingProps {
|
|
5
|
+
readonly pricing: PricingProjection;
|
|
6
|
+
readonly totalCheckoutItemsKept: number;
|
|
7
|
+
readonly collapsed: boolean;
|
|
8
|
+
readonly onPress: () => void;
|
|
9
|
+
readonly onSubmit: () => void;
|
|
10
|
+
readonly onLayout?: ({ width, height }: LayoutRectangle) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const StickyPricing: FC<StickyPricingProps>;
|
|
13
|
+
export { StickyPricing };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
3
|
+
import { Body } from "../../../../components/layouts/body/Body";
|
|
4
|
+
import { Pricing } from "../pricing/Pricing";
|
|
5
|
+
import { style } from "./StickyPricing.style";
|
|
6
|
+
const StickyPricing = ({ pricing, totalCheckoutItemsKept, collapsed, onPress, onSubmit, onLayout, }) => (React.createElement(Sticky, { style: style.sticky, onLayout: onLayout },
|
|
7
|
+
React.createElement(Body, null,
|
|
8
|
+
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: collapsed, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onPress: onPress, onSubmit: onSubmit }))));
|
|
9
|
+
export { StickyPricing };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
+
type IsCheckoutAccessibleByCustomerIdProjection = boolean;
|
|
3
|
+
declare const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
4
|
+
interface ViewIsCheckoutAccessibleByCustomerIdPayload {
|
|
5
|
+
readonly customerId: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
interface ViewIsCheckoutAccessibleByCustomerId extends Query<typeof VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID>, ViewIsCheckoutAccessibleByCustomerIdPayload {
|
|
8
|
+
}
|
|
9
|
+
interface ViewIsCheckoutAccessibleByCustomerIdFunction {
|
|
10
|
+
(payload: ViewIsCheckoutAccessibleByCustomerIdPayload): ViewIsCheckoutAccessibleByCustomerId;
|
|
11
|
+
}
|
|
12
|
+
declare const viewIsCheckoutAccessibleByCustomerId: ViewIsCheckoutAccessibleByCustomerIdFunction;
|
|
13
|
+
interface ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
14
|
+
}
|
|
15
|
+
declare const viewIsCheckoutAccessibleByCustomerIdHandler: QueryHandlerFunction<ViewIsCheckoutAccessibleByCustomerId, IsCheckoutAccessibleByCustomerIdProjection, ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs>;
|
|
16
|
+
export type { IsCheckoutAccessibleByCustomerIdProjection };
|
|
17
|
+
export { VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerId, viewIsCheckoutAccessibleByCustomerIdHandler, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { query } from "@lookiero/messaging";
|
|
2
|
+
import { viewFirstAvailableCheckoutByCustomerId } from "./viewFirstAvailableCheckoutByCustomerId";
|
|
3
|
+
import { viewIsCheckoutEnabledByCustomerId } from "./viewIsCheckoutEnabledByCustomerId";
|
|
4
|
+
const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
5
|
+
const viewIsCheckoutAccessibleByCustomerId = (payload) => ({
|
|
6
|
+
...query({ name: VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID }),
|
|
7
|
+
...payload,
|
|
8
|
+
});
|
|
9
|
+
const isNonEmptyCustomerId = (customerId) => Boolean(customerId);
|
|
10
|
+
const viewIsCheckoutAccessibleByCustomerIdHandler = ({ queryBus }) => async ({ customerId }) => isNonEmptyCustomerId(customerId) &&
|
|
11
|
+
Boolean(await queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId }))) &&
|
|
12
|
+
Boolean(await queryBus(viewIsCheckoutEnabledByCustomerId({ customerId })));
|
|
13
|
+
export { VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerId, viewIsCheckoutAccessibleByCustomerIdHandler, };
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "7.0.
|
|
1
|
+
export declare const VERSION = "7.2.0-beta.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "7.0.
|
|
1
|
+
export const VERSION = "7.2.0-beta.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.2.0-beta.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@lookiero/messaging-react": "^8.1.1",
|
|
18
18
|
"@lookiero/sty-psp-ab-testing": "^0.2.2",
|
|
19
19
|
"@lookiero/sty-psp-expo-config": "^0.1.0",
|
|
20
|
-
"@lookiero/sty-psp-http": "^0.
|
|
20
|
+
"@lookiero/sty-psp-http": "^2.0.0",
|
|
21
21
|
"@lookiero/sty-psp-i18n": "^0.1.7",
|
|
22
22
|
"@lookiero/sty-psp-locale": "^0.2.1",
|
|
23
23
|
"@lookiero/sty-psp-logging": "^0.2.2",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@lookiero/sty-psp-react-native": "^0.2.0",
|
|
26
26
|
"@lookiero/sty-psp-segment": "^0.1.1",
|
|
27
27
|
"@lookiero/sty-psp-storage": "^0.1.3",
|
|
28
|
-
"@lookiero/sty-psp-tracking": "^0.1.
|
|
28
|
+
"@lookiero/sty-psp-tracking": "^0.1.7-beta.0",
|
|
29
29
|
"@lookiero/sty-psp-ui": "^0.5.5",
|
|
30
30
|
"@lookiero/sty-psp-ui-settings": "^0.1.1",
|
|
31
31
|
"@lookiero/sty-psp-units": "^0.1.1",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
1
2
|
import { BuildBootstrapFunctionReturn } from "@lookiero/messaging-react";
|
|
2
3
|
import { fetchHttpGet, fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
4
|
+
import { VERSION } from "../../version";
|
|
3
5
|
import { getCheckout, saveCheckout } from "../domain/checkout/model/httpCheckouts";
|
|
4
6
|
import { getCheckoutBooking, saveCheckoutBooking } from "../domain/checkoutBooking/model/httpCheckoutBookings";
|
|
5
7
|
import { getCheckoutFeedback, saveCheckoutFeedback } from "../domain/checkoutFeedback/model/httpCheckoutFeedbacks";
|
|
@@ -21,6 +23,10 @@ import { httpReturnQuestionsByCheckoutItemIdView } from "../projection/returnQue
|
|
|
21
23
|
import { storageUiSettingByKeyView } from "../projection/uiSetting/storageUiSettingByKeyView";
|
|
22
24
|
import { baseBootstrap } from "./baseBootstrap";
|
|
23
25
|
|
|
26
|
+
type OS = typeof Platform.OS;
|
|
27
|
+
type Device = Exclude<OS, "macos" | "windows">;
|
|
28
|
+
const device = Platform.OS as Device;
|
|
29
|
+
|
|
24
30
|
interface BootstrapFunctionArgs {
|
|
25
31
|
readonly getAuthToken: () => Promise<string>;
|
|
26
32
|
readonly apiUrl: () => string;
|
|
@@ -31,8 +37,8 @@ interface BootstrapFunction {
|
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken }) => {
|
|
34
|
-
const httpGet = fetchHttpGet({ apiUrl, getAuthToken });
|
|
35
|
-
const httpPost = fetchHttpPost({ apiUrl, getAuthToken });
|
|
40
|
+
const httpGet = fetchHttpGet({ apiUrl, getAuthToken, device, version: VERSION });
|
|
41
|
+
const httpPost = fetchHttpPost({ apiUrl, getAuthToken, device, version: VERSION });
|
|
36
42
|
|
|
37
43
|
return baseBootstrap({
|
|
38
44
|
checkoutByIdView: httpCheckoutByIdView({ httpPost }),
|
|
@@ -47,6 +47,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewBookedProductVariantsForCheckoutItem API", (
|
|
|
47
47
|
const httpPost = fetchHttpPost({
|
|
48
48
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
49
49
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
50
|
+
device: "web",
|
|
51
|
+
version: "1.0.0",
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
const response = await httpBookedProductsVariantsForCheckoutItemView({ httpPost })({
|
|
@@ -8,7 +8,7 @@ const fetchMock = jest.fn();
|
|
|
8
8
|
global.fetch = fetchMock;
|
|
9
9
|
const apiUrl = "/api";
|
|
10
10
|
const getAuthToken = () => Promise.resolve("token");
|
|
11
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
11
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
12
12
|
const signal = mock<AbortSignal>();
|
|
13
13
|
|
|
14
14
|
const checkoutItemId = "6f720954-8039-4bed-9596-34fc5a02131b";
|
|
@@ -86,6 +86,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutById API", () => {
|
|
|
86
86
|
const httpPost = fetchHttpPost({
|
|
87
87
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
88
88
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
89
|
+
device: "web",
|
|
90
|
+
version: "1.0.0",
|
|
89
91
|
});
|
|
90
92
|
|
|
91
93
|
const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
@@ -114,6 +116,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutById API", () => {
|
|
|
114
116
|
const httpPost = fetchHttpPost({
|
|
115
117
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
116
118
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
119
|
+
device: "web",
|
|
120
|
+
version: "1.0.0",
|
|
117
121
|
});
|
|
118
122
|
|
|
119
123
|
const response = await httpCheckoutByIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
@@ -9,7 +9,7 @@ const fetchMock = jest.fn();
|
|
|
9
9
|
global.fetch = fetchMock;
|
|
10
10
|
const apiUrl = "/api";
|
|
11
11
|
const getAuthToken = () => Promise.resolve("token");
|
|
12
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
12
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
13
13
|
const signal = mock<AbortSignal>();
|
|
14
14
|
|
|
15
15
|
const checkoutId = "29790d24-b139-4ab8-b618-d796d101e974";
|
package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts
CHANGED
|
@@ -48,6 +48,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewFirstAvailableCheckoutByCustomerId API", ()
|
|
|
48
48
|
const httpPost = fetchHttpPost({
|
|
49
49
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
50
50
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
51
|
+
device: "web",
|
|
52
|
+
version: "1.0.0",
|
|
51
53
|
});
|
|
52
54
|
|
|
53
55
|
const response = await httpFirstAvailableCheckoutByCustomerIdView({ httpPost })({
|
package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.test.ts
CHANGED
|
@@ -9,7 +9,7 @@ const fetchMock = jest.fn();
|
|
|
9
9
|
global.fetch = fetchMock;
|
|
10
10
|
const apiUrl = "/api";
|
|
11
11
|
const getAuthToken = () => Promise.resolve("token");
|
|
12
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
12
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
13
13
|
const signal = mock<AbortSignal>();
|
|
14
14
|
|
|
15
15
|
const customerId = "29790d24-b139-4ab8-b618-d796d101e974";
|
package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts
CHANGED
|
@@ -42,6 +42,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewFiveItemsDiscountByCustomerId API", () => {
|
|
|
42
42
|
const httpGet = fetchHttpGet({
|
|
43
43
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
44
44
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
45
|
+
device: "web",
|
|
46
|
+
version: "1.0.0",
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
const response = await httpFiveItemsDiscountByCustomerIdView({ httpGet })({
|
package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ const fetchMock = jest.fn();
|
|
|
6
6
|
global.fetch = fetchMock;
|
|
7
7
|
const apiUrl = "/api";
|
|
8
8
|
const getAuthToken = () => Promise.resolve("token");
|
|
9
|
-
const view = sut({ httpGet: fetchHttpGet({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
9
|
+
const view = sut({ httpGet: fetchHttpGet({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
10
10
|
const signal = mock<AbortSignal>();
|
|
11
11
|
|
|
12
12
|
const customerId = "29790d24-b139-4ab8-b618-d796d101e974";
|
package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts
CHANGED
|
@@ -42,6 +42,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewIsCheckoutEnabledByCustomerId API", () => {
|
|
|
42
42
|
const httpGet = fetchHttpGet({
|
|
43
43
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
44
44
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
45
|
+
device: "web",
|
|
46
|
+
version: "1.0.0",
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
const response = await httpIsCheckoutEnabledByCustomerIdView({ httpGet })({
|
package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ const fetchMock = jest.fn();
|
|
|
6
6
|
global.fetch = fetchMock;
|
|
7
7
|
const apiUrl = "/api";
|
|
8
8
|
const getAuthToken = () => Promise.resolve("token");
|
|
9
|
-
const view = sut({ httpGet: fetchHttpGet({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
9
|
+
const view = sut({ httpGet: fetchHttpGet({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
10
10
|
const signal = mock<AbortSignal>();
|
|
11
11
|
|
|
12
12
|
const customerId = "29790d24-b139-4ab8-b618-d796d101e974";
|
package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts
CHANGED
|
@@ -42,6 +42,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewIsSizeChangeEnabledByCheckoutId API", () =>
|
|
|
42
42
|
const httpGet = fetchHttpGet({
|
|
43
43
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
44
44
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
45
|
+
device: "web",
|
|
46
|
+
version: "1.0.0",
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
const response = await httpIsSizeChangeEnabledByCheckoutIdView({ httpGet })({
|
package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ const fetchMock = jest.fn();
|
|
|
6
6
|
global.fetch = fetchMock;
|
|
7
7
|
const apiUrl = "/api";
|
|
8
8
|
const getAuthToken = () => Promise.resolve("token");
|
|
9
|
-
const view = sut({ httpGet: fetchHttpGet({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
9
|
+
const view = sut({ httpGet: fetchHttpGet({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
10
10
|
const signal = mock<AbortSignal>();
|
|
11
11
|
|
|
12
12
|
const checkoutId = "29790d24-b139-4ab8-b618-d796d101e974";
|
|
@@ -48,6 +48,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutBookingById API", () => {
|
|
|
48
48
|
const httpPost = fetchHttpPost({
|
|
49
49
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
50
50
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
51
|
+
device: "web",
|
|
52
|
+
version: "1.0.0",
|
|
51
53
|
});
|
|
52
54
|
|
|
53
55
|
const response = await httpCheckoutBookingByIdView({ httpPost })({
|
|
@@ -8,7 +8,7 @@ const fetchMock = jest.fn();
|
|
|
8
8
|
global.fetch = fetchMock;
|
|
9
9
|
const apiUrl = "/api";
|
|
10
10
|
const getAuthToken = () => Promise.resolve("token");
|
|
11
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
11
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
12
12
|
const signal = mock<AbortSignal>();
|
|
13
13
|
|
|
14
14
|
const checkoutBookingProjection = checkoutBookingMock;
|
|
@@ -49,6 +49,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewCheckoutItemById API", () => {
|
|
|
49
49
|
const httpPost = fetchHttpPost({
|
|
50
50
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
51
51
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
52
|
+
device: "web",
|
|
53
|
+
version: "1.0.0",
|
|
52
54
|
});
|
|
53
55
|
|
|
54
56
|
const response = await httpCheckoutItemByIdView({ httpPost })({
|
|
@@ -9,7 +9,7 @@ const fetchMock = jest.fn();
|
|
|
9
9
|
global.fetch = fetchMock;
|
|
10
10
|
const apiUrl = "/api";
|
|
11
11
|
const getAuthToken = () => Promise.resolve("token");
|
|
12
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
12
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
13
13
|
const signal = mock<AbortSignal>();
|
|
14
14
|
|
|
15
15
|
const checkoutItemId = "29790d24-b139-4ab8-b618-d796d101e974";
|
package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts
CHANGED
|
@@ -47,6 +47,8 @@ describe("STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId API", () => {
|
|
|
47
47
|
const httpPost = fetchHttpPost({
|
|
48
48
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
49
49
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
50
|
+
device: "web",
|
|
51
|
+
version: "1.0.0",
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
const response = await httpCheckoutQuestionsByCheckoutIdView({ httpPost })({
|
package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.test.ts
CHANGED
|
@@ -8,7 +8,7 @@ const fetchMock = jest.fn();
|
|
|
8
8
|
global.fetch = fetchMock;
|
|
9
9
|
const apiUrl = "/api";
|
|
10
10
|
const getAuthToken = () => Promise.resolve("token");
|
|
11
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
11
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
12
12
|
const signal = mock<AbortSignal>();
|
|
13
13
|
|
|
14
14
|
const checkoutId = "29790d24-b139-4ab8-b618-d796d101e974";
|
package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts
CHANGED
|
@@ -64,6 +64,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
|
|
|
64
64
|
const httpPost = fetchHttpPost({
|
|
65
65
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
66
66
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
67
|
+
device: "web",
|
|
68
|
+
version: "1.0.0",
|
|
67
69
|
});
|
|
68
70
|
|
|
69
71
|
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
@@ -92,6 +94,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
|
|
|
92
94
|
const httpPost = fetchHttpPost({
|
|
93
95
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
94
96
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
97
|
+
device: "web",
|
|
98
|
+
version: "1.0.0",
|
|
95
99
|
});
|
|
96
100
|
|
|
97
101
|
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
@@ -120,6 +124,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
|
|
|
120
124
|
const httpPost = fetchHttpPost({
|
|
121
125
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
122
126
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
127
|
+
device: "web",
|
|
128
|
+
version: "1.0.0",
|
|
123
129
|
});
|
|
124
130
|
|
|
125
131
|
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.test.ts
CHANGED
|
@@ -8,7 +8,7 @@ const fetchMock = jest.fn();
|
|
|
8
8
|
global.fetch = fetchMock;
|
|
9
9
|
const apiUrl = "/api";
|
|
10
10
|
const getAuthToken = () => Promise.resolve("token");
|
|
11
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
11
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
12
12
|
const signal = mock<AbortSignal>();
|
|
13
13
|
|
|
14
14
|
const checkoutId = "29790d24-b139-4ab8-b618-d796d101e974";
|
|
@@ -47,6 +47,8 @@ describe("STY-BOX_CHECKOUT-BACK_ViewPricingByCheckoutId API", () => {
|
|
|
47
47
|
const httpPost = fetchHttpPost({
|
|
48
48
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
49
49
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
50
|
+
device: "web",
|
|
51
|
+
version: "1.0.0",
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
const response = await httpPricingByCheckoutIdView({ httpPost })({
|
|
@@ -8,7 +8,7 @@ const fetchMock = jest.fn();
|
|
|
8
8
|
global.fetch = fetchMock;
|
|
9
9
|
const apiUrl = "/api";
|
|
10
10
|
const getAuthToken = () => Promise.resolve("token");
|
|
11
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
11
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
12
12
|
const signal = mock<AbortSignal>();
|
|
13
13
|
|
|
14
14
|
const checkoutId = "29790d24-b139-4ab8-b618-d796d101e974";
|
package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts
CHANGED
|
@@ -47,6 +47,8 @@ describe("STY-BOX_CHECKOUT-BACK_ListReturnQuestionsByCheckoutItemId API", () =>
|
|
|
47
47
|
const httpPost = fetchHttpPost({
|
|
48
48
|
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
49
49
|
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
50
|
+
device: "web",
|
|
51
|
+
version: "1.0.0",
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
const response = await httpReturnQuestionsByCheckoutItemIdView({ httpPost })({
|
package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.test.ts
CHANGED
|
@@ -8,7 +8,7 @@ const fetchMock = jest.fn();
|
|
|
8
8
|
global.fetch = fetchMock;
|
|
9
9
|
const apiUrl = "/api";
|
|
10
10
|
const getAuthToken = () => Promise.resolve("token");
|
|
11
|
-
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken }) });
|
|
11
|
+
const view = sut({ httpPost: fetchHttpPost({ apiUrl: () => apiUrl, getAuthToken, device: "web", version: "1.0.0" }) });
|
|
12
12
|
const signal = mock<AbortSignal>();
|
|
13
13
|
|
|
14
14
|
const checkoutItemId = "29790d24-b139-4ab8-b618-d796d101e974";
|