@lookiero/checkout 0.3.20 → 0.3.22

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 (27) hide show
  1. package/dist/package.json +13 -13
  2. package/dist/src/infrastructure/delivery/baseBootstrap.d.ts +2 -0
  3. package/dist/src/infrastructure/delivery/baseBootstrap.js +5 -1
  4. package/dist/src/infrastructure/delivery/bootstrap.js +2 -0
  5. package/dist/src/infrastructure/delivery/mock/dataSourceCheckoutFeedbacks.js +6 -8
  6. package/dist/src/infrastructure/domain/checkoutFeedback/model/httpCheckoutFeedbacks.js +5 -4
  7. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +12 -0
  8. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +9 -0
  9. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +9 -1
  10. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionFeedback.d.ts +3 -3
  11. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +1 -2
  12. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.d.ts +2 -2
  13. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +7 -2
  14. package/dist/src/infrastructure/ui/views/item/Item.js +43 -13
  15. package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +2 -2
  16. package/dist/src/projection/checkoutFeedback/checkoutFeedback.d.ts +2 -5
  17. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +25 -0
  18. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +8 -0
  19. package/dist/src/projection/checkoutQuestion/checkoutQuestion.d.ts +1 -1
  20. package/dist/src/projection/pricing/pricing.d.ts +3 -3
  21. package/package.json +13 -13
  22. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByIdView.d.ts +0 -12
  23. package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByIdView.js +0 -9
  24. package/dist/src/projection/checkoutFeedback/feedback.d.ts +0 -3
  25. package/dist/src/projection/checkoutFeedback/feedback.js +0 -1
  26. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackById.d.ts +0 -25
  27. package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackById.js +0 -8
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -48,14 +48,14 @@
48
48
  "@lookiero/locale": "^0.3",
49
49
  "@lookiero/payments-front": "^0.16.5",
50
50
  "apollo-boost": "0.4.4",
51
- "graphql": "14.5.8",
51
+ "graphql": "16.6.0",
52
52
  "graphql-tag": "2.12.6",
53
53
  "react": "^18.0.0",
54
54
  "react-dom": "^18.0.0",
55
- "react-native": "^0.70.1",
55
+ "react-native": "^0.70.6",
56
56
  "react-native-web": "^0.18.9",
57
- "react-router-dom": "^6.4.2",
58
- "react-router-native": "^6.4.2"
57
+ "react-router-dom": "^6.4.5",
58
+ "react-router-native": "^6.4.5"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@babel/core": "^7.19.1",
@@ -73,11 +73,11 @@
73
73
  "@testing-library/react-hooks": "^8.0.1",
74
74
  "@testing-library/react-native": "^11.0.0",
75
75
  "@trivago/prettier-plugin-sort-imports": "^3.3.0",
76
- "@types/jest": "^29.2.3",
76
+ "@types/jest": "^29.2.4",
77
77
  "@types/react": "~18.0.0",
78
78
  "@types/react-dom": "~18.0.0",
79
79
  "@types/react-native": "~0.69.1",
80
- "@types/uuid": "^8.3.4",
80
+ "@types/uuid": "^9.0.0",
81
81
  "apollo-boost": "0.4.4",
82
82
  "eslint": "^8.24.0",
83
83
  "eslint-config-prettier": "^8.5.0",
@@ -92,9 +92,9 @@
92
92
  "expo": "~46.0.8",
93
93
  "expo-modules-core": "^1.0.3",
94
94
  "expo-status-bar": "~1.4.0",
95
- "graphql": "14.5.8",
95
+ "graphql": "16.6.0",
96
96
  "graphql-tag": "2.12.6",
97
- "husky": "^8.0.1",
97
+ "husky": "^8.0.2",
98
98
  "jest": "^29.3.1",
99
99
  "jest-expo": "^46.0.1",
100
100
  "jest-fetch-mock": "^3.0.3",
@@ -104,14 +104,14 @@
104
104
  "prettier": "^2.7.1",
105
105
  "react": "^18.0.0",
106
106
  "react-dom": "^18.0.0",
107
- "react-native": "^0.70.1",
107
+ "react-native": "^0.70.6",
108
108
  "react-native-get-random-values": "^1.8.0",
109
109
  "react-native-unimodules": "^0.14.10",
110
110
  "react-native-web": "^0.18.9",
111
- "react-router-dom": "^6.4.2",
112
- "react-router-native": "^6.4.2",
111
+ "react-router-dom": "^6.4.5",
112
+ "react-router-native": "^6.4.5",
113
113
  "react-test-renderer": "^18.0.0",
114
114
  "typescript": "^4.9.3",
115
- "webpack-bundle-analyzer": "^4.6.1"
115
+ "webpack-bundle-analyzer": "^4.7.0"
116
116
  }
117
117
  }
@@ -15,6 +15,7 @@ import { CheckoutByIdView } from "../../projection/checkout/viewCheckoutById";
15
15
  import { FirstAvailableCheckoutByCustomerIdView } from "../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
16
16
  import { FiveItemsDiscountByCustomerIdView } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
17
17
  import { IsCheckoutEnabledByCustomerIdView } from "../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
18
+ import { CheckoutBookingByIdView } from "../../projection/checkoutBooking/viewCheckoutBookingById";
18
19
  import { CheckoutItemByIdView } from "../../projection/checkoutItem/viewCheckoutItemById";
