@lookiero/checkout 2.2.2-beta.0 → 2.3.0

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.
Files changed (95) hide show
  1. package/dist/infrastructure/projection/pricing/pricing.d.ts +1 -0
  2. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +2 -2
  3. package/dist/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +5 -7
  4. package/dist/infrastructure/ui/views/App.js +1 -3
  5. package/dist/infrastructure/ui/views/checkout/Checkout.style.d.ts +1 -0
  6. package/dist/infrastructure/ui/views/checkout/Checkout.style.js +1 -0
  7. package/dist/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +3 -1
  8. package/dist/infrastructure/ui/views/summary/Summary.js +3 -1
  9. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +1 -3
  10. package/dist/projection/pricing/pricing.d.ts +1 -0
  11. package/package.json +3 -3
  12. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +0 -13
  13. package/dist/domain/checkout/command/markCheckoutAsPaid.js +0 -4
  14. package/dist/domain/checkout/model/checkoutPaid.d.ts +0 -13
  15. package/dist/domain/checkout/model/checkoutPaid.js +0 -4
  16. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  17. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  18. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +0 -5
  19. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +0 -13
  20. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +0 -13
  21. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +0 -16
  22. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -13
  23. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +0 -14
  24. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  25. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  26. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
  27. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +0 -9
  28. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
  29. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +0 -12
  30. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +0 -12
  31. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +0 -9
  32. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  33. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  34. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  35. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  36. package/dist/infrastructure/ui/views/App.style.d.ts +0 -4
  37. package/dist/infrastructure/ui/views/App.style.js +0 -16
  38. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  39. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  40. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  41. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  42. package/dist/infrastructure/ui/views/header/Header.d.ts +0 -15
  43. package/dist/infrastructure/ui/views/header/Header.js +0 -90
  44. package/dist/infrastructure/ui/views/header/Header.style.d.ts +0 -35
  45. package/dist/infrastructure/ui/views/header/Header.style.js +0 -38
  46. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +0 -7
  47. package/dist/infrastructure/ui/views/header/components/Logo.js +0 -11
  48. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +0 -7
  49. package/dist/infrastructure/ui/views/header/components/Logo.style.js +0 -8
  50. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  51. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  52. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -55
  53. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -58
  54. package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -15
  55. package/dist/infrastructure/ui/views/item/Item.style.js +0 -18
  56. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +0 -26
  57. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +0 -44
  58. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -45
  59. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +0 -53
  60. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  61. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  62. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  63. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  64. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -10
  65. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +0 -1
  66. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
  67. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
  68. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +0 -25
  69. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +0 -8
  70. package/dist/shared/logging/location.d.ts +0 -3
  71. package/dist/shared/logging/location.js +0 -5
  72. package/dist/shared/logging/matchRoutes.d.ts +0 -3
  73. package/dist/shared/logging/matchRoutes.js +0 -7
  74. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +0 -29
  75. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +0 -134
  76. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +0 -22
  77. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +0 -15
  78. package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +0 -27
  79. package/dist/shared/logging/reactRouterV6Instrumentation.native.js +0 -115
  80. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  81. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  82. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
  83. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +0 -9
  84. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  85. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  86. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  87. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  88. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  89. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  90. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  91. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
  92. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  93. package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
  94. package/dist/shared/ui/components/atoms/error/Error.style.d.ts +0 -6
  95. package/dist/shared/ui/components/atoms/error/Error.style.js +0 -9
@@ -8,6 +8,7 @@ interface PricingDto {
8
8
  readonly pendingToPay: PriceProjection;
9
9
  readonly service: ServiceProjection;
10
10
  readonly subtotal: PriceProjection;
11
+ readonly paidWithPromocode?: boolean;
11
12
  }
