@lookiero/checkout 0.2.2 → 0.2.4

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 (21) hide show
  1. package/dist/infrastructure/delivery/_mock/bootstrap.mock.js +5 -0
  2. package/dist/infrastructure/delivery/bootstrap.js +5 -0
  3. package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +3 -3
  4. package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +1 -4
  5. package/dist/infrastructure/domain/react/useSetCheckoutIntroShown.d.ts +1 -4
  6. package/dist/infrastructure/domain/react/useSetCheckoutIntroShown.js +2 -2
  7. package/dist/infrastructure/domain/react/useUpdateUiSetting.d.ts +1 -4
  8. package/dist/infrastructure/domain/react/useUpdateUiSetting.js +1 -4
  9. package/dist/infrastructure/projection/httpFiveItemsDiscountByCustomerIdView.d.ts +12 -0
  10. package/dist/infrastructure/projection/httpFiveItemsDiscountByCustomerIdView.js +7 -0
  11. package/dist/infrastructure/projection/react/useViewFiveItemsDiscountByCustomerId.d.ts +10 -0
  12. package/dist/infrastructure/projection/react/useViewFiveItemsDiscountByCustomerId.js +9 -0
  13. package/dist/infrastructure/ui/Root.d.ts +1 -0
  14. package/dist/infrastructure/ui/Root.js +4 -6
  15. package/dist/infrastructure/ui/routing/Routing.d.ts +5 -1
  16. package/dist/infrastructure/ui/routing/Routing.js +22 -17
  17. package/dist/infrastructure/ui/views/intro/Intro.d.ts +4 -1
  18. package/dist/infrastructure/ui/views/intro/Intro.js +17 -8
  19. package/dist/projection/checkout/viewFiveItemsDiscountByCustomerId.d.ts +23 -0
  20. package/dist/projection/checkout/viewFiveItemsDiscountByCustomerId.js +8 -0
  21. package/package.json +1 -1
@@ -10,8 +10,10 @@ import { getUiSetting, saveUiSetting } from "../../domain/uiSetting/model/storag
10
10
  import { storageUiSettingByKeyView } from "../../projection/storageUiSettingByKeyView";
11
11
  import { startedCheckoutWithItems } from "./checkout.mock";
12
12
  import { read, write } from "../../persistence/asyncStorageStorage";
13
+ import { viewFiveItemsDiscountByCustomerIdHandler, VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, } from "../../../projection/checkout/viewFiveItemsDiscountByCustomerId";
13
14
  const firstAvailableCheckoutByCustomerIdView = async () => startedCheckoutWithItems({ status: [CheckoutItemStatus.KEPT, CheckoutItemStatus.INITIAL] });
14
15
  const isCheckoutEnabledByCustomerIdView = async () => true;
16
+ const fiveItemsDiscountByCustomerIdView = async () => 25;
15
17
  const bootstrap = () => messagingBootstrap({ id: CHECKOUT_MESSAGING_REACT_ID })
16
18
  .query(VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID, viewFirstAvailableCheckoutByCustomerIdHandler, {
17
19
  view: firstAvailableCheckoutByCustomerIdView,
@@ -20,6 +22,9 @@ const bootstrap = () => messagingBootstrap({ id: CHECKOUT_MESSAGING_REACT_ID })
20
22
  view: isCheckoutEnabledByCustomerIdView,
21
23
  })
22
24
  .query(VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerIdHandler, {})
25
+ .query(VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerIdHandler, {
26
+ view: fiveItemsDiscountByCustomerIdView,
27
+ })
23
28
  .query(VIEW_UI_SETTING_BY_KEY, viewUiSettingByKeyHandler, {
24
29
  view: storageUiSettingByKeyView({ read }),
25
30
  })
@@ -2,12 +2,14 @@ import { bootstrap as messagingBootstrap } from "@lookiero/messaging-react";
2
2
  import { UPDATE_UI_SETTING } from "../../domain/uiSetting/command/updateUiSetting";
