@lookiero/checkout 0.2.49 → 0.2.51
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/checkoutBooking/command/bookCheckoutBookingForCheckoutItem.d.ts +0 -1
- package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +0 -1
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutBookings.js +0 -1
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +0 -1
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBook.js +2 -3
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -1
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +2 -3
- package/dist/infrastructure/ui/components/atoms/price/Price.d.ts +1 -1
- package/dist/infrastructure/ui/i18n/i18n.d.ts +8 -0
- package/dist/infrastructure/ui/i18n/i18n.js +8 -0
- package/dist/infrastructure/ui/views/item/Item.js +0 -1
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +2 -1
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.d.ts +2 -1
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +2 -1
- package/dist/infrastructure/ui/views/summary/Summary.js +8 -2
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.d.ts +18 -0
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +57 -0
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +32 -0
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +35 -0
- package/dist/projection/checkoutBooking/checkoutBooking.d.ts +0 -1
- package/dist/projection/checkoutItem/checkoutItem.d.ts +3 -11
- package/dist/projection/checkoutItem/checkoutItem.js +1 -2
- package/dist/projection/pricing/pricing.d.ts +17 -0
- package/dist/projection/pricing/pricing.js +1 -0
- package/dist/projection/pricing/pricing.mock.d.ts +3 -0
- package/dist/projection/pricing/pricing.mock.js +37 -0
- package/dist/projection/shared/price.d.ts +10 -0
- package/dist/projection/shared/price.js +1 -0
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@ import { Command } from "@lookiero/messaging";
|
|
|
2
2
|
declare const BOOK_CHECKOUT_BOOKING_FOR_CHECKOUT_ITEM = "book_checkout_booking_for_checkout_item";
|
|
3
3
|
interface BookCheckoutBookingForCheckoutItemPayload {
|
|
4
4
|
readonly aggregateId: string;
|
|
5
|
-
readonly checkoutId: string;
|
|
6
5
|
readonly checkoutItemId: string;
|
|
7
6
|
}
|
|
8
7
|
interface BookCheckoutBookingForCheckoutItem extends Command<typeof BOOK_CHECKOUT_BOOKING_FOR_CHECKOUT_ITEM>, BookCheckoutBookingForCheckoutItemPayload {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AggregateRoot, CommandHandlerFunction } from "@lookiero/messaging";
|
|
2
2
|
import { BookCheckoutBookingForCheckoutItem } from "../command/bookCheckoutBookingForCheckoutItem";
|
|
3
3
|
interface CheckoutBooking extends AggregateRoot {
|
|
4
|
-
readonly checkoutId: string;
|
|
5
4
|
readonly checkoutItemIds: string[];
|
|
6
5
|
}
|
|
7
6
|
declare const bookCheckoutBookingForCheckoutItemHandler: CommandHandlerFunction<BookCheckoutBookingForCheckoutItem, CheckoutBooking>;
|
|
@@ -11,7 +11,6 @@ const toCheckoutBookingDomain = (checkoutBooking) => {
|
|
|
11
11
|
};
|
|
12
12
|
const toCheckoutBookingProjection = (checkoutBooking) => ({
|
|
13
13
|
id: checkoutBooking.aggregateId,
|
|
14
|
-
checkoutId: checkoutBooking.checkoutId,
|
|
15
14
|
checkoutItemIds: checkoutBooking.checkoutItemIds,
|
|
16
15
|
});
|
|
17
16
|
const getCheckoutBooking = ({ queryBus }) => async (aggregateId) => toCheckoutBookingDomain(await queryBus(viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId: aggregateId })));
|
|
@@ -4,7 +4,6 @@ import { httpCheckoutBookingsBook } from "./httpCheckoutBookingsBook";
|
|
|
4
4
|
const toDomain = (checkoutBooking) => {
|
|
5
5
|
invariant(checkoutBooking, "No checkout booking found!");
|
|
6
6
|
return {
|
|
7
|
-
checkoutId: checkoutBooking.checkoutId,
|
|
8
7
|
checkoutItemIds: checkoutBooking.checkoutItemIds,
|
|
9
8
|
aggregateId: checkoutBooking.id,
|
|
10
9
|
domainEvents: [],
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
|
|
2
2
|
const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
|
|
3
|
-
const httpCheckoutBookingsBook = ({ httpPost }) => async ({ aggregateId,
|
|
3
|
+
const httpCheckoutBookingsBook = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
|
|
4
4
|
const checkoutBookingBooked = domainEvents.find(isCheckoutBookingBooked);
|
|
5
5
|
if (!checkoutBookingBooked) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
const { checkoutItemId } = checkoutBookingBooked;
|
|
9
9
|
await httpPost({
|
|
10
|
-
endpoint: "/book-
|
|
10
|
+
endpoint: "/book-checkout-booking-for-checkout-item",
|
|
11
11
|
body: {
|
|
12
|
-
checkoutId,
|
|
13
12
|
checkoutItemId,
|
|
14
13
|
checkoutBookingId: aggregateId,
|
|
15
14
|
},
|
package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ interface BookFunction {
|
|
|
4
4
|
}
|
|
5
5
|
declare type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
|
|
6
6
|
interface UseBookCheckouBookingForCheckoutItemFunctionArgs {
|
|
7
|
-
readonly checkoutId: string;
|
|
8
7
|
readonly checkoutItemId: string;
|
|
9
8
|
readonly checkoutBookingId: string | undefined;
|
|
10
9
|
}
|
package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js
CHANGED
|
@@ -3,13 +3,12 @@ import { useCallback } from "react";
|
|
|
3
3
|
import { v4 as uuid } from "uuid";
|
|
4
4
|
import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
|
|
5
5
|
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
6
|
-
const useBookCheckouBookingForCheckoutItem = ({
|
|
6
|
+
const useBookCheckouBookingForCheckoutItem = ({ checkoutItemId, checkoutBookingId, }) => {
|
|
7
7
|
const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
|
|
8
8
|
const book = useCallback(() => commandBus(bookCheckoutBookingForCheckoutItem({
|
|
9
9
|
aggregateId: checkoutBookingId || uuid(),
|
|
10
|
-
checkoutId,
|
|
11
10
|
checkoutItemId,
|
|
12
|
-
})), [checkoutBookingId,
|
|
11
|
+
})), [checkoutBookingId, checkoutItemId, commandBus]);
|
|
13
12
|
return [book, status];
|
|
14
13
|
};
|
|
15
14
|
export { useBookCheckouBookingForCheckoutItem };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { TextProps } from "react-native";
|
|
3
|
-
import { PriceProjection } from "../../../../../projection/
|
|
3
|
+
import { PriceProjection } from "../../../../../projection/shared/price";
|
|
4
4
|
declare type PriceStyle = "priceText" | "discountedText";
|
|
5
5
|
declare type PriceVariant = "default" | "detail" | "subtotal" | "total";
|
|
6
6
|
interface PriceProps {
|
|
@@ -37,6 +37,14 @@ declare enum I18nMessages {
|
|
|
37
37
|
SUMMARY_RETURN_TAB = "summary.return_tab",
|
|
38
38
|
SUMMARY_KEEP_EMPTY = "summary.keep_empty",
|
|
39
39
|
SUMMARY_RETURN_EMPTY = "summary.return_empty",
|
|
40
|
+
SUMMARY_TOTAL = "summary.total",
|
|
41
|
+
SUMMARY_SUBTOTAL = "summary.subtotal",
|
|
42
|
+
SUMMARY_SUBMIT_BUTTON = "summary.submit_button",
|
|
43
|
+
SUMMARY_FREE = "summary.free",
|
|
44
|
+
SUMMARY_DISCOUNT = "summary.discount",
|
|
45
|
+
SUMMARY_TOTAL_ITEMS_KEPT = "summary.total_items_kept",
|
|
46
|
+
SUMMARY_CREDIT = "summary.credit",
|
|
47
|
+
SUMMARY_FEE = "summary.fee",
|
|
40
48
|
PRODUCT_VARIANT_SIZE_CHANGE = "product_variant.size_change"
|
|
41
49
|
}
|
|
42
50
|
export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX };
|
|
@@ -38,6 +38,14 @@ var I18nMessages;
|
|
|
38
38
|
I18nMessages["SUMMARY_RETURN_TAB"] = "summary.return_tab";
|
|
39
39
|
I18nMessages["SUMMARY_KEEP_EMPTY"] = "summary.keep_empty";
|
|
40
40
|
I18nMessages["SUMMARY_RETURN_EMPTY"] = "summary.return_empty";
|
|
41
|
+
I18nMessages["SUMMARY_TOTAL"] = "summary.total";
|
|
42
|
+
I18nMessages["SUMMARY_SUBTOTAL"] = "summary.subtotal";
|
|
43
|
+
I18nMessages["SUMMARY_SUBMIT_BUTTON"] = "summary.submit_button";
|
|
44
|
+
I18nMessages["SUMMARY_FREE"] = "summary.free";
|
|
45
|
+
I18nMessages["SUMMARY_DISCOUNT"] = "summary.discount";
|
|
46
|
+
I18nMessages["SUMMARY_TOTAL_ITEMS_KEPT"] = "summary.total_items_kept";
|
|
47
|
+
I18nMessages["SUMMARY_CREDIT"] = "summary.credit";
|
|
48
|
+
I18nMessages["SUMMARY_FEE"] = "summary.fee";
|
|
41
49
|
I18nMessages["PRODUCT_VARIANT_SIZE_CHANGE"] = "product_variant.size_change";
|
|
42
50
|
})(I18nMessages || (I18nMessages = {}));
|
|
43
51
|
export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX };
|
|
@@ -40,7 +40,6 @@ const Item = ({ customerId }) => {
|
|
|
40
40
|
});
|
|
41
41
|
const [bookCheckouBooking] = useBookCheckouBookingForCheckoutItem({
|
|
42
42
|
checkoutBookingId: bookedSizeChangeProductsVariants?.id,
|
|
43
|
-
checkoutId: checkout?.id,
|
|
44
43
|
checkoutItemId: checkoutItem.id,
|
|
45
44
|
});
|
|
46
45
|
const [returnQuestions, returnQuestionsStatus] = useListReturnQuestionsByCheckoutItemId({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { ImageStyle, StyleProp } from "react-native";
|
|
3
3
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
4
|
-
import { ColorProjection, MediaProjection
|
|
4
|
+
import { ColorProjection, MediaProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
5
|
+
import { PriceProjection } from "../../../../../../projection/shared/price";
|
|
5
6
|
import { SizeProjection } from "../../../../../../projection/shared/size";
|
|
6
7
|
interface ProductVariantStyle {
|
|
7
8
|
readonly image: StyleProp<ImageStyle>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { ColorProjection
|
|
2
|
+
import { ColorProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
3
|
+
import { PriceProjection } from "../../../../../../projection/shared/price";
|
|
3
4
|
import { SizeProjection } from "../../../../../../projection/shared/size";
|
|
4
5
|
interface ProductVariantDescriptionProps {
|
|
5
6
|
readonly brand: string;
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { CheckoutItemProductVariantProjection
|
|
2
|
+
import { CheckoutItemProductVariantProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
3
3
|
import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
|
|
4
4
|
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
5
|
+
import { PriceProjection } from "../../../../../../projection/shared/price";
|
|
5
6
|
interface ReturnQuestionsFormProps {
|
|
6
7
|
readonly visible: boolean;
|
|
7
8
|
readonly feedback: FeedbackProjection;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
2
|
-
import React, { useCallback } from "react";
|
|
2
|
+
import React, { useCallback, useState } from "react";
|
|
3
|
+
import { pricing } from "../../../../projection/pricing/pricing.mock";
|
|
3
4
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
4
5
|
import { Body } from "../../components/layouts/body/Body";
|
|
5
6
|
import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
|
|
6
7
|
import { Spinner } from "../../shared/components/atoms/spinner/Spinner";
|
|
7
8
|
import { CheckoutItemsTabs } from "./components/checkoutItemsTabs/CheckoutItemsTabs";
|
|
9
|
+
import { Pricing } from "./components/pricing/Pricing";
|
|
8
10
|
const Summary = ({ customerId }) => {
|
|
9
11
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
12
|
+
const [pricingCollapsed, setPricingCollapsed] = useState(true);
|
|
13
|
+
const handleOnPressPricing = useCallback(() => setPricingCollapsed(!pricingCollapsed), [pricingCollapsed]);
|
|
14
|
+
const handleOnSubmit = useCallback(() => void 0, []);
|
|
10
15
|
const handleOnPressItem = useCallback(() => void 0, []);
|
|
11
16
|
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
12
17
|
const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutStatus);
|
|
@@ -14,6 +19,7 @@ const Summary = ({ customerId }) => {
|
|
|
14
19
|
return React.createElement(Spinner, null);
|
|
15
20
|
return (React.createElement(SafeAreaScrollView, null,
|
|
16
21
|
React.createElement(Body, null,
|
|
17
|
-
React.createElement(CheckoutItemsTabs, { checkoutItems: checkout?.items || [], onPressItem: handleOnPressItem })
|
|
22
|
+
React.createElement(CheckoutItemsTabs, { checkoutItems: checkout?.items || [], onPressItem: handleOnPressItem }),
|
|
23
|
+
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: pricingCollapsed, discount: pricing.discount, discountPercentage: pricing.discountPercentage, orderTotal: pricing.orderTotal, service: pricing.service, subtotal: pricing.subtotal, totalItemsKept: 3, onPress: handleOnPressPricing, onSubmit: handleOnSubmit }))));
|
|
18
24
|
};
|
|
19
25
|
export { Summary };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { ServiceProjection } from "../../../../../../projection/pricing/pricing";
|
|
3
|
+
import { PriceProjection } from "../../../../../../projection/shared/price";
|
|
4
|
+
interface PricingProps {
|
|
5
|
+
readonly orderTotal: PriceProjection;
|
|
6
|
+
readonly subtotal: PriceProjection;
|
|
7
|
+
readonly balanceDiscount?: PriceProjection;
|
|
8
|
+
readonly discount?: PriceProjection;
|
|
9
|
+
readonly discountPercentage?: number;
|
|
10
|
+
readonly totalItemsKept: number;
|
|
11
|
+
readonly service: ServiceProjection;
|
|
12
|
+
readonly collapsible?: boolean;
|
|
13
|
+
readonly collapsed?: boolean;
|
|
14
|
+
readonly onPress?: () => void;
|
|
15
|
+
readonly onSubmit: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Pricing: FC<PricingProps>;
|
|
18
|
+
export { Pricing };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
+
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
3
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
+
import { animated, useSpring } from "@react-spring/native";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Pressable, View } from "react-native";
|
|
7
|
+
import { Price } from "../../../../components/atoms/price/Price";
|
|
8
|
+
import { I18nMessages } from "../../../../i18n/i18n";
|
|
9
|
+
import { Icon } from "../../../../shared/components/atoms/icon/Icon";
|
|
10
|
+
import { style } from "./Pricing.style";
|
|
11
|
+
const PS_SERVICE_FREE_INDICATOR = 100;
|
|
12
|
+
const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
13
|
+
React.createElement(Text, { level: level, style: style.uppercase, action: true }, text),
|
|
14
|
+
children));
|
|
15
|
+
const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPercentage = 0, totalItemsKept, service, collapsible = true, collapsed = false, onPress = () => void 0, onSubmit, }) => {
|
|
16
|
+
const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL }) || "";
|
|
17
|
+
const totalItemsKeptText = useI18nMessage({
|
|
18
|
+
id: I18nMessages.SUMMARY_TOTAL_ITEMS_KEPT,
|
|
19
|
+
values: { items: totalItemsKept.toString() },
|
|
20
|
+
});
|
|
21
|
+
const subtotalText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBTOTAL });
|
|
22
|
+
const submitButtonText = useI18nMessage({ id: I18nMessages.SUMMARY_SUBMIT_BUTTON });
|
|
23
|
+
const freeText = useI18nMessage({ id: I18nMessages.SUMMARY_FREE });
|
|
24
|
+
const discountText = useI18nMessage({
|
|
25
|
+
id: I18nMessages.SUMMARY_DISCOUNT,
|
|
26
|
+
values: { discount: discountPercentage?.toString() },
|
|
27
|
+
}) || "";
|
|
28
|
+
const creditText = useI18nMessage({ id: I18nMessages.SUMMARY_CREDIT }) || "";
|
|
29
|
+
const feeText = useI18nMessage({ id: I18nMessages.SUMMARY_FEE }) || "";
|
|
30
|
+
const isPSServiceFree = service.discount.amount === PS_SERVICE_FREE_INDICATOR;
|
|
31
|
+
const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
|
|
32
|
+
const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
|
|
33
|
+
return (React.createElement(Pressable, { disabled: !collapsible, style: style.container, testID: "pricing", onPress: onPress },
|
|
34
|
+
collapsible && (React.createElement(View, { style: style.iconContainer },
|
|
35
|
+
React.createElement(Icon, { name: collapsed ? "arrow-up" : "arrow-down" }))),
|
|
36
|
+
collapsed && collapsible ? (React.createElement(animated.View, { style: [style.collapsed, { opacity: collapsedStyle.opacitiy }] },
|
|
37
|
+
React.createElement(View, null,
|
|
38
|
+
React.createElement(Text, { level: 1, style: style.totalCollapsed, detail: true },
|
|
39
|
+
totalText,
|
|
40
|
+
" ",
|
|
41
|
+
totalItemsKeptText),
|
|
42
|
+
React.createElement(Price, { price: orderTotal, variant: "detail" })),
|
|
43
|
+
React.createElement(View, null,
|
|
44
|
+
React.createElement(Button, { small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
|
|
45
|
+
React.createElement(Row, { text: `${subtotalText} ${totalItemsKeptText}` },
|
|
46
|
+
React.createElement(Price, { price: subtotal, variant: "subtotal" })),
|
|
47
|
+
discount && (React.createElement(Row, { text: discountText },
|
|
48
|
+
React.createElement(Price, { price: discount, variant: "subtotal" }))),
|
|
49
|
+
balanceDiscount && (React.createElement(Row, { text: creditText },
|
|
50
|
+
React.createElement(Price, { price: balanceDiscount, variant: "subtotal" }))),
|
|
51
|
+
React.createElement(Row, { text: feeText }, isPSServiceFree ? (React.createElement(Text, { level: 3, style: style.uppercase, action: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
|
|
52
|
+
React.createElement(View, { style: style.divider }),
|
|
53
|
+
React.createElement(Row, { level: 2, text: totalText },
|
|
54
|
+
React.createElement(Price, { price: orderTotal, variant: "total" })),
|
|
55
|
+
React.createElement(Button, { onPress: onSubmit }, submitButtonText)))));
|
|
56
|
+
};
|
|
57
|
+
export { Pricing };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
collapsed: {
|
|
3
|
+
flexDirection: "row";
|
|
4
|
+
justifyContent: "space-between";
|
|
5
|
+
};
|
|
6
|
+
container: {
|
|
7
|
+
paddingBottom: number;
|
|
8
|
+
paddingHorizontal: number;
|
|
9
|
+
paddingTop: number;
|
|
10
|
+
};
|
|
11
|
+
divider: {
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
height: number;
|
|
14
|
+
marginBottom: number;
|
|
15
|
+
};
|
|
16
|
+
iconContainer: {
|
|
17
|
+
alignItems: "center";
|
|
18
|
+
marginBottom: number;
|
|
19
|
+
};
|
|
20
|
+
row: {
|
|
21
|
+
flexDirection: "row";
|
|
22
|
+
justifyContent: "space-between";
|
|
23
|
+
marginBottom: number;
|
|
24
|
+
};
|
|
25
|
+
totalCollapsed: {
|
|
26
|
+
marginBottom: number;
|
|
27
|
+
};
|
|
28
|
+
uppercase: {
|
|
29
|
+
textTransform: "uppercase";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export { style };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { colorContent, spaceXS, spaceM, spaceL, spaceXL } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
collapsed: {
|
|
6
|
+
flexDirection: "row",
|
|
7
|
+
justifyContent: "space-between",
|
|
8
|
+
},
|
|
9
|
+
container: {
|
|
10
|
+
paddingBottom: spaceXL,
|
|
11
|
+
paddingHorizontal: spaceXL,
|
|
12
|
+
paddingTop: spaceM,
|
|
13
|
+
},
|
|
14
|
+
divider: {
|
|
15
|
+
backgroundColor: colorContent,
|
|
16
|
+
height: 1,
|
|
17
|
+
marginBottom: 19,
|
|
18
|
+
},
|
|
19
|
+
iconContainer: {
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
marginBottom: spaceL,
|
|
22
|
+
},
|
|
23
|
+
row: {
|
|
24
|
+
flexDirection: "row",
|
|
25
|
+
justifyContent: "space-between",
|
|
26
|
+
marginBottom: 19,
|
|
27
|
+
},
|
|
28
|
+
totalCollapsed: {
|
|
29
|
+
marginBottom: spaceXS,
|
|
30
|
+
},
|
|
31
|
+
uppercase: {
|
|
32
|
+
textTransform: "uppercase",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
export { style };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
2
|
-
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
3
2
|
import { FeedbackProjection } from "../feedback/feedback";
|
|
3
|
+
import { PriceProjection } from "../shared/price";
|
|
4
4
|
import { SizeProjection } from "../shared/size";
|
|
5
5
|
declare enum MediaPerspective {
|
|
6
6
|
BACK = "BACK",
|
|
@@ -21,14 +21,6 @@ interface MediaProjection {
|
|
|
21
21
|
readonly url: string;
|
|
22
22
|
readonly perspective: MediaPerspective;
|
|
23
23
|
}
|
|
24
|
-
interface PriceProjection {
|
|
25
|
-
readonly amount: number;
|
|
26
|
-
readonly currency: Currency;
|
|
27
|
-
readonly discountedPrice?: {
|
|
28
|
-
readonly amount: number;
|
|
29
|
-
readonly percentage: number;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
24
|
interface ColorProjection {
|
|
33
25
|
readonly id: string;
|
|
34
26
|
readonly label: string;
|
|
@@ -49,5 +41,5 @@ interface CheckoutItemProjection {
|
|
|
49
41
|
readonly productVariant: CheckoutItemProductVariantProjection;
|
|
50
42
|
readonly feedback: FeedbackProjection;
|
|
51
43
|
}
|
|
52
|
-
export type { CheckoutItemProjection, CheckoutItemProductVariantProjection, ColorProjection, MediaProjection
|
|
53
|
-
export {
|
|
44
|
+
export type { CheckoutItemProjection, CheckoutItemProductVariantProjection, ColorProjection, MediaProjection };
|
|
45
|
+
export { MediaPerspective };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
2
1
|
var MediaPerspective;
|
|
3
2
|
(function (MediaPerspective) {
|
|
4
3
|
MediaPerspective["BACK"] = "BACK";
|
|
@@ -14,4 +13,4 @@ var MediaPerspective;
|
|
|
14
13
|
MediaPerspective["OTHER"] = "OTHER";
|
|
15
14
|
MediaPerspective["SIDE"] = "SIDE";
|
|
16
15
|
})(MediaPerspective || (MediaPerspective = {}));
|
|
17
|
-
export {
|
|
16
|
+
export { MediaPerspective };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PriceProjection } from "../shared/price";
|
|
2
|
+
interface ServiceProjection {
|
|
3
|
+
readonly reference: string;
|
|
4
|
+
readonly originalPrice: PriceProjection;
|
|
5
|
+
readonly discount: PriceProjection;
|
|
6
|
+
readonly finalPrice: PriceProjection;
|
|
7
|
+
readonly prepaid: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface PricingProjection {
|
|
10
|
+
readonly orderTotal: PriceProjection;
|
|
11
|
+
readonly subtotal: PriceProjection;
|
|
12
|
+
readonly balanceDiscount?: PriceProjection;
|
|
13
|
+
readonly discount?: PriceProjection;
|
|
14
|
+
readonly discountPercentage?: number;
|
|
15
|
+
readonly service: ServiceProjection;
|
|
16
|
+
}
|
|
17
|
+
export type { PricingProjection, ServiceProjection };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
2
|
+
const pricing = {
|
|
3
|
+
orderTotal: {
|
|
4
|
+
amount: 14323,
|
|
5
|
+
currency: Currency.EUR,
|
|
6
|
+
},
|
|
7
|
+
subtotal: {
|
|
8
|
+
amount: 21801,
|
|
9
|
+
currency: Currency.EUR,
|
|
10
|
+
},
|
|
11
|
+
discount: {
|
|
12
|
+
amount: -2500,
|
|
13
|
+
currency: Currency.EUR,
|
|
14
|
+
},
|
|
15
|
+
discountPercentage: 25,
|
|
16
|
+
balanceDiscount: {
|
|
17
|
+
amount: 1000,
|
|
18
|
+
currency: Currency.EUR,
|
|
19
|
+
},
|
|
20
|
+
service: {
|
|
21
|
+
reference: "LK-service",
|
|
22
|
+
originalPrice: {
|
|
23
|
+
amount: 10.0,
|
|
24
|
+
currency: Currency.EUR,
|
|
25
|
+
},
|
|
26
|
+
discount: {
|
|
27
|
+
amount: 0,
|
|
28
|
+
currency: Currency.EUR,
|
|
29
|
+
},
|
|
30
|
+
finalPrice: {
|
|
31
|
+
amount: -1000,
|
|
32
|
+
currency: Currency.EUR,
|
|
33
|
+
},
|
|
34
|
+
prepaid: true,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export { pricing };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
2
|
+
interface PriceProjection {
|
|
3
|
+
readonly amount: number;
|
|
4
|
+
readonly currency: Currency;
|
|
5
|
+
readonly discountedPrice?: {
|
|
6
|
+
readonly amount: number;
|
|
7
|
+
readonly percentage: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export type { PriceProjection };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|