@lookiero/checkout 0.2.11 → 0.2.13
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/domain/checkout/command/startCheckout.d.ts +2 -1
- package/dist/domain/checkout/model/checkout.d.ts +2 -1
- package/dist/domain/checkout/model/checkouts.d.ts +1 -1
- package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.d.ts +2 -1
- package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.js +1 -1
- package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +2 -1
- package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +2 -1
- package/dist/domain/checkoutBooking/model/checkoutBookings.d.ts +1 -1
- package/dist/domain/checkoutItem/command/keepCheckoutItem.d.ts +13 -0
- package/dist/domain/checkoutItem/command/keepCheckoutItem.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItem.d.ts +15 -0
- package/dist/domain/checkoutItem/model/checkoutItem.js +20 -0
- package/dist/domain/checkoutItem/model/checkoutItemKept.d.ts +13 -0
- package/dist/domain/checkoutItem/model/checkoutItemKept.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItems.d.ts +7 -0
- package/dist/domain/checkoutItem/model/checkoutItems.js +1 -0
- package/dist/domain/uiSetting/command/updateUiSetting.d.ts +2 -1
- package/dist/domain/uiSetting/model/uiSetting.d.ts +2 -1
- package/dist/domain/uiSetting/model/uiSettingUpdated.d.ts +2 -1
- package/dist/domain/uiSetting/model/uiSettings.d.ts +1 -1
- package/dist/infrastructure/delivery/baseBootstrap.d.ts +11 -2
- package/dist/infrastructure/delivery/baseBootstrap.js +11 -4
- package/dist/infrastructure/delivery/bootstrap.js +6 -0
- package/dist/infrastructure/delivery/bootstrap.mock.js +20 -38
- package/dist/infrastructure/delivery/http/httpClient.d.ts +1 -1
- package/dist/infrastructure/delivery/mock/checkoutDataSource.d.ts +17 -0
- package/dist/infrastructure/delivery/mock/checkoutDataSource.js +18 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutItems.d.ts +14 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutItems.js +21 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckouts.d.ts +11 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckouts.js +27 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsStart.js +1 -2
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItems.d.ts +16 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItems.js +17 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsKeep.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsKeep.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.d.ts +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.js +12 -0
- package/dist/infrastructure/persistence/storage.d.ts +1 -1
- package/dist/infrastructure/persistence/uiSettingData.d.ts +1 -1
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.d.ts +2 -1
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.js +1 -1
- package/dist/infrastructure/projection/checkout/checkout.d.ts +3 -38
- package/dist/infrastructure/projection/checkout/checkout.mock.d.ts +2 -1
- package/dist/infrastructure/projection/checkout/checkout.mock.js +1 -33
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.d.ts +44 -0
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.js +39 -0
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +18 -0
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.mock.js +37 -0
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.js +12 -0
- package/dist/infrastructure/ui/Root.d.ts +2 -1
- package/dist/infrastructure/ui/components/atoms/price/Price.d.ts +1 -1
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +1 -1
- package/dist/infrastructure/ui/views/item/Item.js +1 -3
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.d.ts +1 -1
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +1 -1
- package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.d.ts +1 -1
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.d.ts +1 -1
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.d.ts +1 -1
- package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +2 -1
- package/dist/projection/checkout/checkout.d.ts +2 -68
- package/dist/projection/checkout/checkout.js +1 -29
- package/dist/projection/checkout/viewFiveItemsDiscountByCustomerId.d.ts +2 -1
- package/dist/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +2 -1
- package/dist/projection/checkout/viewIsCheckoutEnabledByCustomerId.d.ts +2 -1
- package/dist/projection/checkoutItem/checkoutItem.d.ts +62 -0
- package/dist/projection/checkoutItem/checkoutItem.js +21 -0
- package/dist/projection/checkoutItem/viewCheckoutItemById.d.ts +25 -0
- package/dist/projection/checkoutItem/viewCheckoutItemById.js +8 -0
- package/dist/projection/uiSetting/viewUiSettingByKey.d.ts +2 -1
- package/dist/projection/uiSetting/viewUiSettingByKey.js +1 -1
- package/package.json +9 -10
|
@@ -33,4 +33,5 @@ interface HttpBookedSizeReplaceableProductVariantsForCheckoutItemViewFunction {
|
|
|
33
33
|
(args: HttpBookedSizeReplaceableProductVariantsForCheckoutItemViewFunctionArgs): HttpBookedSizeReplaceableProductVariantsForCheckoutItemView;
|
|
34
34
|
}
|
|
35
35
|
declare const httpBookedSizeReplaceableProductVariantsForCheckoutItemView: HttpBookedSizeReplaceableProductVariantsForCheckoutItemViewFunction;
|
|
36
|
-
export { BookedSizeReplaceableProductVariantsDto
|
|
36
|
+
export type { BookedSizeReplaceableProductVariantsDto };
|
|
37
|
+
export { toBookedSizeReplaceableProductVariants, httpBookedSizeReplaceableProductVariantsForCheckoutItemView };
|
|
@@ -23,4 +23,4 @@ const httpBookedSizeReplaceableProductVariantsForCheckoutItemView = ({ httpPost
|
|
|
23
23
|
? undefined
|
|
24
24
|
: toBookedSizeReplaceableProductVariants((await response.json()).result);
|
|
25
25
|
};
|
|
26
|
-
export { toBookedSizeReplaceableProductVariants, httpBookedSizeReplaceableProductVariantsForCheckoutItemView
|
|
26
|
+
export { toBookedSizeReplaceableProductVariants, httpBookedSizeReplaceableProductVariantsForCheckoutItemView };
|
|
@@ -1,41 +1,6 @@
|
|
|
1
1
|
import { CheckoutStatus } from "../../../domain/checkout/model/checkout";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly status: CheckoutItemStatus;
|
|
6
|
-
readonly product_variant: {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly media: {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly url: string;
|
|
11
|
-
readonly perspective: MediaPerspective;
|
|
12
|
-
}[];
|
|
13
|
-
readonly brand: string;
|
|
14
|
-
readonly name: string;
|
|
15
|
-
readonly price: {
|
|
16
|
-
readonly amount: number;
|
|
17
|
-
readonly currency: Currency;
|
|
18
|
-
readonly discounted_price?: {
|
|
19
|
-
readonly amount: number;
|
|
20
|
-
readonly percentage: number;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
readonly size: {
|
|
24
|
-
readonly id: string;
|
|
25
|
-
readonly lookiero: string;
|
|
26
|
-
readonly uk: string;
|
|
27
|
-
readonly it: string;
|
|
28
|
-
readonly europe: string;
|
|
29
|
-
readonly unique: boolean;
|
|
30
|
-
readonly visual_order?: number;
|
|
31
|
-
};
|
|
32
|
-
readonly color: {
|
|
33
|
-
readonly id: string;
|
|
34
|
-
readonly label: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
readonly replaced_for?: string;
|
|
38
|
-
}
|
|
2
|
+
import { CheckoutProjection } from "../../../projection/checkout/checkout";
|
|
3
|
+
import { CheckoutItemDto } from "../checkoutItem/checkoutItem";
|
|
39
4
|
interface CheckoutDto {
|
|
40
5
|
readonly id: string;
|
|
41
6
|
readonly customer_id: string;
|
|
@@ -49,5 +14,5 @@ interface ToCheckoutProjectionFunction {
|
|
|
49
14
|
(checkoutDto: CheckoutDto): CheckoutProjection;
|
|
50
15
|
}
|
|
51
16
|
declare const toCheckoutProjection: ToCheckoutProjectionFunction;
|
|
52
|
-
export type { CheckoutDto
|
|
17
|
+
export type { CheckoutDto };
|
|
53
18
|
export { toCheckoutProjection };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CheckoutItemStatus
|
|
1
|
+
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
2
|
+
import { CheckoutProjection } from "../../../projection/checkout/checkout";
|
|
2
3
|
import { CheckoutDto } from "./checkout";
|
|
3
4
|
interface StartedCheckoutWithStatusDtoFunctionArgs {
|
|
4
5
|
readonly status: CheckoutItemStatus[];
|
|
@@ -1,39 +1,7 @@
|
|
|
1
1
|
import { v4 as uuid } from "uuid";
|
|
2
2
|
import { CheckoutStatus } from "../../../domain/checkout/model/checkout";
|
|
3
|
-
import {
|
|
3
|
+
import { checkoutItemDto } from "../checkoutItem/checkoutItem.mock";
|
|
4
4
|
import { toCheckoutProjection } from "./checkout";
|
|
5
|
-
const checkoutItemDto = ({ status }) => ({
|
|
6
|
-
id: uuid(),
|
|
7
|
-
status,
|
|
8
|
-
product_variant: {
|
|
9
|
-
id: uuid(),
|
|
10
|
-
media: [
|
|
11
|
-
{
|
|
12
|
-
id: uuid(),
|
|
13
|
-
url: "https://cdn-catalog-back-prod.envs.lookiero.tech/d2/65/d2655b80-7745-4537-bb17-eb38f960a8de.jpg",
|
|
14
|
-
perspective: MediaPerspective.FRONT,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
brand: "CKS",
|
|
18
|
-
name: "Sari Tshirt lines",
|
|
19
|
-
price: {
|
|
20
|
-
amount: 3999,
|
|
21
|
-
currency: Currency.EUR,
|
|
22
|
-
},
|
|
23
|
-
size: {
|
|
24
|
-
id: uuid(),
|
|
25
|
-
lookiero: "M",
|
|
26
|
-
uk: "M",
|
|
27
|
-
it: "M",
|
|
28
|
-
europe: "M",
|
|
29
|
-
unique: false,
|
|
30
|
-
},
|
|
31
|
-
color: {
|
|
32
|
-
id: uuid(),
|
|
33
|
-
label: "black_C2",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
5
|
const checkoutWithItemsDto = ({ items }) => ({
|
|
38
6
|
id: uuid(),
|
|
39
7
|
status: CheckoutStatus.STARTED,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
2
|
+
import { CheckoutItemProjection, Currency, MediaPerspective } from "../../../projection/checkoutItem/checkoutItem";
|
|
3
|
+
interface CheckoutItemDto {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly status: CheckoutItemStatus;
|
|
6
|
+
readonly product_variant: {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly media: {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly url: string;
|
|
11
|
+
readonly perspective: MediaPerspective;
|
|
12
|
+
}[];
|
|
13
|
+
readonly brand: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly price: {
|
|
16
|
+
readonly amount: number;
|
|
17
|
+
readonly currency: Currency;
|
|
18
|
+
readonly discounted_price?: {
|
|
19
|
+
readonly amount: number;
|
|
20
|
+
readonly percentage: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly size: {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly lookiero: string;
|
|
26
|
+
readonly uk: string;
|
|
27
|
+
readonly it: string;
|
|
28
|
+
readonly europe: string;
|
|
29
|
+
readonly unique: boolean;
|
|
30
|
+
readonly visual_order?: number;
|
|
31
|
+
};
|
|
32
|
+
readonly color: {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly label: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly replaced_for?: string;
|
|
38
|
+
}
|
|
39
|
+
interface ToCheckoutItemProjectionFunction {
|
|
40
|
+
(checkoutItemDto: CheckoutItemDto): CheckoutItemProjection;
|
|
41
|
+
}
|
|
42
|
+
declare const toCheckoutItemProjection: ToCheckoutItemProjectionFunction;
|
|
43
|
+
export type { CheckoutItemDto };
|
|
44
|
+
export { toCheckoutItemProjection };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const toCheckoutItemProjection = (checkoutItemDto) => ({
|
|
2
|
+
id: checkoutItemDto.id,
|
|
3
|
+
status: checkoutItemDto.status,
|
|
4
|
+
replacedFor: checkoutItemDto.replaced_for,
|
|
5
|
+
productVariant: {
|
|
6
|
+
id: checkoutItemDto.product_variant.id,
|
|
7
|
+
media: checkoutItemDto.product_variant.media.map((media) => ({
|
|
8
|
+
id: media.id,
|
|
9
|
+
url: media.url,
|
|
10
|
+
perspective: media.perspective,
|
|
11
|
+
})),
|
|
12
|
+
brand: checkoutItemDto.product_variant.brand,
|
|
13
|
+
name: checkoutItemDto.product_variant.name,
|
|
14
|
+
price: {
|
|
15
|
+
amount: checkoutItemDto.product_variant.price.amount,
|
|
16
|
+
currency: checkoutItemDto.product_variant.price.currency,
|
|
17
|
+
discountedPrice: checkoutItemDto.product_variant.price.discounted_price
|
|
18
|
+
? {
|
|
19
|
+
amount: checkoutItemDto.product_variant.price.discounted_price.amount,
|
|
20
|
+
percentage: checkoutItemDto.product_variant.price.discounted_price.percentage,
|
|
21
|
+
}
|
|
22
|
+
: undefined,
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
id: checkoutItemDto.product_variant.size.id,
|
|
26
|
+
lookiero: checkoutItemDto.product_variant.size.lookiero,
|
|
27
|
+
uk: checkoutItemDto.product_variant.size.uk,
|
|
28
|
+
it: checkoutItemDto.product_variant.size.it,
|
|
29
|
+
europe: checkoutItemDto.product_variant.size.europe,
|
|
30
|
+
unique: checkoutItemDto.product_variant.size.unique,
|
|
31
|
+
visualOrder: checkoutItemDto.product_variant.size.visual_order,
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
id: checkoutItemDto.product_variant.color.id,
|
|
35
|
+
label: checkoutItemDto.product_variant.color.label,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
export { toCheckoutItemProjection };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
2
|
+
import { CheckoutItemProjection } from "../../../projection/checkoutItem/checkoutItem";
|
|
3
|
+
import { CheckoutItemDto } from "./checkoutItem";
|
|
4
|
+
interface CheckoutItemDtoFunctionArgs {
|
|
5
|
+
readonly status: CheckoutItemStatus;
|
|
6
|
+
}
|
|
7
|
+
interface CheckoutItemDtoFunction {
|
|
8
|
+
(args: CheckoutItemDtoFunctionArgs): CheckoutItemDto;
|
|
9
|
+
}
|
|
10
|
+
declare const checkoutItemDto: CheckoutItemDtoFunction;
|
|
11
|
+
interface CheckoutItemProjectionFunctionArgs {
|
|
12
|
+
readonly status: CheckoutItemStatus;
|
|
13
|
+
}
|
|
14
|
+
interface CheckoutItemProjectionFunction {
|
|
15
|
+
(args: CheckoutItemProjectionFunctionArgs): CheckoutItemProjection;
|
|
16
|
+
}
|
|
17
|
+
declare const checkoutItemProjection: CheckoutItemProjectionFunction;
|
|
18
|
+
export { checkoutItemDto, checkoutItemProjection };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { v4 as uuid } from "uuid";
|
|
2
|
+
import { Currency, MediaPerspective } from "../../../projection/checkoutItem/checkoutItem";
|
|
3
|
+
import { toCheckoutItemProjection } from "./checkoutItem";
|
|
4
|
+
const checkoutItemDto = ({ status }) => ({
|
|
5
|
+
id: uuid(),
|
|
6
|
+
status,
|
|
7
|
+
product_variant: {
|
|
8
|
+
id: uuid(),
|
|
9
|
+
media: [
|
|
10
|
+
{
|
|
11
|
+
id: uuid(),
|
|
12
|
+
url: "https://cdn-catalog-back-prod.envs.lookiero.tech/d2/65/d2655b80-7745-4537-bb17-eb38f960a8de.jpg",
|
|
13
|
+
perspective: MediaPerspective.FRONT,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
brand: "CKS",
|
|
17
|
+
name: "Sari Tshirt lines",
|
|
18
|
+
price: {
|
|
19
|
+
amount: 3999,
|
|
20
|
+
currency: Currency.EUR,
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
id: uuid(),
|
|
24
|
+
lookiero: "M",
|
|
25
|
+
uk: "M",
|
|
26
|
+
it: "M",
|
|
27
|
+
europe: "M",
|
|
28
|
+
unique: false,
|
|
29
|
+
},
|
|
30
|
+
color: {
|
|
31
|
+
id: uuid(),
|
|
32
|
+
label: "black_C2",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const checkoutItemProjection = ({ status }) => toCheckoutItemProjection(checkoutItemDto({ status }));
|
|
37
|
+
export { checkoutItemDto, checkoutItemProjection };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CheckoutItemByIdView } from "../../../projection/checkoutItem/viewCheckoutItemById";
|
|
2
|
+
import { HttpPostFunction } from "../../delivery/http/httpClient";
|
|
3
|
+
interface HttpCheckoutItemByIdView extends CheckoutItemByIdView {
|
|
4
|
+
}
|
|
5
|
+
interface HttpCheckoutItemByIdViewFunctionArgs {
|
|
6
|
+
readonly httpPost: HttpPostFunction;
|
|
7
|
+
}
|
|
8
|
+
interface HttpCheckoutItemByIdViewFunction {
|
|
9
|
+
(args: HttpCheckoutItemByIdViewFunctionArgs): HttpCheckoutItemByIdView;
|
|
10
|
+
}
|
|
11
|
+
declare const httpCheckoutItemByIdView: HttpCheckoutItemByIdViewFunction;
|
|
12
|
+
export { httpCheckoutItemByIdView };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { toCheckoutItemProjection } from "./checkoutItem";
|
|
2
|
+
const httpCheckoutItemByIdView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
|
|
3
|
+
const response = await httpPost({
|
|
4
|
+
endpoint: "/view-checkout-item-by-id",
|
|
5
|
+
body: { checkout_item_id: checkoutItemId },
|
|
6
|
+
signal,
|
|
7
|
+
});
|
|
8
|
+
return !response.ok || response.status === 404
|
|
9
|
+
? undefined
|
|
10
|
+
: toCheckoutItemProjection((await response.json()).result);
|
|
11
|
+
};
|
|
12
|
+
export { httpCheckoutItemByIdView };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { generatePath, Navigate, Outlet, useMatch } from "react-router";
|
|
4
|
-
import { CheckoutItemStatus } from "../../../
|
|
4
|
+
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
5
5
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
6
6
|
import { useViewCheckoutIntroShown } from "../../projection/uiSetting/react/useViewCheckoutIntroShown";
|
|
7
7
|
import { Spinner } from "../components/atoms/spinner/Spinner";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
|
-
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
2
|
import React from "react";
|
|
4
3
|
import { StyleSheet, View } from "react-native";
|
|
5
4
|
import { useParams } from "react-router-native";
|
|
@@ -8,9 +7,8 @@ const Item = ({ customerId }) => {
|
|
|
8
7
|
const { id } = useParams();
|
|
9
8
|
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
10
9
|
console.log(checkout);
|
|
11
|
-
const itemText = useI18nMessage({ id: "item" });
|
|
12
10
|
return (React.createElement(View, { style: styles.container },
|
|
13
|
-
React.createElement(Text, { heading: true, level: 3 },
|
|
11
|
+
React.createElement(Text, { heading: true, level: 3 }, "Item"),
|
|
14
12
|
React.createElement(Text, { level: 2 }, id)));
|
|
15
13
|
};
|
|
16
14
|
const styles = StyleSheet.create({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { CheckoutItemStatus } from "../../../../../../
|
|
2
|
+
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
3
3
|
declare type Status = Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL | CheckoutItemStatus.EXPIRED>;
|
|
4
4
|
interface CustomerDecissionBannerProps {
|
|
5
5
|
readonly checkoutItemStatus: Status;
|
|
@@ -2,7 +2,7 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
|
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Pressable, View } from "react-native";
|
|
5
|
-
import { CheckoutItemStatus } from "../../../../../../
|
|
5
|
+
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
6
6
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./CustomerDecissionBanner.style";
|
|
8
8
|
const i18nMessageForCheckoutItemStatus = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { SizeProjection } from "../../../../../../projection/
|
|
2
|
+
import { SizeProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
3
3
|
interface ProductVariantActionsProps {
|
|
4
4
|
readonly sizes: SizeProjection[];
|
|
5
5
|
readonly size: SizeProjection;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { ColorProjection, PriceProjection, SizeProjection } from "../../../../../../projection/
|
|
2
|
+
import { ColorProjection, PriceProjection, SizeProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
3
3
|
interface ProductVariantDescriptionProps {
|
|
4
4
|
readonly brand: string;
|
|
5
5
|
readonly name: string;
|
package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { MediaProjection } from "../../../../../../projection/
|
|
2
|
+
import { MediaProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
3
3
|
interface ProductVariantSlider {
|
|
4
4
|
readonly producVariantMedia: MediaProjection[];
|
|
5
5
|
}
|
|
@@ -40,4 +40,5 @@ interface ViewBookedSizeReplaceableProductVariantsForCheckoutItemHandlerFunction
|
|
|
40
40
|
readonly view: BookedSizeReplaceableProductVariantsForCheckoutItemView;
|
|
41
41
|
}
|
|
42
42
|
declare const viewBookedSizeReplaceableProductVariantsForCheckoutItemHandler: QueryHandlerFunction<ViewBookedSizeReplaceableProductVariantsForCheckoutItem, ViewBookedSizeReplaceableProductVariantsForCheckoutItemResult, ViewBookedSizeReplaceableProductVariantsForCheckoutItemHandlerFunctionArgs>;
|
|
43
|
-
export { Size, ProductVariant, BookedSizeReplaceableProductVariantsProjection,
|
|
43
|
+
export type { Size, ProductVariant, BookedSizeReplaceableProductVariantsProjection, BookedSizeReplaceableProductVariantsForCheckoutItemView, };
|
|
44
|
+
export { VIEW_BOOKED_SIZE_REPLACEABLE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeReplaceableProductVariantsForCheckoutItem, viewBookedSizeReplaceableProductVariantsForCheckoutItemHandler, };
|
|
@@ -1,70 +1,5 @@
|
|
|
1
1
|
import { CheckoutStatus } from "../../domain/checkout/model/checkout";
|
|
2
|
-
|
|
3
|
-
BACK = "BACK",
|
|
4
|
-
BOTTOM_UP = "BOTTOM_UP",
|
|
5
|
-
COLLAGE = "COLLAGE",
|
|
6
|
-
DETAIL = "DETAIL",
|
|
7
|
-
FLAT_BACK = "FLAT_BACK",
|
|
8
|
-
FRONT = "FRONT",
|
|
9
|
-
FRONT_FAR = "FRONT_FAR",
|
|
10
|
-
LABEL = "LABEL",
|
|
11
|
-
MAIN = "MAIN",
|
|
12
|
-
MAIN_TRANSPARENT = "MAIN_TRANSPARENT",
|
|
13
|
-
OTHER = "OTHER",
|
|
14
|
-
SIDE = "SIDE"
|
|
15
|
-
}
|
|
16
|
-
interface MediaProjection {
|
|
17
|
-
readonly id: string;
|
|
18
|
-
readonly url: string;
|
|
19
|
-
readonly perspective: MediaPerspective;
|
|
20
|
-
}
|
|
21
|
-
declare enum Currency {
|
|
22
|
-
EUR = "EUR",
|
|
23
|
-
GBP = "GBP"
|
|
24
|
-
}
|
|
25
|
-
interface PriceProjection {
|
|
26
|
-
readonly amount: number;
|
|
27
|
-
readonly currency: Currency;
|
|
28
|
-
readonly discountedPrice?: {
|
|
29
|
-
readonly amount: number;
|
|
30
|
-
readonly percentage: number;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
interface SizeProjection {
|
|
34
|
-
readonly id: string;
|
|
35
|
-
readonly lookiero: string;
|
|
36
|
-
readonly uk: string;
|
|
37
|
-
readonly it: string;
|
|
38
|
-
readonly europe: string;
|
|
39
|
-
readonly unique: boolean;
|
|
40
|
-
readonly visualOrder?: number;
|
|
41
|
-
}
|
|
42
|
-
interface ColorProjection {
|
|
43
|
-
readonly id: string;
|
|
44
|
-
readonly label: string;
|
|
45
|
-
}
|
|
46
|
-
interface CheckoutItemProductVariantProjection {
|
|
47
|
-
readonly id: string;
|
|
48
|
-
readonly media: MediaProjection[];
|
|
49
|
-
readonly brand: string;
|
|
50
|
-
readonly name: string;
|
|
51
|
-
readonly price: PriceProjection;
|
|
52
|
-
readonly size: SizeProjection;
|
|
53
|
-
readonly color: ColorProjection;
|
|
54
|
-
}
|
|
55
|
-
declare enum CheckoutItemStatus {
|
|
56
|
-
INITIAL = "INITIAL",
|
|
57
|
-
KEPT = "KEPT",
|
|
58
|
-
RETURNED = "RETURNED",
|
|
59
|
-
REPLACED = "REPLACED",
|
|
60
|
-
EXPIRED = "EXPIRED"
|
|
61
|
-
}
|
|
62
|
-
interface CheckoutItemProjection {
|
|
63
|
-
readonly id: string;
|
|
64
|
-
readonly status: CheckoutItemStatus;
|
|
65
|
-
readonly replacedFor?: string;
|
|
66
|
-
readonly productVariant: CheckoutItemProductVariantProjection;
|
|
67
|
-
}
|
|
2
|
+
import { CheckoutItemProjection } from "../checkoutItem/checkoutItem";
|
|
68
3
|
interface CheckoutProjection {
|
|
69
4
|
readonly id: string;
|
|
70
5
|
readonly customerId: string;
|
|
@@ -74,5 +9,4 @@ interface CheckoutProjection {
|
|
|
74
9
|
readonly expiresOn: Date;
|
|
75
10
|
readonly items: CheckoutItemProjection[];
|
|
76
11
|
}
|
|
77
|
-
export type {
|
|
78
|
-
export { CheckoutItemStatus, MediaPerspective, Currency };
|
|
12
|
+
export type { CheckoutProjection };
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
(function (MediaPerspective) {
|
|
3
|
-
MediaPerspective["BACK"] = "BACK";
|
|
4
|
-
MediaPerspective["BOTTOM_UP"] = "BOTTOM_UP";
|
|
5
|
-
MediaPerspective["COLLAGE"] = "COLLAGE";
|
|
6
|
-
MediaPerspective["DETAIL"] = "DETAIL";
|
|
7
|
-
MediaPerspective["FLAT_BACK"] = "FLAT_BACK";
|
|
8
|
-
MediaPerspective["FRONT"] = "FRONT";
|
|
9
|
-
MediaPerspective["FRONT_FAR"] = "FRONT_FAR";
|
|
10
|
-
MediaPerspective["LABEL"] = "LABEL";
|
|
11
|
-
MediaPerspective["MAIN"] = "MAIN";
|
|
12
|
-
MediaPerspective["MAIN_TRANSPARENT"] = "MAIN_TRANSPARENT";
|
|
13
|
-
MediaPerspective["OTHER"] = "OTHER";
|
|
14
|
-
MediaPerspective["SIDE"] = "SIDE";
|
|
15
|
-
})(MediaPerspective || (MediaPerspective = {}));
|
|
16
|
-
var Currency;
|
|
17
|
-
(function (Currency) {
|
|
18
|
-
Currency["EUR"] = "EUR";
|
|
19
|
-
Currency["GBP"] = "GBP";
|
|
20
|
-
})(Currency || (Currency = {}));
|
|
21
|
-
var CheckoutItemStatus;
|
|
22
|
-
(function (CheckoutItemStatus) {
|
|
23
|
-
CheckoutItemStatus["INITIAL"] = "INITIAL";
|
|
24
|
-
CheckoutItemStatus["KEPT"] = "KEPT";
|
|
25
|
-
CheckoutItemStatus["RETURNED"] = "RETURNED";
|
|
26
|
-
CheckoutItemStatus["REPLACED"] = "REPLACED";
|
|
27
|
-
CheckoutItemStatus["EXPIRED"] = "EXPIRED";
|
|
28
|
-
})(CheckoutItemStatus || (CheckoutItemStatus = {}));
|
|
29
|
-
export { CheckoutItemStatus, MediaPerspective, Currency };
|
|
1
|
+
export {};
|
|
@@ -20,4 +20,5 @@ interface ViewFiveItemsDiscountByCustomerIdHandlerFunctionArgs extends QueryHand
|
|
|
20
20
|
readonly view: FiveItemsDiscountByCustomerIdView;
|
|
21
21
|
}
|
|
22
22
|
declare const viewFiveItemsDiscountByCustomerIdHandler: QueryHandlerFunction<ViewFiveItemsDiscountByCustomerId, FiveItemsDiscountByCustomerIdProjection, ViewFiveItemsDiscountByCustomerIdHandlerFunctionArgs>;
|
|
23
|
-
export { FiveItemsDiscountByCustomerIdProjection,
|
|
23
|
+
export type { FiveItemsDiscountByCustomerIdProjection, FiveItemsDiscountByCustomerIdView };
|
|
24
|
+
export { VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerId, viewFiveItemsDiscountByCustomerIdHandler, };
|
|
@@ -13,4 +13,5 @@ declare const viewIsCheckoutAccessibleByCustomerId: ViewIsCheckoutAccessibleByCu
|
|
|
13
13
|
interface ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
14
14
|
}
|
|
15
15
|
declare const viewIsCheckoutAccessibleByCustomerIdHandler: QueryHandlerFunction<ViewIsCheckoutAccessibleByCustomerId, IsCheckoutAccessibleByCustomerIdProjection, ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs>;
|
|
16
|
-
export { IsCheckoutAccessibleByCustomerIdProjection
|
|
16
|
+
export type { IsCheckoutAccessibleByCustomerIdProjection };
|
|
17
|
+
export { VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerId, viewIsCheckoutAccessibleByCustomerIdHandler, };
|
|
@@ -20,4 +20,5 @@ interface ViewIsCheckoutEnabledByCustomerIdHandlerFunctionArgs extends QueryHand
|
|
|
20
20
|
readonly view: IsCheckoutEnabledByCustomerIdView;
|
|
21
21
|
}
|
|
22
22
|
declare const viewIsCheckoutEnabledByCustomerIdHandler: QueryHandlerFunction<ViewIsCheckoutEnabledByCustomerId, IsCheckoutEnabledByCustomerIdProjection, ViewIsCheckoutEnabledByCustomerIdHandlerFunctionArgs>;
|
|
23
|
-
export { IsCheckoutEnabledByCustomerIdProjection,
|
|
23
|
+
export type { IsCheckoutEnabledByCustomerIdProjection, IsCheckoutEnabledByCustomerIdView };
|
|
24
|
+
export { VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, viewIsCheckoutEnabledByCustomerId, viewIsCheckoutEnabledByCustomerIdHandler, };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
2
|
+
declare enum MediaPerspective {
|
|
3
|
+
BACK = "BACK",
|
|
4
|
+
BOTTOM_UP = "BOTTOM_UP",
|
|
5
|
+
COLLAGE = "COLLAGE",
|
|
6
|
+
DETAIL = "DETAIL",
|
|
7
|
+
FLAT_BACK = "FLAT_BACK",
|
|
8
|
+
FRONT = "FRONT",
|
|
9
|
+
FRONT_FAR = "FRONT_FAR",
|
|
10
|
+
LABEL = "LABEL",
|
|
11
|
+
MAIN = "MAIN",
|
|
12
|
+
MAIN_TRANSPARENT = "MAIN_TRANSPARENT",
|
|
13
|
+
OTHER = "OTHER",
|
|
14
|
+
SIDE = "SIDE"
|
|
15
|
+
}
|
|
16
|
+
interface MediaProjection {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly url: string;
|
|
19
|
+
readonly perspective: MediaPerspective;
|
|
20
|
+
}
|
|
21
|
+
declare enum Currency {
|
|
22
|
+
EUR = "EUR",
|
|
23
|
+
GBP = "GBP"
|
|
24
|
+
}
|
|
25
|
+
interface PriceProjection {
|
|
26
|
+
readonly amount: number;
|
|
27
|
+
readonly currency: Currency;
|
|
28
|
+
readonly discountedPrice?: {
|
|
29
|
+
readonly amount: number;
|
|
30
|
+
readonly percentage: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
interface SizeProjection {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly lookiero: string;
|
|
36
|
+
readonly uk: string;
|
|
37
|
+
readonly it: string;
|
|
38
|
+
readonly europe: string;
|
|
39
|
+
readonly unique: boolean;
|
|
40
|
+
readonly visualOrder?: number;
|
|
41
|
+
}
|
|
42
|
+
interface ColorProjection {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly label: string;
|
|
45
|
+
}
|
|
46
|
+
interface CheckoutItemProductVariantProjection {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly media: MediaProjection[];
|
|
49
|
+
readonly brand: string;
|
|
50
|
+
readonly name: string;
|
|
51
|
+
readonly price: PriceProjection;
|
|
52
|
+
readonly size: SizeProjection;
|
|
53
|
+
readonly color: ColorProjection;
|
|
54
|
+
}
|
|
55
|
+
interface CheckoutItemProjection {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly status: CheckoutItemStatus;
|
|
58
|
+
readonly replacedFor?: string;
|
|
59
|
+
readonly productVariant: CheckoutItemProductVariantProjection;
|
|
60
|
+
}
|
|
61
|
+
export type { CheckoutItemProjection, CheckoutItemProductVariantProjection, ColorProjection, MediaProjection, PriceProjection, SizeProjection, };
|
|
62
|
+
export { Currency, MediaPerspective };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var MediaPerspective;
|
|
2
|
+
(function (MediaPerspective) {
|
|
3
|
+
MediaPerspective["BACK"] = "BACK";
|
|
4
|
+
MediaPerspective["BOTTOM_UP"] = "BOTTOM_UP";
|
|
5
|
+
MediaPerspective["COLLAGE"] = "COLLAGE";
|
|
6
|
+
MediaPerspective["DETAIL"] = "DETAIL";
|
|
7
|
+
MediaPerspective["FLAT_BACK"] = "FLAT_BACK";
|
|
8
|
+
MediaPerspective["FRONT"] = "FRONT";
|
|
9
|
+
MediaPerspective["FRONT_FAR"] = "FRONT_FAR";
|
|
10
|
+
MediaPerspective["LABEL"] = "LABEL";
|
|
11
|
+
MediaPerspective["MAIN"] = "MAIN";
|
|
12
|
+
MediaPerspective["MAIN_TRANSPARENT"] = "MAIN_TRANSPARENT";
|
|
13
|
+
MediaPerspective["OTHER"] = "OTHER";
|
|
14
|
+
MediaPerspective["SIDE"] = "SIDE";
|
|
15
|
+
})(MediaPerspective || (MediaPerspective = {}));
|
|
16
|
+
var Currency;
|
|
17
|
+
(function (Currency) {
|
|
18
|
+
Currency["EUR"] = "EUR";
|
|
19
|
+
Currency["GBP"] = "GBP";
|
|
20
|
+
})(Currency || (Currency = {}));
|
|
21
|
+
export { Currency, MediaPerspective };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
+
import { CheckoutItemProjection } from "./checkoutItem";
|
|
3
|
+
declare const VIEW_CHECKOUT_ITEM_BY_ID = "view_checkout_item_by_id";
|
|
4
|
+
interface ViewCheckoutItemByIdPayload {
|
|
5
|
+
readonly checkoutItemId: string;
|
|
6
|
+
}
|
|
7
|
+
interface ViewCheckoutItemById extends Query<typeof VIEW_CHECKOUT_ITEM_BY_ID>, ViewCheckoutItemByIdPayload {
|
|
8
|
+
}
|
|
9
|
+
interface ViewCheckoutItemByIdFunction {
|
|
10
|
+
(payload: ViewCheckoutItemByIdPayload): ViewCheckoutItemById;
|
|
11
|
+
}
|
|
12
|
+
declare const viewCheckoutItemById: ViewCheckoutItemByIdFunction;
|
|
13
|
+
declare type ViewCheckoutItemByIdResult = CheckoutItemProjection | undefined;
|
|
14
|
+
interface CheckoutItemByIdViewArgs extends CancelableQueryViewArgs {
|
|
15
|
+
readonly checkoutItemId: string;
|
|
16
|
+
}
|
|
17
|
+
interface CheckoutItemByIdView {
|
|
18
|
+
(args: CheckoutItemByIdViewArgs): Promise<ViewCheckoutItemByIdResult>;
|
|
19
|
+
}
|
|
20
|
+
interface ViewCheckoutItemByIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
21
|
+
readonly view: CheckoutItemByIdView;
|
|
22
|
+
}
|
|
23
|
+
declare const viewCheckoutItemByIdHandler: QueryHandlerFunction<ViewCheckoutItemById, ViewCheckoutItemByIdResult, ViewCheckoutItemByIdHandlerFunctionArgs>;
|
|
24
|
+
export type { ViewCheckoutItemById, CheckoutItemByIdView, ViewCheckoutItemByIdResult };
|
|
25
|
+
export { VIEW_CHECKOUT_ITEM_BY_ID, viewCheckoutItemById, viewCheckoutItemByIdHandler };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { query, } from "@lookiero/messaging";
|
|
2
|
+
const VIEW_CHECKOUT_ITEM_BY_ID = "view_checkout_item_by_id";
|
|
3
|
+
const viewCheckoutItemById = (payload) => ({
|
|
4
|
+
...query({ name: VIEW_CHECKOUT_ITEM_BY_ID }),
|
|
5
|
+
...payload,
|
|
6
|
+
});
|
|
7
|
+
const viewCheckoutItemByIdHandler = ({ view, signal }) => async ({ checkoutItemId }) => view({ checkoutItemId, signal });
|
|
8
|
+
export { VIEW_CHECKOUT_ITEM_BY_ID, viewCheckoutItemById, viewCheckoutItemByIdHandler };
|