3
3
  import { updateUiSettingHandler } from "../../domain/uiSetting/model/uiSetting";
4
4
  import { viewFirstAvailableCheckoutByCustomerIdHandler, VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID, } from "../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
5
+ import { viewFiveItemsDiscountByCustomerIdHandler, VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
5
6
  import { viewIsCheckoutAccessibleByCustomerIdHandler, VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
6
7
  import { viewIsCheckoutEnabledByCustomerIdHandler, VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
7
8
  import { viewUiSettingByKeyHandler, VIEW_UI_SETTING_BY_KEY } from "../../projection/uiSetting/viewUiSettingByKey";
8
9
  import { getUiSetting, saveUiSetting } from "../domain/uiSetting/model/storageUiSettings";
9
10
  import { read, write } from "../persistence/asyncStorageStorage";
10
11
  import { httpFirstAvailableCheckoutByCustomerIdView } from "../projection/httpFirstAvailableCheckoutByCustomerIdView";
12
+ import { httpFiveItemsDiscountByCustomerIdView } from "../projection/httpFiveItemsDiscountByCustomerIdView";
11
13
  import { httpIsCheckoutEnabledByCustomerIdView } from "../projection/httpIsCheckoutEnabledByCustomerIdView";
12
14
  import { storageUiSettingByKeyView } from "../projection/storageUiSettingByKeyView";
13
15
  import { fetchHttpGet, fetchHttpPost } from "./http/fetchHttpClient";
@@ -23,6 +25,9 @@ const bootstrap = ({ apiUrl, getAuthToken }) => {
23
25
  view: httpIsCheckoutEnabledByCustomerIdView({ httpGet }),
24
26
  })
25
27
  .query(VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerIdHandler, {})
28
+ .query(VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerIdHandler, {
29
+ view: httpFiveItemsDiscountByCustomerIdView({ httpGet }),
30
+ })
26
31
  .query(VIEW_UI_SETTING_BY_KEY, viewUiSettingByKeyHandler, {
27
32
  view: storageUiSettingByKeyView({ read }),
28
33
  })
@@ -1,8 +1,8 @@
1
1
  import { CommandStatus } from "@lookiero/messaging-react";
2
- interface UseBookSizeReplaceableProductVariantsForCheckoutItem {
3
- readonly book: () => Promise<void>;
4
- readonly status: CommandStatus;
2
+ interface BookFunction {
3
+ (): Promise<void>;
5
4
  }
5
+ declare type UseBookSizeReplaceableProductVariantsForCheckoutItem = [book: BookFunction, status: CommandStatus];
6
6
  interface UseBookSizeReplaceableProductVariantsForCheckoutItemFunctionArgs {
7
7
  readonly checkoutId: string;
8
8
  readonly checkoutItemId: string;
@@ -10,9 +10,6 @@ const useBookSizeReplaceableProductVariantsForCheckoutItem = ({ checkoutId, chec
10
10
  checkoutItemId,
11
11
  checkoutBookingId,
12
12
  })), [checkoutBookingId, checkoutId, checkoutItemId, commandBus]);
13
- return {
14
- book,
15
- status,
16
- };
13
+ return [book, status];
17
14
  };
18
15
  export { useBookSizeReplaceableProductVariantsForCheckoutItem };
@@ -2,10 +2,7 @@ import { CommandStatus } from "@lookiero/messaging-react";
2
2
  interface SetCheckoutIntroShownFunction {
3
3
  (): Promise<void>;
4
4
  }
5
- interface UseSetCheckoutIntroShown {
6
- readonly setCheckoutIntroShown: SetCheckoutIntroShownFunction;
7
- readonly status: CommandStatus;
8
- }
5
+ declare type UseSetCheckoutIntroShown = [setCheckoutIntroShown: SetCheckoutIntroShownFunction, status: CommandStatus];
9
6
  interface UseSetCheckoutIntroShownFunction {
10
7
  (): UseSetCheckoutIntroShown;
11
8
  }
@@ -2,8 +2,8 @@ import { useCallback } from "react";
2
2
  import { UISettings } from "../../ui/settings/UISettings";
3
3
  import { useUpdateUiSetting } from "./useUpdateUiSetting";
4
4
  const useSetCheckoutIntroShown = () => {
5
- const { update, status } = useUpdateUiSetting();
5
+ const [update, status] = useUpdateUiSetting();
6
6
  const setCheckoutIntroShown = useCallback(() => update({ key: UISettings.CHECKOUT_INTRO_SHOWN, value: true }), [update]);
7
- return { setCheckoutIntroShown, status };
7
+ return [setCheckoutIntroShown, status];
8
8
  };
9
9
  export { useSetCheckoutIntroShown };
@@ -6,10 +6,7 @@ interface UpdateFunctionArgs {
6
6
  interface UpdateFunction {
7
7
  (args: UpdateFunctionArgs): Promise<void>;
8
8
  }
9
- interface UseUpdateUiSetting {
10
- readonly update: UpdateFunction;
11
- readonly status: CommandStatus;
12
- }
9
+ declare type UseUpdateUiSetting = [update: UpdateFunction, status: CommandStatus];
13
10
  interface UseUpdateUiSettingFunction {
14
11
  (): UseUpdateUiSetting;
15
12
  }
@@ -10,9 +10,6 @@ const useUpdateUiSetting = () => {
10
10
  key,
11
11
  value,
12
12
  })), [commandBus]);