12
13
  interface ToPricingProjectionFunction {
13
14
  (pricingDto: PricingDto): PricingProjection;
@@ -3,14 +3,14 @@ import { Platform, ScrollView } from "react-native";
3
3
  import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import { theme } from "../../theme/theme";
5
5
  import { style } from "./SafeAreaScrollView.style.ts";
6
- const { spaceXXL } = theme();
6
+ const { spaceXXXL } = theme();
7
7
  const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
8
8
  const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
9
9
  return (React.createElement(SafeAreaView, { edges: edges, style: [style.safeAreaView, customStyle?.safeAreaView] },
10
10
  React.createElement(ScrollView, { contentContainerStyle: [
11
11
  {
12
12
  paddingTop: scrollerPaddingTop,
13
- paddingBottom: safeAreaInsetBottom + (Platform.OS !== "ios" ? spaceXXL : 0),
13
+ paddingBottom: safeAreaInsetBottom + (Platform.OS === "android" ? spaceXXXL : 0),
14
14
  },
15
15
  customStyle?.scrollView,
16
16
  ] }, children),
@@ -1,23 +1,21 @@
1
1
  import { useEvent } from "@lookiero/event";
2
2
  import { useCallback, useEffect } from "react";
3
3
  import { useCreateToastNotification } from "../../../shared/notifications";
4
- import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
5
4
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
6
5
  import { I18nMessages } from "../i18n/i18n";
6
+ import { useToast } from "./useToast";
7
7
  const PAYMENT_ERROR = "ERROR";
8
8
  const PAYMENT_SUCCESS = "PAYMENT_INSTRUMENT_UPDATED";
9
9
  const usePaymentInstrumentEvents = ({ logger }) => {
10
10
  const { subscribe, unsubscribe } = useEvent();
11
+ const { showError, showSuccess } = useToast();
11
12
  const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
12
- const onSuccess = useCallback(({ message }) => createNotification({ bodyI18nKey: message.id, level: NotificationLevel.SUCCESS }), [createNotification]);
13
+ const onSuccess = useCallback(({ message }) => showSuccess({ message: message.id }), [showSuccess]);
13
14
  const onError = useCallback(({ error }) => {
14
15
  if (error.toaster) {
15
- createNotification({
16
- bodyI18nKey: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
17
- level: NotificationLevel.ERROR,
18
- });
16
+ showError({ message: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR });
19
17
  }
20
- }, [createNotification]);
18
+ }, [showError]);
21
19
  useEffect(() => {
22
20
  subscribe({ event: PAYMENT_ERROR }, onError);
23
21
  subscribe({ event: PAYMENT_SUCCESS }, onSuccess);
@@ -1,5 +1,4 @@
1
1
  import { PortalProvider } from "@gorhom/portal";
2
- import { PortalProvider as AuroraPortalProvider } from "@lookiero/aurora";
3
2
  import React from "react";
4
3
  import { StatusBar } from "react-native";
5
4
  import { SafeAreaProvider } from "react-native-safe-area-context";
@@ -12,6 +11,5 @@ const App = ({ children, customerId, country, onOpenMenu }) => (React.createElem
12
11
  React.createElement(PortalProvider, null,
13
12
  React.createElement(StatusBar, { backgroundColor: colorBase, barStyle: "dark-content", translucent: true }),
14
13
  React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
15
- React.createElement(Navigation, { country: country, customerId: customerId, onOpenMenu: onOpenMenu },
16
- React.createElement(AuroraPortalProvider, null, children)))));
14
+ React.createElement(Navigation, { country: country, customerId: customerId, onOpenMenu: onOpenMenu }, children))));
17
15
  export { App };
@@ -10,6 +10,7 @@ declare const style: {
10
10
  };
11
11
  pricingContainer: {
12
12
  marginTop: number;
13
+ paddingBottom: number;
13
14
  };
