@lookiero/checkout 0.8.4-beta.10 → 0.8.4-beta.2
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/model/checkout.js +0 -1
- package/dist/infrastructure/delivery/http/fetchHttpClient.js +19 -36
- package/dist/infrastructure/delivery/http/httpClient.d.ts +3 -9
- package/dist/infrastructure/domain/checkout/react/useStartCheckout.d.ts +1 -3
- package/dist/infrastructure/domain/checkout/react/useStartCheckout.js +4 -11
- package/dist/infrastructure/domain/checkout/react/useSubmitCheckout.d.ts +1 -3
- package/dist/infrastructure/domain/checkout/react/useSubmitCheckout.js +6 -19
- package/dist/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +0 -2
- package/dist/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +4 -19
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem.d.ts +0 -2
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem.js +5 -20
- package/dist/infrastructure/domain/checkoutFeedback/react/useGiveCheckoutFeedback.d.ts +0 -2
- package/dist/infrastructure/domain/checkoutFeedback/react/useGiveCheckoutFeedback.js +5 -20
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.d.ts +0 -2
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.js +4 -19
- package/dist/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.d.ts +0 -2
- package/dist/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.js +5 -20
- package/dist/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.d.ts +0 -2
- package/dist/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.js +5 -20
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +1 -5
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.js +6 -13
- package/dist/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.js +8 -9
- package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.js +8 -9
- package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.js +8 -9
- package/dist/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.js +7 -8
- package/dist/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.js +7 -8
- package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.js +4 -1
- package/dist/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.js +8 -9
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.js +8 -9
- package/dist/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.js +8 -9
- package/dist/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.js +8 -9
- package/dist/infrastructure/projection/pricing/httpPricingByCheckoutIdView.js +8 -9
- package/dist/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.js +8 -9
- package/dist/infrastructure/ui/Root.js +1 -2
- package/dist/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +1 -8
- package/dist/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +2 -2
- package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.d.ts +2 -0
- package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.js +28 -0
- package/dist/infrastructure/ui/hooks/useSubmitCheckout.d.ts +0 -2
- package/dist/infrastructure/ui/hooks/useSubmitCheckout.js +13 -7
- package/dist/infrastructure/ui/i18n/i18n.d.ts +0 -1
- package/dist/infrastructure/ui/i18n/i18n.js +0 -1
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +1 -3
- package/dist/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +0 -3
- package/dist/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +1 -3
- package/dist/infrastructure/ui/views/feedback/Feedback.js +0 -3
- package/dist/infrastructure/ui/views/intro/Intro.js +1 -1
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -3
- package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -3
- package/dist/infrastructure/ui/views/item/Item.js +1 -6
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +2 -2
- package/dist/shared/logging/SentryLogger.d.ts +8 -3
- package/dist/shared/logging/SentryLogger.js +33 -27
- package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -2
- package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +7 -14
- package/dist/shared/notifications/infrastructure/domain/notification/react/useRemoveNotification.d.ts +0 -2
- package/dist/shared/notifications/infrastructure/domain/notification/react/useRemoveNotification.js +2 -9
- package/dist/shared/notifications/infrastructure/ui/views/Notifications.js +1 -3
- package/dist/shared/ui/components/layouts/slider/Slider.js +47 -12
- package/package.json +1 -2
- package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +0 -13
- package/dist/domain/checkout/command/markCheckoutAsPaid.js +0 -4
- package/dist/domain/checkout/model/checkoutPaid.d.ts +0 -13
- package/dist/domain/checkout/model/checkoutPaid.js +0 -4
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +0 -5
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +0 -13
- package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +0 -13
- package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +0 -16
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -13
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +0 -14
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +0 -9
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +0 -12
- package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +0 -12
- package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +0 -9
- package/dist/infrastructure/ui/views/App.style.d.ts +0 -4
- package/dist/infrastructure/ui/views/App.style.js +0 -16
- package/dist/infrastructure/ui/views/header/Header.d.ts +0 -15
- package/dist/infrastructure/ui/views/header/Header.js +0 -90
- package/dist/infrastructure/ui/views/header/Header.style.d.ts +0 -35
- package/dist/infrastructure/ui/views/header/Header.style.js +0 -38
- package/dist/infrastructure/ui/views/header/components/Logo.d.ts +0 -7
- package/dist/infrastructure/ui/views/header/components/Logo.js +0 -11
- package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +0 -7
- package/dist/infrastructure/ui/views/header/components/Logo.style.js +0 -8
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -10
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +0 -1
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
- package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +0 -25
- package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +0 -8
- package/dist/shared/logging/Logger.d.ts +0 -7
- package/dist/shared/logging/Logger.js +0 -1
- package/dist/shared/logging/SentryLoggerHOC.d.ts +0 -15
- package/dist/shared/logging/SentryLoggerHOC.js +0 -24
- package/dist/shared/logging/location.d.ts +0 -3
- package/dist/shared/logging/location.js +0 -5
- package/dist/shared/logging/matchRoutes.d.ts +0 -3
- package/dist/shared/logging/matchRoutes.js +0 -7
- package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +0 -29
- package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +0 -134
- package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +0 -22
- package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +0 -15
- package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +0 -27
- package/dist/shared/logging/reactRouterV6Instrumentation.native.js +0 -115
- package/dist/shared/logging/useLogger.d.ts +0 -12
- package/dist/shared/logging/useLogger.js +0 -10
- package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
- package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +0 -9
package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js
CHANGED
|
@@ -2,21 +2,14 @@ import { useCommand } from "@lookiero/messaging-react";
|
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { v4 as uuid } from "uuid";
|
|
4
4
|
import { createNotification } from "../../../../domain/notification/command/createNotification";
|
|
5
|
-
const useCreateNotification = ({ contextId
|
|
5
|
+
const useCreateNotification = ({ contextId }) => {
|
|
6
6
|
const [commandBus, status] = useCommand({ contextId });
|
|
7
|
-
const create = useCallback(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
bodyI18nKey,
|
|
14
|
-
}));
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
logger.captureException(error);
|
|
18
|
-
}
|
|
19
|
-
}, [commandBus, logger]);
|
|
7
|
+
const create = useCallback(({ aggregateId, level, titleI18nKey, bodyI18nKey }) => commandBus(createNotification({
|
|
8
|
+
aggregateId: aggregateId || uuid(),
|
|
9
|
+
level,
|
|
10
|
+
titleI18nKey,
|
|
11
|
+
bodyI18nKey,
|
|
12
|
+
})), [commandBus]);
|
|
20
13
|
return [create, status];
|
|
21
14
|
};
|
|
22
15
|
export { useCreateNotification };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
|
-
import { Logger } from "../../../../../logging/Logger";
|
|
3
2
|
interface RemoveNotificationFunctionArgs {
|
|
4
3
|
readonly aggregateId: string;
|
|
5
4
|
}
|
|
@@ -8,7 +7,6 @@ interface RemoveNotificationFunction {
|
|
|
8
7
|
}
|
|
9
8
|
interface UseRemoveNotificationFunctionArgs {
|
|
10
9
|
readonly contextId: string;
|
|
11
|
-
readonly logger: Logger;
|
|
12
10
|
}
|
|
13
11
|
interface UseRemoveNotificationFunction {
|
|
14
12
|
(args: UseRemoveNotificationFunctionArgs): [remove: RemoveNotificationFunction, status: CommandStatus];
|
package/dist/shared/notifications/infrastructure/domain/notification/react/useRemoveNotification.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { useCommand } from "@lookiero/messaging-react";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { removeNotification } from "../../../../domain/notification/command/removeNotification";
|
|
4
|
-
const useRemoveNotification = ({ contextId
|
|
4
|
+
const useRemoveNotification = ({ contextId }) => {
|
|
5
5
|
const [commandBus, status] = useCommand({ contextId });
|
|
6
|
-
const remove = useCallback(
|
|
7
|
-
try {
|
|
8
|
-
await commandBus(removeNotification({ aggregateId }));
|
|
9
|
-
}
|
|
10
|
-
catch (error) {
|
|
11
|
-
logger.captureException(error);
|
|
12
|
-
}
|
|
13
|
-
}, [commandBus, logger]);
|
|
6
|
+
const remove = useCallback(({ aggregateId }) => commandBus(removeNotification({ aggregateId })), [commandBus]);
|
|
14
7
|
return [remove, status];
|
|
15
8
|
};
|
|
16
9
|
export { useRemoveNotification };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
|
-
import { useLogger } from "../../../../logging/useLogger";
|
|
3
2
|
import { useListNotifications } from "../../../projection/notification/react/useListNotifications";
|
|
4
3
|
import { useRemoveNotification } from "../../domain/notification/react/useRemoveNotification";
|
|
5
4
|
import { Notifications as NotificationsTemplate } from "../components/Notifications";
|
|
6
5
|
const Notifications = ({ contextId }) => {
|
|
7
|
-
const logger = useLogger();
|
|
8
6
|
const [notifications] = useListNotifications({ contextId });
|
|
9
|
-
const [remove] = useRemoveNotification({ contextId
|
|
7
|
+
const [remove] = useRemoveNotification({ contextId });
|
|
10
8
|
const onRemove = useCallback((id) => remove({ aggregateId: id }), [remove]);
|
|
11
9
|
return React.createElement(NotificationsTemplate, { notifications: notifications, onRemove: onRemove });
|
|
12
10
|
};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { Animated,
|
|
3
|
-
|
|
2
|
+
import { Animated, // Dimensions,
|
|
3
|
+
I18nManager, PanResponder, StyleSheet, View, } from "react-native";
|
|
4
|
+
// import { Pagination } from "./Pagination";
|
|
4
5
|
import { style } from "./Slider.style";
|
|
5
6
|
const DEFAULT_WIDTH = 200;
|
|
6
|
-
const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5, minDistanceForAction = 0.2, gesturesEnabled = true,
|
|
7
|
+
const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5, minDistanceForAction = 0.2, gesturesEnabled = true,
|
|
8
|
+
// paginationEnabled = true,
|
|
9
|
+
// paginationStyle,
|
|
10
|
+
// paginationItemStyle,
|
|
11
|
+
// paginationActiveItemStyle,
|
|
12
|
+
onSliderStart, onSliderEnd, onChanged,
|
|
13
|
+
// paginationRenderItem,
|
|
14
|
+
}) => {
|
|
7
15
|
const flatennedChildren = children.flat();
|
|
8
16
|
const count = flatennedChildren.length;
|
|
9
17
|
const [width, setWidth] = useState(0);
|
|
@@ -100,7 +108,7 @@ const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5,
|
|
|
100
108
|
fixAndGo(delta);
|
|
101
109
|
}
|
|
102
110
|
}, [fixAndGo]);
|
|
103
|
-
const getActiveIndex = useCallback(() => activeIndex.current, []);
|
|
111
|
+
// const getActiveIndex = useCallback(() => activeIndex.current, []);
|
|
104
112
|
useEffect(() => {
|
|
105
113
|
pan.x.addListener(({ value }) => (animatedValueX.current = value));
|
|
106
114
|
pan.y.addListener(({ value }) => (animatedValueY.current = value));
|
|
@@ -120,13 +128,40 @@ const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5,
|
|
|
120
128
|
widthRef.current = width;
|
|
121
129
|
fixState();
|
|
122
130
|
}, [fixState]);
|
|
123
|
-
return (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
return (
|
|
132
|
+
// <View style={style.container} testID="slider" onLayout={onLayoutWrapper}>
|
|
133
|
+
// <Animated.View
|
|
134
|
+
// style={StyleSheet.flatten([
|
|
135
|
+
// {
|
|
136
|
+
// transform: [{ translateX: pan.x }, { translateY: pan.y }],
|
|
137
|
+
// },
|
|
138
|
+
// style.sliderAreaStyle,
|
|
139
|
+
// ])}
|
|
140
|
+
// {...panResponder.panHandlers}
|
|
141
|
+
// >
|
|
142
|
+
// {flatennedChildren.map((child, index) => (
|
|
143
|
+
// <View key={index} style={{ width }} testID="slider-child">
|
|
144
|
+
// {child}
|
|
145
|
+
// </View>
|
|
146
|
+
// ))}
|
|
147
|
+
// </Animated.View>
|
|
148
|
+
// {paginationEnabled && (
|
|
149
|
+
// <Pagination
|
|
150
|
+
// activeIndex={getActiveIndex()}
|
|
151
|
+
// count={count}
|
|
152
|
+
// paginationActiveItemStyle={paginationActiveItemStyle}
|
|
153
|
+
// paginationItemStyle={paginationItemStyle}
|
|
154
|
+
// paginationStyle={paginationStyle}
|
|
155
|
+
// renderItem={paginationRenderItem}
|
|
156
|
+
// onChange={(index) => goTo(index)}
|
|
157
|
+
// />
|
|
158
|
+
// )}
|
|
159
|
+
// </View>
|
|
160
|
+
React.createElement(Animated.View, { style: StyleSheet.flatten([
|
|
161
|
+
{
|
|
162
|
+
transform: [{ translateX: pan.x }, { translateY: pan.y }],
|
|
163
|
+
},
|
|
164
|
+
style.sliderAreaStyle,
|
|
165
|
+
]), onLayout: onLayoutWrapper, ...panResponder.panHandlers }, flatennedChildren.map((child, index) => (React.createElement(View, { key: index, style: { width: "100%" }, testID: "slider-child" }, child)))));
|
|
131
166
|
};
|
|
132
167
|
export { Slider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.8.4-beta.
|
|
3
|
+
"version": "0.8.4-beta.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -110,7 +110,6 @@
|
|
|
110
110
|
"prettier": "^2.7.1",
|
|
111
111
|
"react": "^18.0.0",
|
|
112
112
|
"react-dom": "^18.0.0",
|
|
113
|
-
"react-error-overlay": "^6.0.9",
|
|
114
113
|
"react-native": "^0.70.6",
|
|
115
114
|
"react-native-adjust": "^4.33.0",
|
|
116
115
|
"react-native-get-random-values": "^1.8.0",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Command } from "@lookiero/messaging";
|
|
2
|
-
declare const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
|
|
3
|
-
interface MarkCheckoutAsPaidPayload {
|
|
4
|
-
readonly aggregateId: string;
|
|
5
|
-
}
|
|
6
|
-
interface MarkCheckoutAsPaid extends Command<typeof MARK_CHECKOUT_AS_PAID>, MarkCheckoutAsPaidPayload {
|
|
7
|
-
}
|
|
8
|
-
interface MarkCheckoutAsPaidFunction {
|
|
9
|
-
(payload: MarkCheckoutAsPaidPayload): MarkCheckoutAsPaid;
|
|
10
|
-
}
|
|
11
|
-
declare const markCheckoutAsPaid: MarkCheckoutAsPaidFunction;
|
|
12
|
-
export type { MarkCheckoutAsPaid };
|
|
13
|
-
export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DomainEvent } from "@lookiero/messaging";
|
|
2
|
-
declare const CHECKOUT_PAID = "checkout_paid";
|
|
3
|
-
interface CheckoutPaidPayload {
|
|
4
|
-
readonly aggregateId: string;
|
|
5
|
-
}
|
|
6
|
-
interface CheckoutPaid extends DomainEvent<typeof CHECKOUT_PAID>, CheckoutPaidPayload {
|
|
7
|
-
}
|
|
8
|
-
interface CheckoutPaidFunction {
|
|
9
|
-
(payload: CheckoutPaidPayload): CheckoutPaid;
|
|
10
|
-
}
|
|
11
|
-
declare const checkoutPaid: CheckoutPaidFunction;
|
|
12
|
-
export type { CheckoutPaid };
|
|
13
|
-
export { CHECKOUT_PAID, checkoutPaid };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CHECKOUT_PAID } from "../../../../domain/checkout/model/checkoutPaid";
|
|
2
|
-
const isCheckoutPaid = (event) => event.name === CHECKOUT_PAID;
|
|
3
|
-
const httpCheckoutsMarkAsPaid = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
|
|
4
|
-
const checkoutPaid = domainEvents.find(isCheckoutPaid);
|
|
5
|
-
if (!checkoutPaid) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
await httpPost({
|
|
9
|
-
endpoint: "/mark-checkout-as-paid",
|
|
10
|
-
body: { checkoutId: aggregateId },
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export { httpCheckoutsMarkAsPaid };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
|
-
interface MarkAsPaidFunction {
|
|
3
|
-
(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
type UseMarkCheckoutAsPaid = [markAsPaid: MarkAsPaidFunction, status: CommandStatus];
|
|
6
|
-
interface UseMarkCheckoutAsPaidFunctionArgs {
|
|
7
|
-
readonly checkoutId?: string;
|
|
8
|
-
}
|
|
9
|
-
interface UseMarkCheckoutAsPaidFunction {
|
|
10
|
-
(args: UseMarkCheckoutAsPaidFunctionArgs): UseMarkCheckoutAsPaid;
|
|
11
|
-
}
|
|
12
|
-
declare const useMarkCheckoutAsPaid: UseMarkCheckoutAsPaidFunction;
|
|
13
|
-
export { useMarkCheckoutAsPaid };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCommand } from "@lookiero/messaging-react";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import invariant from "tiny-invariant";
|
|
4
|
-
import { markCheckoutAsPaid } from "../../../../domain/checkout/command/markCheckoutAsPaid";
|
|
5
|
-
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
6
|
-
const useMarkCheckoutAsPaid = ({ checkoutId }) => {
|
|
7
|
-
const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
|
|
8
|
-
const markAsPaid = useCallback(() => {
|
|
9
|
-
invariant(checkoutId, "CheckoutId must be defined in order to mark the checkout as paid");
|
|
10
|
-
return commandBus(markCheckoutAsPaid({
|
|
11
|
-
aggregateId: checkoutId,
|
|
12
|
-
}));
|
|
13
|
-
}, [checkoutId, commandBus]);
|
|
14
|
-
return [markAsPaid, status];
|
|
15
|
-
};
|
|
16
|
-
export { useMarkCheckoutAsPaid };
|
package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
|
-
interface BookFunction {
|
|
3
|
-
(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
|
|
6
|
-
interface UseBookCheckouBookingForCheckoutItemFunctionArgs {
|
|
7
|
-
readonly checkoutItemId: string;
|
|
8
|
-
}
|
|
9
|
-
interface UseBookCheckouBookingForCheckoutItemFunction {
|
|
10
|
-
(args: UseBookCheckouBookingForCheckoutItemFunctionArgs): UseBookCheckouBookingForCheckoutItem;
|
|
11
|
-
}
|
|
12
|
-
declare const useBookCheckouBookingForCheckoutItem: UseBookCheckouBookingForCheckoutItemFunction;
|
|
13
|
-
export { useBookCheckouBookingForCheckoutItem };
|
package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useCommand } from "@lookiero/messaging-react";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { v4 as uuid } from "uuid";
|
|
4
|
-
import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
|
|
5
|
-
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
6
|
-
const useBookCheckouBookingForCheckoutItem = ({ checkoutItemId }) => {
|
|
7
|
-
const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
|
|
8
|
-
const book = useCallback(() => commandBus(bookCheckoutBookingForCheckoutItem({
|
|
9
|
-
aggregateId: uuid(),
|
|
10
|
-
checkoutItemId,
|
|
11
|
-
})), [checkoutItemId, commandBus]);
|
|
12
|
-
return [book, status];
|
|
13
|
-
};
|
|
14
|
-
export { useBookCheckouBookingForCheckoutItem };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BookedSizeChangeProductsVariantsForCheckoutItemView } from "../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
|
|
2
|
-
import { HttpPostFunction } from "../../delivery/http/httpClient";
|
|
3
|
-
interface HttpBookedSizeChangeProductsVariantsForCheckoutItemView extends BookedSizeChangeProductsVariantsForCheckoutItemView {
|
|
4
|
-
}
|
|
5
|
-
interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs {
|
|
6
|
-
readonly httpPost: HttpPostFunction;
|
|
7
|
-
}
|
|
8
|
-
interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction {
|
|
9
|
-
(args: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs): HttpBookedSizeChangeProductsVariantsForCheckoutItemView;
|
|
10
|
-
}
|
|
11
|
-
declare const httpBookedSizeChangeProductsVariantsForCheckoutItemView: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction;
|
|
12
|
-
export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
|
|
2
|
-
const response = await httpPost({
|
|
3
|
-
endpoint: "/view-booked-size-change-product-variants-for-checkout-item",
|
|
4
|
-
body: { checkoutItemId },
|
|
5
|
-
signal,
|
|
6
|
-
});
|
|
7
|
-
return !response.ok || response.status === 404 ? null : (await response.json()).result;
|
|
8
|
-
};
|
|
9
|
-
export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { UseQueryFunctionResult } from "@lookiero/messaging-react";
|
|
2
|
-
import { BookedSizeChangeProductsVariantsProjection } from "../../../../projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants";
|
|
3
|
-
interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs {
|
|
4
|
-
readonly checkoutItemId: string;
|
|
5
|
-
}
|
|
6
|
-
interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction {
|
|
7
|
-
(args: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs): UseQueryFunctionResult<BookedSizeChangeProductsVariantsProjection>;
|
|
8
|
-
}
|
|
9
|
-
declare const useViewBookedSizeChangeProductsVariantsForCheckoutItem: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction;
|
|
10
|
-
export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useQuery } from "@lookiero/messaging-react";
|
|
2
|
-
import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
|
|
3
|
-
import { viewBookedSizeChangeProductsVariantsForCheckoutItem } from "../../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
|
|
4
|
-
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
5
|
-
const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
|
|
6
|
-
const useViewBookedSizeChangeProductsVariantsForCheckoutItem = ({ checkoutItemId }) => useQuery({
|
|
7
|
-
query: viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId }),
|
|
8
|
-
contextId: MESSAGING_CONTEXT_ID,
|
|
9
|
-
invalidation: isCheckoutBookingBooked,
|
|
10
|
-
options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
|
|
11
|
-
});
|
|
12
|
-
export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
|
package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CheckoutFeedbackByCheckoutIdView } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId";
|
|
2
|
-
import { HttpPostFunction } from "../../delivery/http/httpClient";
|
|
3
|
-
interface HttpCheckoutFeebackByCheckoutIdView extends CheckoutFeedbackByCheckoutIdView {
|
|
4
|
-
}
|
|
5
|
-
interface HttpCheckoutFeebackByCheckoutIdViewFunctionArgs {
|
|
6
|
-
readonly httpPost: HttpPostFunction;
|
|
7
|
-
}
|
|
8
|
-
interface HttpCheckoutFeebackByCheckoutIdViewFunction {
|
|
9
|
-
(args: HttpCheckoutFeebackByCheckoutIdViewFunctionArgs): HttpCheckoutFeebackByCheckoutIdView;
|
|
10
|
-
}
|
|
11
|
-
declare const httpCheckoutFeebackByCheckoutIdView: HttpCheckoutFeebackByCheckoutIdViewFunction;
|
|
12
|
-
export { httpCheckoutFeebackByCheckoutIdView };
|
package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const httpCheckoutFeebackByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => {
|
|
2
|
-
const response = await httpPost({
|
|
3
|
-
endpoint: "/view-checkout-feedback-by-checkout-id",
|
|
4
|
-
body: { checkoutId },
|
|
5
|
-
signal,
|
|
6
|
-
});
|
|
7
|
-
return !response.ok || response.status === 404 ? null : (await response.json()).result;
|
|
8
|
-
};
|
|
9
|
-
export { httpCheckoutFeebackByCheckoutIdView };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Platform, StyleSheet } from "react-native";
|
|
2
|
-
const style = StyleSheet.create({
|
|
3
|
-
header: {
|
|
4
|
-
...Platform.select({
|
|
5
|
-
web: {
|
|
6
|
-
position: "fixed",
|
|
7
|
-
zIndex: 1,
|
|
8
|
-
},
|
|
9
|
-
native: {
|
|
10
|
-
position: "absolute",
|
|
11
|
-
zIndex: 1,
|
|
12
|
-
},
|
|
13
|
-
}),
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
export { style };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
interface MenuProps {
|
|
4
|
-
readonly isVisible: boolean;
|
|
5
|
-
readonly onClose: () => void;
|
|
6
|
-
}
|
|
7
|
-
type Menu = FC<MenuProps>;
|
|
8
|
-
interface HeaderProps {
|
|
9
|
-
readonly customerId: string;
|
|
10
|
-
readonly menu: Menu;
|
|
11
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
12
|
-
}
|
|
13
|
-
declare const Header: FC<HeaderProps>;
|
|
14
|
-
export type { Menu };
|
|
15
|
-
export { Header };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
|
-
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
-
import React, { useCallback, useState } from "react";
|
|
4
|
-
import { Platform, StatusBar, View } from "react-native";
|
|
5
|
-
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
|
-
import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
|
|
7
|
-
import { ButtonIcon } from "../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
|
|
8
|
-
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
9
|
-
import { I18nMessages } from "../../i18n/i18n";
|
|
10
|
-
import { Routes } from "../../routing/routes";
|
|
11
|
-
import { useBasePath } from "../../routing/useBasePath";
|
|
12
|
-
import { style } from "./Header.style";
|
|
13
|
-
import { Logo } from "./components/Logo";
|
|
14
|
-
const ButtonIconPlaceholder = () => React.createElement(View, { style: style.buttonIconPlaceholder });
|
|
15
|
-
const DefaultHeader = ({ onOpenMenu }) => (React.createElement(View, { style: style.header, testID: "default-header" },
|
|
16
|
-
React.createElement(Logo, { style: style.logo }),
|
|
17
|
-
React.createElement(ButtonIconPlaceholder, null),
|
|
18
|
-
React.createElement(ButtonIcon, { name: "menu", onPress: onOpenMenu })));
|
|
19
|
-
const ItemHeader = ({ items, item }) => {
|
|
20
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
21
|
-
const itemIndex = items.indexOf(item);
|
|
22
|
-
const isFirstItem = itemIndex === 0;
|
|
23
|
-
const isLastItem = itemIndex === items.length - 1;
|
|
24
|
-
const basePath = useBasePath();
|
|
25
|
-
const navigate = useNavigate();
|
|
26
|
-
const navigateToPreviousItem = useCallback(() => {
|
|
27
|
-
const previousItemIndex = itemIndex === 0 ? items.length - 1 : itemIndex - 1;
|
|
28
|
-
const previousItem = items[previousItemIndex];
|
|
29
|
-
navigate(generatePath(`${basePath}/${Routes.ITEM}`, { id: previousItem.id }));
|
|
30
|
-
}, [basePath, itemIndex, items, navigate]);
|
|
31
|
-
const navigateToNextItem = useCallback(() => {
|
|
32
|
-
const nextItemIndex = itemIndex === items.length - 1 ? 0 : itemIndex + 1;
|
|
33
|
-
const nextItem = items[nextItemIndex];
|
|
34
|
-
navigate(generatePath(`${basePath}/${Routes.ITEM}`, { id: nextItem.id }));
|
|
35
|
-
}, [basePath, itemIndex, items, navigate]);
|
|
36
|
-
return (React.createElement(View, { style: style.header, testID: "item-header" },
|
|
37
|
-
!isFirstItem ? React.createElement(ButtonIcon, { name: "arrow-left", onPress: navigateToPreviousItem }) : React.createElement(ButtonIconPlaceholder, null),
|
|
38
|
-
React.createElement(Text, { level: 3, style: style.title, detail: true }, title),
|
|
39
|
-
!isLastItem ? React.createElement(ButtonIcon, { name: "arrow-right", onPress: navigateToNextItem }) : React.createElement(ButtonIconPlaceholder, null)));
|
|
40
|
-
};
|
|
41
|
-
const ItemDetailHeader = () => {
|
|
42
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_CHECKOUT_TITLE });
|
|
43
|
-
const navigate = useNavigate();
|
|
44
|
-
const handleOnBack = useCallback(() => navigate(-1), [navigate]);
|
|
45
|
-
return (React.createElement(View, { style: style.header, testID: "item-detail-header" },
|
|
46
|
-
React.createElement(ButtonIconPlaceholder, null),
|
|
47
|
-
React.createElement(Text, { level: 3, style: style.title, detail: true }, title),
|
|
48
|
-
React.createElement(ButtonIcon, { name: "close", onPress: handleOnBack })));
|
|
49
|
-
};
|
|
50
|
-
const CheckoutHeader = () => {
|
|
51
|
-
const title = useI18nMessage({ id: I18nMessages.HEADER_COMPLETE_CHECKOUT_TITLE });
|
|
52
|
-
const basePath = useBasePath();
|
|
53
|
-
const navigate = useNavigate();
|
|
54
|
-
const handleOnBack = useCallback(() => navigate(`${basePath}/${Routes.SUMMARY}`), [basePath, navigate]);
|
|
55
|
-
return (React.createElement(View, { style: style.header, testID: "checkout-header" },
|
|
56
|
-
React.createElement(ButtonIcon, { name: "arrow-left", onPress: handleOnBack }),
|
|
57
|
-
React.createElement(Text, { level: 3, style: style.title, detail: true }, title),
|
|
58
|
-
React.createElement(ButtonIconPlaceholder, null)));
|
|
59
|
-
};
|
|
60
|
-
const Header = ({ customerId, menu: Menu, style: customStyle }) => {
|
|
61
|
-
const { id: itemId } = useParams();
|
|
62
|
-
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
63
|
-
const currentItem = checkout?.items.find((item) => item.id === itemId);
|
|
64
|
-
const basePath = useBasePath();
|
|
65
|
-
const itemRouteMatch = useMatch(`${basePath}/${Routes.ITEM}`);
|
|
66
|
-
const itemDetailRouteMatch = useMatch(`${basePath}/${Routes.ITEM_DETAIL}`);
|
|
67
|
-
const checkoutRouteMatch = useMatch(`${basePath}/${Routes.CHECKOUT}`);
|
|
68
|
-
const [menuVisible, setMenuVisible] = useState(false);
|
|
69
|
-
const handleOnOpenMenu = useCallback(() => setMenuVisible(true), []);
|
|
70
|
-
const handleOnCloseMenu = useCallback(() => setMenuVisible(false), []);
|
|
71
|
-
let header;
|
|
72
|
-
if (checkout?.items && currentItem) {
|
|
73
|
-
if (itemRouteMatch) {
|
|
74
|
-
header = React.createElement(ItemHeader, { item: currentItem, items: checkout.items });
|
|
75
|
-
}
|
|
76
|
-
else if (itemDetailRouteMatch) {
|
|
77
|
-
header = React.createElement(ItemDetailHeader, null);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else if (checkoutRouteMatch) {
|
|
81
|
-
header = React.createElement(CheckoutHeader, null);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
header = React.createElement(DefaultHeader, { onOpenMenu: handleOnOpenMenu });
|
|
85
|
-
}
|
|
86
|
-
return (React.createElement(React.Fragment, null,
|
|
87
|
-
React.createElement(SafeAreaView, { edges: ["top"], style: [style.container, Platform.OS === "android" && { paddingTop: StatusBar.currentHeight }, customStyle] }, header),
|
|
88
|
-
React.createElement(Menu, { isVisible: menuVisible, onClose: handleOnCloseMenu })));
|
|
89
|
-
};
|
|
90
|
-
export { Header };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
declare const HEADER_HEIGHT: number;
|
|
2
|
-
declare const style: {
|
|
3
|
-
buttonIconPlaceholder: {
|
|
4
|
-
flexGrow: number;
|
|
5
|
-
height: number;
|
|
6
|
-
width: number;
|
|
7
|
-
};
|
|
8
|
-
container: {
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
flexDirection: "row";
|
|
11
|
-
flexGrow: number;
|
|
12
|
-
height: number;
|
|
13
|
-
width: string;
|
|
14
|
-
};
|
|
15
|
-
header: {
|
|
16
|
-
alignItems: "center";
|
|
17
|
-
flexDirection: "row";
|
|
18
|
-
flexGrow: number;
|
|
19
|
-
flexWrap: "nowrap";
|
|
20
|
-
height: number;
|
|
21
|
-
justifyContent: "space-between";
|
|
22
|
-
overflow: "visible";
|
|
23
|
-
paddingHorizontal: number;
|
|
24
|
-
width: string;
|
|
25
|
-
};
|
|
26
|
-
logo: {
|
|
27
|
-
left: number;
|
|
28
|
-
position: "absolute";
|
|
29
|
-
top: number;
|
|
30
|
-
};
|
|
31
|
-
title: {
|
|
32
|
-
textTransform: "uppercase";
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export { style, HEADER_HEIGHT };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "../../theme/theme";
|
|
3
|
-
const { colorBase, spaceXXL, spaceXXXL, spaceS } = theme();
|
|
4
|
-
const HEADER_HEIGHT = spaceXXXL;
|
|
5
|
-
const style = StyleSheet.create({
|
|
6
|
-
buttonIconPlaceholder: {
|
|
7
|
-
flexGrow: 0,
|
|
8
|
-
height: spaceXXL,
|
|
9
|
-
width: spaceXXL,
|
|
10
|
-
},
|
|
11
|
-
container: {
|
|
12
|
-
backgroundColor: colorBase,
|
|
13
|
-
flexDirection: "row",
|
|
14
|
-
flexGrow: 0,
|
|
15
|
-
height: HEADER_HEIGHT,
|
|
16
|
-
width: "100%",
|
|
17
|
-
},
|
|
18
|
-
header: {
|
|
19
|
-
alignItems: "center",
|
|
20
|
-
flexDirection: "row",
|
|
21
|
-
flexGrow: 0,
|
|
22
|
-
flexWrap: "nowrap",
|
|
23
|
-
height: HEADER_HEIGHT,
|
|
24
|
-
justifyContent: "space-between",
|
|
25
|
-
overflow: "visible",
|
|
26
|
-
paddingHorizontal: spaceS,
|
|
27
|
-
width: "100%",
|
|
28
|
-
},
|
|
29
|
-
logo: {
|
|
30
|
-
left: 0,
|
|
31
|
-
position: "absolute",
|
|
32
|
-
top: 0,
|
|
33
|
-
},
|
|
34
|
-
title: {
|
|
35
|
-
textTransform: "uppercase",
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
export { style, HEADER_HEIGHT };
|