13
- return {
14
- update,
15
- status,
16
- };
13
+ return [update, status];
17
14
  };
18
15
  export { useUpdateUiSetting };
@@ -0,0 +1,12 @@
1
+ import { FiveItemsDiscountByCustomerIdView } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
2
+ import { HttpGetFunction } from "../delivery/http/httpClient";
3
+ interface HttpFiveItemsDiscountByCustomerIdView extends FiveItemsDiscountByCustomerIdView {
4
+ }
5
+ interface HttpFiveItemsDiscountByCustomerIdViewFunctionArgs {
6
+ readonly httpGet: HttpGetFunction;
7
+ }
8
+ interface HttpFiveItemsDiscountByCustomerIdViewFunction {
9
+ (args: HttpFiveItemsDiscountByCustomerIdViewFunctionArgs): HttpFiveItemsDiscountByCustomerIdView;
10
+ }
11
+ declare const httpFiveItemsDiscountByCustomerIdView: HttpFiveItemsDiscountByCustomerIdViewFunction;
12
+ export { httpFiveItemsDiscountByCustomerIdView };
@@ -0,0 +1,7 @@
1
+ const httpFiveItemsDiscountByCustomerIdView = ({ httpGet }) => async ({ customerId }) => {
2
+ const response = await httpGet({
3
+ endpoint: `/view-five-items-discount-by-customer-id/${customerId}`,
4
+ });
5
+ return !response.ok ? 0 : await response.json();
6
+ };
7
+ export { httpFiveItemsDiscountByCustomerIdView };
@@ -0,0 +1,10 @@
1
+ import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
+ import { FiveItemsDiscountByCustomerIdProjection } from "../../../projection/checkout/viewFiveItemsDiscountByCustomerId";
3
+ interface UseViewFiveItemsDiscountByCustomerIdFunctionArgs {
4
+ readonly customerId: string;
5
+ }
6
+ interface UseViewFiveItemsDiscountByCustomerIdFunction {
7
+ (args: UseViewFiveItemsDiscountByCustomerIdFunctionArgs): UseQueryFunctionResult<FiveItemsDiscountByCustomerIdProjection>;
8
+ }
9
+ declare const useViewFiveItemsDiscountByCustomerId: UseViewFiveItemsDiscountByCustomerIdFunction;
10
+ export { useViewFiveItemsDiscountByCustomerId };
@@ -0,0 +1,9 @@
1
+ import { useQuery } from "@lookiero/messaging-react";
2
+ import { viewFiveItemsDiscountByCustomerId, } from "../../../projection/checkout/viewFiveItemsDiscountByCustomerId";
3
+ import { CHECKOUT_MESSAGING_REACT_ID } from "../../delivery/bootstrap";
4
+ const useViewFiveItemsDiscountByCustomerId = ({ customerId }) => useQuery({
5
+ query: viewFiveItemsDiscountByCustomerId({ customerId }),
6
+ contextId: CHECKOUT_MESSAGING_REACT_ID,
7
+ options: { staleTime: Infinity },
8
+ });
9
+ export { useViewFiveItemsDiscountByCustomerId };
@@ -4,6 +4,7 @@ import { FC } from "react";
4
4
  interface RootFunctionArgs {
5
5
  readonly Messaging: MessagingRoot;
6
6
  readonly I18n: I18n;
7
+ readonly development?: boolean;
7
8
  }