19
20
  import { CheckoutQuestionsByCheckoutIdView } from "../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
20
21
  import { PaymentFlowPayloadByCheckoutIdView } from "../../projection/payment/viewPaymentFlowPayloadByCheckoutId";
@@ -31,6 +32,7 @@ interface BaseBootstrapFunctionArgs<UiSettingGetFunctionArgs extends RepositoryG
31
32
  readonly fiveItemsDiscountByCustomerIdView: FiveItemsDiscountByCustomerIdView;
32
33
  readonly uiSettingByKeyView: UiSettingByKeyView;
33
34
  readonly checkoutItemByIdView: CheckoutItemByIdView;
35
+ readonly checkoutBookingByIdView: CheckoutBookingByIdView;
34
36
  readonly returnQuestionsByCheckoutItemIdView: ReturnQuestionsByCheckoutItemIdView;
35
37
  readonly bookedSizeChangeProductsVariantsForCheckoutItemView: BookedSizeChangeProductsVariantsForCheckoutItemView;
36
38
  readonly pricingByCheckoutIdView: PricingByCheckoutIdView;
@@ -18,6 +18,7 @@ import { viewFirstAvailableCheckoutByCustomerIdHandler, VIEW_FIRST_AVAILABLE_CHE
18
18
  import { viewFiveItemsDiscountByCustomerIdHandler, VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
19
19
  import { viewIsCheckoutAccessibleByCustomerIdHandler, VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
20
20
  import { viewIsCheckoutEnabledByCustomerIdHandler, VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
21
+ import { viewCheckoutBookingByIdHandler, VIEW_CHECKOUT_BOOKING_BY_ID, } from "../../projection/checkoutBooking/viewCheckoutBookingById";
21
22
  import { viewCheckoutItemByIdHandler, VIEW_CHECKOUT_ITEM_BY_ID, } from "../../projection/checkoutItem/viewCheckoutItemById";
22
23
  import { listCheckoutQuestionsByCheckoutIdHandler, LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID, } from "../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
23
24
  import { viewPaymentFlowPayloadByCheckoutIdHandler, VIEW_PAYMENT_FLOW_PAYLOAD_BY_CHECKOUT_ID, } from "../../projection/payment/viewPaymentFlowPayloadByCheckoutId";
@@ -25,7 +26,7 @@ import { viewPricingByCheckoutIdHandler, VIEW_PRICING_BY_CHECKOUT_ID, } from "..
25
26
  import { listReturnQuestionsByCheckoutItemIdHandler, LIST_RETURN_QUESTIONS_BY_CHECKOUT_ITEM_ID, } from "../../projection/returnQuestion/listReturnQuestionsByCheckoutItemId";
26
27
  import { viewUiSettingByKeyHandler, VIEW_UI_SETTING_BY_KEY, } from "../../projection/uiSetting/viewUiSettingByKey";
27
28
  const MESSAGING_CONTEXT_ID = "Checkout";
28
- const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdView, isCheckoutEnabledByCustomerIdView, fiveItemsDiscountByCustomerIdView, uiSettingByKeyView, checkoutItemByIdView, returnQuestionsByCheckoutItemIdView, bookedSizeChangeProductsVariantsForCheckoutItemView, pricingByCheckoutIdView, paymentFlowPayloadByCheckoutIdView, checkoutQuestionsByCheckoutIdView, getUiSetting, saveUiSetting, uiSettingsDependencies, getCheckout, saveCheckout, checkoutsDependencies, getCheckoutItem, saveCheckoutItem, checkoutItemsDependencies, getCheckoutBooking, saveCheckoutBooking, checkoutBookingsDependencies, getCheckoutFeedback, saveCheckoutFeedback, checkoutFeedbacksDependencies, }) => messagingBootstrap({ id: MESSAGING_CONTEXT_ID })
29
+ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdView, isCheckoutEnabledByCustomerIdView, fiveItemsDiscountByCustomerIdView, uiSettingByKeyView, checkoutItemByIdView, returnQuestionsByCheckoutItemIdView, bookedSizeChangeProductsVariantsForCheckoutItemView, checkoutBookingByIdView, pricingByCheckoutIdView, paymentFlowPayloadByCheckoutIdView, checkoutQuestionsByCheckoutIdView, getUiSetting, saveUiSetting, uiSettingsDependencies, getCheckout, saveCheckout, checkoutsDependencies, getCheckoutItem, saveCheckoutItem, checkoutItemsDependencies, getCheckoutBooking, saveCheckoutBooking, checkoutBookingsDependencies, getCheckoutFeedback, saveCheckoutFeedback, checkoutFeedbacksDependencies, }) => messagingBootstrap({ id: MESSAGING_CONTEXT_ID })
29
30
  .query(VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerIdHandler, {
30
31
  view: fiveItemsDiscountByCustomerIdView,
31
32
  })
@@ -58,6 +59,9 @@ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdVie
58
59
  })
59
60
  .query(LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID, listCheckoutQuestionsByCheckoutIdHandler, {
60
61
  view: checkoutQuestionsByCheckoutIdView,
62
+ })
63
+ .query(VIEW_CHECKOUT_BOOKING_BY_ID, viewCheckoutBookingByIdHandler, {
64
+ view: checkoutBookingByIdView,
61
65
  })
