@lookiero/checkout 0.3.8 → 0.3.10

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 (64) hide show
  1. package/dist/package.json +8 -8
  2. package/dist/src/ExpoRoot.js +1 -1
  3. package/dist/src/domain/checkoutItem/model/feedbacks.d.ts +2 -2
  4. package/dist/src/infrastructure/delivery/baseBootstrap.d.ts +4 -2
  5. package/dist/src/infrastructure/delivery/baseBootstrap.js +5 -1
  6. package/dist/src/infrastructure/delivery/bootstrap.js +4 -0
  7. package/dist/src/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +1 -1
  8. package/dist/src/infrastructure/domain/checkout/react/useStartCheckout.d.ts +1 -1
  9. package/dist/src/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +1 -1
  10. package/dist/src/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.d.ts +1 -1
  11. package/dist/src/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.d.ts +1 -1
  12. package/dist/src/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.d.ts +1 -1
  13. package/dist/src/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +1 -1
  14. package/dist/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +1 -1
  15. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.d.ts +12 -0
  16. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.js +9 -0
  17. package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.d.ts +10 -0
  18. package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.js +9 -0
  19. package/dist/src/infrastructure/ui/components/atoms/price/Price.d.ts +2 -2
  20. package/dist/src/infrastructure/ui/components/layouts/body/Body.d.ts +1 -1
  21. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +1 -1
  22. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +1 -1
  23. package/dist/src/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +1 -1
  24. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.d.ts +0 -1
  25. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +3 -1
  26. package/dist/src/infrastructure/ui/routing/Routing.js +7 -5
  27. package/dist/src/infrastructure/ui/routing/useBasePath.d.ts +8 -0
  28. package/dist/src/infrastructure/ui/routing/useBasePath.js +9 -0
  29. package/dist/src/infrastructure/ui/theme/theme.d.ts +2 -2
  30. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +12 -10
  31. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +2 -11
  32. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +3 -12
  33. package/dist/src/infrastructure/ui/views/intro/Intro.d.ts +1 -1
  34. package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.d.ts +1 -1
  35. package/dist/src/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +1 -1
  36. package/dist/src/infrastructure/ui/views/summary/Summary.js +5 -3
  37. package/dist/src/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +1 -1
  38. package/dist/src/projection/checkout/viewCheckoutById.d.ts +1 -1
  39. package/dist/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.d.ts +1 -1
  40. package/dist/src/projection/checkout/viewFiveItemsDiscountByCustomerId.d.ts +1 -1
  41. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +1 -1
  42. package/dist/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.d.ts +1 -1
  43. package/dist/src/projection/checkoutBooking/viewCheckoutBookingById.d.ts +1 -1
  44. package/dist/src/projection/checkoutItem/viewCheckoutItemById.d.ts +1 -1
  45. package/dist/src/projection/checkoutQuestion/checkoutQuestion.d.ts +20 -0
  46. package/dist/src/projection/checkoutQuestion/checkoutQuestion.js +12 -0
  47. package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.d.ts +25 -0
  48. package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.js +8 -0
  49. package/dist/src/projection/feedback/feedback.d.ts +2 -2
  50. package/dist/src/projection/payment/viewPaymentFlowPayloadByCheckoutId.d.ts +1 -1
  51. package/dist/src/projection/pricing/viewPricingByCheckoutId.d.ts +1 -1
  52. package/dist/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.d.ts +1 -1
  53. package/dist/src/projection/uiSetting/viewUiSettingByKey.d.ts +1 -1
  54. package/dist/src/shared/notifications/infrastructure/ui/notificationsRoot.d.ts +1 -1
  55. package/dist/src/shared/notifications/projection/notification/listNotifications.d.ts +1 -1
  56. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +1 -1
  57. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +1 -1
  58. package/dist/src/shared/ui/components/atoms/icon/Icon.d.ts +2 -2
  59. package/dist/src/shared/ui/components/atoms/input/Input.d.ts +1 -1
  60. package/dist/src/shared/ui/components/layouts/column/Column.d.ts +1 -1
  61. package/dist/src/shared/ui/components/layouts/modal/Modal.d.ts +2 -2
  62. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +1 -1
  63. package/dist/src/shared/ui/hooks/useScreenSize.d.ts +1 -1
  64. package/package.json +8 -8
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -36,7 +36,7 @@
36
36
  "inline-style-prefixer": "6.0.1",
37
37
  "react-native-safe-area-context": "^4.4.1",
38
38
  "react-native-svg": "12.3.0",
39
- "tiny-invariant": "^1.2.0",
39
+ "tiny-invariant": "^1.3.1",
40
40
  "uuid": "^9.0.0"
41
41
  },
42
42
  "peerDependencies": {
@@ -49,7 +49,7 @@
49
49
  "@lookiero/payments-front": "^0.16.3",
50
50
  "apollo-boost": "0.4.4",
51
51
  "graphql": "14.5.8",
52
- "graphql-tag": "2.10.1",
52
+ "graphql-tag": "2.12.6",
53
53
  "react": "^18.0.0",
54
54
  "react-dom": "^18.0.0",
55
55
  "react-native": "^0.70.1",
@@ -73,7 +73,7 @@
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.1.0",
76
+ "@types/jest": "^29.2.3",
77
77
  "@types/react": "~18.0.0",
78
78
  "@types/react-dom": "~18.0.0",
79
79
  "@types/react-native": "~0.69.1",
@@ -92,12 +92,12 @@
92
92
  "expo": "~46.0.8",
93
93
  "expo-status-bar": "~1.4.0",
94
94
  "graphql": "14.5.8",
95
- "graphql-tag": "2.10.1",
95
+ "graphql-tag": "2.12.6",
96
96
  "husky": "^8.0.1",
97
- "jest": "^29.1.1",
97
+ "jest": "^29.3.1",
98
98
  "jest-expo": "^46.0.1",
99
99
  "jest-fetch-mock": "^3.0.3",
100
- "jest-mock-extended": "^2.0.7",
100
+ "jest-mock-extended": "^3.0.1",
101
101
  "lint-staged": "^13.0.3",
102
102
  "pino-std-serializers": "^6.0.0",
103
103
  "prettier": "^2.7.1",
@@ -110,7 +110,7 @@
110
110
  "react-router-dom": "^6.4.2",
111
111
  "react-router-native": "^6.4.2",
112
112
  "react-test-renderer": "^18.0.0",
113
- "typescript": "^4.6.3",
113
+ "typescript": "^4.9.3",
114
114
  "webpack-bundle-analyzer": "^4.6.1"
115
115
  }
116
116
  }
@@ -15,7 +15,7 @@ import { root } from "./infrastructure/ui/Root";
15
15
  import { Router } from "./infrastructure/ui/routing/router/Router";
16
16
  import { notificationsRoot } from "./shared/notifications";
17
17
  const apiUrl = Platform.OS !== "web" ? "https://web2.ps.dev.aws.lookiero.es/checkout/api" : __DEV__ ? "/local-to-dev" : "/api";