14
15
  title: {
15
16
  marginBottom: number;
@@ -13,6 +13,7 @@ const style = StyleSheet.create({
13
13
  },
14
14
  pricingContainer: {
15
15
  marginTop: spaceXL,
16
+ paddingBottom: spaceXL,
16
17
  },
17
18
  title: {
18
19
  marginBottom: spaceM,
@@ -11,10 +11,12 @@ import { useReplaceCheckoutItem } from "../../../../../domain/checkoutItem/react
11
11
  import { TrackingPage } from "../../../../../tracking/tracking";
12
12
  import { Body } from "../../../../components/layouts/body/Body";
13
13
  import { SafeAreaScrollView } from "../../../../components/templates/SafeAreaScrollView";
14
+ import { theme } from "../../../../theme/theme";
14
15
  import { HEADER_HEIGHT } from "../../../navigation/components/header/Header.style";
15
16
  import { ItemActions } from "../../components/itemActions/ItemActions";
16
17
  import { SizeWithoutStockModal } from "../../components/sizeWithoutStockModal/SizeWithoutStockModal";
17
18
  import { ProductVariant } from "../productVariant/ProductVariant";
19
+ const { spaceXL } = theme();
18
20
  const ItemWithoutCustomerDecission = ({ country, checkoutId, checkoutItem, bookedProductsVariants, currentProductVariant, onReturn, }) => {
19
21
  const logger = useLogger();
20
22
  /* KeepCheckoutItem */
@@ -60,6 +62,6 @@ const ItemWithoutCustomerDecission = ({ country, checkoutId, checkoutItem, booke
60
62
  React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
61
63
  React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT, footer: React.createElement(ItemActions, { country: country, currentProductVariant: currentProductVariant, productVariants: bookedProductsVariants?.productVariants, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: onReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal }) },
62
64
  React.createElement(Body, null,
63
- React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, style: { content: { paddingBottom: Platform.OS === "web" ? 0 : stickyHeight } } })))));
65
+ React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, style: { content: { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight } } })))));
64
66
  };
65
67
  export { ItemWithoutCustomerDecission };
@@ -20,11 +20,13 @@ import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollVie
20
20
  import { I18nMessages } from "../../i18n/i18n";
21
21
  import { Routes } from "../../routing/routes";
22
22
  import { useBasePath } from "../../routing/useBasePath";
23
+ import { theme } from "../../theme/theme";
23
24
  import { HEADER_HEIGHT } from "../navigation/components/header/Header.style";
24
25
  import { style } from "./Summary.style";
25
26
  import { CheckoutItemsTabs } from "./components/checkoutItemsTabs/CheckoutItemsTabs";
26
27
  import { FiveItemsDiscountBanner } from "./components/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
27
28
  import { StickyPricing } from "./components/stickyPricing/StickyPricing";
29
+ const { spaceXL } = theme();
28
30
  const Summary = ({ customerId, country }) => {
29
31
  const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
30
32
  const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
@@ -84,7 +86,7 @@ const Summary = ({ customerId, country }) => {
84
86
  if (!dependenciesLoaded)
85
87
  return React.createElement(Spinner, null);
86
88
  return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: HEADER_HEIGHT, footer: pricing && (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })) },
87
- React.createElement(Body, { style: { row: { paddingBottom: pricingHeight } } },
89
+ React.createElement(Body, { style: { row: { paddingBottom: pricingHeight || spaceXL } } },
88
90
  fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
89
91
  React.createElement(View, { style: style.content },
90
92
  React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
@@ -10,7 +10,6 @@ import { style } from "./Pricing.style";
10
10
  import { ArrowDown } from "./icons/ArrowDown";
11
11
  import { ArrowUp } from "./icons/ArrowUp";
12
12
  const { colorGrayscaleS } = theme();
13
- const PS_SERVICE_FREE_INDICATOR = 100;
14
13
  const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
15
14
  React.createElement(Text, { level: level, action: true, upperCase: true }, text),
16
15
  children));
@@ -29,7 +28,6 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
29
28
  }) || "";
30
29
  const creditText = useI18nMessage({ id: I18nMessages.SUMMARY_CREDIT }) || "";
31
30
  const feeText = useI18nMessage({ id: I18nMessages.SUMMARY_FEE }) || "";
32
- const isPSServiceFree = service.discount.amount === PS_SERVICE_FREE_INDICATOR;
33
31
  const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
34
32
  const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
35
33
  return (React.createElement(Pressable, { testID: "pricing", onPress: collapsible ? onPress : null },
@@ -49,7 +47,7 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
49
47
  React.createElement(Price, { price: discount, variant: "subtotal" }))),
50
48
  balanceDiscount && balanceDiscount.amount !== 0 && (React.createElement(Row, { text: creditText },
51
49
  React.createElement(Price, { price: balanceDiscount, variant: "subtotal" }))),
