@lookiero/checkout 0.8.19-beta.0 → 0.8.19
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/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.js +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId.d.ts +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId.js +13 -0
- package/dist/infrastructure/ui/i18n/translationEndpoint.d.ts +1 -10
- package/dist/infrastructure/ui/i18n/translationEndpoint.js +1 -19
- package/dist/projection/checkout/viewIsSizeChangeEnabledByCheckoutId.d.ts +24 -0
- package/dist/projection/checkout/viewIsSizeChangeEnabledByCheckoutId.js +8 -0
- package/dist/projection/shared/country.d.ts +10 -10
- package/package.json +1 -1
- 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/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
- package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
- 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/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
- 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/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.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/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
- package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
- package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
- package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
- 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/infrastructure/ui/views/intro/Intro.d.ts +0 -6
- package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -55
- package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -58
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
- 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/projection/shared/locale.d.ts +0 -11
- package/dist/projection/shared/locale.js +0 -12
- 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/notifications/domain/notification/command/createNotification.d.ts +0 -17
- package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
- 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.d.ts +0 -21
- package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
- package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
- package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { EndpointFunction } from "@lookiero/i18n";
|
|
|
2
2
|
import { ComponentType } from "react";
|
|
3
3
|
import { CheckoutStatus } from "./domain/checkout/model/checkout";
|
|
4
4
|
import { RootProps } from "./infrastructure/ui/Root";
|
|
5
|
-
import { translationEndpoint, translationExternalEndpoint } from "./infrastructure/ui/i18n/translationEndpoint";
|
|
6
5
|
import { CheckoutProjection } from "./projection/checkout/checkout";
|
|
7
6
|
import { IsCheckoutAccessibleByCustomerIdProjection } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
|
|
8
7
|
import { SentryLoggerFunctionArgs } from "./shared/logging/SentryLogger";
|
|
@@ -33,4 +32,4 @@ interface BootstrapFunction {
|
|
|
33
32
|
(args: BootstrapFunctionArgs): BootstrapFunctionReturn;
|
|
34
33
|
}
|
|
35
34
|
declare const bootstrap: BootstrapFunction;
|
|
36
|
-
export { bootstrap,
|
|
35
|
+
export { bootstrap, CheckoutStatus };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import { CheckoutStatus } from "./domain/checkout/model/checkout";
|
|
|
3
3
|
import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
|
|
4
4
|
import { root } from "./infrastructure/ui/Root";
|
|
5
5
|
import { fetchTranslations } from "./infrastructure/ui/i18n/fetchTranslations";
|
|
6
|
-
import { translationEndpoint, translationExternalEndpoint } from "./infrastructure/ui/i18n/translationEndpoint";
|
|
7
6
|
import { viewFirstAvailableCheckoutByCustomerId } from "./projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
8
7
|
import { viewIsCheckoutAccessibleByCustomerId, } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
|
|
9
8
|
const bootstrap = ({ apiUrl, getAuthToken, translations, sentry }) => {
|
|
@@ -21,4 +20,4 @@ const bootstrap = ({ apiUrl, getAuthToken, translations, sentry }) => {
|
|
|
21
20
|
firstAvailableCheckoutByCustomerId,
|
|
22
21
|
};
|
|
23
22
|
};
|
|
24
|
-
export { bootstrap,
|
|
23
|
+
export { bootstrap, CheckoutStatus };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IsSizeChangeEnabledByCheckoutIdView } from "../../../projection/checkout/viewIsSizeChangeEnabledByCheckoutId";
|
|
2
|
+
import { HttpPostFunction } from "../../delivery/http/httpClient";
|
|
3
|
+
interface HttpIsSizeChangeEnabledByCheckoutIdView extends IsSizeChangeEnabledByCheckoutIdView {
|
|
4
|
+
}
|
|
5
|
+
interface HttpIsSizeChangeEnabledByCheckoutIdViewFunctionArgs {
|
|
6
|
+
readonly httpPost: HttpPostFunction;
|
|
7
|
+
}
|
|
8
|
+
interface HttpIsSizeChangeEnabledByCheckoutIdViewFunction {
|
|
9
|
+
(args: HttpIsSizeChangeEnabledByCheckoutIdViewFunctionArgs): HttpIsSizeChangeEnabledByCheckoutIdView;
|
|
10
|
+
}
|
|
11
|
+
declare const httpIsSizeChangeEnabledByCheckoutIdView: HttpIsSizeChangeEnabledByCheckoutIdViewFunction;
|
|
12
|
+
export { httpIsSizeChangeEnabledByCheckoutIdView };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const httpIsSizeChangeEnabledByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => await httpPost({
|
|
2
|
+
endpoint: "/is-size-change-enabled",
|
|
3
|
+
signal,
|
|
4
|
+
body: { checkoutId },
|
|
5
|
+
result: {
|
|
6
|
+
error: false,
|
|
7
|
+
success: (response) => response.result,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
export { httpIsSizeChangeEnabledByCheckoutIdView };
|
package/dist/infrastructure/projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseQueryFunctionResult } from "@lookiero/messaging-react";
|
|
2
|
+
import { IsSizeChangeEnabledByCheckoutIdProjection } from "../../../../projection/checkout/viewIsSizeChangeEnabledByCheckoutId";
|
|
3
|
+
interface UseViewIsSizeChangeEnabledByCheckoutIdFunctionArgs {
|
|
4
|
+
readonly checkoutId: string;
|
|
5
|
+
}
|
|
6
|
+
interface UseViewIsSizeChangeEnabledByCheckoutIdFunction {
|
|
7
|
+
(args: UseViewIsSizeChangeEnabledByCheckoutIdFunctionArgs): UseQueryFunctionResult<IsSizeChangeEnabledByCheckoutIdProjection>;
|
|
8
|
+
}
|
|
9
|
+
declare const useViewIsSizeChangeEnabledByCheckoutId: UseViewIsSizeChangeEnabledByCheckoutIdFunction;
|
|
10
|
+
export { useViewIsSizeChangeEnabledByCheckoutId };
|
package/dist/infrastructure/projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useQuery } from "@lookiero/messaging-react";
|
|
2
|
+
import { viewIsSizeChangeEnabledByCheckoutId, } from "../../../../projection/checkout/viewIsSizeChangeEnabledByCheckoutId";
|
|
3
|
+
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
4
|
+
const useViewIsSizeChangeEnabledByCheckoutId = ({ checkoutId }) => useQuery({
|
|
5
|
+
query: viewIsSizeChangeEnabledByCheckoutId({ checkoutId }),
|
|
6
|
+
contextId: MESSAGING_CONTEXT_ID,
|
|
7
|
+
options: {
|
|
8
|
+
staleTime: Infinity,
|
|
9
|
+
retry: false,
|
|
10
|
+
refetchOnWindowFocus: false,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export { useViewIsSizeChangeEnabledByCheckoutId };
|
|
@@ -7,13 +7,4 @@ interface TranslationEndpointFunction {
|
|
|
7
7
|
(args: TranslationEndpointFunctionArgs): EndpointFunction;
|
|
8
8
|
}
|
|
9
9
|
declare const translationEndpoint: TranslationEndpointFunction;
|
|
10
|
-
|
|
11
|
-
interface TranslationExternalEndpointFunctionArgs {
|
|
12
|
-
readonly translationsUrl: string;
|
|
13
|
-
readonly projects: [project: Project, filter?: string][];
|
|
14
|
-
}
|
|
15
|
-
interface TranslationExternalEndpointFunction {
|
|
16
|
-
(args: TranslationExternalEndpointFunctionArgs): EndpointFunction;
|
|
17
|
-
}
|
|
18
|
-
declare const translationExternalEndpoint: TranslationExternalEndpointFunction;
|
|
19
|
-
export { translationEndpoint, translationExternalEndpoint };
|
|
10
|
+
export { translationEndpoint };
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
import { Country } from "../../../projection/shared/country";
|
|
2
|
-
import { Locale } from "../../../projection/shared/locale";
|
|
3
1
|
const translationEndpoint = ({ translationsUrl, translationsApiKey }) => (locale) => `${translationsUrl}/${locale}?key=${translationsApiKey}&no-folding=true`;
|
|
4
|
-
|
|
5
|
-
[Locale.ES]: Country.ES,
|
|
6
|
-
[Locale.FR]: Country.FR,
|
|
7
|
-
[Locale.EN]: Country.GB,
|
|
8
|
-
[Locale.IT]: Country.IT,
|
|
9
|
-
[Locale.PT]: Country.PT,
|
|
10
|
-
[Locale.DE]: Country.DE,
|
|
11
|
-
[Locale.AT]: Country.AT,
|
|
12
|
-
[Locale.NL]: Country.NL,
|
|
13
|
-
};
|
|
14
|
-
const translationExternalEndpoint = ({ translationsUrl, projects }) => (locale) => {
|
|
15
|
-
const projectsQueryParam = projects
|
|
16
|
-
.map(([project, filter]) => `projectFilter=${project}${filter ? `:${filter}` : ""}`)
|
|
17
|
-
.join("&");
|
|
18
|
-
return `${translationsUrl}/${locale}/${COUNTRY[locale]}?${projectsQueryParam}`;
|
|
19
|
-
};
|
|
20
|
-
export { translationEndpoint, translationExternalEndpoint };
|
|
2
|
+
export { translationEndpoint };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
+
type IsSizeChangeEnabledByCheckoutIdProjection = boolean;
|
|
3
|
+
declare const VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID = "view_is_size_change_enabled_by_checkout_id";
|
|
4
|
+
interface ViewIsSizeChangeEnabledByCheckoutIdPayload {
|
|
5
|
+
readonly checkoutId: string;
|
|
6
|
+
}
|
|
7
|
+
interface ViewIsSizeChangeEnabledByCheckoutId extends Query<typeof VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID>, ViewIsSizeChangeEnabledByCheckoutIdPayload {
|
|
8
|
+
}
|
|
9
|
+
interface ViewIsSizeChangeEnabledByCheckoutIdFunction {
|
|
10
|
+
(payload: ViewIsSizeChangeEnabledByCheckoutIdPayload): ViewIsSizeChangeEnabledByCheckoutId;
|
|
11
|
+
}
|
|
12
|
+
declare const viewIsSizeChangeEnabledByCheckoutId: ViewIsSizeChangeEnabledByCheckoutIdFunction;
|
|
13
|
+
interface IsSizeChangeEnabledByCheckoutIdViewArgs extends CancelableQueryViewArgs {
|
|
14
|
+
readonly checkoutId: string;
|
|
15
|
+
}
|
|
16
|
+
interface IsSizeChangeEnabledByCheckoutIdView {
|
|
17
|
+
(args: IsSizeChangeEnabledByCheckoutIdViewArgs): Promise<IsSizeChangeEnabledByCheckoutIdProjection>;
|
|
18
|
+
}
|
|
19
|
+
interface IsSizeChangeEnabledByCheckoutIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
20
|
+
readonly view: IsSizeChangeEnabledByCheckoutIdView;
|
|
21
|
+
}
|
|
22
|
+
declare const viewIsSizeChangeEnabledByCheckoutIdHandler: QueryHandlerFunction<ViewIsSizeChangeEnabledByCheckoutId, IsSizeChangeEnabledByCheckoutIdProjection, IsSizeChangeEnabledByCheckoutIdHandlerFunctionArgs>;
|
|
23
|
+
export type { IsSizeChangeEnabledByCheckoutIdProjection, IsSizeChangeEnabledByCheckoutIdView };
|
|
24
|
+
export { VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID, viewIsSizeChangeEnabledByCheckoutId, viewIsSizeChangeEnabledByCheckoutIdHandler, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { query, } from "@lookiero/messaging";
|
|
2
|
+
const VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID = "view_is_size_change_enabled_by_checkout_id";
|
|
3
|
+
const viewIsSizeChangeEnabledByCheckoutId = (payload) => ({
|
|
4
|
+
...query({ name: VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID }),
|
|
5
|
+
...payload,
|
|
6
|
+
});
|
|
7
|
+
const viewIsSizeChangeEnabledByCheckoutIdHandler = ({ view, signal }) => async ({ checkoutId }) => view({ checkoutId, signal });
|
|
8
|
+
export { VIEW_IS_SIZE_CHANGE_ENABLED_BY_CHECKOUT_ID, viewIsSizeChangeEnabledByCheckoutId, viewIsSizeChangeEnabledByCheckoutIdHandler, };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare enum Country {
|
|
2
|
-
ES = "ES",
|
|
3
|
-
FR = "FR",
|
|
4
|
-
GB = "GB",
|
|
5
|
-
BE = "BE",
|
|
6
|
-
LU = "LU",
|
|
7
|
-
IT = "IT",
|
|
8
|
-
PT = "PT",
|
|
9
|
-
DE = "DE",
|
|
10
|
-
AT = "AT",
|
|
11
|
-
NL = "NL"
|
|
2
|
+
"ES" = "ES",
|
|
3
|
+
"FR" = "FR",
|
|
4
|
+
"GB" = "GB",
|
|
5
|
+
"BE" = "BE",
|
|
6
|
+
"LU" = "LU",
|
|
7
|
+
"IT" = "IT",
|
|
8
|
+
"PT" = "PT",
|
|
9
|
+
"DE" = "DE",
|
|
10
|
+
"AT" = "AT",
|
|
11
|
+
"NL" = "NL"
|
|
12
12
|
}
|
|
13
13
|
export { Country };
|
package/package.json
CHANGED
|
@@ -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,6 +0,0 @@
|
|
|
1
|
-
import { ProcessManagerFunction } from "@lookiero/messaging";
|
|
2
|
-
import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
|
|
3
|
-
interface CreateNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
|
|
4
|
-
}
|
|
5
|
-
declare const createNotificationWhenCheckoutBookingExpired: CreateNotificationWhenCheckoutBookingExpiredFunction;
|
|
6
|
-
export { createNotificationWhenCheckoutBookingExpired };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { v4 as uuid } from "uuid";
|
|
2
|
-
import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
|
|
3
|
-
import { createNotification } from "../../../shared/notifications/domain/notification/command/createNotification";
|
|
4
|
-
import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
|
|
5
|
-
const createNotificationWhenCheckoutBookingExpired = ({ commandBus }) => async () => {
|
|
6
|
-
await commandBus(createNotification({
|
|
7
|
-
aggregateId: uuid(),
|
|
8
|
-
level: NotificationLevel.ERROR,
|
|
9
|
-
titleI18nKey: undefined,
|
|
10
|
-
bodyI18nKey: I18nMessages.CHECKOUT_TOAST_BOOKING_EXPIRED,
|
|
11
|
-
}));
|
|
12
|
-
};
|
|
13
|
-
export { createNotificationWhenCheckoutBookingExpired };
|
|
@@ -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,10 +0,0 @@
|
|
|
1
|
-
import { CommandStatus } from "@lookiero/messaging-react";
|
|
2
|
-
interface IncrementIntroShownCountFunction {
|
|
3
|
-
(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
|
|
6
|
-
interface UseIncrementIntroShownCountFunction {
|
|
7
|
-
(): UseIncrementIntroShownCount;
|
|
8
|
-
}
|
|
9
|
-
declare const useIncrementIntroShownCount: UseIncrementIntroShownCountFunction;
|
|
10
|
-
export { useIncrementIntroShownCount };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
2
|
-
import { useViewIntroShownCount } from "../../../projection/uiSetting/react/useViewIntroShownCount";
|
|
3
|
-
import { UISettings } from "../../../ui/settings/UISettings";
|
|
4
|
-
import { useUpdateUiSetting } from "./useUpdateUiSetting";
|
|
5
|
-
const useIncrementIntroShownCount = () => {
|
|
6
|
-
const [update, status] = useUpdateUiSetting();
|
|
7
|
-
const [introShownCount] = useViewIntroShownCount();
|
|
8
|
-
const incrementIntroShownCount = useCallback(() => update({ key: UISettings.INTRO_SHOWN_COUNT, value: introShownCount + 1 }), [introShownCount, update]);
|
|
9
|
-
return [incrementIntroShownCount, status];
|
|
10
|
-
};
|
|
11
|
-
export { useIncrementIntroShownCount };
|
|
@@ -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,7 +0,0 @@
|
|
|
1
|
-
import { useViewIntroShownCount } from "./useViewIntroShownCount";
|
|
2
|
-
const MAX_INTRO_SHOWN_COUNT = 2;
|
|
3
|
-
const useShouldIntroBeShown = () => {
|
|
4
|
-
const [introShownCount, introShownCountStatus] = useViewIntroShownCount();
|
|
5
|
-
return [introShownCount < MAX_INTRO_SHOWN_COUNT, introShownCountStatus];
|
|
6
|
-
};
|
|
7
|
-
export { useShouldIntroBeShown };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { UISettings } from "../../../ui/settings/UISettings";
|
|
2
|
-
import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
|
|
3
|
-
const useViewIntroShownCount = () => {
|
|
4
|
-
const [introShownCount, introShownCountStatus] = useViewUiSettingByKey({
|
|
5
|
-
key: UISettings.INTRO_SHOWN_COUNT,
|
|
6
|
-
});
|
|
7
|
-
return [introShownCount?.value || 0, introShownCountStatus];
|
|
8
|
-
};
|
|
9
|
-
export { useViewIntroShownCount };
|
|
@@ -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,25 +0,0 @@
|
|
|
1
|
-
import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
|
|
2
|
-
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
3
|
-
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { View } from "react-native";
|
|
6
|
-
import { Modal } from "../../../../../../shared/ui/components/layouts/modal/Modal";
|
|
7
|
-
import { I18nMessages } from "../../../../i18n/i18n";
|
|
8
|
-
import { style } from "./CheckoutSuccessModal.style";
|
|
9
|
-
const CheckoutSuccessModal = ({ visible, onDismiss }) => {
|
|
10
|
-
const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_TITLE });
|
|
11
|
-
const descriptionText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_DESCRIPTION });
|
|
12
|
-
const buttonText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_BUTTON });
|
|
13
|
-
return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
|
|
14
|
-
React.createElement(View, { style: style.modal },
|
|
15
|
-
React.createElement(Text, { level: 1, style: style.modalTitle, body: true }, titleText),
|
|
16
|
-
React.createElement(Text, { level: 3, style: style.modalDescription, body: true }, descriptionText),
|
|
17
|
-
React.createElement(Button
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
, {
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
style: style.button, onPress: onDismiss }, buttonText))));
|
|
24
|
-
};
|
|
25
|
-
export { CheckoutSuccessModal };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "../../../../theme/theme";
|
|
3
|
-
const { spaceXL } = theme();
|
|
4
|
-
const style = StyleSheet.create({
|
|
5
|
-
button: {
|
|
6
|
-
flex: 0,
|
|
7
|
-
},
|
|
8
|
-
modal: {
|
|
9
|
-
padding: spaceXL,
|
|
10
|
-
},
|
|
11
|
-
modalDescription: {
|
|
12
|
-
marginVertical: spaceXL,
|
|
13
|
-
textAlign: "center",
|
|
14
|
-
},
|
|
15
|
-
modalTitle: {
|
|
16
|
-
textAlign: "center",
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
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 };
|