18
- const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIwOTUxNjAsImV4cCI6MTY2OTM5MTY3MCwiZGlzcGxheU5hbWUiOiJBbGV4YW5kZXIiLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0wOS0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiJjZjdjNjQxZi0wZTVjLTQ4NTAtYWUwNy0yNzY3NDdlZGZkMGIiLCJpYXQiOjE2NjY3MTMyNzB9.KaEZc8M5N9TWg6flwUMx7O14DW-u4oTWFzYm23RaL9c";
18
+ const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIwOTUxNjAsImV4cCI6MTY3MjI5OTg4MSwiZGlzcGxheU5hbWUiOiJBbGV4YW5kZXIiLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0wOS0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiJjZjdjNjQxZi0wZTVjLTQ4NTAtYWUwNy0yNzY3NDdlZGZkMGIiLCJpYXQiOjE2Njk3MDc4ODF9.-nGGMNmMlsq-PsupefyjxH0Z3td7ybM9TpnUV_VIYSg";
19
19
  const translationsUrl = Platform.OS !== "web" ? "https://web2.ps.dev.aws.lookiero.es/checkout/i18n" : __DEV__ ? "/local-to-i18n" : "/i18n";
20
20
  const translationsApiKey = "f2AfMGaPCZGVbAFWz_OV4GWhBDG_NbZJ";
21
21
  const translations = (locale) => `${translationsUrl}/${locale}?key=${translationsApiKey}&no-folding=true`;
@@ -1,3 +1,3 @@
1
- declare type ReturnQuestionId = string;
2
- declare type Feedbacks = Record<ReturnQuestionId, ReturnQuestionId | string>;
1
+ type ReturnQuestionId = string;
2
+ type Feedbacks = Record<ReturnQuestionId, ReturnQuestionId | string>;
3
3
  export type { Feedbacks };
@@ -14,13 +14,14 @@ import { FirstAvailableCheckoutByCustomerIdView } from "../../projection/checkou
14
14
  import { FiveItemsDiscountByCustomerIdView } from "../../projection/checkout/viewFiveItemsDiscountByCustomerId";
15
15
  import { IsCheckoutEnabledByCustomerIdView } from "../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
16
16
  import { CheckoutItemByIdView } from "../../projection/checkoutItem/viewCheckoutItemById";
17
+ import { CheckoutQuestionsByCheckoutIdView } from "../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
17
18
  import { PaymentFlowPayloadByCheckoutIdView } from "../../projection/payment/viewPaymentFlowPayloadByCheckoutId";
18
19
  import { PricingByCheckoutIdView } from "../../projection/pricing/viewPricingByCheckoutId";
19
20
  import { ReturnQuestionsByCheckoutItemIdView } from "../../projection/returnQuestion/listReturnQuestionsByCheckoutItemId";
20
21
  import { UiSettingByKeyView } from "../../projection/uiSetting/viewUiSettingByKey";
21
22
  declare const MESSAGING_CONTEXT_ID = "Checkout";
22
- declare type NeverWhenEmptyRecord<K extends [Record<string, unknown>]> = K extends [Record<string, never>] ? [never?] : K;
23
- declare type RepositoryDependencies<A extends AggregateRoot, GetFunctionArgs extends RepositoryGetFunctionArgs, SaveFunctionArgs extends RepositorySaveFunctionArgs> = Omit<Parameters<RepositoryGetFunction<A, GetFunctionArgs>>[0] & Parameters<RepositorySaveFunction<A, SaveFunctionArgs>>[0], keyof RepositoryGetFunctionArgs>;
23
+ type NeverWhenEmptyRecord<K extends [Record<string, unknown>]> = K extends [Record<string, never>] ? [never?] : K;
24
+ type RepositoryDependencies<A extends AggregateRoot, GetFunctionArgs extends RepositoryGetFunctionArgs, SaveFunctionArgs extends RepositorySaveFunctionArgs> = Omit<Parameters<RepositoryGetFunction<A, GetFunctionArgs>>[0] & Parameters<RepositorySaveFunction<A, SaveFunctionArgs>>[0], keyof RepositoryGetFunctionArgs>;
24
25
  interface BaseBootstrapFunctionArgs<UiSettingGetFunctionArgs extends RepositoryGetFunctionArgs, UiSettingSaveFunctionArgs extends RepositorySaveFunctionArgs, CheckoutGetFunctionArgs extends RepositoryGetFunctionArgs, CheckoutSaveFunctionArgs extends RepositorySaveFunctionArgs, CheckoutItemGetFunctionArgs extends RepositoryGetFunctionArgs, CheckoutItemSaveFunctionArgs extends RepositorySaveFunctionArgs, CheckoutBookingGetFunctionArgs extends RepositoryGetFunctionArgs, CheckoutBookingSaveFunctionArgs extends RepositorySaveFunctionArgs> {
25
26
  readonly checkoutByIdView: CheckoutByIdView;
26
27
  readonly firstAvailableCheckoutByCustomerIdView: FirstAvailableCheckoutByCustomerIdView;
@@ -32,6 +33,7 @@ interface BaseBootstrapFunctionArgs<UiSettingGetFunctionArgs extends RepositoryG
32
33
  readonly bookedSizeChangeProductsVariantsForCheckoutItemView: BookedSizeChangeProductsVariantsForCheckoutItemView;
33
34
  readonly pricingByCheckoutIdView: PricingByCheckoutIdView;
34
35
  readonly paymentFlowPayloadByCheckoutIdView: PaymentFlowPayloadByCheckoutIdView;
36
+ readonly checkoutQuestionsByCheckoutIdView: CheckoutQuestionsByCheckoutIdView;
35
37
  readonly getUiSetting: UiSettingGetFunction<UiSettingGetFunctionArgs>;
36
38
  readonly saveUiSetting: UiSettingSaveFunction<UiSettingSaveFunctionArgs>;
37
39
  readonly uiSettingsDependencies: NeverWhenEmptyRecord<[
@@ -17,12 +17,13 @@ import { viewFiveItemsDiscountByCustomerIdHandler, VIEW_FIVE_ITEMS_DISCOUNT_BY_C
17
17
  import { viewIsCheckoutAccessibleByCustomerIdHandler, VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
18
18
  import { viewIsCheckoutEnabledByCustomerIdHandler, VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, } from "../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
19
19
  import { viewCheckoutItemByIdHandler, VIEW_CHECKOUT_ITEM_BY_ID, } from "../../projection/checkoutItem/viewCheckoutItemById";
20
+ import { listCheckoutQuestionsByCheckoutIdHandler, LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID, } from "../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
20
21
  import { viewPaymentFlowPayloadByCheckoutIdHandler, VIEW_PAYMENT_FLOW_PAYLOAD_BY_CHECKOUT_ID, } from "../../projection/payment/viewPaymentFlowPayloadByCheckoutId";
21
22
  import { viewPricingByCheckoutIdHandler, VIEW_PRICING_BY_CHECKOUT_ID, } from "../../projection/pricing/viewPricingByCheckoutId";
22
23
  import { listReturnQuestionsByCheckoutItemIdHandler, LIST_RETURN_QUESTIONS_BY_CHECKOUT_ITEM_ID, } from "../../projection/returnQuestion/listReturnQuestionsByCheckoutItemId";
23
24
  import { viewUiSettingByKeyHandler, VIEW_UI_SETTING_BY_KEY, } from "../../projection/uiSetting/viewUiSettingByKey";
24
25
  const MESSAGING_CONTEXT_ID = "Checkout";
25
- const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdView, isCheckoutEnabledByCustomerIdView, fiveItemsDiscountByCustomerIdView, uiSettingByKeyView, checkoutItemByIdView, returnQuestionsByCheckoutItemIdView, bookedSizeChangeProductsVariantsForCheckoutItemView, pricingByCheckoutIdView, paymentFlowPayloadByCheckoutIdView, getUiSetting, saveUiSetting, uiSettingsDependencies, getCheckout, saveCheckout, checkoutsDependencies, getCheckoutItem, saveCheckoutItem, checkoutItemsDependencies, getCheckoutBooking, saveCheckoutBooking, checkoutBookingsDependencies, }) => messagingBootstrap({ id: MESSAGING_CONTEXT_ID })
26
+ 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, }) => messagingBootstrap({ id: MESSAGING_CONTEXT_ID })
26
27
  .query(VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID, viewFiveItemsDiscountByCustomerIdHandler, {
27
28
  view: fiveItemsDiscountByCustomerIdView,
28
29
  })