52
- React.createElement(Row, { text: feeText }, isPSServiceFree ? (React.createElement(Text, { level: 3, action: true, upperCase: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
50
+ React.createElement(Row, { text: feeText }, service.paidWithPromocode ? (React.createElement(Text, { level: 3, action: true, upperCase: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
53
51
  React.createElement(View, { style: style.divider }),
54
52
  React.createElement(Row, { level: 2, text: totalText },
55
53
  React.createElement(Price, { price: pendingToPay, variant: "total" })),
@@ -5,6 +5,7 @@ interface ServiceProjection {
5
5
  readonly originalPrice: PriceProjection;
6
6
  readonly prepaid: boolean;
7
7
  readonly reference: string;
8
+ readonly paidWithPromocode?: boolean;
8
9
  }
9
10
  interface PricingProjection {
10
11
  readonly balanceDiscount: PriceProjection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "2.2.2-beta.0",
3
+ "version": "2.3.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -49,7 +49,7 @@
49
49
  "@lookiero/data-sources": "^0.3",
50
50
  "@lookiero/event": "^0.3",
51
51
  "@lookiero/locale": "^0.3",
52
- "@lookiero/payments-front": "^1.1.1",
52
+ "@lookiero/payments-front": "^1.0.2",
53
53
  "@lookiero/user-tracking-front": "0.0.37",
54
54
  "apollo-boost": "0.4.4",
55
55
  "graphql": "16.6.0",
@@ -71,7 +71,7 @@
71
71
  "@lookiero/data-sources": "^0.3",
72
72
  "@lookiero/event": "^0.3",
73
73
  "@lookiero/locale": "^0.3",
74
- "@lookiero/payments-front": "^1.1.1",
74
+ "@lookiero/payments-front": "^1.0.2",
75
75
  "@lookiero/user-tracking-front": "0.0.37",
76
76
  "@pact-foundation/pact": "^10.1.4",
77
77
  "@pact-foundation/pact-node": "^10.17.6",
@@ -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,4 +0,0 @@
1
- import { command } from "@lookiero/messaging";
2
- const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
- const markCheckoutAsPaid = ({ aggregateId }) => command({ aggregateId, name: MARK_CHECKOUT_AS_PAID });
4
- 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,4 +0,0 @@
1
- import { domainEvent } from "@lookiero/messaging";
2
- const CHECKOUT_PAID = "checkout_paid";
3
- const checkoutPaid = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_PAID });
4
- 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,5 +0,0 @@
1
- import { HttpCheckoutsSaveFunction } from "./httpCheckouts";
2
- interface HttpCheckoutsMarkAsPaidFunction extends HttpCheckoutsSaveFunction {
3
- }
4
- declare const httpCheckoutsMarkAsPaid: HttpCheckoutsMarkAsPaidFunction;
5
- export { httpCheckoutsMarkAsPaid };
@@ -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 };
@@ -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 };
@@ -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 };
@@ -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 };
@@ -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,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseShouldIntroBeShownFunction {
3
- (): [boolean, QueryStatus];
4
- }
5
- declare const useShouldIntroBeShown: UseShouldIntroBeShownFunction;
6
- export { useShouldIntroBeShown };
@@ -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,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseViewIntroShownCountFunction {
3
- (): [number, QueryStatus];
4
- }
5
- declare const useViewIntroShownCount: UseViewIntroShownCountFunction;
6
- export { useViewIntroShownCount };
@@ -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,4 +0,0 @@
1
- declare const style: {
2
- header: {};
3
- };
4
- export { style };
@@ -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,7 +0,0 @@
1
- import { FC } from "react";
2
- interface CheckoutSuccessModalProps {
3
- readonly visible: boolean;
4
- readonly onDismiss: () => void;
5
- }
6
- declare const CheckoutSuccessModal: FC<CheckoutSuccessModalProps>;
7
- export { CheckoutSuccessModal };
@@ -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,16 +0,0 @@
1
- declare const style: {
2
- button: {
3
- flex: number;
4
- };
5
- modal: {
6
- padding: number;
7
- };
8
- modalDescription: {
9
- marginVertical: number;
10
- textAlign: "center";
11
- };
12
- modalTitle: {
13
- textAlign: "center";
14
- };
15
- };
16
- export { style };
@@ -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 };