@lookiero/checkout 0.4.6-beta.4 → 0.4.7
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/submitCheckout.d.ts +13 -0
- package/dist/domain/checkout/command/submitCheckout.js +4 -0
- package/dist/domain/checkout/model/checkout.d.ts +4 -4
- package/dist/domain/checkout/model/checkout.js +6 -6
- package/dist/domain/checkout/model/checkoutSubmitted.d.ts +13 -0
- package/dist/domain/checkout/model/checkoutSubmitted.js +4 -0
- package/dist/infrastructure/delivery/baseBootstrap.js +3 -3
- package/dist/infrastructure/domain/checkout/model/httpCheckouts.js +2 -2
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsSubmit.d.ts +5 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsSubmit.js +13 -0
- package/dist/infrastructure/domain/checkout/react/useSubmitCheckout.d.ts +13 -0
- package/dist/infrastructure/domain/checkout/react/{useMarkCheckoutAsPaid.js → useSubmitCheckout.js} +7 -7
- package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.js +3 -3
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +0 -1
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +5 -7
- package/dist/infrastructure/ui/hooks/useSubmitCheckout.js +8 -8
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +2 -2
- package/dist/infrastructure/ui/views/checkout/Checkout.js +1 -1
- package/dist/infrastructure/ui/views/feedback/Feedback.js +1 -1
- package/dist/infrastructure/ui/views/header/Header.d.ts +1 -1
- package/dist/infrastructure/ui/views/header/Header.js +6 -5
- package/dist/infrastructure/ui/views/header/Header.style.d.ts +1 -1
- package/dist/infrastructure/ui/views/header/Header.style.js +1 -1
- package/dist/infrastructure/ui/views/item/Item.js +2 -1
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +1 -3
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +1 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +2 -1
- package/dist/infrastructure/ui/views/summary/Summary.js +9 -7
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +1 -3
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +1 -0
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +2 -1
- package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +2 -2
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +1 -4
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +1 -2
- package/dist/shared/ui/components/atoms/field/Field.js +1 -1
- package/dist/shared/ui/components/atoms/field/Field.style.d.ts +0 -2
- package/dist/shared/ui/components/atoms/field/Field.style.js +0 -2
- package/dist/shared/ui/components/atoms/input/Input.js +1 -1
- package/dist/shared/ui/components/atoms/input/Input.style.d.ts +3 -0
- package/dist/shared/ui/components/atoms/input/Input.style.js +3 -3
- package/dist/shared/ui/components/layouts/stack/Stack.js +5 -4
- package/dist/shared/ui/components/layouts/sticky/Sticky.style.d.ts +0 -3
- package/dist/shared/ui/components/layouts/sticky/Sticky.style.js +9 -4
- package/dist/shared/ui/components/molecules/inputField/InputField.js +1 -6
- 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/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/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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from "@lookiero/messaging";
|
|
2
|
+
declare const SUBMIT_CHECKOUT = "submit_checkout";
|
|
3
|
+
interface SubmitCheckoutPayload {
|
|
4
|
+
readonly aggregateId: string;
|
|
5
|
+
}
|
|
6
|
+
interface SubmitCheckout extends Command<typeof SUBMIT_CHECKOUT>, SubmitCheckoutPayload {
|
|
7
|
+
}
|
|
8
|
+
interface SubmitCheckoutFunction {
|
|
9
|
+
(payload: SubmitCheckoutPayload): SubmitCheckout;
|
|
10
|
+
}
|
|
11
|
+
declare const submitCheckout: SubmitCheckoutFunction;
|
|
12
|
+
export type { SubmitCheckout };
|
|
13
|
+
export { SUBMIT_CHECKOUT, submitCheckout };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AggregateRoot, CommandHandlerFunction } from "@lookiero/messaging";
|
|
2
|
-
import { MarkCheckoutAsPaid } from "../command/markCheckoutAsPaid";
|
|
3
2
|
import { StartCheckout } from "../command/startCheckout";
|
|
3
|
+
import { SubmitCheckout } from "../command/submitCheckout";
|
|
4
4
|
declare enum CheckoutStatus {
|
|
5
5
|
AVAILABLE = "AVAILABLE",
|
|
6
6
|
NOTIFIED = "NOTIFIED",
|
|
7
7
|
STARTED = "STARTED",
|
|
8
8
|
COMPLETED = "COMPLETED",
|
|
9
|
-
|
|
9
|
+
SUBMITTED = "SUBMITTED",
|
|
10
10
|
EXPIRED = "EXPIRED"
|
|
11
11
|
}
|
|
12
12
|
interface Checkout extends AggregateRoot {
|
|
@@ -17,6 +17,6 @@ interface Checkout extends AggregateRoot {
|
|
|
17
17
|
readonly expiresOn: Date;
|
|
18
18
|
}
|
|
19
19
|
declare const startCheckoutHandler: CommandHandlerFunction<StartCheckout, Checkout>;
|
|
20
|
-
declare const
|
|
20
|
+
declare const submitCheckoutHandler: CommandHandlerFunction<SubmitCheckout, Checkout>;
|
|
21
21
|
export type { Checkout };
|
|
22
|
-
export { CheckoutStatus, startCheckoutHandler,
|
|
22
|
+
export { CheckoutStatus, startCheckoutHandler, submitCheckoutHandler };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import invariant from "tiny-invariant";
|
|
2
|
-
import { checkoutPaid } from "./checkoutPaid";
|
|
3
2
|
import { checkoutStarted } from "./checkoutStarted";
|
|
3
|
+
import { checkoutSubmitted } from "./checkoutSubmitted";
|
|
4
4
|
var CheckoutStatus;
|
|
5
5
|
(function (CheckoutStatus) {
|
|
6
6
|
CheckoutStatus["AVAILABLE"] = "AVAILABLE";
|
|
7
7
|
CheckoutStatus["NOTIFIED"] = "NOTIFIED";
|
|
8
8
|
CheckoutStatus["STARTED"] = "STARTED";
|
|
9
9
|
CheckoutStatus["COMPLETED"] = "COMPLETED";
|
|
10
|
-
CheckoutStatus["
|
|
10
|
+
CheckoutStatus["SUBMITTED"] = "SUBMITTED";
|
|
11
11
|
CheckoutStatus["EXPIRED"] = "EXPIRED";
|
|
12
12
|
})(CheckoutStatus || (CheckoutStatus = {}));
|
|
13
13
|
const startCheckoutHandler = () => async ({ aggregateRoot, command }) => {
|
|
@@ -20,13 +20,13 @@ const startCheckoutHandler = () => async ({ aggregateRoot, command }) => {
|
|
|
20
20
|
domainEvents: [checkoutStarted({ aggregateId })],
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
const
|
|
23
|
+
const submitCheckoutHandler = () => async ({ aggregateRoot, command }) => {
|
|
24
24
|
const { aggregateId } = command;
|
|
25
25
|
invariant(aggregateRoot.status !== CheckoutStatus.COMPLETED, "Checkout is already completed");
|
|
26
26
|
return {
|
|
27
27
|
...aggregateRoot,
|
|
28
|
-
status: CheckoutStatus.
|
|
29
|
-
domainEvents: [
|
|
28
|
+
status: CheckoutStatus.SUBMITTED,
|
|
29
|
+
domainEvents: [checkoutSubmitted({ aggregateId })],
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
export { CheckoutStatus, startCheckoutHandler,
|
|
32
|
+
export { CheckoutStatus, startCheckoutHandler, submitCheckoutHandler };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DomainEvent } from "@lookiero/messaging";
|
|
2
|
+
declare const CHECKOUT_SUBMITTED = "checkout_submitted";
|
|
3
|
+
interface CheckoutSubmittedPayload {
|
|
4
|
+
readonly aggregateId: string;
|
|
5
|
+
}
|
|
6
|
+
interface CheckoutSubmitted extends DomainEvent<typeof CHECKOUT_SUBMITTED>, CheckoutSubmittedPayload {
|
|
7
|
+
}
|
|
8
|
+
interface CheckoutSubmittedFunction {
|
|
9
|
+
(payload: CheckoutSubmittedPayload): CheckoutSubmitted;
|
|
10
|
+
}
|
|
11
|
+
declare const checkoutSubmitted: CheckoutSubmittedFunction;
|
|
12
|
+
export type { CheckoutSubmitted };
|
|
13
|
+
export { CHECKOUT_SUBMITTED, checkoutSubmitted };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { bootstrap as messagingBootstrap } from "@lookiero/messaging-react";
|
|
2
|
-
import { MARK_CHECKOUT_AS_PAID } from "../../domain/checkout/command/markCheckoutAsPaid";
|
|
3
2
|
import { START_CHECKOUT } from "../../domain/checkout/command/startCheckout";
|
|
4
|
-
import {
|
|
3
|
+
import { SUBMIT_CHECKOUT } from "../../domain/checkout/command/submitCheckout";
|
|
4
|
+
import { submitCheckoutHandler, startCheckoutHandler } from "../../domain/checkout/model/checkout";
|
|
5
5
|
import { BLOCK_CHECKOUT_BOOKING } from "../../domain/checkoutBooking/command/blockCheckoutBooking";
|
|
6
6
|
import { BOOK_CHECKOUT_BOOKING_FOR_CHECKOUT_ITEM } from "../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
|
|
7
7
|
import { createNotificationWhenCheckoutBookingExpired } from "../../domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired";
|
|
@@ -47,7 +47,7 @@ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdVie
|
|
|
47
47
|
})
|
|
48
48
|
.query(VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerIdHandler)
|
|
49
49
|
.command(START_CHECKOUT, startCheckoutHandler)(getCheckout, saveCheckout, ...checkoutsDependencies)
|
|
50
|
-
.command(
|
|
50
|
+
.command(SUBMIT_CHECKOUT, submitCheckoutHandler)(getCheckout, saveCheckout, ...checkoutsDependencies)
|
|
51
51
|
.query(VIEW_CHECKOUT_ITEM_BY_ID, viewCheckoutItemByIdHandler, {
|
|
52
52
|
view: checkoutItemByIdView,
|
|
53
53
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import invariant from "tiny-invariant";
|
|
2
2
|
import { viewCheckoutById, } from "../../../../projection/checkout/viewCheckoutById";
|
|
3
|
-
import { httpCheckoutsMarkAsPaid } from "./httpCheckoutsMarkAsPaid";
|
|
4
3
|
import { httpCheckoutsStart } from "./httpCheckoutsStart";
|
|
4
|
+
import { httpCheckoutsSubmit } from "./httpCheckoutsSubmit";
|
|
5
5
|
const toDomain = (checkout) => {
|
|
6
6
|
invariant(checkout, "No checkout found!");
|
|
7
7
|
return {
|
|
@@ -19,7 +19,7 @@ const getCheckout = ({ queryBus }) => async (aggregateId) => toDomain(await quer
|
|
|
19
19
|
const saveCheckout = ({ httpPost }) => async (aggregateRoot) => {
|
|
20
20
|
await Promise.all([
|
|
21
21
|
httpCheckoutsStart({ httpPost })(aggregateRoot),
|
|
22
|
-
|
|
22
|
+
httpCheckoutsSubmit({ httpPost })(aggregateRoot),
|
|
23
23
|
]);
|
|
24
24
|
};
|
|
25
25
|
export { getCheckout, saveCheckout };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CHECKOUT_SUBMITTED } from "../../../../domain/checkout/model/checkoutSubmitted";
|
|
2
|
+
const isCheckoutSubmitted = (event) => event.name === CHECKOUT_SUBMITTED;
|
|
3
|
+
const httpCheckoutsSubmit = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
|
|
4
|
+
const checkoutSubmitted = domainEvents.find(isCheckoutSubmitted);
|
|
5
|
+
if (!checkoutSubmitted) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
await httpPost({
|
|
9
|
+
endpoint: "/submit-checkout",
|
|
10
|
+
body: { checkoutId: aggregateId },
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export { httpCheckoutsSubmit };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
|
+
interface SubmitFunction {
|
|
3
|
+
(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
type UseSubmitCheckout = [submit: SubmitFunction, status: CommandStatus];
|
|
6
|
+
interface UseSubmitCheckoutFunctionArgs {
|
|
7
|
+
readonly checkoutId?: string;
|
|
8
|
+
}
|
|
9
|
+
interface UseSubmitCheckoutFunction {
|
|
10
|
+
(args: UseSubmitCheckoutFunctionArgs): UseSubmitCheckout;
|
|
11
|
+
}
|
|
12
|
+
declare const useSubmitCheckout: UseSubmitCheckoutFunction;
|
|
13
|
+
export { useSubmitCheckout };
|
package/dist/infrastructure/domain/checkout/react/{useMarkCheckoutAsPaid.js → useSubmitCheckout.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCommand } from "@lookiero/messaging-react";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import invariant from "tiny-invariant";
|
|
4
|
-
import {
|
|
4
|
+
import { submitCheckout } from "../../../../domain/checkout/command/submitCheckout";
|
|
5
5
|
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
6
|
-
const
|
|
6
|
+
const useSubmitCheckout = ({ checkoutId }) => {
|
|
7
7
|
const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
|
|
8
|
-
const
|
|
9
|
-
invariant(checkoutId, "CheckoutId must be defined in order to
|
|
10
|
-
return commandBus(
|
|
8
|
+
const submit = useCallback(() => {
|
|
9
|
+
invariant(checkoutId, "CheckoutId must be defined in order to submit checkout");
|
|
10
|
+
return commandBus(submitCheckout({
|
|
11
11
|
aggregateId: checkoutId,
|
|
12
12
|
}));
|
|
13
13
|
}, [checkoutId, commandBus]);
|
|
14
|
-
return [
|
|
14
|
+
return [submit, status];
|
|
15
15
|
};
|
|
16
|
-
export {
|
|
16
|
+
export { useSubmitCheckout };
|
package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useQuery } from "@lookiero/messaging-react";
|
|
2
|
-
import {
|
|
2
|
+
import { CHECKOUT_SUBMITTED } from "../../../../domain/checkout/model/checkoutSubmitted";
|
|
3
3
|
import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
|
|
4
4
|
import { CHECKOUT_BOOKING_EXPIRED, } from "../../../../domain/checkoutBooking/model/checkoutBookingExpired";
|
|
5
5
|
import { CHECKOUT_FEEDBACK_GIVEN, } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
|
|
@@ -11,14 +11,14 @@ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
|
11
11
|
const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
|
|
12
12
|
const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
|
|
13
13
|
const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
|
|
14
|
-
const
|
|
14
|
+
const isCheckoutSubmitted = (event) => event.name === CHECKOUT_SUBMITTED;
|
|
15
15
|
const isCheckoutFeedbackGiven = (event) => event.name === CHECKOUT_FEEDBACK_GIVEN;
|
|
16
16
|
const isCheckoutBookingExpired = (event) => event.name === CHECKOUT_BOOKING_EXPIRED;
|
|
17
17
|
const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
|
|
18
18
|
const shouldInvalidate = (event) => isCheckoutItemKept(event) ||
|
|
19
19
|
isCheckoutItemReplaced(event) ||
|
|
20
20
|
isCheckoutItemReturned(event) ||
|
|
21
|
-
|
|
21
|
+
isCheckoutSubmitted(event) ||
|
|
22
22
|
isCheckoutFeedbackGiven(event) ||
|
|
23
23
|
isCheckoutBookingExpired(event) ||
|
|
24
24
|
isCheckoutBookingBooked(event);
|
|
@@ -4,7 +4,6 @@ import { Edge } from "react-native-safe-area-context";
|
|
|
4
4
|
type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
|
|
5
5
|
interface SafeAreaScrollViewProps {
|
|
6
6
|
readonly children: ReactNode;
|
|
7
|
-
readonly footer?: ReactNode;
|
|
8
7
|
readonly scrollerPaddingTop?: number;
|
|
9
8
|
readonly edges?: Edge[];
|
|
10
9
|
readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ScrollView } from "react-native";
|
|
3
3
|
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
-
|
|
5
|
-
const { spaceXXXL } = theme();
|
|
6
|
-
const SafeAreaScrollView = ({ children, footer, edges = ["top", "bottom", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
|
|
4
|
+
const SafeAreaScrollView = ({ children, edges = ["top", "bottom", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
|
|
7
5
|
const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
|
|
8
6
|
return (React.createElement(SafeAreaView, { edges: edges, style: customStyle?.safeAreaView },
|
|
9
7
|
React.createElement(ScrollView, { contentContainerStyle: [
|
|
10
8
|
{
|
|
9
|
+
// Why did we set this??
|
|
11
10
|
paddingTop: safeAreaInsetTop + scrollerPaddingTop,
|
|
12
|
-
paddingBottom: safeAreaInsetBottom
|
|
11
|
+
paddingBottom: safeAreaInsetBottom,
|
|
13
12
|
},
|
|
14
13
|
customStyle?.scrollView,
|
|
15
|
-
] }, children)
|
|
16
|
-
footer));
|
|
14
|
+
] }, children)));
|
|
17
15
|
};
|
|
18
16
|
export { SafeAreaScrollView };
|
|
@@ -4,11 +4,11 @@ import { useCallback, useMemo, useState } from "react";
|
|
|
4
4
|
import { useCreateNotification } from "../../../shared/notifications";
|
|
5
5
|
import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
|
|
6
6
|
import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
|
|
7
|
-
import {
|
|
7
|
+
import { useSubmitCheckout as useSubmitCheckoutCommand } from "../../domain/checkout/react/useSubmitCheckout";
|
|
8
8
|
import { useBlockCheckoutBooking } from "../../domain/checkoutBooking/react/useBlockCheckoutBooking";
|
|
9
9
|
import { I18nMessages } from "../i18n/i18n";
|
|
10
10
|
const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onError }) => {
|
|
11
|
-
const [
|
|
11
|
+
const [submitCheckoutCommand, submitCheckoutCommandStatus] = useSubmitCheckoutCommand({ checkoutId });
|
|
12
12
|
const [blockCheckoutBooking, blockCheckoutBookingStatus] = useBlockCheckoutBooking({ checkoutBookingId });
|
|
13
13
|
const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID });
|
|
14
14
|
const [startLegacyBoxCheckoutStatus, setStartLegacyBoxCheckoutStatus] = useState("idle");
|
|
@@ -39,31 +39,31 @@ const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onEr
|
|
|
39
39
|
else if (status === ChargeStatus.EXECUTED) {
|
|
40
40
|
setStartLegacyBoxCheckoutStatus("success");
|
|
41
41
|
try {
|
|
42
|
-
await
|
|
42
|
+
await submitCheckoutCommand();
|
|
43
43
|
}
|
|
44
44
|
catch (error) { }
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
}, [blockCheckoutBooking, createNotification,
|
|
47
|
+
}, [blockCheckoutBooking, createNotification, submitCheckoutCommand, paymentFlowRef]);
|
|
48
48
|
const status = useMemo(() => {
|
|
49
49
|
if (blockCheckoutBookingStatus === CommandStatus.LOADING ||
|
|
50
50
|
startLegacyBoxCheckoutStatus === "loading" ||
|
|
51
|
-
|
|
51
|
+
submitCheckoutCommandStatus === CommandStatus.LOADING) {
|
|
52
52
|
return "loading";
|
|
53
53
|
}
|
|
54
54
|
if (blockCheckoutBookingStatus === CommandStatus.SUCCESS &&
|
|
55
55
|
startLegacyBoxCheckoutStatus === "success" &&
|
|
56
|
-
|
|
56
|
+
submitCheckoutCommandStatus === CommandStatus.SUCCESS) {
|
|
57
57
|
return "success";
|
|
58
58
|
}
|
|
59
59
|
if (blockCheckoutBookingStatus === CommandStatus.ERROR ||
|
|
60
60
|
startLegacyBoxCheckoutStatus === "error" ||
|
|
61
|
-
|
|
61
|
+
submitCheckoutCommandStatus === CommandStatus.ERROR) {
|
|
62
62
|
onError();
|
|
63
63
|
return "error";
|
|
64
64
|
}
|
|
65
65
|
return "idle";
|
|
66
|
-
}, [blockCheckoutBookingStatus,
|
|
66
|
+
}, [blockCheckoutBookingStatus, submitCheckoutCommandStatus, onError, startLegacyBoxCheckoutStatus]);
|
|
67
67
|
return [submitCheckout, status];
|
|
68
68
|
};
|
|
69
69
|
export { useSubmitCheckout };
|
|
@@ -34,8 +34,8 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
34
34
|
if (checkoutPaymentRouteMatch && !checkoutShown.current) {
|
|
35
35
|
return React.createElement(Navigate, { to: `${basePath}/${Routes.HOME}`, replace: true });
|
|
36
36
|
}
|
|
37
|
-
/* Navigate to the feedback if checkout is
|
|
38
|
-
if (checkout?.status === CheckoutStatus.
|
|
37
|
+
/* Navigate to the feedback if checkout is submitted */
|
|
38
|
+
if (checkout?.status === CheckoutStatus.SUBMITTED &&
|
|
39
39
|
!(feedbackRouteMatch || checkoutRouteMatch || checkoutPaymentRouteMatch)) {
|
|
40
40
|
return React.createElement(Navigate, { to: `${basePath}/${Routes.FEEDBACK}`, replace: true });
|
|
41
41
|
}
|
|
@@ -38,7 +38,7 @@ const Checkout = ({ children, customerId, useRedirect }) => {
|
|
|
38
38
|
if (!dependenciesLoaded)
|
|
39
39
|
return React.createElement(Spinner, null);
|
|
40
40
|
return (React.createElement(React.Fragment, null,
|
|
41
|
-
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web"
|
|
41
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0 },
|
|
42
42
|
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
43
43
|
hasReplacedCheckoutItem && (React.createElement(View, { style: style.deliveryBannerContainer },
|
|
44
44
|
React.createElement(DeliveryBanner, null))),
|
|
@@ -30,7 +30,7 @@ const Feedback = ({ customerId }) => {
|
|
|
30
30
|
if (!dependenciesLoaded)
|
|
31
31
|
return React.createElement(Spinner, null);
|
|
32
32
|
return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {} },
|
|
33
|
-
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web"
|
|
33
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0 },
|
|
34
34
|
React.createElement(Body, { style: { column: style.bodyColumn } },
|
|
35
35
|
React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
|
|
36
36
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
2
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
3
|
import React, { useCallback, useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { SafeAreaView
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { SafeAreaView, // useSafeAreaInsets
|
|
6
|
+
} from "react-native-safe-area-context";
|
|
6
7
|
import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
|
|
7
8
|
import { ButtonIcon } from "../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
|
|
8
9
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
@@ -83,8 +84,8 @@ const Header = ({ customerId, menu: Menu, style: customStyle }) => {
|
|
|
83
84
|
else {
|
|
84
85
|
header = React.createElement(DefaultHeader, { onOpenMenu: handleOnOpenMenu });
|
|
85
86
|
}
|
|
86
|
-
return (React.createElement(
|
|
87
|
-
|
|
88
|
-
React.createElement(Menu, {
|
|
87
|
+
return (React.createElement(SafeAreaView, { edges: ["top"], style: [style.container, customStyle] },
|
|
88
|
+
header,
|
|
89
|
+
React.createElement(Menu, { visible: menuVisible, onClose: handleOnCloseMenu })));
|
|
89
90
|
};
|
|
90
91
|
export { Header };
|
|
@@ -6,7 +6,6 @@ declare const style: {
|
|
|
6
6
|
width: number;
|
|
7
7
|
};
|
|
8
8
|
container: {
|
|
9
|
-
backgroundColor: string;
|
|
10
9
|
flexDirection: "row";
|
|
11
10
|
flexGrow: number;
|
|
12
11
|
height: number;
|
|
@@ -14,6 +13,7 @@ declare const style: {
|
|
|
14
13
|
};
|
|
15
14
|
header: {
|
|
16
15
|
alignItems: "center";
|
|
16
|
+
backgroundColor: string;
|
|
17
17
|
flexDirection: "row";
|
|
18
18
|
flexGrow: number;
|
|
19
19
|
flexWrap: "nowrap";
|
|
@@ -9,7 +9,6 @@ const style = StyleSheet.create({
|
|
|
9
9
|
width: spaceXXL,
|
|
10
10
|
},
|
|
11
11
|
container: {
|
|
12
|
-
backgroundColor: colorBase,
|
|
13
12
|
flexDirection: "row",
|
|
14
13
|
flexGrow: 0,
|
|
15
14
|
height: HEADER_HEIGHT,
|
|
@@ -17,6 +16,7 @@ const style = StyleSheet.create({
|
|
|
17
16
|
},
|
|
18
17
|
header: {
|
|
19
18
|
alignItems: "center",
|
|
19
|
+
backgroundColor: colorBase,
|
|
20
20
|
flexDirection: "row",
|
|
21
21
|
flexGrow: 0,
|
|
22
22
|
flexWrap: "nowrap",
|
|
@@ -136,7 +136,7 @@ const Item = ({ customerId }) => {
|
|
|
136
136
|
return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: checkoutItem.feedbacks || {} },
|
|
137
137
|
React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
|
|
138
138
|
React.createElement(SizeChangeModal, { visible: sizeChangeModalVisible, onDismiss: handleOnHideSizeChangeModal }),
|
|
139
|
-
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web"
|
|
139
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0 },
|
|
140
140
|
React.createElement(Body, null,
|
|
141
141
|
customerDecissionMade && (React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: handleOnBannerPress })),
|
|
142
142
|
React.createElement(View, { style: [style.container, { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight }] },
|
|
@@ -145,6 +145,7 @@ const Item = ({ customerId }) => {
|
|
|
145
145
|
React.createElement(ProductVariantDescription, { brand: brand, color: color, name: name, price: price, size: productVariantSelected.size }),
|
|
146
146
|
checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: style.feedbackContainer },
|
|
147
147
|
React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions || [], onEditFeedback: handleOnEditFeedback })))))),
|
|
148
|
+
!customerDecissionMade && (React.createElement(ItemActions, { keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })),
|
|
148
149
|
React.createElement(ReturnQuestionsForm, { checkoutItemPrice: checkoutItem.price, productVariant: checkoutItem.productVariant, returnQuestions: returnQuestions || [], visible: returnQuestionsVisible, onClose: handleOnHideReturnQuestions, onSubmit: handleOnSubmit })));
|
|
149
150
|
};
|
|
150
151
|
export { Item };
|
|
@@ -8,9 +8,7 @@ import { ButtonIcon } from "../../../../../../shared/ui/components/molecules/but
|
|
|
8
8
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
9
9
|
import { useMediaImage } from "../../../../hooks/useMediaImage";
|
|
10
10
|
import { COLOR_I18N_PREFIX, I18nMessages } from "../../../../i18n/i18n";
|
|
11
|
-
import { theme } from "../../../../theme/theme";
|
|
12
11
|
import { IMAGE_WIDTH, style } from "./ProductVariant.style";
|
|
13
|
-
const { colorContent } = theme();
|
|
14
12
|
const ProductVariant = ({ media, brand, name, price, size, color, status, discarded, style: customStyle, onPress, }) => {
|
|
15
13
|
const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
|
|
16
14
|
const colorLabel = useI18nMessage({ id: color.label, prefix: COLOR_I18N_PREFIX });
|
|
@@ -25,7 +23,7 @@ const ProductVariant = ({ media, brand, name, price, size, color, status, discar
|
|
|
25
23
|
width: IMAGE_WIDTH,
|
|
26
24
|
}),
|
|
27
25
|
} }),
|
|
28
|
-
discarded && (React.createElement(Svg, { preserveAspectRatio: "none",
|
|
26
|
+
discarded && (React.createElement(Svg, { preserveAspectRatio: "none", style: style.discarded, testID: "discarded", viewBox: "0 0 100 100" },
|
|
29
27
|
React.createElement(Line, { vectorEffect: "non-scaling-stroke", x1: "100", x2: "0", y1: "0", y2: "100" })))),
|
|
30
28
|
React.createElement(View, { style: style.descriptionContainer },
|
|
31
29
|
React.createElement(View, null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const { borderSize, colorGrayscaleL, colorInfo, spaceXS, spaceS, spaceM } = theme();
|
|
3
|
+
const { borderSize, colorContent, colorGrayscaleL, colorInfo, spaceXS, spaceS, spaceM } = theme();
|
|
4
4
|
const IMAGE_WIDTH = 96;
|
|
5
5
|
const IMAGE_HEIGHT = 120;
|
|
6
6
|
const style = StyleSheet.create({
|
|
@@ -19,6 +19,7 @@ const style = StyleSheet.create({
|
|
|
19
19
|
height: "100%",
|
|
20
20
|
left: 0,
|
|
21
21
|
position: "absolute",
|
|
22
|
+
stroke: colorContent,
|
|
22
23
|
top: 0,
|
|
23
24
|
width: "100%",
|
|
24
25
|
zIndex: 10,
|
|
@@ -43,12 +43,14 @@ const Summary = ({ customerId }) => {
|
|
|
43
43
|
dependenciesLoadedStatuses.includes(fiveItemsDiscountStatus);
|
|
44
44
|
if (!dependenciesLoaded)
|
|
45
45
|
return React.createElement(Spinner, null);
|
|
46
|
-
return (React.createElement(
|
|
47
|
-
React.createElement(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
return (React.createElement(React.Fragment, null,
|
|
47
|
+
React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container } },
|
|
48
|
+
React.createElement(Body, { style: { row: { paddingBottom: pricingHeight || spaceXL } } },
|
|
49
|
+
fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
|
|
50
|
+
React.createElement(View, { style: style.content },
|
|
51
|
+
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
52
|
+
React.createElement(Text, { level: 3, style: style.description, body: true }, descriptionText)),
|
|
53
|
+
React.createElement(CheckoutItemsTabs, { checkoutItemsKept: checkoutItemsKept || [], checkoutItemsReturned: checkoutItemsReturned || [], onPressItem: handleOnPressItem }))),
|
|
54
|
+
pricing && (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit }))));
|
|
53
55
|
};
|
|
54
56
|
export { Summary };
|
|
@@ -6,11 +6,9 @@ import React from "react";
|
|
|
6
6
|
import { Pressable, View } from "react-native";
|
|
7
7
|
import { Price } from "../../../../components/atoms/price/Price";
|
|
8
8
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
9
|
-
import { theme } from "../../../../theme/theme";
|
|
10
9
|
import { style } from "./Pricing.style";
|
|
11
10
|
import { ArrowDown } from "./icons/ArrowDown";
|
|
12
11
|
import { ArrowUp } from "./icons/ArrowUp";
|
|
13
|
-
const { colorGrayscaleS } = theme();
|
|
14
12
|
const PS_SERVICE_FREE_INDICATOR = 100;
|
|
15
13
|
const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
16
14
|
React.createElement(Text, { level: level, style: style.uppercase, action: true }, text),
|
|
@@ -34,7 +32,7 @@ const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPerc
|
|
|
34
32
|
const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
|
|
35
33
|
const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
|
|
36
34
|
return (React.createElement(Pressable, { testID: "pricing", onPress: collapsible ? onPress : null },
|
|
37
|
-
collapsible && (React.createElement(View, { style: style.iconContainer }, collapsed ? (React.createElement(ArrowUp, {
|
|
35
|
+
collapsible && (React.createElement(View, { style: style.iconContainer }, collapsed ? (React.createElement(ArrowUp, { style: style.icon, testID: "arrow-up" })) : (React.createElement(ArrowDown, { style: style.icon, testID: "arrow-down" })))),
|
|
38
36
|
collapsed && collapsible ? (React.createElement(animated.View, { style: [style.collapsed, { opacity: collapsedStyle.opacitiy }] },
|
|
39
37
|
React.createElement(View, null,
|
|
40
38
|
React.createElement(Text, { level: 1, style: style.totalCollapsed, detail: true },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const { colorContent, spaceXS, spaceL } = theme();
|
|
3
|
+
const { colorContent, colorGrayscaleS, spaceXS, spaceL } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
5
|
collapsed: {
|
|
6
6
|
flexDirection: "row",
|
|
@@ -13,6 +13,7 @@ const style = StyleSheet.create({
|
|
|
13
13
|
},
|
|
14
14
|
icon: {
|
|
15
15
|
height: 10,
|
|
16
|
+
stroke: colorGrayscaleS,
|
|
16
17
|
width: 58,
|
|
17
18
|
},
|
|
18
19
|
iconContainer: {
|
|
@@ -16,8 +16,8 @@ const NotificationItem = ({ notification, onRemove, autoHideTimeout, testID = "n
|
|
|
16
16
|
if (!autoHideTimeout) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const hideTimeout = setTimeout(handleOnClose, autoHideTimeout);
|
|
20
|
+
return () => clearTimeout(hideTimeout);
|
|
21
21
|
}, [autoHideTimeout, handleOnClose]);
|
|
22
22
|
return (React.createElement(Toast, { body: body, style: customStyle, testID: testID, title: title, variant: toastVariantForNotificationLevel[notification.level], onClose: handleOnClose }));
|
|
23
23
|
};
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
3
3
|
notifications: {
|
|
4
|
-
flexDirection: "column";
|
|
5
4
|
top: number;
|
|
6
5
|
width: string;
|
|
7
6
|
zIndex: number;
|
|
8
7
|
left: number;
|
|
9
8
|
} | {
|
|
10
|
-
flexDirection: "column";
|
|
11
9
|
top: number;
|
|
12
10
|
width: string;
|
|
13
11
|
zIndex: number;
|
|
14
|
-
position: "
|
|
12
|
+
position: "sticky";
|
|
15
13
|
left: number;
|
|
16
14
|
} | {
|
|
17
|
-
flexDirection: "column";
|
|
18
15
|
top: number;
|
|
19
16
|
width: string;
|
|
20
17
|
zIndex: number;
|
|
@@ -7,11 +7,10 @@ const style = StyleSheet.create({
|
|
|
7
7
|
notifications: {
|
|
8
8
|
left: 0,
|
|
9
9
|
...Platform.select({
|
|
10
|
-
web: { position: "
|
|
10
|
+
web: { position: "sticky" },
|
|
11
11
|
ios: { position: "absolute" },
|
|
12
12
|
android: { position: "absolute" },
|
|
13
13
|
}),
|
|
14
|
-
flexDirection: "column",
|
|
15
14
|
top: 0,
|
|
16
15
|
width: "100%",
|
|
17
16
|
zIndex: 20,
|
|
@@ -23,7 +23,7 @@ const Field = ({ label, isFocused = false, style: customStyle }) => {
|
|
|
23
23
|
},
|
|
24
24
|
customStyle?.field,
|
|
25
25
|
] },
|
|
26
|
-
React.createElement(Text, { level: 1,
|
|
26
|
+
React.createElement(Text, { level: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
|
|
27
27
|
React.createElement(View, { style: [style.fieldBackground, { opacity: isFocused ? 1 : 0 }] })));
|
|
28
28
|
};
|
|
29
29
|
export { Field };
|
|
@@ -32,6 +32,6 @@ const Input = ({ minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, style: customSt
|
|
|
32
32
|
}, [maxHeight, minHeight, multiline]);
|
|
33
33
|
useLayoutEffect(handleOnContentSizeChangeWeb, [handleOnContentSizeChangeWeb, value]);
|
|
34
34
|
const textInputRef = useRef(null);
|
|
35
|
-
return (React.createElement(TextInput, { ...restOfProps, ref: textInputRef, multiline: multiline,
|
|
35
|
+
return (React.createElement(TextInput, { ...restOfProps, ref: textInputRef, multiline: multiline, placeholderTextColor: placeholderTextColor, style: [style.input, customStyle, { height }], testID: "input", textAlignVertical: "top", value: value, onChange: onChange, onContentSizeChange: handleOnContentSizeChange }));
|
|
36
36
|
};
|
|
37
37
|
export { Input };
|
|
@@ -8,9 +8,12 @@ declare const style: {
|
|
|
8
8
|
fontFamily: string;
|
|
9
9
|
fontSize: number;
|
|
10
10
|
letterSpacing: number;
|
|
11
|
+
outlineStyle: string;
|
|
11
12
|
paddingBottom: number;
|
|
12
13
|
paddingHorizontal: number;
|
|
13
14
|
paddingTop: number;
|
|
15
|
+
textOverflow: string;
|
|
16
|
+
whiteSpace: string;
|
|
14
17
|
};
|
|
15
18
|
};
|
|
16
19
|
export { style, borderSize, paddingVertical };
|
|
@@ -10,12 +10,12 @@ const style = StyleSheet.create({
|
|
|
10
10
|
fontFamily: fontMap.Body,
|
|
11
11
|
fontSize: fontBodySize3,
|
|
12
12
|
letterSpacing: fontBodyLetterSpacing3,
|
|
13
|
-
|
|
13
|
+
outlineStyle: "none",
|
|
14
14
|
paddingBottom: paddingVertical,
|
|
15
15
|
paddingHorizontal: spaceM,
|
|
16
16
|
paddingTop: paddingVertical,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
textOverflow: "ellipsis",
|
|
18
|
+
whiteSpace: "nowrap",
|
|
19
19
|
...Platform.select({
|
|
20
20
|
web: {
|
|
21
21
|
lineHeight: fontBodyHeight3,
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { animated, useTransition } from "@react-spring/native";
|
|
2
|
-
import React, { useCallback, useState } from "react";
|
|
2
|
+
import React, { useCallback, useState, useMemo } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { style } from "./Stack.style";
|
|
5
5
|
const Stack = ({ children, style: customStyle }) => {
|
|
6
6
|
const [heights, setHeights] = useState({});
|
|
7
7
|
const handleOnLayout = useCallback((itemKey) => ({ nativeEvent: { layout } }) => setHeights((heights) => ({ ...heights, [itemKey]: layout.height })), []);
|
|
8
|
-
const
|
|
8
|
+
const outState = useMemo(() => ({ opacity: 0, height: 0, translateY: -50 }), []);
|
|
9
|
+
const inState = useCallback((height = 0) => ({ opacity: 1, height, translateY: 0 }), []);
|
|
9
10
|
const transitions = useTransition(children, {
|
|
10
11
|
keys: (item) => `${item.key}`,
|
|
11
12
|
native: true,
|
|
12
|
-
from:
|
|
13
|
+
from: outState,
|
|
13
14
|
enter: (item) => inState(heights[item.key]),
|
|
14
15
|
update: (item) => inState(heights[item.key]),
|
|
15
|
-
leave:
|
|
16
|
+
leave: outState,
|
|
16
17
|
});
|
|
17
18
|
return (React.createElement(View, { pointerEvents: "box-none", style: [style.stack, customStyle] }, transitions(({ opacity, height, translateY }, item, { phase }) => (React.createElement(animated.View, { key: item.key, testID: "stack-item", style: [
|
|
18
19
|
{
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
3
3
|
sticky: {
|
|
4
|
-
zIndex: number;
|
|
5
4
|
backgroundColor: string;
|
|
6
5
|
bottom: number;
|
|
7
6
|
elevation: number;
|
|
@@ -15,7 +14,6 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
|
15
14
|
shadowRadius: number;
|
|
16
15
|
width: string;
|
|
17
16
|
} | {
|
|
18
|
-
zIndex: number;
|
|
19
17
|
position: "sticky";
|
|
20
18
|
backgroundColor: string;
|
|
21
19
|
bottom: number;
|
|
@@ -30,7 +28,6 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
|
30
28
|
shadowRadius: number;
|
|
31
29
|
width: string;
|
|
32
30
|
} | {
|
|
33
|
-
zIndex: number;
|
|
34
31
|
position: "absolute";
|
|
35
32
|
backgroundColor: string;
|
|
36
33
|
bottom: number;
|
|
@@ -18,11 +18,16 @@ const style = StyleSheet.create({
|
|
|
18
18
|
shadowRadius: elevationRadius,
|
|
19
19
|
width: "100%",
|
|
20
20
|
...Platform.select({
|
|
21
|
-
web: {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
web: {
|
|
22
|
+
position: "sticky",
|
|
23
|
+
},
|
|
24
|
+
ios: {
|
|
25
|
+
position: "absolute",
|
|
26
|
+
},
|
|
27
|
+
android: {
|
|
28
|
+
position: "absolute",
|
|
29
|
+
},
|
|
24
30
|
}),
|
|
25
|
-
zIndex: 0,
|
|
26
31
|
},
|
|
27
32
|
});
|
|
28
33
|
export { style };
|
|
@@ -8,7 +8,6 @@ import { Input } from "../../atoms/input/Input";
|
|
|
8
8
|
import { style } from "./InputField.style";
|
|
9
9
|
const { colorBase, colorContent, colorGrayscaleL, colorPrimary, spaceM, iconSize } = theme();
|
|
10
10
|
const inputPaddingRightWithIcon = iconSize + spaceM * 2;
|
|
11
|
-
const inputPaddingRightWithoutIcon = spaceM * 2;
|
|
12
11
|
const InputField = ({ label, placeholder, value, multiline = false, minHeight, error, style: customStyle, onChange = () => void 0, icon, ...inputRestProps }) => {
|
|
13
12
|
const [isFocused, setIsFocused] = useState(false);
|
|
14
13
|
const handleOnChange = useCallback((text) => onChange(text), [onChange]);
|
|
@@ -18,11 +17,7 @@ const InputField = ({ label, placeholder, value, multiline = false, minHeight, e
|
|
|
18
17
|
return (React.createElement(View, { style: customStyle?.inputField, testID: "input-field" },
|
|
19
18
|
React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
|
|
20
19
|
field: [style.field, customStyle?.field],
|
|
21
|
-
fieldText: [
|
|
22
|
-
{ color },
|
|
23
|
-
{ paddingRight: !!icon ? inputPaddingRightWithIcon : inputPaddingRightWithoutIcon },
|
|
24
|
-
customStyle?.fieldText,
|
|
25
|
-
],
|
|
20
|
+
fieldText: [{ color }, customStyle?.fieldText],
|
|
26
21
|
} }),
|
|
27
22
|
React.createElement(Input, { minHeight: minHeight, multiline: multiline, placeholder: placeholder, placeholderTextColor: isFocused ? colorGrayscaleL : colorBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, { borderColor: color }, customStyle?.input], value: value, onBlur: handleOnBlur, onChangeText: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
|
|
28
23
|
!!icon && React.createElement(Icon, { name: icon, style: [style.icon, { color }, customStyle?.icon] }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"react": "^18.0.0",
|
|
54
54
|
"react-dom": "^18.0.0",
|
|
55
55
|
"react-native": "^0.70.6",
|
|
56
|
-
"react-native-get-random-values": "^1.8.0",
|
|
57
56
|
"react-native-web": "^0.18.9",
|
|
58
57
|
"react-router-dom": "^6.4.5",
|
|
59
58
|
"react-router-native": "^6.4.5"
|
|
@@ -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 };
|
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 };
|
package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SizeProjection } from "../shared/size";
|
|
2
|
-
interface ProductVariantProjection {
|
|
3
|
-
readonly id: string;
|
|
4
|
-
readonly size: SizeProjection;
|
|
5
|
-
}
|
|
6
|
-
interface BookedSizeChangeProductsVariantsProjection {
|
|
7
|
-
readonly bookingId: string;
|
|
8
|
-
readonly productVariants: ProductVariantProjection[];
|
|
9
|
-
}
|
|
10
|
-
export type { BookedSizeChangeProductsVariantsProjection, ProductVariantProjection };
|
package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
-
import { BookedSizeChangeProductsVariantsProjection } from "./bookedSizeChangeProductsVariants";
|
|
3
|
-
declare const VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM = "view_booked_size_change_product_variants_for_checkout_item";
|
|
4
|
-
interface ViewBookedSizeChangeProductsVariantsForCheckoutItemPayload {
|
|
5
|
-
readonly checkoutItemId: string;
|
|
6
|
-
}
|
|
7
|
-
interface ViewBookedSizeChangeProductsVariantsForCheckoutItem extends Query<typeof VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM>, ViewBookedSizeChangeProductsVariantsForCheckoutItemPayload {
|
|
8
|
-
}
|
|
9
|
-
interface ViewBookedSizeChangeProductsVariantsForCheckoutItemFunction {
|
|
10
|
-
(payload: ViewBookedSizeChangeProductsVariantsForCheckoutItemPayload): ViewBookedSizeChangeProductsVariantsForCheckoutItem;
|
|
11
|
-
}
|
|
12
|
-
declare const viewBookedSizeChangeProductsVariantsForCheckoutItem: ViewBookedSizeChangeProductsVariantsForCheckoutItemFunction;
|
|
13
|
-
type ViewBookedSizeChangeProductsVariantsForCheckoutItemResult = BookedSizeChangeProductsVariantsProjection | null;
|
|
14
|
-
interface BookedSizeChangeProductsVariantsForCheckoutItemViewArgs extends CancelableQueryViewArgs {
|
|
15
|
-
readonly checkoutItemId: string;
|
|
16
|
-
}
|
|
17
|
-
interface BookedSizeChangeProductsVariantsForCheckoutItemView {
|
|
18
|
-
(args: BookedSizeChangeProductsVariantsForCheckoutItemViewArgs): Promise<ViewBookedSizeChangeProductsVariantsForCheckoutItemResult>;
|
|
19
|
-
}
|
|
20
|
-
interface ViewBookedSizeChangeProductsVariantsForCheckoutItemHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
21
|
-
readonly view: BookedSizeChangeProductsVariantsForCheckoutItemView;
|
|
22
|
-
}
|
|
23
|
-
declare const viewBookedSizeChangeProductsVariantsForCheckoutItemHandler: QueryHandlerFunction<ViewBookedSizeChangeProductsVariantsForCheckoutItem, ViewBookedSizeChangeProductsVariantsForCheckoutItemResult, ViewBookedSizeChangeProductsVariantsForCheckoutItemHandlerFunctionArgs>;
|
|
24
|
-
export type { ViewBookedSizeChangeProductsVariantsForCheckoutItem, BookedSizeChangeProductsVariantsForCheckoutItemView, ViewBookedSizeChangeProductsVariantsForCheckoutItemResult, };
|
|
25
|
-
export { VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeChangeProductsVariantsForCheckoutItem, viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { query, } from "@lookiero/messaging";
|
|
2
|
-
const VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM = "view_booked_size_change_product_variants_for_checkout_item";
|
|
3
|
-
const viewBookedSizeChangeProductsVariantsForCheckoutItem = (payload) => ({
|
|
4
|
-
...query({ name: VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM }),
|
|
5
|
-
...payload,
|
|
6
|
-
});
|
|
7
|
-
const viewBookedSizeChangeProductsVariantsForCheckoutItemHandler = ({ view, signal }) => async ({ checkoutItemId }) => view({ checkoutItemId, signal });
|
|
8
|
-
export { VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeChangeProductsVariantsForCheckoutItem, viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
-
import { CheckoutFeedbackProjection } from "./checkoutFeedback";
|
|
3
|
-
declare const VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID = "view_checkout_feedback_by_checkout_id";
|
|
4
|
-
interface ViewCheckoutFeedbackByCheckoutIdPayload {
|
|
5
|
-
readonly checkoutId: string;
|
|
6
|
-
}
|
|
7
|
-
interface ViewCheckoutFeedbackByCheckoutId extends Query<typeof VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID>, ViewCheckoutFeedbackByCheckoutIdPayload {
|
|
8
|
-
}
|
|
9
|
-
interface ViewCheckoutFeedbackByCheckoutIdFunction {
|
|
10
|
-
(payload: ViewCheckoutFeedbackByCheckoutIdPayload): ViewCheckoutFeedbackByCheckoutId;
|
|
11
|
-
}
|
|
12
|
-
declare const viewCheckoutFeedbackByCheckoutId: ViewCheckoutFeedbackByCheckoutIdFunction;
|
|
13
|
-
type ViewCheckoutFeedbackByCheckoutIdResult = CheckoutFeedbackProjection | null;
|
|
14
|
-
interface CheckoutFeedbackByCheckoutIdViewArgs extends CancelableQueryViewArgs {
|
|
15
|
-
readonly checkoutId: string;
|
|
16
|
-
}
|
|
17
|
-
interface CheckoutFeedbackByCheckoutIdView {
|
|
18
|
-
(args: CheckoutFeedbackByCheckoutIdViewArgs): Promise<ViewCheckoutFeedbackByCheckoutIdResult>;
|
|
19
|
-
}
|
|
20
|
-
interface ViewCheckoutFeedbackByCheckoutIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
21
|
-
readonly view: CheckoutFeedbackByCheckoutIdView;
|
|
22
|
-
}
|
|
23
|
-
declare const viewCheckoutFeedbackByCheckoutIdHandler: QueryHandlerFunction<ViewCheckoutFeedbackByCheckoutId, ViewCheckoutFeedbackByCheckoutIdResult, ViewCheckoutFeedbackByCheckoutIdHandlerFunctionArgs>;
|
|
24
|
-
export type { ViewCheckoutFeedbackByCheckoutId, CheckoutFeedbackByCheckoutIdView, ViewCheckoutFeedbackByCheckoutIdResult, };
|
|
25
|
-
export { VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID, viewCheckoutFeedbackByCheckoutId, viewCheckoutFeedbackByCheckoutIdHandler, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { query, } from "@lookiero/messaging";
|
|
2
|
-
const VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID = "view_checkout_feedback_by_checkout_id";
|
|
3
|
-
const viewCheckoutFeedbackByCheckoutId = (payload) => ({
|
|
4
|
-
...query({ name: VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID }),
|
|
5
|
-
...payload,
|
|
6
|
-
});
|
|
7
|
-
const viewCheckoutFeedbackByCheckoutIdHandler = ({ view, signal }) => async ({ checkoutId }) => view({ checkoutId, signal });
|
|
8
|
-
export { VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID, viewCheckoutFeedbackByCheckoutId, viewCheckoutFeedbackByCheckoutIdHandler, };
|