@lookiero/checkout 0.2.7 → 0.2.9

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 (88) hide show
  1. package/dist/domain/checkout/command/startCheckout.d.ts +12 -0
  2. package/dist/domain/checkout/command/startCheckout.js +4 -0
  3. package/dist/domain/checkout/model/checkout.d.ts +17 -0
  4. package/dist/domain/checkout/model/checkout.js +20 -0
  5. package/dist/domain/checkout/model/checkoutStarted.d.ts +13 -0
  6. package/dist/domain/checkout/model/checkoutStarted.js +4 -0
  7. package/dist/domain/checkout/model/checkouts.d.ts +7 -0
  8. package/dist/domain/checkout/model/checkouts.js +1 -0
  9. package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.d.ts +0 -1
  10. package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +0 -1
  11. package/dist/domain/checkoutBooking/model/checkoutBooking.js +1 -3
  12. package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +0 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.js +1 -0
  15. package/dist/infrastructure/delivery/bootstrap.js +13 -4
  16. package/dist/infrastructure/delivery/{_mock/bootstrap.mock.js → bootstrap.mock.js} +14 -13
  17. package/dist/infrastructure/domain/checkout/model/httpCheckouts.d.ts +16 -0
  18. package/dist/infrastructure/domain/checkout/model/httpCheckouts.js +21 -0
  19. package/dist/infrastructure/domain/checkout/model/httpCheckoutsStart.d.ts +5 -0
  20. package/dist/infrastructure/domain/checkout/model/httpCheckoutsStart.js +14 -0
  21. package/dist/infrastructure/domain/checkout/react/useStartCheckout.d.ts +13 -0
  22. package/dist/infrastructure/domain/checkout/react/useStartCheckout.js +10 -0
  23. package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +2 -2
  24. package/dist/infrastructure/domain/{react → checkoutBooking/react}/useBookSizeReplaceableProductVariantsForCheckoutItem.js +2 -3
  25. package/dist/infrastructure/domain/{react → uiSetting/react}/useSetCheckoutIntroShown.js +1 -1
  26. package/dist/infrastructure/domain/{react → uiSetting/react}/useUpdateUiSetting.js +2 -2
  27. package/dist/infrastructure/projection/{httpBookedSizeReplaceableProductVariantsForCheckoutItemView.d.ts → bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.d.ts} +2 -2
  28. package/dist/infrastructure/projection/{react → bookedSizeReplaceableProductVariants/react}/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +1 -1
  29. package/dist/infrastructure/projection/{react → bookedSizeReplaceableProductVariants/react}/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.js +2 -2
  30. package/dist/infrastructure/projection/checkout/checkout.d.ts +53 -0
  31. package/dist/infrastructure/projection/{httpFirstAvailableCheckoutByCustomerIdView.js → checkout/checkout.js} +1 -8
  32. package/dist/infrastructure/projection/checkout/checkout.mock.d.ts +17 -0
  33. package/dist/infrastructure/{delivery/_mock → projection/checkout}/checkout.mock.js +13 -10
  34. package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.d.ts +12 -0
  35. package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.js +9 -0
  36. package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.d.ts +12 -0
  37. package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.js +9 -0
  38. package/dist/infrastructure/projection/{httpFiveItemsDiscountByCustomerIdView.d.ts → checkout/httpFiveItemsDiscountByCustomerIdView.d.ts} +2 -2
  39. package/dist/infrastructure/projection/{httpIsCheckoutEnabledByCustomerIdView.d.ts → checkout/httpIsCheckoutEnabledByCustomerIdView.d.ts} +2 -2
  40. package/dist/infrastructure/projection/{react → checkout/react}/useViewFirstAvailableCheckoutByCustomerId.d.ts +1 -1
  41. package/dist/infrastructure/projection/{react → checkout/react}/useViewFirstAvailableCheckoutByCustomerId.js +2 -2
  42. package/dist/infrastructure/projection/{react → checkout/react}/useViewFiveItemsDiscountByCustomerId.d.ts +1 -1
  43. package/dist/infrastructure/projection/{react → checkout/react}/useViewFiveItemsDiscountByCustomerId.js +2 -2
  44. package/dist/infrastructure/projection/{react → checkout/react}/useViewIsCheckoutAccessibleByCustomerId.d.ts +1 -1
  45. package/dist/infrastructure/projection/{react → checkout/react}/useViewIsCheckoutAccessibleByCustomerId.js +2 -2
  46. package/dist/infrastructure/projection/uiSetting/react/useViewCheckoutIntroShown.d.ts +2 -0
  47. package/dist/infrastructure/projection/{react → uiSetting/react}/useViewCheckoutIntroShown.js +1 -1
  48. package/dist/infrastructure/projection/{react → uiSetting/react}/useViewUiSettingByKey.d.ts +1 -1
  49. package/dist/infrastructure/projection/{react → uiSetting/react}/useViewUiSettingByKey.js +3 -3
  50. package/dist/infrastructure/projection/{storageUiSettingByKeyView.d.ts → uiSetting/storageUiSettingByKeyView.d.ts} +3 -3
  51. package/dist/infrastructure/ui/Root.js +1 -1
  52. package/dist/infrastructure/ui/components/atoms/price/Price.d.ts +1 -1
  53. package/dist/infrastructure/ui/components/atoms/price/Price.js +2 -2
  54. package/dist/infrastructure/ui/i18n/i18n.d.ts +8 -1
  55. package/dist/infrastructure/ui/i18n/i18n.js +7 -0
  56. package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -1
  57. package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +2 -3
  58. package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +3 -3
  59. package/dist/infrastructure/ui/views/intro/Intro.js +6 -6
  60. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.d.ts +9 -0
  61. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +21 -0
  62. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.d.ts +17 -0
  63. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.js +20 -0
  64. package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.d.ts +11 -0
  65. package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.js +23 -0
  66. package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.style.d.ts +19 -0
  67. package/dist/infrastructure/ui/views/item/components/productVariantActions/ProductVariantActions.style.js +22 -0
  68. package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.d.ts +1 -1
  69. package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -3
  70. package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.d.ts +1 -1
  71. package/dist/projection/checkout/checkout.d.ts +78 -0
  72. package/dist/projection/checkout/checkout.js +29 -0
  73. package/dist/projection/checkout/viewCheckoutById.d.ts +25 -0
  74. package/dist/projection/checkout/viewCheckoutById.js +8 -0
  75. package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.d.ts +3 -83
  76. package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.js +1 -36
  77. package/package.json +6 -2
  78. package/dist/infrastructure/delivery/_mock/checkout.mock.d.ts +0 -9
  79. package/dist/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.d.ts +0 -60
  80. package/dist/infrastructure/projection/react/useViewCheckoutIntroShown.d.ts +0 -2
  81. /package/dist/infrastructure/delivery/{_mock/bootstrap.mock.d.ts → bootstrap.mock.d.ts} +0 -0
  82. /package/dist/infrastructure/domain/{react → checkoutBooking/react}/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +0 -0
  83. /package/dist/infrastructure/domain/{react → uiSetting/react}/useSetCheckoutIntroShown.d.ts +0 -0
  84. /package/dist/infrastructure/domain/{react → uiSetting/react}/useUpdateUiSetting.d.ts +0 -0
  85. /package/dist/infrastructure/projection/{httpBookedSizeReplaceableProductVariantsForCheckoutItemView.js → bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.js} +0 -0
  86. /package/dist/infrastructure/projection/{httpFiveItemsDiscountByCustomerIdView.js → checkout/httpFiveItemsDiscountByCustomerIdView.js} +0 -0
  87. /package/dist/infrastructure/projection/{httpIsCheckoutEnabledByCustomerIdView.js → checkout/httpIsCheckoutEnabledByCustomerIdView.js} +0 -0
  88. /package/dist/infrastructure/projection/{storageUiSettingByKeyView.js → uiSetting/storageUiSettingByKeyView.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { viewFirstAvailableCheckoutByCustomerId, } from "../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
3
- import { CHECKOUT_MESSAGING_REACT_ID } from "../../delivery/bootstrap";
2
+ import { viewFirstAvailableCheckoutByCustomerId } from "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
3
+ import { CHECKOUT_MESSAGING_REACT_ID } from "../../../delivery/bootstrap";
4
4
  const useViewFirstAvailableCheckoutByCustomerId = ({ customerId }) => useQuery({
5
5
  query: viewFirstAvailableCheckoutByCustomerId({ customerId }),
6
6
  contextId: CHECKOUT_MESSAGING_REACT_ID,
@@ -1,5 +1,5 @@
1
1
  import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
- import { FiveItemsDiscountByCustomerIdProjection } from "../../../projection/checkout/viewFiveItemsDiscountByCustomerId";
2
+ import { FiveItemsDiscountByCustomerIdProjection } from "../../../../projection/checkout/viewFiveItemsDiscountByCustomerId";
3
3
  interface UseViewFiveItemsDiscountByCustomerIdFunctionArgs {
4
4
  readonly customerId: string;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { viewFiveItemsDiscountByCustomerId, } from "../../../projection/checkout/viewFiveItemsDiscountByCustomerId";
3
- import { CHECKOUT_MESSAGING_REACT_ID } from "../../delivery/bootstrap";
2
+ import { viewFiveItemsDiscountByCustomerId, } from "../../../../projection/checkout/viewFiveItemsDiscountByCustomerId";
3
+ import { CHECKOUT_MESSAGING_REACT_ID } from "../../../delivery/bootstrap";
4
4
  const useViewFiveItemsDiscountByCustomerId = ({ customerId }) => useQuery({
5
5
  query: viewFiveItemsDiscountByCustomerId({ customerId }),
6
6
  contextId: CHECKOUT_MESSAGING_REACT_ID,
@@ -1,5 +1,5 @@
1
1
  import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
- import { IsCheckoutAccessibleByCustomerIdProjection } from "../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
2
+ import { IsCheckoutAccessibleByCustomerIdProjection } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
3
3
  interface UseViewIsCheckoutAccessibleByCustomerIdFunctionArgs {
4
4
  readonly customerId: string | undefined;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { viewIsCheckoutAccessibleByCustomerId, } from "../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
3
- import { CHECKOUT_MESSAGING_REACT_ID } from "../../delivery/bootstrap";
2
+ import { viewIsCheckoutAccessibleByCustomerId, } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
3
+ import { CHECKOUT_MESSAGING_REACT_ID } from "../../../delivery/bootstrap";
4
4
  const useViewIsCheckoutAccessibleByCustomerId = ({ customerId }) => useQuery({
5
5
  query: viewIsCheckoutAccessibleByCustomerId({ customerId }),
6
6
  contextId: CHECKOUT_MESSAGING_REACT_ID,
@@ -0,0 +1,2 @@
1
+ declare const useViewCheckoutIntroShown: () => import("@lookiero/messaging-react").UseQueryFunctionResult<import("../../../../projection/uiSetting/viewUiSettingByKey").UiSettingProjection>;
2
+ export { useViewCheckoutIntroShown };
@@ -1,4 +1,4 @@
1
- import { UISettings } from "../../ui/settings/UISettings";
1
+ import { UISettings } from "../../../ui/settings/UISettings";
2
2
  import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
3
3
  const useViewCheckoutIntroShown = () => useViewUiSettingByKey({
4
4
  key: UISettings.CHECKOUT_INTRO_SHOWN,
@@ -1,5 +1,5 @@
1
1
  import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
- import { UiSettingProjection } from "../../../projection/uiSetting/viewUiSettingByKey";
2
+ import { UiSettingProjection } from "../../../../projection/uiSetting/viewUiSettingByKey";
3
3
  interface UseViewUiSettingByKeyFunctionArgs {
4
4
  readonly key: string;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { UI_SETTING_UPDATED } from "../../../domain/uiSetting/model/uiSettingUpdated";
3
- import { viewUiSettingByKey } from "../../../projection/uiSetting/viewUiSettingByKey";
4
- import { CHECKOUT_MESSAGING_REACT_ID } from "../../delivery/bootstrap";
2
+ import { UI_SETTING_UPDATED } from "../../../../domain/uiSetting/model/uiSettingUpdated";
3
+ import { viewUiSettingByKey } from "../../../../projection/uiSetting/viewUiSettingByKey";
4
+ import { CHECKOUT_MESSAGING_REACT_ID } from "../../../delivery/bootstrap";
5
5
  const isUiSettingUpdated = (event) => event.name === UI_SETTING_UPDATED;
6
6
  const useViewUiSettingByKey = ({ key }) => useQuery({
7
7
  query: viewUiSettingByKey({ key }),
@@ -1,6 +1,6 @@
1
- import { UiSettingByKeyView } from "../../projection/uiSetting/viewUiSettingByKey";
2
- import { ReadFunction } from "../persistence/storage";
3
- import { UiSettingDto } from "../persistence/uiSettingData";
1
+ import { UiSettingByKeyView } from "../../../projection/uiSetting/viewUiSettingByKey";
2
+ import { ReadFunction } from "../../persistence/storage";
3
+ import { UiSettingDto } from "../../persistence/uiSettingData";
4
4
  interface StorageUiSettingByKeyView extends UiSettingByKeyView {
5
5
  }
6
6
  interface StorageUiSettingByKeyViewFunctionArgs {
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback } from "react";
2
2
  import { Platform } from "react-native";
3
- import { Router } from "./routing/router/Router";
4
3
  import { Routing } from "./routing/Routing";
4
+ import { Router } from "./routing/router/Router";
5
5
  const root = ({ Messaging, I18n, development }) =>
6
6
  // eslint-disable-next-line react/display-name, react/prop-types
7
7
  ({ locale = "en", customerId, onNotAccessible }) => {
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import { PriceProjection } from "../../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
2
+ import { PriceProjection } from "../../../../../projection/checkout/checkout";
3
3
  interface PriceProps {
4
4
  readonly price: PriceProjection;
5
5
  }
@@ -1,7 +1,7 @@
1
+ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
+ import { useI18nNumber } from "@lookiero/i18n-react";
1
3
  import React from "react";
2
4
  import { View } from "react-native";
3
- import { useI18nNumber } from "@lookiero/i18n-react";
4
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
5
5
  import { style } from "./Price.style";
6
6
  const Price = ({ price }) => {
7
7
  const isDiscounted = price.discountedPrice && price.discountedPrice.percentage !== 0;
@@ -8,6 +8,13 @@ declare enum I18nMessages {
8
8
  INTRO_BUTTON = "intro.button",
9
9
  ITEM_SIZE = "item.size",
10
10
  ITEM_COLOR = "item.color",
11
- ITEM_UNIQUE = "item.unique"
11
+ ITEM_UNIQUE = "item.unique",
12
+ ITEM_SIZES_LABEL = "item.sizes_label",
13
+ ITEM_KEEP_BUTTON = "item.keep_button",
14
+ ITEM_RETURN_BUTTON = "item.return_button",
15
+ ITEM_BANNER_CUSTOMER_KEPT_DECISSION = "item.banner_customer_kept_decission",
16
+ ITEM_BANNER_CUSTOMER_REPLACED_DECISSION = "item.banner_customer_replaced_decission",
17
+ ITEM_BANNER_CUSTOMER_RETURNED_DECISSION = "item.banner_customer_returned_decission",
18
+ ITEM_BANNER_BUTTON = "item.banner_button"
12
19
  }
13
20
  export { I18nMessages };
@@ -10,5 +10,12 @@ var I18nMessages;
10
10
  I18nMessages["ITEM_SIZE"] = "item.size";
11
11
  I18nMessages["ITEM_COLOR"] = "item.color";
12
12
  I18nMessages["ITEM_UNIQUE"] = "item.unique";
13
+ I18nMessages["ITEM_SIZES_LABEL"] = "item.sizes_label";
14
+ I18nMessages["ITEM_KEEP_BUTTON"] = "item.keep_button";
15
+ I18nMessages["ITEM_RETURN_BUTTON"] = "item.return_button";
16
+ I18nMessages["ITEM_BANNER_CUSTOMER_KEPT_DECISSION"] = "item.banner_customer_kept_decission";
17
+ I18nMessages["ITEM_BANNER_CUSTOMER_REPLACED_DECISSION"] = "item.banner_customer_replaced_decission";
18
+ I18nMessages["ITEM_BANNER_CUSTOMER_RETURNED_DECISSION"] = "item.banner_customer_returned_decission";
19
+ I18nMessages["ITEM_BANNER_BUTTON"] = "item.banner_button";
13
20
  })(I18nMessages || (I18nMessages = {}));
14
21
  export { I18nMessages };
@@ -1,4 +1,3 @@
1
- import "react-native-get-random-values";
2
1
  import { FC } from "react";
3
2
  interface CheckoutAccessibilityMiddlewareProps {
4
3
  readonly customerId: string | undefined;
@@ -1,9 +1,8 @@
1
- import "react-native-get-random-values";
1
+ import { QueryStatus } from "@lookiero/messaging-react";
2
2
  import React, { useEffect, useRef } from "react";
3
3
  import { Outlet } from "react-router-native";
4
- import { useViewIsCheckoutAccessibleByCustomerId } from "../../projection/react/useViewIsCheckoutAccessibleByCustomerId";
4
+ import { useViewIsCheckoutAccessibleByCustomerId } from "../../projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId";
5
5
  import { Spinner } from "../components/atoms/spinner/Spinner";
6
- import { QueryStatus } from "@lookiero/messaging-react";
7
6
  const CheckoutAccessibilityMiddleware = ({ customerId, onNotAccessible, loader = React.createElement(Spinner, null), }) => {
8
7
  const [accessible, status] = useViewIsCheckoutAccessibleByCustomerId({ customerId });
9
8
  const onNotAccessibleRef = useRef(onNotAccessible);
@@ -1,9 +1,9 @@
1
1
  import { QueryStatus } from "@lookiero/messaging-react";
2
2
  import React from "react";
3
3
  import { generatePath, Navigate, Outlet, useMatch } from "react-router";
4
- import { CheckoutItemStatus, } from "../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
5
- import { useViewCheckoutIntroShown } from "../../projection/react/useViewCheckoutIntroShown";
6
- import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/react/useViewFirstAvailableCheckoutByCustomerId";
4
+ import { CheckoutItemStatus } from "../../../projection/checkout/checkout";
5
+ import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
6
+ import { useViewCheckoutIntroShown } from "../../projection/uiSetting/react/useViewCheckoutIntroShown";
7
7
  import { Spinner } from "../components/atoms/spinner/Spinner";
8
8
  import { Routes } from "./routes";
9
9
  const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner, null) }) => {
@@ -1,15 +1,15 @@
1
1
  import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
- import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
3
- import { I18nMessages } from "../../i18n/i18n";
4
2
  import { Icon } from "@lookiero/aurora-next/build/components/primitives/Icon/Icon";
5
- import { Spinner } from "../../components/atoms/spinner/Spinner";
6
3
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
7
4
  import { useI18nMessage } from "@lookiero/i18n-react";
8
- import { useSetCheckoutIntroShown } from "../../../domain/react/useSetCheckoutIntroShown";
9
- import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/react/useViewFiveItemsDiscountByCustomerId";
10
- import { View } from "react-native";
5
+ import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
11
6
  import React, { useCallback } from "react";
7
+ import { View } from "react-native";
8
+ import { useSetCheckoutIntroShown } from "../../../domain/uiSetting/react/useSetCheckoutIntroShown";
9
+ import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
10
+ import { Spinner } from "../../components/atoms/spinner/Spinner";
12
11
  import { Body } from "../../components/layouts/body/Body";
12
+ import { I18nMessages } from "../../i18n/i18n";
13
13
  import { style } from "./Intro.style";
14
14
  const Bullet = ({ text }) => (React.createElement(View, { style: style.bullet },
15
15
  React.createElement(Icon, { name: "rounded-tick", style: style.tickIcon }),
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { CheckoutItemStatus } from "../../../../../../projection/checkout/checkout";
3
+ declare type Status = Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL | CheckoutItemStatus.EXPIRED>;
4
+ interface CustomerDecissionBannerProps {
5
+ readonly checkoutItemStatus: Status;
6
+ readonly onPress: () => void;
7
+ }
8
+ declare const CustomerDecissionBanner: FC<CustomerDecissionBannerProps>;
9
+ export { CustomerDecissionBanner };
@@ -0,0 +1,21 @@
1
+ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
+ import { useI18nMessage } from "@lookiero/i18n-react";
3
+ import React from "react";
4
+ import { Pressable, View } from "react-native";
5
+ import { CheckoutItemStatus } from "../../../../../../projection/checkout/checkout";
6
+ import { I18nMessages } from "../../../../i18n/i18n";
7
+ import { style } from "./CustomerDecissionBanner.style";
8
+ const i18nMessageForCheckoutItemStatus = {
9
+ [CheckoutItemStatus.KEPT]: I18nMessages.ITEM_BANNER_CUSTOMER_KEPT_DECISSION,
10
+ [CheckoutItemStatus.REPLACED]: I18nMessages.ITEM_BANNER_CUSTOMER_REPLACED_DECISSION,
11
+ [CheckoutItemStatus.RETURNED]: I18nMessages.ITEM_BANNER_CUSTOMER_RETURNED_DECISSION,
12
+ };
13
+ const CustomerDecissionBanner = ({ checkoutItemStatus, onPress }) => {
14
+ const decissionText = useI18nMessage({ id: i18nMessageForCheckoutItemStatus[checkoutItemStatus] });
15
+ const bannerButtonText = useI18nMessage({ id: I18nMessages.ITEM_BANNER_BUTTON });
16
+ return (React.createElement(View, { style: style.container },
17
+ React.createElement(Text, { detail: true, level: 2, style: style.decissionText }, decissionText),
18
+ React.createElement(Pressable, { onPress: onPress },
19
+ React.createElement(Text, { detail: true, level: 2, style: style.buttonText }, bannerButtonText))));
20
+ };
21
+ export { CustomerDecissionBanner };
@@ -0,0 +1,17 @@
1
+ declare const style: {
2
+ container: {
3
+ alignItems: "center";
4
+ backgroundColor: string;
5
+ paddingTop: number;
6
+ paddingHorizontal: number;
7
+ paddingBottom: number;
8
+ };
9
+ decissionText: {
10
+ textAlign: "center";
11
+ marginBottom: number;
12
+ };
13
+ buttonText: {
14
+ textDecorationLine: "underline";
15
+ };
16
+ };
17
+ export { style };
@@ -0,0 +1,20 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../theme/theme";
3
+ const { colorInfo, spaceM, spaceL } = theme();
4
+ const style = StyleSheet.create({
5
+ container: {
6
+ alignItems: "center",
7
+ backgroundColor: colorInfo,
8
+ paddingTop: spaceM,
9
+ paddingHorizontal: spaceL,
10
+ paddingBottom: spaceL,
11
+ },
12
+ decissionText: {
13
+ textAlign: "center",
14
+ marginBottom: spaceM,
15
+ },
16
+ buttonText: {
17
+ textDecorationLine: "underline",
18
+ },
19
+ });
20
+ export { style };
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { SizeProjection } from "../../../../../../projection/checkout/checkout";
3
+ interface ProductVariantActionsProps {
4
+ readonly sizes: SizeProjection[];
5
+ readonly size: SizeProjection;
6
+ readonly onKeep: (value: string) => void;
7
+ readonly onReturn: () => void;
8
+ readonly onReplace: () => void;
9
+ }
10
+ declare const ProductVariantActions: FC<ProductVariantActionsProps>;
11
+ export { ProductVariantActions };
@@ -0,0 +1,23 @@
1
+ import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
+ import { BUTTON_VARIANT } from "@lookiero/aurora-next/build/components/atoms/Button/Button.definition";
3
+ import { InputField } from "@lookiero/aurora-next/build/components/atoms/InputField/InputField";
4
+ import { useI18nMessage } from "@lookiero/i18n-react";
5
+ import React, { useMemo } from "react";
6
+ import { View } from "react-native";
7
+ import { I18nMessages } from "../../../../i18n/i18n";
8
+ import { style } from "./ProductVariantActions.style";
9
+ const ProductVariantActions = ({ sizes, size, onKeep, onReplace, onReturn }) => {
10
+ const sizeSelectorLabelText = useI18nMessage({ id: I18nMessages.ITEM_SIZES_LABEL });
11
+ const keepButtonText = useI18nMessage({ id: I18nMessages.ITEM_KEEP_BUTTON });
12
+ const returnButtonText = useI18nMessage({ id: I18nMessages.ITEM_RETURN_BUTTON });
13
+ const sizeSelectorOptions = useMemo(() => sizes.map((size) => ({ name: size.lookiero, value: size.id })), [sizes]);
14
+ const disabledSizeSelector = useMemo(() => sizeSelectorOptions.length === 1 && sizeSelectorOptions[0]?.value === size.id, [sizeSelectorOptions, size.id]);
15
+ return (React.createElement(View, { style: style.container },
16
+ React.createElement(Button, { onPress: onKeep }, keepButtonText),
17
+ React.createElement(View, { style: style.row },
18
+ !size.unique && (React.createElement(View, { style: style.dropdownContainer },
19
+ React.createElement(InputField, { label: sizeSelectorLabelText, value: size.id, name: "size-selector", icon: "arrow-down", onChange: onReplace, options: sizeSelectorOptions, disabled: disabledSizeSelector, testID: "size-selector" }))),
20
+ React.createElement(View, { style: style.returnButtonContainer },
21
+ React.createElement(Button, { variant: BUTTON_VARIANT.SECONDARY, onPress: onReturn }, returnButtonText)))));
22
+ };
23
+ export { ProductVariantActions };
@@ -0,0 +1,19 @@
1
+ declare const style: {
2
+ container: {
3
+ width: string;
4
+ };
5
+ row: {
6
+ alignItems: "center";
7
+ flexDirection: "row";
8
+ marginTop: number;
9
+ };
10
+ dropdownContainer: {
11
+ flex: number;
12
+ zIndex: number;
13
+ marginRight: number;
14
+ };
15
+ returnButtonContainer: {
16
+ flex: number;
17
+ };
18
+ };
19
+ export { style };
@@ -0,0 +1,22 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../theme/theme";
3
+ const { spaceL } = theme();
4
+ const style = StyleSheet.create({
5
+ container: {
6
+ width: "100%",
7
+ },
8
+ row: {
9
+ alignItems: "center",
10
+ flexDirection: "row",
11
+ marginTop: spaceL,
12
+ },
13
+ dropdownContainer: {
14
+ flex: 1,
15
+ zIndex: 4,
16
+ marginRight: spaceL,
17
+ },
18
+ returnButtonContainer: {
19
+ flex: 1,
20
+ },
21
+ });
22
+ export { style };
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import { ColorProjection, PriceProjection, SizeProjection } from "../../../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
2
+ import { ColorProjection, PriceProjection, SizeProjection } from "../../../../../../projection/checkout/checkout";
3
3
  interface ProductVariantDescriptionProps {
4
4
  readonly brand: string;
5
5
  readonly name: string;
@@ -1,9 +1,9 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
1
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
4
2
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { I18nMessages } from "../../../../i18n/i18n";
3
+ import React from "react";
4
+ import { View } from "react-native";
6
5
  import { Price } from "../../../../components/atoms/price/Price";
6
+ import { I18nMessages } from "../../../../i18n/i18n";
7
7
  import { style } from "./ProductVariantDescription.style";
8
8
  const ProductVariantDescription = ({ brand, name, price, size, color }) => {
9
9
  const sizeText = useI18nMessage({ id: I18nMessages.ITEM_SIZE });
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import { MediaProjection } from "../../../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
2
+ import { MediaProjection } from "../../../../../../projection/checkout/checkout";
3
3
  interface ProductVariantSlider {
4
4
  readonly producVariantMedia: MediaProjection[];
5
5
  }
@@ -0,0 +1,78 @@
1
+ import { CheckoutStatus } from "../../domain/checkout/model/checkout";
2
+ declare enum MediaPerspective {
3
+ BACK = "BACK",
4
+ BOTTOM_UP = "BOTTOM_UP",
5
+ COLLAGE = "COLLAGE",
6
+ DETAIL = "DETAIL",
7
+ FLAT_BACK = "FLAT_BACK",
8
+ FRONT = "FRONT",
9
+ FRONT_FAR = "FRONT_FAR",
10
+ LABEL = "LABEL",
11
+ MAIN = "MAIN",
12
+ MAIN_TRANSPARENT = "MAIN_TRANSPARENT",
13
+ OTHER = "OTHER",
14
+ SIDE = "SIDE"
15
+ }
16
+ interface MediaProjection {
17
+ readonly id: string;
18
+ readonly url: string;
19
+ readonly perspective: MediaPerspective;
20
+ }
21
+ declare enum Currency {
22
+ EUR = "EUR",
23
+ GBP = "GBP"
24
+ }
25
+ interface PriceProjection {
26
+ readonly amount: number;
27
+ readonly currency: Currency;
28
+ readonly discountedPrice?: {
29
+ readonly amount: number;
30
+ readonly percentage: number;
31
+ };
32
+ }
33
+ interface SizeProjection {
34
+ readonly id: string;
35
+ readonly lookiero: string;
36
+ readonly uk: string;
37
+ readonly it: string;
38
+ readonly europe: string;
39
+ readonly unique: boolean;
40
+ readonly visualOrder?: number;
41
+ }
42
+ interface ColorProjection {
43
+ readonly id: string;
44
+ readonly label: string;
45
+ }
46
+ interface CheckoutItemProductVariantProjection {
47
+ readonly id: string;
48
+ readonly media: MediaProjection[];
49
+ readonly brand: string;
50
+ readonly name: string;
51
+ readonly price: PriceProjection;
52
+ readonly size: SizeProjection;
53
+ readonly color: ColorProjection;
54
+ }
55
+ declare enum CheckoutItemStatus {
56
+ INITIAL = "INITIAL",
57
+ KEPT = "KEPT",
58
+ RETURNED = "RETURNED",
59
+ REPLACED = "REPLACED",
60
+ EXPIRED = "EXPIRED"
61
+ }
62
+ interface CheckoutItemProjection {
63
+ readonly id: string;
64
+ readonly status: CheckoutItemStatus;
65
+ readonly replacedFor?: string;
66
+ readonly productVariant: CheckoutItemProductVariantProjection;
67
+ }
68
+ interface CheckoutProjection {
69
+ readonly id: string;
70
+ readonly customerId: string;
71
+ readonly boxId: string;
72
+ readonly bookingId: string;
73
+ readonly status: CheckoutStatus;
74
+ readonly expiresOn: Date;
75
+ readonly items: CheckoutItemProjection[];
76
+ }
77
+ export type { CheckoutItemProjection, ColorProjection, MediaProjection, PriceProjection, SizeProjection, CheckoutProjection, };
78
+ export { CheckoutItemStatus, MediaPerspective, Currency };
@@ -0,0 +1,29 @@
1
+ var MediaPerspective;
2
+ (function (MediaPerspective) {
3
+ MediaPerspective["BACK"] = "BACK";
4
+ MediaPerspective["BOTTOM_UP"] = "BOTTOM_UP";
5
+ MediaPerspective["COLLAGE"] = "COLLAGE";
6
+ MediaPerspective["DETAIL"] = "DETAIL";
7
+ MediaPerspective["FLAT_BACK"] = "FLAT_BACK";
8
+ MediaPerspective["FRONT"] = "FRONT";
9
+ MediaPerspective["FRONT_FAR"] = "FRONT_FAR";
10
+ MediaPerspective["LABEL"] = "LABEL";
11
+ MediaPerspective["MAIN"] = "MAIN";
12
+ MediaPerspective["MAIN_TRANSPARENT"] = "MAIN_TRANSPARENT";
13
+ MediaPerspective["OTHER"] = "OTHER";
14
+ MediaPerspective["SIDE"] = "SIDE";
15
+ })(MediaPerspective || (MediaPerspective = {}));
16
+ var Currency;
17
+ (function (Currency) {
18
+ Currency["EUR"] = "EUR";
19
+ Currency["GBP"] = "GBP";
20
+ })(Currency || (Currency = {}));
21
+ var CheckoutItemStatus;
22
+ (function (CheckoutItemStatus) {
23
+ CheckoutItemStatus["INITIAL"] = "INITIAL";
24
+ CheckoutItemStatus["KEPT"] = "KEPT";
25
+ CheckoutItemStatus["RETURNED"] = "RETURNED";
26
+ CheckoutItemStatus["REPLACED"] = "REPLACED";
27
+ CheckoutItemStatus["EXPIRED"] = "EXPIRED";
28
+ })(CheckoutItemStatus || (CheckoutItemStatus = {}));
29
+ export { CheckoutItemStatus, MediaPerspective, Currency };
@@ -0,0 +1,25 @@
1
+ import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
+ import { CheckoutProjection } from "./checkout";
3
+ declare const VIEW_CHECKOUT_BY_ID = "view_checkout_by_id";
4
+ interface ViewCheckoutByIdPayload {
5
+ readonly checkoutId: string;
6
+ }
7
+ interface ViewCheckoutById extends Query<typeof VIEW_CHECKOUT_BY_ID>, ViewCheckoutByIdPayload {
8
+ }
9
+ interface ViewCheckoutByIdFunction {
10
+ (payload: ViewCheckoutByIdPayload): ViewCheckoutById;
11
+ }
12
+ declare const viewCheckoutById: ViewCheckoutByIdFunction;
13
+ declare type ViewCheckoutByIdResult = CheckoutProjection | undefined;
14
+ interface CheckoutByIdViewArgs {
15
+ readonly checkoutId: string;
16
+ }
17
+ interface CheckoutByIdView {
18
+ (args: CheckoutByIdViewArgs): Promise<ViewCheckoutByIdResult>;
19
+ }
20
+ interface ViewCheckoutByIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
21
+ readonly view: CheckoutByIdView;
22
+ }
23
+ declare const viewCheckoutByIdHandler: QueryHandlerFunction<ViewCheckoutById, ViewCheckoutByIdResult, ViewCheckoutByIdHandlerFunctionArgs>;
24
+ export type { ViewCheckoutById, CheckoutByIdView, ViewCheckoutByIdResult };
25
+ export { VIEW_CHECKOUT_BY_ID, viewCheckoutById, viewCheckoutByIdHandler };
@@ -0,0 +1,8 @@
1
+ import { query } from "@lookiero/messaging";
2
+ const VIEW_CHECKOUT_BY_ID = "view_checkout_by_id";
3
+ const viewCheckoutById = (payload) => ({
4
+ ...query({ name: VIEW_CHECKOUT_BY_ID }),
5
+ ...payload,
6
+ });
7
+ const viewCheckoutByIdHandler = ({ view }) => async ({ checkoutId }) => view({ checkoutId });
8
+ export { VIEW_CHECKOUT_BY_ID, viewCheckoutById, viewCheckoutByIdHandler };
@@ -1,85 +1,5 @@
1
1
  import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
- declare enum MediaPerspective {
3
- BACK = "BACK",
4
- BOTTOM_UP = "BOTTOM_UP",
5
- COLLAGE = "COLLAGE",
6
- DETAIL = "DETAIL",
7
- FLAT_BACK = "FLAT_BACK",
8
- FRONT = "FRONT",
9
- FRONT_FAR = "FRONT_FAR",
10
- LABEL = "LABEL",
11
- MAIN = "MAIN",
12
- MAIN_TRANSPARENT = "MAIN_TRANSPARENT",
13
- OTHER = "OTHER",
14
- SIDE = "SIDE"
15
- }
16
- interface MediaProjection {
17
- readonly id: string;
18
- readonly url: string;
19
- readonly perspective: MediaPerspective;
20
- }
21
- declare enum Currency {
22
- EUR = "EUR",
23
- GBP = "GBP"
24
- }
25
- interface PriceProjection {
26
- readonly amount: number;
27
- readonly currency: Currency;
28
- readonly discountedPrice?: {
29
- readonly amount: number;
30
- readonly percentage: number;
31
- };
32
- }
33
- interface SizeProjection {
34
- readonly id: string;
35
- readonly lookiero: string;
36
- readonly uk: string;
37
- readonly it: string;
38
- readonly europe: string;
39
- readonly unique: boolean;
40
- readonly visualOrder?: number;
41
- }
42
- interface ColorProjection {
43
- readonly id: string;
44
- readonly label: string;
45
- }
46
- interface CheckoutItemProductVariantProjection {
47
- readonly id: string;
48
- readonly media: MediaProjection[];
49
- readonly brand: string;
50
- readonly name: string;
51
- readonly price: PriceProjection;
52
- readonly size: SizeProjection;
53
- readonly color: ColorProjection;
54
- }
55
- declare enum CheckoutItemStatus {
56
- INITIAL = "INITIAL",
57
- KEPT = "KEPT",
58
- RETURNED = "RETURNED",
59
- REPLACED = "REPLACED",
60
- EXPIRED = "EXPIRED"
61
- }
62
- interface CheckoutItemProjection {
63
- readonly id: string;
64
- readonly status: CheckoutItemStatus;
65
- readonly replacedFor?: string;
66
- readonly productVariant: CheckoutItemProductVariantProjection;
67
- }
68
- declare enum CheckoutStatus {
69
- AVAILABLE = "AVAILABLE",
70
- NOTIFIED = "NOTIFIED",
71
- STARTED = "STARTED",
72
- COMPLETED = "COMPLETED"
73
- }
74
- interface CheckoutProjection {
75
- readonly id: string;
76
- readonly customerId: string;
77
- readonly boxId: string;
78
- readonly bookingId: string;
79
- readonly status: CheckoutStatus;
80
- readonly expiresOn: Date;
81
- readonly items: CheckoutItemProjection[];
82
- }
2
+ import { CheckoutProjection } from "./checkout";
83
3
  declare const VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID = "view_first_available_checkout_by_customer_id";
84
4
  interface ViewFirstAvailableCheckoutByCustomerIdPayload {
85
5
  readonly customerId: string;
@@ -101,5 +21,5 @@ interface ViewFirstAvailableCheckoutByCustomerIdHandlerFunctionArgs extends Quer
101
21
  readonly view: FirstAvailableCheckoutByCustomerIdView;
102
22
  }
103
23
  declare const viewFirstAvailableCheckoutByCustomerIdHandler: QueryHandlerFunction<ViewFirstAvailableCheckoutByCustomerId, ViewFirstAvailableCheckoutByCustomerIdResult, ViewFirstAvailableCheckoutByCustomerIdHandlerFunctionArgs>;
104
- export type { CheckoutItemProjection, CheckoutProjection, ColorProjection, FirstAvailableCheckoutByCustomerIdView, MediaProjection, PriceProjection, SizeProjection, };
105
- export { CheckoutStatus, CheckoutItemStatus, MediaPerspective, Currency, VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID, viewFirstAvailableCheckoutByCustomerId, viewFirstAvailableCheckoutByCustomerIdHandler, };
24
+ export type { FirstAvailableCheckoutByCustomerIdView };
25
+ export { VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID, viewFirstAvailableCheckoutByCustomerId, viewFirstAvailableCheckoutByCustomerIdHandler, };