8
9
  interface RootFunction {
9
10
  (args: RootFunctionArgs): FC<RootProps>;
@@ -1,15 +1,13 @@
1
1
  import React, { useCallback } from "react";
2
2
  import { Platform } from "react-native";
3
- import { Spinner } from "./components/atoms/spinner/Spinner";
4
3
  import { Router } from "./routing/router/Router";
5
4
  import { Routing } from "./routing/Routing";
6
- const root = ({ Messaging, I18n }) =>
5
+ const root = ({ Messaging, I18n, development }) =>
7
6
  // eslint-disable-next-line react/display-name, react/prop-types
8
7
  ({ locale = "en", customerId, onNotAccessible }) => {
9
8
  const handleOnI18nError = useCallback(() => void 0, []);
10
- return (React.createElement(I18n, { locale: locale, loader: React.createElement(Spinner, null), onError: handleOnI18nError },
11
- React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
12
- React.createElement(Router, null,
13
- React.createElement(Routing, { customerId: customerId, onNotAccessible: onNotAccessible })))));
9
+ return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
10
+ React.createElement(Router, null,
11
+ React.createElement(Routing, { onNotAccessible: onNotAccessible, customerId: customerId, locale: locale, I18n: I18n, onI18nError: development ? undefined : handleOnI18nError }))));
14
12
  };
15
13
  export { root };
@@ -1,7 +1,11 @@
1
+ import { I18n } from "@lookiero/i18n-react";
1
2
  import { FC } from "react";
2
3
  interface RoutingProps {
3
- readonly customerId: string | undefined;
4
4
  readonly onNotAccessible: () => void;
5
+ readonly customerId: string | undefined;
6
+ readonly locale: string;
7
+ readonly I18n: I18n;
8
+ readonly onI18nError?: (err: Error) => void;
5
9
  }
6
10
  declare const Routing: FC<RoutingProps>;
7
11
  export { Routing };
@@ -1,5 +1,5 @@
1
1
  import React, { lazy, Suspense } from "react";
2
- import { Navigate, useRoutes } from "react-router-native";
2
+ import { Navigate, Outlet, useRoutes } from "react-router-native";
3
3
  import { Spinner } from "../components/atoms/spinner/Spinner";
4
4
  import { CheckoutAccessibilityMiddleware } from "./CheckoutAccessibilityMiddleware";
5
5
  import { CheckoutMiddleware } from "./CheckoutMiddleware";
@@ -7,30 +7,35 @@ import { Routes } from "./routes";
7
7
  const Intro = lazy(() => import("../views/intro/Intro").then((module) => ({ default: module.Intro })));
8
8
  const Item = lazy(() => import("../views/item/Item").then((module) => ({ default: module.Item })));
9
9
  const Summary = lazy(() => import("../views/summary/Summary").then((module) => ({ default: module.Summary })));