@@ -52,6 +53,9 @@ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdVie
52
53
  })
53
54
  .query(VIEW_PAYMENT_FLOW_PAYLOAD_BY_CHECKOUT_ID, viewPaymentFlowPayloadByCheckoutIdHandler, {
54
55
  view: paymentFlowPayloadByCheckoutIdView,
56
+ })
57
+ .query(LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID, listCheckoutQuestionsByCheckoutIdHandler, {
58
+ view: checkoutQuestionsByCheckoutIdView,
55
59
  })
56
60
  .query(VIEW_BOOKED_SIZE_CHANGE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, viewBookedSizeChangeProductsVariantsForCheckoutItemHandler, {
57
61
  view: bookedSizeChangeProductsVariantsForCheckoutItemView,
@@ -9,6 +9,7 @@ import { httpFirstAvailableCheckoutByCustomerIdView } from "../projection/checko
9
9
  import { httpFiveItemsDiscountByCustomerIdView } from "../projection/checkout/httpFiveItemsDiscountByCustomerIdView";
10
10
  import { httpIsCheckoutEnabledByCustomerIdView } from "../projection/checkout/httpIsCheckoutEnabledByCustomerIdView";
11
11
  import { httpCheckoutItemByIdView } from "../projection/checkoutItem/httpCheckoutItemByIdView";
12
+ import { httpCheckoutQuestionsByCheckoutIdView } from "../projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView";
12
13
  import { httpPaymentFlowPayloadByCheckoutIdView } from "../projection/payment/httpPaymentFlowPayloadByCheckoutIdView";
13
14
  import { httpPricingByCheckoutIdView } from "../projection/pricing/httpPricingByCheckoutIdView";
14
15
  import { httpReturnQuestionsByCheckoutItemIdView } from "../projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView";
@@ -35,6 +36,9 @@ const bootstrap = ({ apiUrl, authToken }) => {
35
36
  paymentFlowPayloadByCheckoutIdView: httpPaymentFlowPayloadByCheckoutIdView({
36
37
  httpPost,
37
38
  }),
39
+ checkoutQuestionsByCheckoutIdView: httpCheckoutQuestionsByCheckoutIdView({
40
+ httpPost,
41
+ }),
38
42
  getUiSetting,
39
43
  saveUiSetting,
40
44
  uiSettingsDependencies: [{ read, write }],
@@ -2,7 +2,7 @@ import { CommandStatus } from "@lookiero/messaging-react";
2
2
  interface MarkAsPaidFunction {
3
3
  (): void;
4
4
  }
5
- declare type UseMarkCheckoutAsPaid = [markAsPaid: MarkAsPaidFunction, status: CommandStatus];
5
+ type UseMarkCheckoutAsPaid = [markAsPaid: MarkAsPaidFunction, status: CommandStatus];
6
6
  interface UseMarkCheckoutAsPaidFunctionArgs {
7
7
  readonly checkoutId?: string;
8
8
  }
@@ -5,7 +5,7 @@ interface StartCheckoutFunction {
5
5
  interface UseStartCheckoutArgs {
6
6
  readonly checkoutId: string;
7
7
  }
8
- declare type UseStartCheckoutResult = [start: StartCheckoutFunction, status: CommandStatus];
8
+ type UseStartCheckoutResult = [start: StartCheckoutFunction, status: CommandStatus];
9
9
  interface UseStartCheckout {
10
10
  (args: UseStartCheckoutArgs): UseStartCheckoutResult;
11
11
  }
@@ -2,7 +2,7 @@ import { CommandStatus } from "@lookiero/messaging-react";
2
2
  interface BookFunction {
3
3
  (): Promise<void>;
4
4
  }
5
- declare type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
5
+ type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
6
6
  interface UseBookCheckouBookingForCheckoutItemFunctionArgs {
7
7
  readonly checkoutItemId: string;
8
8
  }
@@ -5,7 +5,7 @@ interface KeepCheckoutItemFunction {
5
5
  interface UseKeepCheckoutItemFunctionArgs {
6
6
  readonly checkoutItemId: string;
7
7
  }
8
- declare type UseKeepCheckoutItemResult = [keep: KeepCheckoutItemFunction, status: CommandStatus];
8
+ type UseKeepCheckoutItemResult = [keep: KeepCheckoutItemFunction, status: CommandStatus];
9
9
  interface UseKeepCheckoutItemFunction {
10
10
  (args: UseKeepCheckoutItemFunctionArgs): UseKeepCheckoutItemResult;
11
11
  }
@@ -8,7 +8,7 @@ interface ReplaceCheckoutItemFunction {
8
8
  interface UseReplaceCheckoutItemFunctionArgs {
9
9
  readonly checkoutItemId: string;
10
10
  }
11
- declare type UseReplaceCheckoutItemResult = [replace: ReplaceCheckoutItemFunction, status: CommandStatus];
11
+ type UseReplaceCheckoutItemResult = [replace: ReplaceCheckoutItemFunction, status: CommandStatus];
12
12
  interface UseReplaceCheckoutItemFunction {
13
13
  (args: UseReplaceCheckoutItemFunctionArgs): UseReplaceCheckoutItemResult;
14
14
  }
@@ -9,7 +9,7 @@ interface ReturnCheckoutItemFunction {
9
9
  interface UseReturnCheckoutItemFunctionArgs {
10
10
  readonly checkoutItemId: string;
11
11
  }
12
- declare type UseReturnCheckoutItemResult = [returnCheckoutItem: ReturnCheckoutItemFunction, status: CommandStatus];
12
+ type UseReturnCheckoutItemResult = [returnCheckoutItem: ReturnCheckoutItemFunction, status: CommandStatus];
13
13
  interface UseReturnCheckoutItemFunction {
14
14
  (args: UseReturnCheckoutItemFunctionArgs): UseReturnCheckoutItemResult;
15
15
  }
@@ -2,7 +2,7 @@ import { CommandStatus } from "@lookiero/messaging-react";
2
2
  interface IncrementIntroShownCountFunction {
3
3
  (): Promise<void>;
4
4
  }
5
- declare type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
5
+ type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
6
6
  interface UseIncrementIntroShownCountFunction {
7
7
  (): UseIncrementIntroShownCount;
8
8
  }
@@ -6,7 +6,7 @@ interface UpdateFunctionArgs {
6
6
  interface UpdateFunction {
7
7
  (args: UpdateFunctionArgs): Promise<void>;
8
8
  }
9
- declare type UseUpdateUiSetting = [update: UpdateFunction, status: CommandStatus];
9
+ type UseUpdateUiSetting = [update: UpdateFunction, status: CommandStatus];
10
10
  interface UseUpdateUiSettingFunction {
11
11
  (): UseUpdateUiSetting;
12
12
  }
@@ -0,0 +1,12 @@
1
+ import { CheckoutQuestionsByCheckoutIdView } from "../../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
2
+ import { HttpPostFunction } from "../../delivery/http/httpClient";
3
+ interface HttpCheckoutQuestionsByCheckoutIdView extends CheckoutQuestionsByCheckoutIdView {
4
+ }
5
+ interface HttpCheckoutQuestionsByCheckoutIdViewFunctionArgs {
6
+ readonly httpPost: HttpPostFunction;
7
+ }
8
+ interface HttpCheckoutQuestionsByCheckoutIdViewFunction {
9
+ (args: HttpCheckoutQuestionsByCheckoutIdViewFunctionArgs): HttpCheckoutQuestionsByCheckoutIdView;
10
+ }
11
+ declare const httpCheckoutQuestionsByCheckoutIdView: HttpCheckoutQuestionsByCheckoutIdViewFunction;
12
+ export { httpCheckoutQuestionsByCheckoutIdView };
@@ -0,0 +1,9 @@
1
+ const httpCheckoutQuestionsByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => {
2
+ const response = await httpPost({
3
+ endpoint: "/list-checkout-questions-by-checkout-id",
4
+ body: { checkoutId },
5
+ signal,
6
+ });
7
+ return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
+ };
9
+ export { httpCheckoutQuestionsByCheckoutIdView };
@@ -0,0 +1,10 @@
1
+ import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
+ import { CheckoutQuestionProjection } from "../../../../projection/checkoutQuestion/checkoutQuestion";
3
+ interface UseListChckoutQuestionsByCheckoutIdFunctionArgs {
4
+ readonly checkoutId: string;
5
+ }
6
+ interface UseListChckoutQuestionsByCheckoutIdFunction {
7
+ (args: UseListChckoutQuestionsByCheckoutIdFunctionArgs): UseQueryFunctionResult<CheckoutQuestionProjection[]>;
8
+ }
9
+ declare const useListCheckoutQuestionsByCheckoutId: UseListChckoutQuestionsByCheckoutIdFunction;
10
+ export { useListCheckoutQuestionsByCheckoutId };
@@ -0,0 +1,9 @@
1
+ import { useQuery } from "@lookiero/messaging-react";
2
+ import { listCheckoutQuestionsByCheckoutId } from "../../../../projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId";
3
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
4
+ const useListCheckoutQuestionsByCheckoutId = ({ checkoutId }) => useQuery({
5
+ query: listCheckoutQuestionsByCheckoutId({ checkoutId }),
6
+ contextId: MESSAGING_CONTEXT_ID,
7
+ options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
8
+ });
9
+ export { useListCheckoutQuestionsByCheckoutId };
@@ -1,8 +1,8 @@
1
1
  import { FC } from "react";
2
2
  import { TextProps } from "react-native";
3
3
  import { PriceProjection } from "../../../../../projection/shared/price";
4
- declare type PriceStyle = "priceText" | "discountedText";
5
- declare type PriceVariant = "default" | "detail" | "subtotal" | "total";
4
+ type PriceStyle = "priceText" | "discountedText";
5
+ type PriceVariant = "default" | "detail" | "subtotal" | "total";
6
6
  interface PriceProps {
7
7
  readonly price: PriceProjection;
8
8
  readonly variant?: PriceVariant;
@@ -1,6 +1,6 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { StyleProp, ViewStyle } from "react-native";
3
- declare type BodyStyle = "row" | "column";
3
+ type BodyStyle = "row" | "column";
4
4
  interface BodyProps {
5
5
  readonly children: ReactNode;
6
6
  readonly style?: Partial<Record<BodyStyle, StyleProp<ViewStyle>>>;
@@ -1,7 +1,7 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
3
3
  import { ReturnQuestionItem } from "../components/ReturnQuestionItem";
4
- declare type ReturnQuestionItems = Record<ReturnQuestionType, ReturnQuestionItem>;
4
+ type ReturnQuestionItems = Record<ReturnQuestionType, ReturnQuestionItem>;
5
5
  interface ReturnQuestionItemContextProviderProps {
6
6
  readonly returnQuestionItems: ReturnQuestionItems;
7
7
  readonly children: ReactNode;
@@ -6,5 +6,5 @@ interface ReturnQuestionItemProps {
6
6
  readonly children?: ReactNode;
7
7
  readonly portalHostName?: string;
8
8
  }
9
- declare type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
9
+ type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
10
10
  export type { ReturnQuestionItem, ReturnQuestionItemProps };
@@ -1,7 +1,7 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { StyleProp, ViewStyle } from "react-native";
3
3
  import { Edge } from "react-native-safe-area-context";
4
- declare type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
4
+ type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
5
5
  interface SafeAreaScrollViewProps {
6
6
  readonly children: ReactNode;
7
7
  readonly edges?: Edge[];
@@ -1,6 +1,5 @@
1
1
  import { FC } from "react";
2
2
  interface CheckoutMiddlewareProps {
3
- readonly basePath: string;
4
3
  readonly customerId: string;
5
4
  readonly loader?: JSX.Element;
6
5
  readonly children: JSX.Element;
@@ -6,7 +6,9 @@ import { Spinner } from "../../../shared/ui/components/atoms/spinner/Spinner";
6
6
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
7
7
  import { useShouldIntroBeShown } from "../../projection/uiSetting/react/useShouldIntroBeShown";
8
8
  import { Routes } from "./routes";
9
- const CheckoutMiddleware = ({ basePath, customerId, loader = React.createElement(Spinner, null), children }) => {
9
+ import { useBasePath } from "./useBasePath";
10
+ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner, null), children }) => {
11
+ const basePath = useBasePath();
10
12
  const introShown = useRef(false);
11
13
  const [shouldIntroBeShown, shouldIntroBeShownStatus] = useShouldIntroBeShown();
12
14
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
@@ -5,6 +5,7 @@ import { App } from "../views/App";
5
5
  import { CheckoutAccessibilityMiddleware } from "./CheckoutAccessibilityMiddleware";
6
6
  import { CheckoutMiddleware } from "./CheckoutMiddleware";
7
7
  import { Routes } from "./routes";
8
+ import { BasePathProvider } from "./useBasePath";
8
9
  const Intro = lazy(() => import("../views/intro/Intro").then((module) => ({ default: module.Intro })));
9
10
  const Item = lazy(() => import("../views/item/Item").then((module) => ({ default: module.Item })));
10
11
  const Summary = lazy(() => import("../views/summary/Summary").then((module) => ({ default: module.Summary })));
@@ -13,11 +14,12 @@ const Routing = ({ basePath = "", customerId, locale, I18n, authToken, onI18nErr
13
14
  const routes = useRoutes([
14
15
  {
15
16
  path: "",
16
- element: (React.createElement(CheckoutAccessibilityMiddleware, { customerId: customerId, onNotAccessible: onNotAccessible },
17
- React.createElement(I18n, { loader: React.createElement(Spinner, null), locale: locale, onError: onI18nError },
18
- React.createElement(CheckoutMiddleware, { basePath: basePath, customerId: customerId },
19
- React.createElement(App, null,
20
- React.createElement(Outlet, null)))))),
17
+ element: (React.createElement(BasePathProvider, { basePath: basePath },
18
+ React.createElement(CheckoutAccessibilityMiddleware, { customerId: customerId, onNotAccessible: onNotAccessible },
19
+ React.createElement(I18n, { loader: React.createElement(Spinner, null), locale: locale, onError: onI18nError },
20
+ React.createElement(CheckoutMiddleware, { customerId: customerId },
21
+ React.createElement(App, null,
22
+ React.createElement(Outlet, null))))))),
21
23
  children: [
22
24
  {
23
25
  path: Routes.INTRO,
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ interface BasePathProviderProps {
3
+ readonly children: JSX.Element;
4
+ readonly basePath: string;
5
+ }
6
+ export declare const BasePathProvider: FC<BasePathProviderProps>;
7
+ export declare const useBasePath: () => string;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { invariant } from "@remix-run/router";
2
+ import React, { createContext, useContext } from "react";
3
+ const BasePathContext = createContext(null);
4
+ export const BasePathProvider = ({ basePath, children }) => (React.createElement(BasePathContext.Provider, { value: basePath }, children));
5
+ export const useBasePath = () => {
6
+ const basePath = useContext(BasePathContext);
7
+ invariant(basePath, "Your are trying to use the useBasePath hook without wrapping your app with the <BasePathProvider>.");
8
+ return basePath;
9
+ };
@@ -1,8 +1,8 @@
1
1
  import { DefaultTheme } from "@lookiero/aurora-next/build/theming/theme.default";
2
- declare type Remove$PrefixFromKeys<T> = {
2
+ type Remove$PrefixFromKeys<T> = {
3
3
  [K in keyof T as K extends `$${infer F}` ? F : K]: T[K];
4
4
  };
5
- declare type AuroraTheme = Remove$PrefixFromKeys<typeof DefaultTheme>;
5
+ type AuroraTheme = Remove$PrefixFromKeys<typeof DefaultTheme>;
6
6
  interface ThemeFunction {
7
7
  (): AuroraTheme;
8
8
  }
@@ -3,9 +3,10 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
3
3
  import { useI18nMessage } from "@lookiero/i18n-react";
4
4
  import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
5
5
  import { CheckoutStatus, PaymentFlow } from "@lookiero/payments-front";
6
- import React, { useCallback, useRef, useState } from "react";
6
+ import React, { useCallback, useMemo, useRef, useState } from "react";
7
7
  import { View } from "react-native";
8
8
  import { useNavigate } from "react-router-native";
9
+ import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
9
10
  import { useCreateNotification } from "../../../../shared/notifications";
10
11
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
11
12
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
@@ -16,6 +17,8 @@ import { Body } from "../../components/layouts/body/Body";
16
17
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
17
18
  import { I18nMessages } from "../../i18n/i18n";
18
19
  import { Routes } from "../../routing/routes";
20
+ import { useBasePath } from "../../routing/useBasePath";
21
+ import { ProductVariant } from "../item/components/productVariant/ProductVariant";
19
22
  import { style } from "./Checkout.style";
20
23
  import { CheckoutSuccessModal } from "./components/CheckoutSuccessModal";
21
24
  const Checkout = ({ customerId, authToken }) => {
@@ -30,6 +33,7 @@ const Checkout = ({ customerId, authToken }) => {
30
33
  const [createNotification] = useCreateNotification();
31
34
  const [processingCheckout, setProcessingCheckout] = useState(false);
32
35
  const navigate = useNavigate();
36
+ const basePath = useBasePath();
33
37
  const onSubmitCheckout = useCallback(() => {
34
38
  if (!paymentFlowRef.current) {
35
39
  return;
@@ -57,22 +61,20 @@ const Checkout = ({ customerId, authToken }) => {
57
61
  }
58
62
  });
59
63
  }, [createNotification, markAsPaid, paymentFlowPayload]);
60
- const handleOnSuccessModalDismiss = useCallback(() => navigate(Routes.FEEDBACK), [navigate]);
64
+ const handleOnSuccessModalDismiss = useCallback(() => navigate(`${basePath}/${Routes.FEEDBACK}`), [basePath, navigate]);
65
+ const checkoutItemsKept = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
61
66
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
62
67
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutStatus);
63
68
  if (!dependenciesLoaded)
64
69
  return React.createElement(Spinner, null);
65
70
  return (React.createElement(React.Fragment, null,
71
+ React.createElement(CheckoutSuccessModal, { visible: markAsPaidStatus === CommandStatus.SUCCESS, onDismiss: handleOnSuccessModalDismiss }),
66
72
  React.createElement(SafeAreaScrollView, null,
67
73
  React.createElement(Body, { style: { column: style.bodyColumn } },
68
- React.createElement(View, { style: style.container },
69
- React.createElement(View, { style: style.content },
70
- React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
71
- React.createElement(Button, { busy: processingCheckout || markAsPaidStatus === CommandStatus.LOADING,
72
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
73
- // @ts-ignore
74
- testID: "submit-checkout-button", onPress: onSubmitCheckout }, payButtonText),
75
- React.createElement(CheckoutSuccessModal, { visible: markAsPaidStatus === CommandStatus.SUCCESS, onDismiss: handleOnSuccessModalDismiss }))))),
74
+ React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
75
+ checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, style: style.checkoutItemKept, testID: "checkout-items-kept" },
76
+ React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, size: checkoutItem.productVariant.size, status: checkoutItem.status })))),
77
+ React.createElement(Button, { busy: processingCheckout || markAsPaidStatus === CommandStatus.LOADING, onPress: onSubmitCheckout }, payButtonText))),
76
78
  React.createElement(PaymentFlow, { ref: paymentFlowRef, token: authToken })));
77
79
  };
78
80
  export { Checkout };
@@ -2,17 +2,8 @@ declare const style: {
2
2
  bodyColumn: {
3
3
  paddingHorizontal: number;
4
4
  };
5
- bullet: {
6
- alignItems: "center";
7
- flexDirection: "row";
8
- marginVertical: number;
9
- };
10
- container: {
11
- flex: number;
12
- justifyContent: "space-between";
13
- };
14
- content: {
15
- alignItems: "center";
5
+ checkoutItemKept: {
6
+ paddingVertical: number;
16
7
  };
17
8
  title: {
18
9
  marginBottom: number;
@@ -1,21 +1,12 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../theme/theme";
3
- const { spaceS, spaceM, spaceXL } = theme();
3
+ const { spaceM, spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
5
  bodyColumn: {
6
6
  paddingHorizontal: spaceXL,
7
7
  },
8
- bullet: {
9
- alignItems: "center",
10
- flexDirection: "row",
11
- marginVertical: spaceS,
12
- },
13
- container: {
14
- flex: 1,
15
- justifyContent: "space-between",
16
- },
17
- content: {
18
- alignItems: "center",
8
+ checkoutItemKept: {
9
+ paddingVertical: spaceM,
19
10
  },
20
11
  title: {
21
12
  marginBottom: spaceM,
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- declare type IntroProps = {
2
+ type IntroProps = {
3
3
  readonly customerId: string;
4
4
  };
5
5
  declare const Intro: FC<IntroProps>;
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
3
- declare type CustomerDecissionBannerStatus = Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL | CheckoutItemStatus.EXPIRED>;
3
+ type CustomerDecissionBannerStatus = Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL | CheckoutItemStatus.EXPIRED>;
4
4
  interface CustomerDecissionBannerProps {
5
5
  readonly checkoutItemStatus: CustomerDecissionBannerStatus;
6
6
  readonly onPress: () => void;
@@ -14,7 +14,7 @@ const ProductVariant = ({ media, brand, name, price, size, color, status, discar
14
14
  const colorLabel = useI18nMessage({ id: color.label, prefix: COLOR_I18N_PREFIX });
15
15
  const sizeChangeText = useI18nMessage({ id: I18nMessages.PRODUCT_VARIANT_SIZE_CHANGE });
16
16
  const cdnImageUrl = useMediaImage();
17
- return (React.createElement(Pressable, { style: style.container, testID: "product-variant", onPress: onPress },
17
+ return (React.createElement(Pressable, { pointerEvents: onPress ? "auto" : "none", style: style.container, testID: "product-variant", onPress: onPress },
18
18
  React.createElement(View, { style: style.row },
19
19
  React.createElement(View, null,
20
20
  React.createElement(Image, { resizeMode: "contain", style: [style.media, customStyle?.image], testID: "product-variant-media", source: {
@@ -13,6 +13,7 @@ import { Body } from "../../components/layouts/body/Body";
13
13
  import { SafeAreaScrollView } from "../../components/templates/SafeAreaScrollView";
14
14
  import { I18nMessages } from "../../i18n/i18n";
15
15
  import { Routes } from "../../routing/routes";
16
+ import { useBasePath } from "../../routing/useBasePath";
16
17
  import { style } from "./Summary.style";
17
18
  import { CheckoutItemsTabs } from "./components/checkoutItemsTabs/CheckoutItemsTabs";
18
19
  import { FiveItemsDiscountBanner } from "./components/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
@@ -23,11 +24,12 @@ const Summary = ({ customerId }) => {
23
24
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
24
25
  const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
25
26
  const [fiveItemsDiscount = 0, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({ customerId });
27
+ const navigate = useNavigate();
28
+ const basePath = useBasePath();
26
29
  const [pricingCollapsed, setPricingCollapsed] = useState(true);
27
30
  const handleOnPressPricing = useCallback(() => setPricingCollapsed(!pricingCollapsed), [pricingCollapsed]);
28
- const handleOnSubmit = useCallback(() => void 0, []);
29
- const navigate = useNavigate();
30
- const handleOnPressItem = useCallback((checkoutItemId) => navigate(generatePath(Routes.ITEM_DETAIL, { id: checkoutItemId })), [navigate]);
31
+ const handleOnSubmit = useCallback(() => navigate(`${basePath}/${Routes.CHECKOUT}`), [basePath, navigate]);
32
+ const handleOnPressItem = useCallback((checkoutItemId) => navigate(`${basePath}/${generatePath(Routes.ITEM_DETAIL, { id: checkoutItemId })}`), [basePath, navigate]);
31
33
  const checkoutItemsKept = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
32
34
  const checkoutItemsReturned = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.RETURNED || checkoutItem.status === CheckoutItemStatus.REPLACED), [checkout?.items]);
33
35
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
@@ -10,7 +10,7 @@ interface ViewBookedSizeChangeProductsVariantsForCheckoutItemFunction {
10
10
  (payload: ViewBookedSizeChangeProductsVariantsForCheckoutItemPayload): ViewBookedSizeChangeProductsVariantsForCheckoutItem;
11
11
  }
12
12
  declare const viewBookedSizeChangeProductsVariantsForCheckoutItem: ViewBookedSizeChangeProductsVariantsForCheckoutItemFunction;
13
- declare type ViewBookedSizeChangeProductsVariantsForCheckoutItemResult = BookedSizeChangeProductsVariantsProjection | null;
13
+ type ViewBookedSizeChangeProductsVariantsForCheckoutItemResult = BookedSizeChangeProductsVariantsProjection | null;
14
14
  interface BookedSizeChangeProductsVariantsForCheckoutItemViewArgs extends CancelableQueryViewArgs {
15
15
  readonly checkoutItemId: string;
16
16
  }
@@ -10,7 +10,7 @@ interface ViewCheckoutByIdFunction {
10
10
  (payload: ViewCheckoutByIdPayload): ViewCheckoutById;
11
11
  }
12
12
  declare const viewCheckoutById: ViewCheckoutByIdFunction;
13
- declare type ViewCheckoutByIdResult = CheckoutProjection | null;
13
+ type ViewCheckoutByIdResult = CheckoutProjection | null;
14
14
  interface CheckoutByIdViewArgs extends CancelableQueryViewArgs {
15
15
  readonly checkoutId: string;
16
16
  }
@@ -10,7 +10,7 @@ interface ViewFirstAvailableCheckoutByCustomerIdFunction {
10
10
  (payload: ViewFirstAvailableCheckoutByCustomerIdPayload): ViewFirstAvailableCheckoutByCustomerId;
11
11
  }
12
12
  declare const viewFirstAvailableCheckoutByCustomerId: ViewFirstAvailableCheckoutByCustomerIdFunction;
13
- declare type ViewFirstAvailableCheckoutByCustomerIdResult = CheckoutProjection | null;
13
+ type ViewFirstAvailableCheckoutByCustomerIdResult = CheckoutProjection | null;
14
14
  interface FirstAvailableCheckoutByCustomerIdViewArgs extends CancelableQueryViewArgs {
15
15
  readonly customerId: string;
16
16
  }
@@ -1,5 +1,5 @@
1
1
  import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
- declare type FiveItemsDiscountByCustomerIdProjection = number;
2
+ type FiveItemsDiscountByCustomerIdProjection = number;
3
3
  declare const VIEW_FIVE_ITEMS_DISCOUNT_BY_CUSTOMER_ID = "view_five_items_discount_by_customer_id";
4
4
  interface ViewFiveItemsDiscountByCustomerIdPayload {
5
5
  readonly customerId: string;
@@ -1,5 +1,5 @@
1
1
  import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
- declare type IsCheckoutAccessibleByCustomerIdProjection = boolean;
2
+ type IsCheckoutAccessibleByCustomerIdProjection = boolean;
3
3
  declare const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
4
4
  interface ViewIsCheckoutAccessibleByCustomerIdPayload {
5
5
  readonly customerId: string | undefined;
@@ -1,5 +1,5 @@
1
1
  import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
- declare type IsCheckoutEnabledByCustomerIdProjection = boolean;
2
+ type IsCheckoutEnabledByCustomerIdProjection = boolean;
3
3
  declare const VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID = "view_is_checkout_enabled_by_customer_id";
4
4
  interface ViewIsCheckoutEnabledByCustomerIdPayload {
5
5
  readonly customerId: string;
@@ -10,7 +10,7 @@ interface ViewCheckoutBookingByIdFunction {
10
10
  (payload: ViewCheckoutBookingByIdPayload): ViewCheckoutBookingById;
11
11
  }
12
12
  declare const viewCheckoutBookingById: ViewCheckoutBookingByIdFunction;
13
- declare type ViewCheckoutBookingByIdResult = CheckoutBookingProjection | null;
13
+ type ViewCheckoutBookingByIdResult = CheckoutBookingProjection | null;
14
14
  interface CheckoutBookingByIdViewArgs extends CancelableQueryViewArgs {
15
15
  readonly checkoutBookingId: string;
16
16
  }
@@ -10,7 +10,7 @@ interface ViewCheckoutItemByIdFunction {
10
10
  (payload: ViewCheckoutItemByIdPayload): ViewCheckoutItemById;
11
11
  }
12
12
  declare const viewCheckoutItemById: ViewCheckoutItemByIdFunction;
13
- declare type ViewCheckoutItemByIdResult = CheckoutItemProjection | null;
13
+ type ViewCheckoutItemByIdResult = CheckoutItemProjection | null;
14
14
  interface CheckoutItemByIdViewArgs extends CancelableQueryViewArgs {
15
15
  readonly checkoutItemId: string;
16
16
  }
@@ -0,0 +1,20 @@
1
+ declare enum CheckoutQuestionType {
2
+ HOST_DEFAULT = "HOST_DEFAULT",
3
+ HOST_TEXTAREA = "HOST_TEXTAREA",
4
+ HOST_SELECT = "HOST_SELECT",
5
+ HOST_STACK = "HOST_STACK",
6
+ TEXTAREA = "TEXTAREA",
7
+ OPTION = "OPTION",
8
+ ICON = "ICON",
9
+ BUTTON = "BUTTON"
10
+ }
11
+ interface CheckoutQuestionProjection {
12
+ readonly id: string;
13
+ readonly name: string;
14
+ readonly placeholder: string;
15
+ readonly type: CheckoutQuestionType;
16
+ readonly children?: CheckoutQuestionProjection[];
17
+ readonly showCondition?: string[];
18
+ }
19
+ export { CheckoutQuestionType };
20
+ export type { CheckoutQuestionProjection };
@@ -0,0 +1,12 @@
1
+ var CheckoutQuestionType;
2
+ (function (CheckoutQuestionType) {
3
+ CheckoutQuestionType["HOST_DEFAULT"] = "HOST_DEFAULT";
4
+ CheckoutQuestionType["HOST_TEXTAREA"] = "HOST_TEXTAREA";
5
+ CheckoutQuestionType["HOST_SELECT"] = "HOST_SELECT";
6
+ CheckoutQuestionType["HOST_STACK"] = "HOST_STACK";
7
+ CheckoutQuestionType["TEXTAREA"] = "TEXTAREA";
8
+ CheckoutQuestionType["OPTION"] = "OPTION";
9
+ CheckoutQuestionType["ICON"] = "ICON";
10
+ CheckoutQuestionType["BUTTON"] = "BUTTON";
11
+ })(CheckoutQuestionType || (CheckoutQuestionType = {}));
12
+ export { CheckoutQuestionType };
@@ -0,0 +1,25 @@
1
+ import { CancelableQueryViewArgs, Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
+ import { CheckoutQuestionProjection } from "./checkoutQuestion";
3
+ declare const LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID = "list_checkout_questions_by_checkout_id";
4
+ interface ListCheckoutQuestionsByCheckoutIdPayload {
5
+ readonly checkoutId: string;
6
+ }
7
+ interface ListCheckoutQuestionsByCheckoutId extends Query<typeof LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID>, ListCheckoutQuestionsByCheckoutIdPayload {
8
+ }
9
+ interface ListCheckoutQuestionsByCheckoutIdFunction {
10
+ (payload: ListCheckoutQuestionsByCheckoutIdPayload): ListCheckoutQuestionsByCheckoutId;
11
+ }
12
+ declare const listCheckoutQuestionsByCheckoutId: ListCheckoutQuestionsByCheckoutIdFunction;
13
+ type ListCheckoutQuestionsByCheckoutIdResult = CheckoutQuestionProjection[] | null;
14
+ interface CheckoutQuestionsByCheckoutIdViewArgs extends CancelableQueryViewArgs {
15
+ readonly checkoutId: string;
16
+ }
17
+ interface CheckoutQuestionsByCheckoutIdView {
18
+ (args: CheckoutQuestionsByCheckoutIdViewArgs): Promise<ListCheckoutQuestionsByCheckoutIdResult>;
19
+ }
20
+ interface ListCheckoutQuestionsByCheckoutIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
21
+ readonly view: CheckoutQuestionsByCheckoutIdView;
22
+ }
23
+ declare const listCheckoutQuestionsByCheckoutIdHandler: QueryHandlerFunction<ListCheckoutQuestionsByCheckoutId, ListCheckoutQuestionsByCheckoutIdResult, ListCheckoutQuestionsByCheckoutIdHandlerFunctionArgs>;
24
+ export type { ListCheckoutQuestionsByCheckoutId, CheckoutQuestionsByCheckoutIdView, ListCheckoutQuestionsByCheckoutIdResult, };
25
+ export { LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID, listCheckoutQuestionsByCheckoutId, listCheckoutQuestionsByCheckoutIdHandler, };
@@ -0,0 +1,8 @@
1
+ import { query, } from "@lookiero/messaging";
2
+ const LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID = "list_checkout_questions_by_checkout_id";
3
+ const listCheckoutQuestionsByCheckoutId = (payload) => ({
4
+ ...query({ name: LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID }),
5
+ ...payload,
6
+ });
7
+ const listCheckoutQuestionsByCheckoutIdHandler = ({ view, signal }) => async ({ checkoutId }) => view({ checkoutId, signal });
8
+ export { LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID, listCheckoutQuestionsByCheckoutId, listCheckoutQuestionsByCheckoutIdHandler, };
@@ -1,3 +1,3 @@
1
- declare type ReturnQuestionId = string;
2
- declare type FeedbackProjection = Record<ReturnQuestionId, ReturnQuestionId | string>;
1
+ type ReturnQuestionId = string;
2
+ type FeedbackProjection = Record<ReturnQuestionId, ReturnQuestionId | string>;
3
3
  export type { FeedbackProjection };
@@ -10,7 +10,7 @@ interface ViewPaymentFlowPayloadByCheckoutIdFunction {
10
10
  (payload: ViewPaymentFlowPayloadByCheckoutIdPayload): ViewPaymentFlowPayloadByCheckoutId;
11
11
  }
12
12
  declare const viewPaymentFlowPayloadByCheckoutId: ViewPaymentFlowPayloadByCheckoutIdFunction;
13
- declare type ViewPaymentFlowPayloadByCheckoutIdResult = PaymentFlowPayloadProjection | null;
13
+ type ViewPaymentFlowPayloadByCheckoutIdResult = PaymentFlowPayloadProjection | null;
14
14
  interface PaymentFlowPayloadByCheckoutIdViewArgs extends CancelableQueryViewArgs {
15
15
  readonly checkoutId: string;
16
16
  }
@@ -10,7 +10,7 @@ interface ViewPricingByCheckoutIdFunction {
10
10
  (payload: ViewPricingByCheckoutIdPayload): ViewPricingByCheckoutId;
11
11
  }
12
12
  declare const viewPricingByCheckoutId: ViewPricingByCheckoutIdFunction;
13
- declare type ViewPricingByCheckoutIdResult = PricingProjection | null;
13
+ type ViewPricingByCheckoutIdResult = PricingProjection | null;
14
14
  interface PricingByCheckoutIdViewArgs extends CancelableQueryViewArgs {
15
15
  readonly checkoutId: string;
16
16
  }
@@ -10,7 +10,7 @@ interface ListReturnQuestionsByCheckoutItemIdFunction {
10
10
  (payload: ListReturnQuestionsByCheckoutItemIdPayload): ListReturnQuestionsByCheckoutItemId;
11
11
  }
12
12
  declare const listReturnQuestionsByCheckoutItemId: ListReturnQuestionsByCheckoutItemIdFunction;
13
- declare type ListReturnQuestionsByCheckoutItemIdResult = ReturnQuestionProjection[] | null;
13
+ type ListReturnQuestionsByCheckoutItemIdResult = ReturnQuestionProjection[] | null;
14
14
  interface ReturnQuestionsByCheckoutItemIdViewArgs extends CancelableQueryViewArgs {
15
15
  readonly checkoutItemId: string;
16
16
  }
@@ -14,7 +14,7 @@ interface ViewUiSettingByKeyFunction {
14
14
  (payload: ViewUiSettingByKeyPayload): ViewUiSettingByKey;
15
15
  }
16
16
  declare const viewUiSettingByKey: ViewUiSettingByKeyFunction;
17
- declare type ViewUiSettingByKeyResult = UiSettingProjection | null;
17
+ type ViewUiSettingByKeyResult = UiSettingProjection | null;
18
18
  interface UiSettingByKeyViewArgs {
19
19
  readonly key: string;
20
20
  }
@@ -4,7 +4,7 @@ interface NotificationsRootProps {
4
4
  readonly children: JSX.Element;
5
5
  readonly includeReactQueryDevTools?: boolean;
6
6
  }
7
- declare type NotificationsRoot = FC<NotificationsRootProps>;
7
+ type NotificationsRoot = FC<NotificationsRootProps>;
8
8
  interface NotificationsRootFunction {
9
9
  (args?: BootstrapFunctionArgs): NotificationsRoot;
10
10
  }
@@ -7,7 +7,7 @@ interface ListNotificationsFunction {
7
7
  (): ListNotifications;
8
8
  }
9
9
  declare const listNotifications: ListNotificationsFunction;
10
- declare type ListNotificationsResult = NotificationProjection[];
10
+ type ListNotificationsResult = NotificationProjection[];
11
11
  interface ListNotificationsView {
12
12
  (): Promise<ListNotificationsResult>;
13
13
  }
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  import { StyleProp, TextStyle } from "react-native";
3
- declare type ErrorStyle = StyleProp<TextStyle>;
3
+ type ErrorStyle = StyleProp<TextStyle>;
4
4
  interface ErrorProps {
5
5
  readonly error?: string | null;
6
6
  readonly style?: ErrorStyle;
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
- declare type FieldStyle = {
3
+ type FieldStyle = {
4
4
  readonly field: StyleProp<ViewStyle>;
5
5
  readonly fieldText: StyleProp<TextStyle>;
6
6
  };
@@ -1,8 +1,8 @@
1
1
  import glyphs from "@lookiero/aurora-iconfont/dist/glyphs.json";
2
2
  import { FC } from "react";
3
3
  import { StyleProp, TextStyle } from "react-native";
4
- declare type IconStyle = StyleProp<TextStyle>;
5
- declare type IconName = keyof typeof glyphs;
4
+ type IconStyle = StyleProp<TextStyle>;
5
+ type IconName = keyof typeof glyphs;
6
6
  interface IconProps {
7
7
  readonly name: IconName;
8
8
  readonly style?: IconStyle;
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  import { StyleProp, TextInputProps, TextStyle } from "react-native";
3
- declare type InputStyle = StyleProp<TextStyle>;
3
+ type InputStyle = StyleProp<TextStyle>;
4
4
  interface InputProps extends TextInputProps {
5
5
  readonly minHeight?: number;
6
6
  readonly maxHeight?: number;
@@ -1,7 +1,7 @@
1
1
  import { FC } from "react";
2
2
  import { ViewProps } from "react-native";
3
3
  import { ScreenSize } from "../../../hooks/useScreenSize";
4
- declare type ColumnSize = "1/4" | "1/3" | "1/2" | "2/3";
4
+ type ColumnSize = "1/4" | "1/3" | "1/2" | "2/3";
5
5
  interface ColumnProps extends ViewProps {
6
6
  readonly size?: Partial<Record<ScreenSize, ColumnSize>>;
7
7
  }
@@ -1,8 +1,8 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { StyleProp, ViewStyle } from "react-native";
3
3
  import { ScreenSize } from "../../../hooks/useScreenSize";
4
- declare type ColumnSize = "1/4" | "1/3" | "1/2" | "2/3";
5
- declare type ModalStyle = "overlay" | "row" | "modal" | "header" | "closeButton";
4
+ type ColumnSize = "1/4" | "1/3" | "1/2" | "2/3";
5
+ type ModalStyle = "overlay" | "row" | "modal" | "header" | "closeButton";
6
6
  interface ModalProps {
7
7
  readonly children: ReactNode;
8
8
  readonly visible: boolean;
@@ -4,7 +4,7 @@ import { ErrorStyle } from "../../atoms/error/Error";
4
4
  import { FieldStyle } from "../../atoms/field/Field";
5
5
  import { IconName, IconStyle } from "../../atoms/icon/Icon";
6
6
  import { InputProps, InputStyle } from "../../atoms/input/Input";
7
- declare type InputFieldStyle = FieldStyle & {
7
+ type InputFieldStyle = FieldStyle & {
8
8
  readonly inputField: StyleProp<ViewStyle>;
9
9
  readonly input: InputStyle;
10
10
  readonly error: ErrorStyle;
@@ -1,4 +1,4 @@
1
- declare type ScreenSize = "S" | "M" | "L";
1
+ type ScreenSize = "S" | "M" | "L";
2
2
  declare const useScreenSize: () => ScreenSize;
3
3
  export type { ScreenSize };
4
4
  export { useScreenSize };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -36,7 +36,7 @@
36
36
  "inline-style-prefixer": "6.0.1",
37
37
  "react-native-safe-area-context": "^4.4.1",
38
38
  "react-native-svg": "12.3.0",
39
- "tiny-invariant": "^1.2.0",
39
+ "tiny-invariant": "^1.3.1",
40
40
  "uuid": "^9.0.0"
41
41
  },
42
42
  "peerDependencies": {
@@ -49,7 +49,7 @@
49
49
  "@lookiero/payments-front": "^0.16.3",
50
50
  "apollo-boost": "0.4.4",
51
51
  "graphql": "14.5.8",
52
- "graphql-tag": "2.10.1",
52
+ "graphql-tag": "2.12.6",
53
53
  "react": "^18.0.0",
54
54
  "react-dom": "^18.0.0",
55
55
  "react-native": "^0.70.1",
@@ -73,7 +73,7 @@
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.1.0",
76
+ "@types/jest": "^29.2.3",
77
77
  "@types/react": "~18.0.0",
78
78
  "@types/react-dom": "~18.0.0",
79
79
  "@types/react-native": "~0.69.1",
@@ -92,12 +92,12 @@
92
92
  "expo": "~46.0.8",
93
93
  "expo-status-bar": "~1.4.0",
94
94
  "graphql": "14.5.8",
95
- "graphql-tag": "2.10.1",
95
+ "graphql-tag": "2.12.6",
96
96
  "husky": "^8.0.1",
97
- "jest": "^29.1.1",
97
+ "jest": "^29.3.1",
98
98
  "jest-expo": "^46.0.1",
99
99
  "jest-fetch-mock": "^3.0.3",
100
- "jest-mock-extended": "^2.0.7",
100
+ "jest-mock-extended": "^3.0.1",
101
101
  "lint-staged": "^13.0.3",
102
102
  "pino-std-serializers": "^6.0.0",
103
103
  "prettier": "^2.7.1",
@@ -110,7 +110,7 @@
110
110
  "react-router-dom": "^6.4.2",
111
111
  "react-router-native": "^6.4.2",
112
112
  "react-test-renderer": "^18.0.0",
113
- "typescript": "^4.6.3",
113
+ "typescript": "^4.9.3",
114
114
  "webpack-bundle-analyzer": "^4.6.1"
115
115
  }
116
116
  }