62
66
  .query(VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, {
63
67
  view: bookedSizeChangeProductsVariantsForCheckoutItemView,
@@ -9,6 +9,7 @@ import { httpCheckoutByIdView } from "../projection/checkout/httpCheckoutByIdVie
9
9
  import { httpFirstAvailableCheckoutByCustomerIdView } from "../projection/checkout/httpFirstAvailableCheckoutByCustomerIdView";
10
10
  import { httpFiveItemsDiscountByCustomerIdView } from "../projection/checkout/httpFiveItemsDiscountByCustomerIdView";
11
11
  import { httpIsCheckoutEnabledByCustomerIdView } from "../projection/checkout/httpIsCheckoutEnabledByCustomerIdView";
12
+ import { httpCheckoutBookingByIdView } from "../projection/checkoutBooking/httpCheckoutBookingByIdView";
12
13
  import { httpCheckoutItemByIdView } from "../projection/checkoutItem/httpCheckoutItemByIdView";
13
14
  import { httpCheckoutQuestionsByCheckoutIdView } from "../projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView";
14
15
  import { httpPaymentFlowPayloadByCheckoutIdView } from "../projection/payment/httpPaymentFlowPayloadByCheckoutIdView";
@@ -28,6 +29,7 @@ const bootstrap = ({ apiUrl, authToken }) => {
28
29
  uiSettingByKeyView: storageUiSettingByKeyView({ read }),
29
30
  checkoutItemByIdView: httpCheckoutItemByIdView({ httpPost }),
30
31
  returnQuestionsByCheckoutItemIdView: httpReturnQuestionsByCheckoutItemIdView({ httpPost }),
32
+ checkoutBookingByIdView: httpCheckoutBookingByIdView({ httpPost }),
31
33
  bookedSizeChangeProductsVariantsForCheckoutItemView: httpBookedSizeChangeProductsVariantsForCheckoutItemView({
32
34
  httpPost,
33
35
  }),
@@ -1,18 +1,16 @@
1
1
  import invariant from "tiny-invariant";
2
- import { viewCheckoutFeedbackById, } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackById";
2
+ import { v4 as uuid } from "uuid";
3
+ import { viewCheckoutFeedbackByCheckoutId, } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId";
3
4
  const toCheckoutFeedbackDomain = (checkoutFeedback) => {
4
5
  invariant(checkoutFeedback, "No checkoutFeedback found!");
5
6
  return {
6
- aggregateId: checkoutFeedback.id,
7
- feedbacks: checkoutFeedback.feedbacks,
7
+ aggregateId: uuid(),
8
+ feedbacks: checkoutFeedback,
8
9
  domainEvents: [],
9
10
  };
10
11
  };
11
- const toCheckoutFeedbackProjection = (checkoutFeedback) => ({
12
- id: checkoutFeedback.aggregateId,
13
- feedbacks: checkoutFeedback.feedbacks,
14
- });
15
- const getCheckoutFeedback = ({ queryBus }) => async (aggregateId) => toCheckoutFeedbackDomain(await queryBus(viewCheckoutFeedbackById({ checkoutFeedbackId: aggregateId })));
12
+ const toCheckoutFeedbackProjection = (checkoutFeedback) => checkoutFeedback.feedbacks;
13
+ const getCheckoutFeedback = ({ queryBus }) => async (aggregateId) => toCheckoutFeedbackDomain(await queryBus(viewCheckoutFeedbackByCheckoutId({ checkoutId: aggregateId })));
16
14
  const saveCheckoutFeedback = ({ dataSource }) => async (aggregateRoot) => {
17
15
  dataSource.saveCheckoutFeedback(toCheckoutFeedbackProjection(aggregateRoot));
18
16
  };
@@ -1,14 +1,15 @@
1
1
  import invariant from "tiny-invariant";
2
- import { viewCheckoutFeedbackById, } from "../../../../projection/checkoutFeedback/viewCheckoutFeedbackById";
2
+ import { v4 as uuid } from "uuid";
3
+ import { viewCheckoutFeedbackByCheckoutId, } from "../../../../projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId";
3
4
  import { httpCheckoutFeedbacksGive } from "./httpCheckoutFeedbacksGive";
4
5
  const toDomain = (checkoutFeedback) => {
5
6
  invariant(checkoutFeedback, "Not checkoutFeedback found!");
6
7
  return {
7
- aggregateId: checkoutFeedback.id,
8
- feedbacks: checkoutFeedback.feedbacks,
8
+ aggregateId: uuid(),
9
+ feedbacks: checkoutFeedback,
9
10
  domainEvents: [],
10
11
  };
11
12
  };
12
- const getCheckoutFeedback = ({ queryBus }) => async (aggregateId) => toDomain(await queryBus(viewCheckoutFeedbackById({ checkoutFeedbackId: aggregateId })));
13
+ const getCheckoutFeedback = ({ queryBus }) => async (aggregateId) => toDomain(await queryBus(viewCheckoutFeedbackByCheckoutId({ checkoutId: aggregateId })));
13
14
  const saveCheckoutFeedback = ({ httpPost }) => async (aggregateRoot) => await httpCheckoutFeedbacksGive({ httpPost })(aggregateRoot);
14
15
  export { getCheckoutFeedback, saveCheckoutFeedback };
@@ -0,0 +1,12 @@
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 };
@@ -0,0 +1,9 @@
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,9 +1,17 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
+ import { CHECKOUT_ITEM_KEPT } from "../../../../domain/checkoutItem/model/checkoutItemKept";
3
+ import { CHECKOUT_ITEM_REPLACED, } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
4
+ import { CHECKOUT_ITEM_RETURNED, } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
2
5
  import { viewPricingByCheckoutId } from "../../../../projection/pricing/viewPricingByCheckoutId";
3
6
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
+ const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
8
+ const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
9
+ const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
10
+ const shouldInvalidate = (event) => isCheckoutItemKept(event) || isCheckoutItemReplaced(event) || isCheckoutItemReturned(event);
4
11
  const useViewPricingByCheckoutId = ({ checkoutId }) => useQuery({
5
12
  query: viewPricingByCheckoutId({ checkoutId }),
6
13
  contextId: MESSAGING_CONTEXT_ID,
7
- options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
14
+ invalidation: shouldInvalidate,
15
+ options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false, refetchOnMount: "always" },
8
16
  });
9
17
  export { useViewPricingByCheckoutId };
@@ -1,5 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
- import { FeedbackProjection } from "../../../../../../projection/checkoutFeedback/feedback";
2
+ import { CheckoutFeedbackProjection } from "../../../../../../projection/checkoutFeedback/checkoutFeedback";
3
3
  interface OnChangeCheckoutQuestionFeedbackFunctionArgs {
4
4
  readonly checkoutQuestionId: string;
5
5
  readonly checkoutQuestionFeedback: string | undefined;
@@ -8,7 +8,7 @@ interface OnChangeCheckoutQuestionFeedbackFunction {
8
8
  (args: OnChangeCheckoutQuestionFeedbackFunctionArgs): void;
9
9
  }
10
10
  interface CheckoutQuestionFeedbackContextProviderProps {
11
- readonly feedback: FeedbackProjection | undefined;
11
+ readonly feedback: CheckoutFeedbackProjection | undefined;
12
12
  readonly children: ReactNode;
13
13
  }
14
14
  declare const CheckoutQuestionFeedbackProvider: FC<CheckoutQuestionFeedbackContextProviderProps>;
@@ -23,7 +23,7 @@ interface UseCheckoutQuestionFeedbackForIdFunction {
23
23
  }
24
24
  declare const useCheckoutQuestionFeedbackForId: UseCheckoutQuestionFeedbackForIdFunction;
25
25
  interface UseCheckoutQuestionFeedbackFunction {
26
- (): FeedbackProjection;
26
+ (): CheckoutFeedbackProjection;
27
27
  }
28
28
  declare const useCheckoutQuestionFeedback: UseCheckoutQuestionFeedbackFunction;
29
29
  export { useCheckoutQuestionFeedbackForId, useCheckoutQuestionFeedback, CheckoutQuestionFeedbackProvider };
@@ -23,7 +23,7 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
23
23
  const notFoundRouteMatch = useMatch(`${basePath}/${Routes.NOT_FOUND}`);
24
24
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
25
25
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(shouldIntroBeShownStatus) &&
26
- dependenciesLoadedStatuses.includes(checkoutStatus);
26
+ (dependenciesLoadedStatuses.includes(checkoutStatus) || checkout);
27
27
  if (!dependenciesLoaded) {
28
28
  return loader;
29
29
  }
@@ -54,7 +54,6 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
54
54
  }
55
55
  /* Navigate to the first item without customer's decission */
56
56
  if (firstItemWithoutCustomerDecision && !itemRouteMatch) {
57
- console.log("navigate to first item...", firstItemWithoutCustomerDecision.id);
58
57
  return (React.createElement(Navigate, { to: generatePath(`${basePath}/${Routes.ITEM}`, { id: firstItemWithoutCustomerDecision.id }), replace: true }));
59
58
  }
60
59
  /* Navigate to the summary if required */
@@ -1,10 +1,10 @@
1
1
  import { FC } from "react";
2
- import { FeedbackProjection } from "../../../../../../projection/checkoutFeedback/feedback";
2
+ import { CheckoutFeedbackProjection } from "../../../../../../projection/checkoutFeedback/checkoutFeedback";
3
3
  import { CheckoutQuestionProjection } from "../../../../../../projection/checkoutQuestion/checkoutQuestion";
4
4
  interface CheckoutQuestionsFormProps {
5
5
  readonly checkoutQuestions: CheckoutQuestionProjection[];
6
6
  readonly submitButtonDisabled: boolean;
7
- readonly onSubmit: (feedback: FeedbackProjection) => void;
7
+ readonly onSubmit: (feedback: CheckoutFeedbackProjection) => void;
8
8
  }
9
9
  declare const CheckoutQuestionsForm: FC<CheckoutQuestionsFormProps>;
10
10
  export { CheckoutQuestionsForm };
@@ -1,6 +1,6 @@
1
1
  import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
- import React, { useCallback } from "react";
3
+ import React, { useCallback, useMemo } from "react";
4
4
  import { CheckoutQuestionType, } from "../../../../../../projection/checkoutQuestion/checkoutQuestion";
5
5
  import { CheckoutQuestions } from "../../../../components/organisms/checkoutQuestions/CheckoutQuestions";
6
6
  import { useCheckoutQuestionFeedback } from "../../../../components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionFeedback";
@@ -24,9 +24,14 @@ const CheckoutQuestionsForm = ({ checkoutQuestions, submitButtonDisabled, onSubm
24
24
  const buttonText = useI18nMessage({ id: I18nMessages.FEEDBACK_BUTTON });
25
25
  const feedback = useCheckoutQuestionFeedback();
26
26
  const handlePress = useCallback(() => onSubmit(feedback), [feedback, onSubmit]);
27
+ const filteredCheckoutQuestions = useMemo(() => {
28
+ const responses = Object.values(feedback);
29
+ return checkoutQuestions.filter((checkoutQuestion) => checkoutQuestion.showCondition.length === 0 ||
30
+ checkoutQuestion.showCondition.every((condition) => responses.includes(condition)));
31
+ }, [checkoutQuestions, feedback]);
27
32
  return (React.createElement(React.Fragment, null,
28
33
  React.createElement(CheckoutQuestionItemProvider, { checkoutQuestionItems: checkoutQuestionItems },
29
- React.createElement(CheckoutQuestions, { checkoutQuestions: checkoutQuestions })),
34
+ React.createElement(CheckoutQuestions, { checkoutQuestions: filteredCheckoutQuestions })),
30
35
  React.createElement(Button, { busy: submitButtonDisabled,
31
36
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
32
37
  // @ts-ignore
@@ -1,7 +1,7 @@
1
1
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from "react";
3
3
  import { View } from "react-native";
4
- import { useParams } from "react-router-native";
4
+ import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
5
5
  import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
6
6
  import "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
7
7
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
@@ -15,6 +15,8 @@ import { useListReturnQuestionsByCheckoutItemId } from "../../../projection/retu
15
15
  import { Body } from "../../components/layouts/body/Body";
16
16
  import { ReturnQuestionFeedbackProvider } from "../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
17
17
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
18
+ import { Routes } from "../../routing/routes";
19
+ import { useBasePath } from "../../routing/useBasePath";
18
20
  import { style } from "./Item.style";
19
21
  import { CustomerDecissionBanner } from "./components/banner/CustomerDecissionBanner";
20
22
  import { ItemActions } from "./components/itemActions/ItemActions";
@@ -28,14 +30,48 @@ const Item = ({ customerId }) => {
28
30
  const { id } = useParams();
29
31
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
30
32
  const checkoutItem = checkout?.items.find((checkoutItem) => checkoutItem.id === id);
31
- const [customerDecissionMade, setCustomerDecissionMade] = useState(() => checkoutItem.status === CheckoutItemStatus.INITIAL || checkoutItem.status === CheckoutItemStatus.EXPIRED);
33
+ const basePath = useBasePath();
34
+ const itemRouteMatch = useMatch(`${basePath}/${Routes.ITEM}`);
35
+ const firstItemWithoutCustomerDecision = checkout?.items.find((item) => [CheckoutItemStatus.EXPIRED, CheckoutItemStatus.INITIAL].includes(item.status));
36
+ const navigate = useNavigate();
37
+ const navigateToNextItem = useCallback(() => {
38
+ if (itemRouteMatch && firstItemWithoutCustomerDecision) {
39
+ navigate(generatePath(`${basePath}/${Routes.ITEM}`, { id: firstItemWithoutCustomerDecision.id }));
40
+ }
41
+ }, [basePath, firstItemWithoutCustomerDecision, itemRouteMatch, navigate]);
42
+ const [customerDecissionMade, setCustomerDecissionMade] = useState(false);
32
43
  const handleOnBannerPress = useCallback(() => setCustomerDecissionMade(!customerDecissionMade), [customerDecissionMade]);
44
+ useEffect(() => {
45
+ setCustomerDecissionMade(checkoutItem.status === CheckoutItemStatus.INITIAL || checkoutItem.status === CheckoutItemStatus.EXPIRED);
46
+ }, [checkoutItem]);
47
+ const [keepCheckoutItem, keepCheckoutItemStatus] = useKeepCheckoutItem({ checkoutItemId: checkoutItem.id });
48
+ const [returnCheckoutItem, returnCheckoutItemStatus] = useReturnCheckoutItem({
49
+ checkoutItemId: checkoutItem.id,
50
+ });
51
+ const [replaceCheckoutItem, replaceCheckoutItemStatus] = useReplaceCheckoutItem({
52
+ checkoutItemId: checkoutItem.id,
53
+ });
54
+ useEffect(() => {
55
+ if (keepCheckoutItemStatus === CommandStatus.SUCCESS) {
56
+ navigateToNextItem();
57
+ }
58
+ }, [keepCheckoutItemStatus, navigateToNextItem]);
59
+ useEffect(() => {
60
+ if (returnCheckoutItemStatus === CommandStatus.SUCCESS) {
61
+ navigateToNextItem();
62
+ }
63
+ }, [returnCheckoutItemStatus, navigateToNextItem]);
33
64
  const [sizeWithoutStockModalVisible, setSizeWithoutStockModalVisible] = useState(false);
34
65
  const handleOnShowSizeWithoutStockModal = useCallback(() => setSizeWithoutStockModalVisible(true), []);
35
66
  const handleOnHideSizeWithoutStockModal = useCallback(() => setSizeWithoutStockModalVisible(false), []);
36
67
  const [sizeChangeModalVisible, setSizeChangeModalVisible] = useState(false);
37
68
  const handleOnShowSizeChangeModal = useCallback(() => setSizeChangeModalVisible(true), []);
38
- const handleOnHideSizeChangeModal = useCallback(() => setSizeChangeModalVisible(false), []);
69
+ const handleOnHideSizeChangeModal = useCallback(() => {
70
+ setSizeChangeModalVisible(false);
71
+ if (replaceCheckoutItemStatus === CommandStatus.SUCCESS) {
72
+ navigateToNextItem();
73
+ }
74
+ }, [navigateToNextItem, replaceCheckoutItemStatus]);
39
75
  const [bookedSizeChangeProductsVariants, bookedSizeChangeProductsVariantsStatus] = useViewBookedSizeChangeProductsVariantsForCheckoutItem({
40
76
  checkoutItemId: checkoutItem.id,
41
77
  });
@@ -44,17 +80,10 @@ const Item = ({ customerId }) => {
44
80
  });
45
81
  useEffect(() => {
46
82
  bookedSizeChangeProductsVariants === null && bookCheckouBooking();
47
- }, [bookCheckouBooking, bookedSizeChangeProductsVariants, bookedSizeChangeProductsVariants?.bookingId]);
83
+ }, [bookCheckouBooking, bookedSizeChangeProductsVariants]);
48
84
  const [returnQuestions, returnQuestionsStatus] = useListReturnQuestionsByCheckoutItemId({
49
85
  checkoutItemId: checkoutItem.id,
50
86
  });
51
- const [keepCheckoutItem, keepCheckoutItemStatus] = useKeepCheckoutItem({ checkoutItemId: checkoutItem.id });
52
- const [returnCheckoutItem, returnCheckoutItemStatus] = useReturnCheckoutItem({
53
- checkoutItemId: checkoutItem.id,
54
- });
55
- const [replaceCheckoutItem, replaceCheckoutItemStatus] = useReplaceCheckoutItem({
56
- checkoutItemId: checkoutItem.id,
57
- });
58
87
  const [stickyHeight, setStickyHeight] = useState(0);
59
88
  const handleOnStickyLayout = useCallback(({ height }) => setStickyHeight(height), []);
60
89
  const [returnQuestionsVisible, setReturnQuestionsVisible] = useState(false);
@@ -70,17 +99,18 @@ const Item = ({ customerId }) => {
70
99
  replaceCheckoutItem({ replacedFor });
71
100
  }, [handleOnShowSizeChangeModal, replaceCheckoutItem]);
72
101
  const handleOnReturn = useCallback(() => handleOnShowReturnQuestions(), [handleOnShowReturnQuestions]);
73
- const productVariantSelected = useMemo(() => checkoutItem.replacedFor
102
+ const productVariantSelected = useMemo(() => checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
74
103
  ? bookedSizeChangeProductsVariants?.productVariants.find((productVariant) => productVariant.id === checkoutItem.replacedFor)
75
104
  : { id: checkoutItem.productVariant.id, size: checkoutItem.productVariant.size }, [
76
105
  bookedSizeChangeProductsVariants?.productVariants,
77
106
  checkoutItem.productVariant.id,
78
107
  checkoutItem.productVariant.size,
79
108
  checkoutItem.replacedFor,
109
+ checkoutItem.status,
80
110
  ]);
81
111
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
82
112
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(returnQuestionsStatus) &&
83
- dependenciesLoadedStatuses.includes(checkoutStatus) &&
113
+ (dependenciesLoadedStatuses.includes(checkoutStatus) || checkout) &&
84
114
  dependenciesLoadedStatuses.includes(bookedSizeChangeProductsVariantsStatus);
85
115
  if (!dependenciesLoaded)
86
116
  return React.createElement(Spinner, null);
@@ -44,9 +44,9 @@ const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPerc
44
44
  React.createElement(Button, { busy: busy, small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
45
45
  React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
46
46
  React.createElement(Price, { price: subtotal, variant: "subtotal" })),
47
- discount && (React.createElement(Row, { text: discountText },
47
+ discount && discount.amount !== 0 && (React.createElement(Row, { text: discountText },
48
48
  React.createElement(Price, { price: discount, variant: "subtotal" }))),
49
- balanceDiscount && (React.createElement(Row, { text: creditText },
49
+ balanceDiscount && balanceDiscount.amount !== 0 && (React.createElement(Row, { text: creditText },
50
50
  React.createElement(Price, { price: balanceDiscount, variant: "subtotal" }))),
51
51
  React.createElement(Row, { text: feeText }, isPSServiceFree ? (React.createElement(Text, { level: 3, style: style.uppercase, action: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
52
52
  React.createElement(View, { style: style.divider }),
@@ -1,6 +1,3 @@
1
- import { FeedbackProjection } from "./feedback";
2
- interface CheckoutFeedbackProjection {
3
- readonly id: string;
4
- readonly feedbacks: FeedbackProjection;
5
- }
1
+ import { FeedbackProjection } from "../feedback/feedback";
2
+ type CheckoutFeedbackProjection = FeedbackProjection;
6
3
  export type { CheckoutFeedbackProjection };
@@ -0,0 +1,25 @@
1
+ import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
+ import { CheckoutFeedbackProjection } from "./checkoutFeedback";
3
+ declare const VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID = "view_checkout_feedback_by_checkout_id";
4
+ interface ViewCheckoutFeedbackByCheckoutIdPayload {
5
+ readonly checkoutId: string;
6
+ }
7
+ interface ViewCheckoutFeedbackByCheckoutId extends Query<typeof VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID>, ViewCheckoutFeedbackByCheckoutIdPayload {
8
+ }
9
+ interface ViewCheckoutFeedbackByCheckoutIdFunction {
10
+ (payload: ViewCheckoutFeedbackByCheckoutIdPayload): ViewCheckoutFeedbackByCheckoutId;
11
+ }
12
+ declare const viewCheckoutFeedbackByCheckoutId: ViewCheckoutFeedbackByCheckoutIdFunction;
13
+ type ViewCheckoutFeedbackByCheckoutIdResult = CheckoutFeedbackProjection | null;
14
+ interface CheckoutFeedbackByCheckoutIdViewArgs extends CancelableQueryViewArgs {
15
+ readonly checkoutId: string;
16
+ }
17
+ interface CheckoutFeedbackByCheckoutIdView {
18
+ (args: CheckoutFeedbackByCheckoutIdViewArgs): Promise<ViewCheckoutFeedbackByCheckoutIdResult>;
19
+ }
20
+ interface ViewCheckoutFeedbackByCheckoutIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
21
+ readonly view: CheckoutFeedbackByCheckoutIdView;
22
+ }
23
+ declare const viewCheckoutFeedbackByCheckoutIdHandler: QueryHandlerFunction<ViewCheckoutFeedbackByCheckoutId, ViewCheckoutFeedbackByCheckoutIdResult, ViewCheckoutFeedbackByCheckoutIdHandlerFunctionArgs>;
24
+ export type { ViewCheckoutFeedbackByCheckoutId, CheckoutFeedbackByCheckoutIdView, ViewCheckoutFeedbackByCheckoutIdResult, };
25
+ export { VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID, viewCheckoutFeedbackByCheckoutId, viewCheckoutFeedbackByCheckoutIdHandler, };
@@ -0,0 +1,8 @@
1
+ import { query, } from "@lookiero/messaging";
2
+ const VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID = "view_checkout_feedback_by_checkout_id";
3
+ const viewCheckoutFeedbackByCheckoutId = (payload) => ({
4
+ ...query({ name: VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID }),
5
+ ...payload,
6
+ });
7
+ const viewCheckoutFeedbackByCheckoutIdHandler = ({ view, signal }) => async ({ checkoutId }) => view({ checkoutId, signal });
8
+ export { VIEW_CHECKOUT_FEEDBACK_BY_CHECKOUT_ID, viewCheckoutFeedbackByCheckoutId, viewCheckoutFeedbackByCheckoutIdHandler, };
@@ -12,7 +12,7 @@ interface CheckoutQuestionProjection {
12
12
  readonly placeholder: string;
13
13
  readonly type: CheckoutQuestionType;
14
14
  readonly children?: CheckoutQuestionProjection[];
15
- readonly showCondition?: string[];
15
+ readonly showCondition: string[];
16
16
  }
17
17
  export { CheckoutQuestionType };
18
18
  export type { CheckoutQuestionProjection };
@@ -9,9 +9,9 @@ interface ServiceProjection {
9
9
  interface PricingProjection {
10
10
  readonly orderTotal: PriceProjection;
11
11
  readonly subtotal: PriceProjection;
12
- readonly balanceDiscount?: PriceProjection;
13
- readonly discount?: PriceProjection;
14
- readonly discountPercentage?: number;
12
+ readonly balanceDiscount: PriceProjection;
13
+ readonly discount: PriceProjection;
14
+ readonly discountPercentage: number;
15
15
  readonly service: ServiceProjection;
16
16
  }
17
17
  export type { PricingProjection, ServiceProjection };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -48,14 +48,14 @@
48
48
  "@lookiero/locale": "^0.3",
49
49
  "@lookiero/payments-front": "^0.16.5",
50
50
  "apollo-boost": "0.4.4",
51
- "graphql": "14.5.8",
51
+ "graphql": "16.6.0",
52
52
  "graphql-tag": "2.12.6",
53
53
  "react": "^18.0.0",
54
54
  "react-dom": "^18.0.0",
55
- "react-native": "^0.70.1",
55
+ "react-native": "^0.70.6",
56
56
  "react-native-web": "^0.18.9",
57
- "react-router-dom": "^6.4.2",
58
- "react-router-native": "^6.4.2"
57
+ "react-router-dom": "^6.4.5",
58
+ "react-router-native": "^6.4.5"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@babel/core": "^7.19.1",
@@ -73,11 +73,11 @@
73
73
  "@testing-library/react-hooks": "^8.0.1",
74
74
  "@testing-library/react-native": "^11.0.0",
75
75
  "@trivago/prettier-plugin-sort-imports": "^3.3.0",
76
- "@types/jest": "^29.2.3",
76
+ "@types/jest": "^29.2.4",
77
77
  "@types/react": "~18.0.0",
78
78
  "@types/react-dom": "~18.0.0",
79
79
  "@types/react-native": "~0.69.1",
80
- "@types/uuid": "^8.3.4",
80
+ "@types/uuid": "^9.0.0",
81
81
  "apollo-boost": "0.4.4",
82
82
  "eslint": "^8.24.0",
83
83
  "eslint-config-prettier": "^8.5.0",
@@ -92,9 +92,9 @@
92
92
  "expo": "~46.0.8",
93
93
  "expo-modules-core": "^1.0.3",
94
94
  "expo-status-bar": "~1.4.0",
95
- "graphql": "14.5.8",
95
+ "graphql": "16.6.0",
96
96
  "graphql-tag": "2.12.6",
97
- "husky": "^8.0.1",
97
+ "husky": "^8.0.2",
98
98
  "jest": "^29.3.1",
99
99
  "jest-expo": "^46.0.1",
100
100
  "jest-fetch-mock": "^3.0.3",
@@ -104,14 +104,14 @@
104
104
  "prettier": "^2.7.1",
105
105
  "react": "^18.0.0",
106
106
  "react-dom": "^18.0.0",
107
- "react-native": "^0.70.1",
107
+ "react-native": "^0.70.6",
108
108
  "react-native-get-random-values": "^1.8.0",
109
109
  "react-native-unimodules": "^0.14.10",
110
110
  "react-native-web": "^0.18.9",
111
- "react-router-dom": "^6.4.2",
112
- "react-router-native": "^6.4.2",
111
+ "react-router-dom": "^6.4.5",
112
+ "react-router-native": "^6.4.5",
113
113
  "react-test-renderer": "^18.0.0",
114
114
  "typescript": "^4.9.3",
115
- "webpack-bundle-analyzer": "^4.6.1"
115
+ "webpack-bundle-analyzer": "^4.7.0"
116
116
  }
117
117
  }
@@ -1,12 +0,0 @@
1
- import { CheckoutFeedbackByIdView } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackById";
2
- import { HttpPostFunction } from "../../delivery/http/httpClient";
3
- interface HttpCheckoutFeebackByIdView extends CheckoutFeedbackByIdView {
4
- }
5
- interface HttpCheckoutFeebackByIdViewFunctionArgs {
6
- readonly httpPost: HttpPostFunction;
7
- }
8
- interface HttpCheckoutFeebackByIdViewFunction {
9
- (args: HttpCheckoutFeebackByIdViewFunctionArgs): HttpCheckoutFeebackByIdView;
10
- }
11
- declare const httpCheckoutFeebackByIdView: HttpCheckoutFeebackByIdViewFunction;
12
- export { httpCheckoutFeebackByIdView };
@@ -1,9 +0,0 @@
1
- const httpCheckoutFeebackByIdView = ({ httpPost }) => async ({ checkoutFeedbackId, signal }) => {
2
- const response = await httpPost({
3
- endpoint: "/view-checkout-feedback-by-id",
4
- body: { checkoutFeedbackId },
5
- signal,
6
- });
7
- return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
- };
9
- export { httpCheckoutFeebackByIdView };
@@ -1,3 +0,0 @@
1
- type CheckoutQuestionId = string;
2
- type FeedbackProjection = Record<CheckoutQuestionId, CheckoutQuestionId | string>;
3
- export type { FeedbackProjection };
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +0,0 @@
1
- import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
- import { CheckoutFeedbackProjection } from "./checkoutFeedback";
3
- declare const VIEW_CHECKOUT_FEEDBACK_BY_ID = "view_checkout_feedback_by_id";
4
- interface ViewCheckoutFeedbackByIdPayload {
5
- readonly checkoutFeedbackId: string;
6
- }
7
- interface ViewCheckoutFeedbackById extends Query<typeof VIEW_CHECKOUT_FEEDBACK_BY_ID>, ViewCheckoutFeedbackByIdPayload {
8
- }
9
- interface ViewCheckoutFeedbackByIdFunction {
10
- (payload: ViewCheckoutFeedbackByIdPayload): ViewCheckoutFeedbackById;
11
- }
12
- declare const viewCheckoutFeedbackById: ViewCheckoutFeedbackByIdFunction;
13
- type ViewCheckoutFeedbackByIdResult = CheckoutFeedbackProjection | null;
14
- interface CheckoutFeedbackByIdViewArgs extends CancelableQueryViewArgs {
15
- readonly checkoutFeedbackId: string;
16
- }
17
- interface CheckoutFeedbackByIdView {
18
- (args: CheckoutFeedbackByIdViewArgs): Promise<ViewCheckoutFeedbackByIdResult>;
19
- }
20
- interface ViewCheckoutFeedbackByIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
21
- readonly view: CheckoutFeedbackByIdView;
22
- }
23
- declare const viewCheckoutFeedbackByIdHandler: QueryHandlerFunction<ViewCheckoutFeedbackById, ViewCheckoutFeedbackByIdResult, ViewCheckoutFeedbackByIdHandlerFunctionArgs>;
24
- export type { ViewCheckoutFeedbackById, CheckoutFeedbackByIdView, ViewCheckoutFeedbackByIdResult };
25
- export { VIEW_CHECKOUT_FEEDBACK_BY_ID, viewCheckoutFeedbackById, viewCheckoutFeedbackByIdHandler };
@@ -1,8 +0,0 @@
1
- import { query, } from "@lookiero/messaging";
2
- const VIEW_CHECKOUT_FEEDBACK_BY_ID = "view_checkout_feedback_by_id";
3
- const viewCheckoutFeedbackById = (payload) => ({
4
- ...query({ name: VIEW_CHECKOUT_FEEDBACK_BY_ID }),
5
- ...payload,
6
- });
7
- const viewCheckoutFeedbackByIdHandler = ({ view, signal }) => async ({ checkoutFeedbackId }) => view({ checkoutFeedbackId, signal });
8
- export { VIEW_CHECKOUT_FEEDBACK_BY_ID, viewCheckoutFeedbackById, viewCheckoutFeedbackByIdHandler };