10
- const Routing = ({ customerId, onNotAccessible }) => {
10
+ const Routing = ({ onNotAccessible, customerId, locale, I18n, onI18nError }) => {
11
11
  const routes = useRoutes([
12
12
  {
13
13
  path: Routes.CHECKOUT,
14
14
  element: React.createElement(CheckoutAccessibilityMiddleware, { customerId: customerId, onNotAccessible: onNotAccessible }),
15
15
  children: [
16
16
  {
17
- path: Routes.CHECKOUT,
18
- element: React.createElement(CheckoutMiddleware, { customerId: customerId }),
17
+ element: (React.createElement(I18n, { locale: locale, loader: React.createElement(Spinner, null), onError: onI18nError },
18
+ React.createElement(Outlet, null))),
19
19
  children: [
20
20
  {
21
- path: Routes.INTRO,
22
- element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
23
- React.createElement(Intro, null))),
24
- },
25
- {
26
- path: Routes.ITEM,
27
- element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
28
- React.createElement(Item, null))),
29
- },
30
- {
31
- path: Routes.SUMMARY,
32
- element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
33
- React.createElement(Summary, null))),
21
+ element: React.createElement(CheckoutMiddleware, { customerId: customerId }),
22
+ children: [
23
+ {
24
+ path: Routes.INTRO,
25
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
26
+ React.createElement(Intro, { customerId: customerId }))),
27
+ },
28
+ {
29
+ path: Routes.ITEM,
30
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
31
+ React.createElement(Item, null))),
32
+ },
33
+ {
34
+ path: Routes.SUMMARY,
35
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
36
+ React.createElement(Summary, null))),
37
+ },
38
+ ],
34
39
  },
35
40
  ],
36
41
  },
@@ -1,3 +1,6 @@
1
1
  import { FC } from "react";
2
- declare const Intro: FC;
2
+ declare type IntroProps = {
3
+ readonly customerId: string;
4
+ };
5
+ declare const Intro: FC<IntroProps>;
3
6
  export { Intro };
@@ -1,18 +1,20 @@
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";
2
4
  import { Icon } from "@lookiero/aurora-next/build/components/primitives/Icon/Icon";
5
+ import { Spinner } from "../../components/atoms/spinner/Spinner";
3
6
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
4
7
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { CommandStatus } from "@lookiero/messaging-react";
6
- import React, { useCallback } from "react";
7
- import { View } from "react-native";
8
8
  import { useSetCheckoutIntroShown } from "../../../domain/react/useSetCheckoutIntroShown";
9
- import { Body } from "../../components/layouts/body/Body";
10
- import { I18nMessages } from "../../i18n/i18n";
9
+ import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/react/useViewFiveItemsDiscountByCustomerId";
10
+ import { View } from "react-native";
11
+ import React, { useCallback } from "react";
11
12
  import { styles } from "./Intro.style";
13
+ import { Body } from "../../components/layouts/body/Body";
12
14
  const Bullet = ({ text }) => (React.createElement(View, { style: styles.bullet },
13
15
  React.createElement(Icon, { name: "rounded-tick", style: styles.tickIcon }),
14
16
  React.createElement(Text, { detail: true, level: 2 }, text)));
15
- const Intro = () => {
17
+ const Intro = ({ customerId }) => {
16
18
  const titleText = useI18nMessage({ id: I18nMessages.INTRO_TITLE });
17
19
  const subTitleText = useI18nMessage({ id: I18nMessages.INTRO_SUBTITLE });
18
20
  const discountText = useI18nMessage({ id: I18nMessages.INTRO_DISCOUNT });
@@ -20,15 +22,22 @@ const Intro = () => {
20
22
  const bulletTwoText = useI18nMessage({ id: I18nMessages.INTRO_BULLET_TWO });
21
23
  const bulletThreeText = useI18nMessage({ id: I18nMessages.INTRO_BULLET_THREE });
22
24
  const buttonText = useI18nMessage({ id: I18nMessages.INTRO_BUTTON });
23
- const { setCheckoutIntroShown, status: setCheckoutIntroShownStatus } = useSetCheckoutIntroShown();
25
+ const [fiveItemsDiscount, fiveItemsDiscountState] = useViewFiveItemsDiscountByCustomerId({
26
+ customerId,
27
+ });
28
+ const [setCheckoutIntroShown, setCheckoutIntroShownStatus] = useSetCheckoutIntroShown();
24
29
  const handleOnPress = useCallback(() => setCheckoutIntroShown(), [setCheckoutIntroShown]);
30
+ if (fiveItemsDiscountState === QueryStatus.LOADING)
31
+ return React.createElement(Spinner, null);
25
32
  return (React.createElement(Body, null,
26
33
  React.createElement(View, null,
27
34
  React.createElement(Text, { heading: true, level: 3, style: styles.title }, titleText),
28
35
  React.createElement(Text, { body: true, level: 3 }, subTitleText),
29
36
  React.createElement(View, { style: styles.discountContainer },
30
37
  React.createElement(View, { style: styles.discount },
31
- React.createElement(Text, { heading: true, level: 2 }, "- 25"),
38
+ React.createElement(Text, { heading: true, level: 2 },
39
+ "- ",
40
+ fiveItemsDiscount),
32
41
  React.createElement(Text, { heading: true, level: 3, style: styles.percentage }, "%")),
33
42
  React.createElement(Text, { body: true, level: 3 }, discountText)),
34
43
  React.createElement(View, { style: styles.description },
@@ -0,0 +1,23 @@
1
+ import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
+ declare type FiveItemsDiscountByCustomerIdProjection = number;
3
+ declare const VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID = "view_five_items_discount_by_customer_id";
4
+ interface ViewFiveItemsDiscountByCustomerIdPayload {
5
+ readonly customerId: string;
6
+ }
7
+ interface ViewFiveItemsDiscountByCustomerId extends Query<typeof VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID>, ViewFiveItemsDiscountByCustomerIdPayload {
8
+ }
9
+ interface ViewFiveItemsDiscountByCustomerIdFunction {
10
+ (payload: ViewFiveItemsDiscountByCustomerIdPayload): ViewFiveItemsDiscountByCustomerId;
11
+ }
12
+ declare const viewFiveItemsDiscountByCustomerId: ViewFiveItemsDiscountByCustomerIdFunction;
13
+ interface FiveItemsDiscountByCustomerIdViewArgs {
14
+ readonly customerId: string;
15
+ }
16
+ interface FiveItemsDiscountByCustomerIdView {
17
+ (args: FiveItemsDiscountByCustomerIdViewArgs): Promise<FiveItemsDiscountByCustomerIdProjection>;
18
+ }
19
+ interface ViewFiveItemsDiscountByCustomerIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
20
+ readonly view: FiveItemsDiscountByCustomerIdView;
21
+ }
22
+ declare const viewFiveItemsDiscountByCustomerIdHandler: QueryHandlerFunction<ViewFiveItemsDiscountByCustomerId, FiveItemsDiscountByCustomerIdProjection, ViewFiveItemsDiscountByCustomerIdHandlerFunctionArgs>;
23
+ export { FiveItemsDiscountByCustomerIdProjection, VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerId, FiveItemsDiscountByCustomerIdView, viewFiveItemsDiscountByCustomerIdHandler, };
@@ -0,0 +1,8 @@
1
+ import { query } from "@lookiero/messaging";
2
+ const VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID = "view_five_items_discount_by_customer_id";
3
+ const viewFiveItemsDiscountByCustomerId = (payload) => ({
4
+ ...query({ name: VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID }),
5
+ ...payload,
6
+ });
7
+ const viewFiveItemsDiscountByCustomerIdHandler = ({ view }) => async ({ customerId }) => view({ customerId });
8
+ export { VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerId, viewFiveItemsDiscountByCustomerIdHandler, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [