@lookiero/checkout 0.1.1

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 (202) hide show
  1. package/.eslintignore +7 -0
  2. package/.eslintrc +72 -0
  3. package/.expo-shared/assets.json +4 -0
  4. package/.github/CODEOWNERS +1 -0
  5. package/.github/actions/version/action.yaml +32 -0
  6. package/.github/dependabot.yaml +10 -0
  7. package/.github/workflows/build.yaml +71 -0
  8. package/.github/workflows/publish.yaml +52 -0
  9. package/.husky/pre-commit +4 -0
  10. package/.husky/prepare-commit-msg +26 -0
  11. package/.husky/prepush +12 -0
  12. package/.lintstagedrc.json +4 -0
  13. package/.nvmrc +1 -0
  14. package/.prettierignore +2 -0
  15. package/.prettierrc.json +6 -0
  16. package/@types/aurora-next.d.ts +1 -0
  17. package/README.md +19 -0
  18. package/app.config.js +4 -0
  19. package/app.json +31 -0
  20. package/assets/adaptive-icon.png +0 -0
  21. package/assets/favicon.png +0 -0
  22. package/assets/icon.png +0 -0
  23. package/assets/splash.png +0 -0
  24. package/babel.config.js +6 -0
  25. package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.d.ts +15 -0
  26. package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.js +6 -0
  27. package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +8 -0
  28. package/dist/domain/checkoutBooking/model/checkoutBooking.js +16 -0
  29. package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +15 -0
  30. package/dist/domain/checkoutBooking/model/checkoutBookingBooked.js +6 -0
  31. package/dist/domain/checkoutBooking/model/checkoutBookings.d.ts +6 -0
  32. package/dist/domain/checkoutBooking/model/checkoutBookings.js +1 -0
  33. package/dist/domain/uiSetting/command/updateUiSetting.d.ts +14 -0
  34. package/dist/domain/uiSetting/command/updateUiSetting.js +9 -0
  35. package/dist/domain/uiSetting/model/uiSetting.d.ts +8 -0
  36. package/dist/domain/uiSetting/model/uiSetting.js +10 -0
  37. package/dist/domain/uiSetting/model/uiSettingUpdated.d.ts +13 -0
  38. package/dist/domain/uiSetting/model/uiSettingUpdated.js +6 -0
  39. package/dist/domain/uiSetting/model/uiSettings.d.ts +6 -0
  40. package/dist/domain/uiSetting/model/uiSettings.js +1 -0
  41. package/dist/index.d.ts +22 -0
  42. package/dist/index.js +13 -0
  43. package/dist/infrastructure/delivery/_mock/bootstrap.mock.d.ts +6 -0
  44. package/dist/infrastructure/delivery/_mock/bootstrap.mock.js +17 -0
  45. package/dist/infrastructure/delivery/_mock/checkout.mock.d.ts +9 -0
  46. package/dist/infrastructure/delivery/_mock/checkout.mock.js +45 -0
  47. package/dist/infrastructure/delivery/bootstrap.d.ts +10 -0
  48. package/dist/infrastructure/delivery/bootstrap.js +21 -0
  49. package/dist/infrastructure/delivery/http/fetchHttpClient.d.ts +14 -0
  50. package/dist/infrastructure/delivery/http/fetchHttpClient.js +18 -0
  51. package/dist/infrastructure/delivery/http/httpClient.d.ts +14 -0
  52. package/dist/infrastructure/delivery/http/httpClient.js +1 -0
  53. package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.d.ts +10 -0
  54. package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +19 -0
  55. package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +15 -0
  56. package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +17 -0
  57. package/dist/infrastructure/domain/react/useUpdateUiSetting.d.ts +17 -0
  58. package/dist/infrastructure/domain/react/useUpdateUiSetting.js +16 -0
  59. package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.d.ts +18 -0
  60. package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.js +19 -0
  61. package/dist/infrastructure/persistence/asyncStorageStorage.d.ts +4 -0
  62. package/dist/infrastructure/persistence/asyncStorageStorage.js +6 -0
  63. package/dist/infrastructure/persistence/storage.d.ts +6 -0
  64. package/dist/infrastructure/persistence/storage.js +1 -0
  65. package/dist/infrastructure/persistence/uiSettingData.d.ts +5 -0
  66. package/dist/infrastructure/persistence/uiSettingData.js +1 -0
  67. package/dist/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.d.ts +36 -0
  68. package/dist/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.js +30 -0
  69. package/dist/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.d.ts +60 -0
  70. package/dist/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.js +54 -0
  71. package/dist/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.d.ts +12 -0
  72. package/dist/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.js +7 -0
  73. package/dist/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +10 -0
  74. package/dist/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.js +8 -0
  75. package/dist/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.d.ts +10 -0
  76. package/dist/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.js +8 -0
  77. package/dist/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +10 -0
  78. package/dist/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.js +8 -0
  79. package/dist/infrastructure/projection/react/useViewIsCheckoutIntroVisible.d.ts +3 -0
  80. package/dist/infrastructure/projection/react/useViewIsCheckoutIntroVisible.js +3 -0
  81. package/dist/infrastructure/projection/react/useViewUiSettingByKey.d.ts +10 -0
  82. package/dist/infrastructure/projection/react/useViewUiSettingByKey.js +8 -0
  83. package/dist/infrastructure/projection/storageUiSettingByKeyView.d.ts +13 -0
  84. package/dist/infrastructure/projection/storageUiSettingByKeyView.js +14 -0
  85. package/dist/infrastructure/ui/Root.d.ts +15 -0
  86. package/dist/infrastructure/ui/Root.js +25 -0
  87. package/dist/infrastructure/ui/components/atoms/spiner/Spinner.d.ts +3 -0
  88. package/dist/infrastructure/ui/components/atoms/spiner/Spinner.js +11 -0
  89. package/dist/infrastructure/ui/components/atoms/spiner/Spinner.style.d.ts +9 -0
  90. package/dist/infrastructure/ui/components/atoms/spiner/Spinner.style.js +10 -0
  91. package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +8 -0
  92. package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +16 -0
  93. package/dist/infrastructure/ui/routing/CheckoutMiddleware.d.ts +7 -0
  94. package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +34 -0
  95. package/dist/infrastructure/ui/routing/Routing.d.ts +7 -0
  96. package/dist/infrastructure/ui/routing/Routing.js +49 -0
  97. package/dist/infrastructure/ui/routing/router/Router.d.ts +1 -0
  98. package/dist/infrastructure/ui/routing/router/Router.js +1 -0
  99. package/dist/infrastructure/ui/routing/router/Router.native.d.ts +1 -0
  100. package/dist/infrastructure/ui/routing/router/Router.native.js +1 -0
  101. package/dist/infrastructure/ui/routing/routes.d.ts +6 -0
  102. package/dist/infrastructure/ui/routing/routes.js +7 -0
  103. package/dist/infrastructure/ui/test/render.d.ts +19 -0
  104. package/dist/infrastructure/ui/test/render.js +14 -0
  105. package/dist/infrastructure/ui/views/intro/Intro.d.ts +3 -0
  106. package/dist/infrastructure/ui/views/intro/Intro.js +20 -0
  107. package/dist/infrastructure/ui/views/item/Item.d.ts +3 -0
  108. package/dist/infrastructure/ui/views/item/Item.js +23 -0
  109. package/dist/infrastructure/ui/views/summary/Summary.d.ts +3 -0
  110. package/dist/infrastructure/ui/views/summary/Summary.js +20 -0
  111. package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +43 -0
  112. package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.js +8 -0
  113. package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.d.ts +104 -0
  114. package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.js +43 -0
  115. package/dist/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +16 -0
  116. package/dist/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +13 -0
  117. package/dist/projection/checkout/viewIsCheckoutEnabledByCustomerId.d.ts +23 -0
  118. package/dist/projection/checkout/viewIsCheckoutEnabledByCustomerId.js +8 -0
  119. package/dist/projection/uiSetting/viewUiSettingByKey.d.ts +28 -0
  120. package/dist/projection/uiSetting/viewUiSettingByKey.js +7 -0
  121. package/jest.config.js +9 -0
  122. package/jest.setup.js +3 -0
  123. package/package.json +75 -0
  124. package/src/Expo.tsx +59 -0
  125. package/src/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.test.ts +26 -0
  126. package/src/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.ts +27 -0
  127. package/src/domain/checkoutBooking/model/checkoutBooking.test.ts +30 -0
  128. package/src/domain/checkoutBooking/model/checkoutBooking.ts +31 -0
  129. package/src/domain/checkoutBooking/model/checkoutBookingBooked.test.ts +23 -0
  130. package/src/domain/checkoutBooking/model/checkoutBookingBooked.ts +23 -0
  131. package/src/domain/checkoutBooking/model/checkoutBookings.ts +6 -0
  132. package/src/domain/uiSetting/command/updateUiSetting.test.ts +19 -0
  133. package/src/domain/uiSetting/command/updateUiSetting.ts +23 -0
  134. package/src/domain/uiSetting/model/uiSetting.test.ts +26 -0
  135. package/src/domain/uiSetting/model/uiSetting.ts +22 -0
  136. package/src/domain/uiSetting/model/uiSettingUpdated.test.ts +17 -0
  137. package/src/domain/uiSetting/model/uiSettingUpdated.ts +19 -0
  138. package/src/domain/uiSetting/model/uiSettings.ts +6 -0
  139. package/src/index.ts +44 -0
  140. package/src/infrastructure/delivery/_mock/bootstrap.mock.ts +38 -0
  141. package/src/infrastructure/delivery/_mock/checkout.mock.ts +81 -0
  142. package/src/infrastructure/delivery/bootstrap.ts +42 -0
  143. package/src/infrastructure/delivery/http/fetchHttpClient.test.ts +51 -0
  144. package/src/infrastructure/delivery/http/fetchHttpClient.ts +41 -0
  145. package/src/infrastructure/delivery/http/httpClient.ts +18 -0
  146. package/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.test.ts +45 -0
  147. package/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.ts +32 -0
  148. package/src/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.test.ts +38 -0
  149. package/src/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.ts +44 -0
  150. package/src/infrastructure/domain/react/useUpdateUiSetting.test.ts +31 -0
  151. package/src/infrastructure/domain/react/useUpdateUiSetting.ts +43 -0
  152. package/src/infrastructure/domain/uiSetting/model/storageUiSettings.test.ts +50 -0
  153. package/src/infrastructure/domain/uiSetting/model/storageUiSettings.ts +50 -0
  154. package/src/infrastructure/persistence/asyncStorageStorage.ts +12 -0
  155. package/src/infrastructure/persistence/storage.ts +7 -0
  156. package/src/infrastructure/persistence/uiSettingData.ts +5 -0
  157. package/src/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.test.ts +65 -0
  158. package/src/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.ts +102 -0
  159. package/src/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.test.ts +99 -0
  160. package/src/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.ts +128 -0
  161. package/src/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.test.ts +32 -0
  162. package/src/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.ts +27 -0
  163. package/src/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.test.ts +51 -0
  164. package/src/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.ts +25 -0
  165. package/src/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.test.ts +28 -0
  166. package/src/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.ts +22 -0
  167. package/src/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.test.ts +44 -0
  168. package/src/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.ts +24 -0
  169. package/src/infrastructure/projection/react/useViewIsCheckoutIntroVisible.ts +5 -0
  170. package/src/infrastructure/projection/react/useViewUiSettingByKey.test.ts +30 -0
  171. package/src/infrastructure/projection/react/useViewUiSettingByKey.ts +18 -0
  172. package/src/infrastructure/projection/storageUiSettingByKeyView.test.ts +32 -0
  173. package/src/infrastructure/projection/storageUiSettingByKeyView.ts +35 -0
  174. package/src/infrastructure/ui/Root.tsx +53 -0
  175. package/src/infrastructure/ui/components/atoms/spiner/Spinner.style.ts +12 -0
  176. package/src/infrastructure/ui/components/atoms/spiner/Spinner.tsx +35 -0
  177. package/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.test.tsx +70 -0
  178. package/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.tsx +31 -0
  179. package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +100 -0
  180. package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +52 -0
  181. package/src/infrastructure/ui/routing/Routing.tsx +64 -0
  182. package/src/infrastructure/ui/routing/router/Router.native.ts +1 -0
  183. package/src/infrastructure/ui/routing/router/Router.ts +1 -0
  184. package/src/infrastructure/ui/routing/routes.ts +6 -0
  185. package/src/infrastructure/ui/test/render.tsx +47 -0
  186. package/src/infrastructure/ui/views/intro/Intro.test.tsx +15 -0
  187. package/src/infrastructure/ui/views/intro/Intro.tsx +27 -0
  188. package/src/infrastructure/ui/views/item/Item.tsx +31 -0
  189. package/src/infrastructure/ui/views/summary/Summary.tsx +27 -0
  190. package/src/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.test.ts +40 -0
  191. package/src/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.ts +85 -0
  192. package/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.test.ts +22 -0
  193. package/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.ts +149 -0
  194. package/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.test.ts +54 -0
  195. package/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.ts +46 -0
  196. package/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.test.ts +20 -0
  197. package/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.ts +51 -0
  198. package/src/projection/uiSetting/viewUiSettingByKey.test.ts +22 -0
  199. package/src/projection/uiSetting/viewUiSettingByKey.ts +47 -0
  200. package/tsconfig.build.json +16 -0
  201. package/tsconfig.json +19 -0
  202. package/webpack.config.js +17 -0
@@ -0,0 +1,8 @@
1
+ import { query } from "@lookiero/messaging";
2
+ const VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID = "view_is_checkout_enabled_by_customer_id";
3
+ const viewIsCheckoutEnabledByCustomerId = (payload) => ({
4
+ ...query({ name: VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID }),
5
+ ...payload,
6
+ });
7
+ const viewIsCheckoutEnabledByCustomerIdHandler = ({ view }) => async ({ customerId }) => view({ customerId });
8
+ export { VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, viewIsCheckoutEnabledByCustomerId, viewIsCheckoutEnabledByCustomerIdHandler, };
@@ -0,0 +1,28 @@
1
+ import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
+ export interface UiSettingProjection {
3
+ readonly id: string;
4
+ readonly key: string;
5
+ readonly value: unknown;
6
+ }
7
+ export declare const VIEW_UI_SETTING_BY_KEY = "view_ui_setting_by_key";
8
+ interface ViewUiSettingByKeyPayload {
9
+ readonly key: string;
10
+ }
11
+ interface ViewUiSettingByKey extends Query<typeof VIEW_UI_SETTING_BY_KEY>, ViewUiSettingByKeyPayload {
12
+ }
13
+ interface ViewUiSettingByKeyFunction {
14
+ (payload: ViewUiSettingByKeyPayload): ViewUiSettingByKey;
15
+ }
16
+ declare type ViewUiSettingByKeyResult = UiSettingProjection | undefined;
17
+ interface UiSettingByKeyViewArgs {
18
+ readonly key: string;
19
+ }
20
+ export interface UiSettingByKeyView {
21
+ (args: UiSettingByKeyViewArgs): Promise<ViewUiSettingByKeyResult>;
22
+ }
23
+ interface ViewUiSettingByKeyHandlerFunctionArgs extends QueryHandlerFunctionArgs {
24
+ readonly view: UiSettingByKeyView;
25
+ }
26
+ export declare const viewUiSettingByKey: ViewUiSettingByKeyFunction;
27
+ export declare const viewUiSettingByKeyHandler: QueryHandlerFunction<ViewUiSettingByKey, ViewUiSettingByKeyResult, ViewUiSettingByKeyHandlerFunctionArgs>;
28
+ export {};
@@ -0,0 +1,7 @@
1
+ import { query } from "@lookiero/messaging";
2
+ export const VIEW_UI_SETTING_BY_KEY = "view_ui_setting_by_key";
3
+ export const viewUiSettingByKey = (payload) => ({
4
+ ...query({ name: VIEW_UI_SETTING_BY_KEY }),
5
+ ...payload,
6
+ });
7
+ export const viewUiSettingByKeyHandler = ({ view }) => async ({ key }) => view({ key });
package/jest.config.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ preset: "jest-expo",
3
+ transformIgnorePatterns: [
4
+ "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@lookiero/messaging|@lookiero/messaging-react|@lookiero/i18n|@lookiero/i18n-react|react-router-native)",
5
+ ],
6
+ coveragePathIgnorePatterns: ["<rootDir>/src/infrastructure/ui/test/"],
7
+ testPathIgnorePatterns: ["<rootDir>/dist/"],
8
+ setupFiles: ["<rootDir>/jest.setup.js"],
9
+ };
package/jest.setup.js ADDED
@@ -0,0 +1,3 @@
1
+ import mockAsyncStorage from "@react-native-async-storage/async-storage/jest/async-storage-mock";
2
+
3
+ jest.mock("@react-native-async-storage/async-storage", () => mockAsyncStorage);
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@lookiero/checkout",
3
+ "version": "0.1.1",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "engines": {
7
+ "node": ">=14.19.3"
8
+ },
9
+ "scripts": {
10
+ "start": "expo start",
11
+ "android": "expo start --android",
12
+ "ios": "expo start --ios",
13
+ "web": "expo start --web",
14
+ "build": "tsc -b tsconfig.build.json",
15
+ "lint": "eslint --fix --cache --cache-location ./node_modules/.cache/.eslintcache --ext ts,tsx .",
16
+ "format": "prettier --write \"**/*.+(json|css|ts|tsx|md)\"",
17
+ "test": "jest",
18
+ "test:coverage": "jest --coverage --coverageReporters=text --detectOpenHandles --forceExit --silent",
19
+ "publish": "npm publish"
20
+ },
21
+ "dependencies": {
22
+ "@lookiero/i18n": "^0.6.1",
23
+ "@lookiero/i18n-react": "^0.6.1",
24
+ "@lookiero/messaging": "^6.2.1",
25
+ "@lookiero/messaging-react": "^6.2.1",
26
+ "react-router-dom": "^6.3.0",
27
+ "react-router-native": "^6.3.0",
28
+ "uuid": "^9.0.0"
29
+ },
30
+ "peerDependencies": {
31
+ "@lookiero/aurora-next": "^3.0.181",
32
+ "react": "^18.0.0",
33
+ "react-dom": "^18.0.0",
34
+ "react-native": "^0.69.4",
35
+ "react-native-web": "^0.18.7"
36
+ },
37
+ "devDependencies": {
38
+ "@babel/core": "^7.12.9",
39
+ "@expo/webpack-config": "^0.17.2",
40
+ "@lookiero/aurora-fonts": "^1.0.6",
41
+ "@lookiero/aurora-iconfont": "^2.0.37",
42
+ "@lookiero/aurora-next": "^3.0.181",
43
+ "@testing-library/react": "^13.3.0",
44
+ "@testing-library/react-hooks": "^8.0.1",
45
+ "@testing-library/react-native": "^11.0.0",
46
+ "@types/jest": "^28.1.7",
47
+ "@types/react": "~18.0.0",
48
+ "@types/react-dom": "~18.0.0",
49
+ "@types/react-native": "~0.69.1",
50
+ "@types/uuid": "^8.3.4",
51
+ "eslint": "^8.22.0",
52
+ "eslint-config-prettier": "^8.5.0",
53
+ "eslint-config-react-app": "^7.0.1",
54
+ "eslint-plugin-flowtype": "^8.0.3",
55
+ "eslint-plugin-import": "^2.26.0",
56
+ "eslint-plugin-jsx-a11y": "^6.6.1",
57
+ "eslint-plugin-prettier": "^4.2.1",
58
+ "eslint-plugin-react": "^7.30.1",
59
+ "eslint-plugin-react-hooks": "^4.6.0",
60
+ "expo": "~46.0.8",
61
+ "expo-status-bar": "~1.4.0",
62
+ "husky": "^8.0.1",
63
+ "jest": "^26.6.3",
64
+ "jest-expo": "^46.0.1",
65
+ "jest-mock-extended": "^2.0.7",
66
+ "lint-staged": "^13.0.3",
67
+ "prettier": "^2.7.1",
68
+ "react": "^18.0.0",
69
+ "react-dom": "^18.0.0",
70
+ "react-native": "^0.69.4",
71
+ "react-native-web": "^0.18.7",
72
+ "react-test-renderer": "^18.0.0",
73
+ "typescript": "^4.6.3"
74
+ }
75
+ }
package/src/Expo.tsx ADDED
@@ -0,0 +1,59 @@
1
+ import { Aurora } from "@lookiero/aurora-next/build/components/primitives/Aurora/Aurora";
2
+ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
3
+ import { useFonts } from "expo-font";
4
+ import { activateKeepAwake } from "expo-keep-awake";
5
+ import withExpoRoot from "expo/build/launch/withExpoRoot";
6
+ import { useCallback, useState } from "react";
7
+ import { createRoot } from "react-dom/client";
8
+ import { AppRegistry, Platform, StatusBar } from "react-native";
9
+ // import { bootstrap as checkoutMockBootstrap } from "./infrastructure/delivery/_mock/bootstrap.mock";
10
+ import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
11
+ import { root } from "./infrastructure/ui/Root";
12
+
13
+ const apiUrl = Platform.OS === "web" ? "/local-to-dev" : "https://web2.ps.dev.aws.lookiero.es/checkout/api";
14
+ const authToken =
15
+ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIwOTUxNjAsImV4cCI6MTY2NTEzMzQxMywiZGlzcGxheU5hbWUiOiJBbGV4YW5kZXIiLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0wOS0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiJjZjdjNjQxZi0wZTVjLTQ4NTAtYWUwNy0yNzY3NDdlZGZkMGIiLCJpYXQiOjE2NjI1NDE0MTN9.v17FPhySnvKPjOYiZumdcy-pVQO-F_PHjWSY-tnk2xU";
16
+
17
+ // const { Component: Messaging } = checkoutMockBootstrap();
18
+ const { Component: Messaging } = checkoutBootstrap({ apiUrl, getAuthToken: () => authToken });
19
+ const Root = root({ Messaging });
20
+
21
+ const ExpoRoot = () => {
22
+ const [fontsLoaded] = useFonts({
23
+ ["Romie-Regular"]: require("@lookiero/aurora-fonts/Romie-Regular.ttf"),
24
+ ["FoundersGroteskText-Regular"]: require("@lookiero/aurora-fonts/FoundersGroteskText-Regular.ttf"),
25
+ auroraicons: require("@lookiero/aurora-iconfont/dist/auroraicons.ttf"),
26
+ });
27
+
28
+ const [isAccessible, setIsAccessible] = useState<boolean>();
29
+ const onNotAccessible = useCallback(() => setIsAccessible(false), []);
30
+
31
+ return fontsLoaded ? (
32
+ <>
33
+ <Aurora usePortal={false} useStack={false}>
34
+ {isAccessible === false && <Text heading={true}>Checkout is not accessible!</Text>}
35
+ <Root locale="es" customerId="606d8c89-d4f2-438b-89a8-906e6526992d" onNotAccessible={onNotAccessible} />
36
+ </Aurora>
37
+ <StatusBar />
38
+ </>
39
+ ) : null;
40
+ };
41
+
42
+ if (__DEV__) {
43
+ activateKeepAwake();
44
+ }
45
+
46
+ AppRegistry.registerComponent("main", () => withExpoRoot(ExpoRoot));
47
+
48
+ if ("web" === Platform.OS) {
49
+ const rootElement = document.getElementById("root") ?? document.getElementById("main");
50
+
51
+ if (rootElement) {
52
+ const rootTag = createRoot(rootElement);
53
+ const RootComponent = withExpoRoot(ExpoRoot);
54
+
55
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
56
+ // @ts-ignore
57
+ rootTag.render(<RootComponent />);
58
+ }
59
+ }
@@ -0,0 +1,26 @@
1
+ import { v4 as uuid } from "uuid";
2
+ import {
3
+ bookSizeReplaceableProductVariantsForCheckoutItem as sut,
4
+ BOOK_SIZE_REPLACEABLE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM,
5
+ } from "./bookSizeReplaceableProductVariantsForCheckoutItem";
6
+
7
+ describe("bookSizeReplaceableProductVariantsForCheckoutItem", () => {
8
+ it("returns an BookSizeReplaceableProductVariantsForCheckoutItem command", () => {
9
+ const aggregateId = uuid();
10
+ const checkoutBooking = {
11
+ checkoutId: "this-should-be-a-uuid",
12
+ checkoutItemId: "this-should-be-a-uuid",
13
+ checkoutBookingId: "this-should-be-a-uuid",
14
+ };
15
+
16
+ const command = sut({ aggregateId, ...checkoutBooking });
17
+
18
+ expect(command.aggregateId).toBe(aggregateId);
19
+ expect(command.checkoutId).toBe(checkoutBooking.checkoutId);
20
+ expect(command.checkoutItemId).toBe(checkoutBooking.checkoutItemId);
21
+ expect(command.checkoutBookingId).toBe(checkoutBooking.checkoutBookingId);
22
+ expect(command.name).toBe(BOOK_SIZE_REPLACEABLE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM);
23
+ expect(typeof command.messageId).toBe("string");
24
+ expect(typeof command.occurredOn).toBe("number");
25
+ });
26
+ });
@@ -0,0 +1,27 @@
1
+ import { command, Command } from "@lookiero/messaging";
2
+
3
+ export const BOOK_SIZE_REPLACEABLE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM =
4
+ "book_size_replaceable_product_variants_for_checkout_item";
5
+
6
+ interface BookSizeReplaceableProductVariantsForCheckoutItemPayload {
7
+ readonly aggregateId: string;
8
+ readonly checkoutId: string;
9
+ readonly checkoutItemId: string;
10
+ readonly checkoutBookingId: string;
11
+ }
12
+
13
+ export interface BookSizeReplaceableProductVariantsForCheckoutItem
14
+ extends Command<typeof BOOK_SIZE_REPLACEABLE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM>,
15
+ BookSizeReplaceableProductVariantsForCheckoutItemPayload {}
16
+
17
+ interface BookSizeReplaceableProductVariantsForCheckoutItemFunction {
18
+ (
19
+ payload: BookSizeReplaceableProductVariantsForCheckoutItemPayload,
20
+ ): BookSizeReplaceableProductVariantsForCheckoutItem;
21
+ }
22
+
23
+ export const bookSizeReplaceableProductVariantsForCheckoutItem: BookSizeReplaceableProductVariantsForCheckoutItemFunction =
24
+ ({ aggregateId, ...payload }) => ({
25
+ ...command({ aggregateId, name: BOOK_SIZE_REPLACEABLE_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM }),
26
+ ...payload,
27
+ });
@@ -0,0 +1,30 @@
1
+ import { DomainEvent, QueryBus } from "@lookiero/messaging";
2
+ import { v4 as uuid } from "uuid";
3
+ import { mock } from "jest-mock-extended";
4
+ import { CHECKOUT_BOOKING_BOOKED } from "./checkoutBookingBooked";
5
+ import { bookSizeReplaceableProductVariantsForCheckoutItemHandler as sut } from "./checkoutBooking";
6
+ import { bookSizeReplaceableProductVariantsForCheckoutItem } from "../command/bookSizeReplaceableProductVariantsForCheckoutItem";
7
+
8
+ describe("checkoutBooking", () => {
9
+ const queryBus = mock<QueryBus>();
10
+
11
+ it("bookSizeReplaceableProductVariantsForCheckoutItem publishing CheckoutBookingBooked", async () => {
12
+ const aggregateId = uuid();
13
+ const checkoutBooking = {
14
+ checkoutId: "this-should-be-a-uuid",
15
+ checkoutItemId: "this-should-be-a-uuid",
16
+ checkoutBookingId: "this-should-be-a-uuid",
17
+ };
18
+ const state = { aggregateId, ...checkoutBooking, domainEvents: [] };
19
+
20
+ const command = bookSizeReplaceableProductVariantsForCheckoutItem({ aggregateId, ...checkoutBooking });
21
+
22
+ const aggregateRoot = await sut({ queryBus })({ aggregateRoot: state, command });
23
+
24
+ expect(aggregateRoot.aggregateId).toBe(aggregateId);
25
+ expect(aggregateRoot.checkoutId).toBe(checkoutBooking.checkoutId);
26
+ expect(aggregateRoot.checkoutItemId).toBe(checkoutBooking.checkoutItemId);
27
+ expect(aggregateRoot.checkoutBookingId).toBe(checkoutBooking.checkoutBookingId);
28
+ expect((aggregateRoot.domainEvents as DomainEvent<string>).name).toBe(CHECKOUT_BOOKING_BOOKED);
29
+ });
30
+ });
@@ -0,0 +1,31 @@
1
+ import { AggregateRoot, CommandHandlerFunction } from "@lookiero/messaging";
2
+ import { BookSizeReplaceableProductVariantsForCheckoutItem } from "../command/bookSizeReplaceableProductVariantsForCheckoutItem";
3
+ import { checkoutBookingBooked } from "./checkoutBookingBooked";
4
+
5
+ export interface CheckoutBooking extends AggregateRoot {
6
+ readonly checkoutId: string;
7
+ readonly checkoutItemId: string;
8
+ readonly checkoutBookingId: string;
9
+ }
10
+
11
+ export const bookSizeReplaceableProductVariantsForCheckoutItemHandler: CommandHandlerFunction<
12
+ BookSizeReplaceableProductVariantsForCheckoutItem,
13
+ CheckoutBooking
14
+ > =
15
+ () =>
16
+ async ({ aggregateRoot, command }) => {
17
+ const { aggregateId, checkoutId, checkoutItemId, checkoutBookingId } = command;
18
+
19
+ return {
20
+ ...aggregateRoot,
21
+ checkoutId,
22
+ checkoutItemId,
23
+ checkoutBookingId,
24
+ domainEvents: checkoutBookingBooked({
25
+ aggregateId,
26
+ checkoutId,
27
+ checkoutItemId,
28
+ checkoutBookingId,
29
+ }),
30
+ };
31
+ };
@@ -0,0 +1,23 @@
1
+ import { v4 as uuid } from "uuid";
2
+ import { checkoutBookingBooked as sut, CHECKOUT_BOOKING_BOOKED } from "./checkoutBookingBooked";
3
+
4
+ describe("checkoutBookingBooked", () => {
5
+ it("returns an CheckoutBookingBooked domain event", () => {
6
+ const aggregateId = uuid();
7
+ const checkoutBooking = {
8
+ checkoutId: "this-should-be-a-uuid",
9
+ checkoutItemId: "this-should-be-a-uuid",
10
+ checkoutBookingId: "this-should-be-a-uuid",
11
+ };
12
+
13
+ const domainEvent = sut({ aggregateId, ...checkoutBooking });
14
+
15
+ expect(domainEvent.aggregateId).toBe(aggregateId);
16
+ expect(domainEvent.checkoutId).toBe(checkoutBooking.checkoutId);
17
+ expect(domainEvent.checkoutItemId).toBe(checkoutBooking.checkoutItemId);
18
+ expect(domainEvent.checkoutBookingId).toBe(checkoutBooking.checkoutBookingId);
19
+ expect(domainEvent.name).toBe(CHECKOUT_BOOKING_BOOKED);
20
+ expect(typeof domainEvent.messageId).toBe("string");
21
+ expect(typeof domainEvent.occurredOn).toBe("number");
22
+ });
23
+ });
@@ -0,0 +1,23 @@
1
+ import { domainEvent, DomainEvent } from "@lookiero/messaging";
2
+
3
+ export const CHECKOUT_BOOKING_BOOKED = "checkout_booking_booked";
4
+
5
+ interface CheckoutBookingBookedPayload {
6
+ readonly aggregateId: string;
7
+ readonly checkoutId: string;
8
+ readonly checkoutItemId: string;
9
+ readonly checkoutBookingId: string;
10
+ }
11
+
12
+ export interface CheckoutBookingBooked
13
+ extends DomainEvent<typeof CHECKOUT_BOOKING_BOOKED>,
14
+ CheckoutBookingBookedPayload {}
15
+
16
+ interface CheckoutBookingBookedFunction {
17
+ (payload: CheckoutBookingBookedPayload): CheckoutBookingBooked;
18
+ }
19
+
20
+ export const checkoutBookingBooked: CheckoutBookingBookedFunction = ({ aggregateId, ...payload }) => ({
21
+ ...domainEvent({ aggregateId, name: CHECKOUT_BOOKING_BOOKED }),
22
+ ...payload,
23
+ });
@@ -0,0 +1,6 @@
1
+ import { RepositoryGetFunction, RepositorySaveFunction } from "@lookiero/messaging";
2
+ import { CheckoutBooking } from "./checkoutBooking";
3
+
4
+ export interface CheckoutBookingsGetFunction extends RepositoryGetFunction<CheckoutBooking> {}
5
+
6
+ export interface CheckoutBookingsSaveFunction extends RepositorySaveFunction<CheckoutBooking> {}
@@ -0,0 +1,19 @@
1
+ import { v4 as uuid } from "uuid";
2
+ import { updateUiSetting as sut, UPDATE_UI_SETTING } from "./updateUiSetting";
3
+
4
+ describe("updateUiSetting", () => {
5
+ it("returns an UpdateUiSetting command", () => {
6
+ const aggregateId = uuid();
7
+ const key = "ui_setting_key";
8
+ const value = "ui_setting_value";
9
+
10
+ const command = sut({ aggregateId, key, value });
11
+
12
+ expect(command.aggregateId).toBe(aggregateId);
13
+ expect(command.key).toBe(key);
14
+ expect(command.value).toBe(value);
15
+ expect(command.name).toBe(UPDATE_UI_SETTING);
16
+ expect(typeof command.messageId).toBe("string");
17
+ expect(typeof command.occurredOn).toBe("number");
18
+ });
19
+ });
@@ -0,0 +1,23 @@
1
+ import { command, Command } from "@lookiero/messaging";
2
+
3
+ export const UPDATE_UI_SETTING = "update_ui_setting";
4
+
5
+ interface UpdateUiSettingPayload {
6
+ readonly aggregateId: string;
7
+ readonly key: string;
8
+ readonly value: unknown;
9
+ }
10
+
11
+ export interface UpdateUiSetting extends Command<typeof UPDATE_UI_SETTING>, UpdateUiSettingPayload {}
12
+
13
+ interface UpdateUiSettingFunction {
14
+ (payload: UpdateUiSettingPayload): UpdateUiSetting;
15
+ }
16
+
17
+ export const updateUiSetting: UpdateUiSettingFunction = ({ aggregateId, ...payload }) => ({
18
+ ...command({
19
+ aggregateId,
20
+ name: UPDATE_UI_SETTING,
21
+ }),
22
+ ...payload,
23
+ });
@@ -0,0 +1,26 @@
1
+ import { DomainEvent, QueryBus } from "@lookiero/messaging";
2
+ import { v4 as uuid } from "uuid";
3
+ import { mock } from "jest-mock-extended";
4
+ import { UI_SETTING_UPDATED } from "./uiSettingUpdated";
5
+ import { updateUiSettingHandler as sut } from "./uiSetting";
6
+ import { updateUiSetting } from "../command/updateUiSetting";
7
+
8
+ describe("uiSetting", () => {
9
+ const queryBus = mock<QueryBus>();
10
+
11
+ it("updateUiSetting publishing UiSettingUpdated", async () => {
12
+ const aggregateId = uuid();
13
+ const key = "ui_setting_key";
14
+ const value = "ui_setting_value";
15
+ const state = { aggregateId, key, value, domainEvents: [] };
16
+
17
+ const command = updateUiSetting({ aggregateId, key, value });
18
+
19
+ const aggregateRoot = await sut({ queryBus })({ aggregateRoot: state, command });
20
+
21
+ expect(aggregateRoot.aggregateId).toBe(aggregateId);
22
+ expect(aggregateRoot.key).toBe(key);
23
+ expect(aggregateRoot.value).toBe(value);
24
+ expect((aggregateRoot.domainEvents as DomainEvent<string>).name).toBe(UI_SETTING_UPDATED);
25
+ });
26
+ });
@@ -0,0 +1,22 @@
1
+ import { AggregateRoot } from "@lookiero/messaging";
2
+ import { CommandHandlerFunction } from "@lookiero/messaging/domain/model";
3
+ import { UpdateUiSetting } from "../command/updateUiSetting";
4
+ import { uiSettingUpdated } from "./uiSettingUpdated";
5
+
6
+ export interface UiSetting extends AggregateRoot {
7
+ readonly key: string;
8
+ readonly value: unknown;
9
+ }
10
+
11
+ export const updateUiSettingHandler: CommandHandlerFunction<UpdateUiSetting, UiSetting> =
12
+ () =>
13
+ async ({ aggregateRoot, command }) => {
14
+ const { aggregateId, key, value } = command;
15
+
16
+ return {
17
+ ...aggregateRoot,
18
+ key,
19
+ value,
20
+ domainEvents: uiSettingUpdated({ aggregateId, key }),
21
+ };
22
+ };
@@ -0,0 +1,17 @@
1
+ import { v4 as uuid } from "uuid";
2
+ import { uiSettingUpdated as sut, UI_SETTING_UPDATED } from "./uiSettingUpdated";
3
+
4
+ describe("uiSettingUpdated", () => {
5
+ it("returns an UiSettingUpdated domain event", () => {
6
+ const aggregateId = uuid();
7
+ const key = "ui_setting_key";
8
+
9
+ const domainEvent = sut({ aggregateId, key });
10
+
11
+ expect(domainEvent.aggregateId).toBe(aggregateId);
12
+ expect(domainEvent.key).toBe(key);
13
+ expect(domainEvent.name).toBe(UI_SETTING_UPDATED);
14
+ expect(typeof domainEvent.messageId).toBe("string");
15
+ expect(typeof domainEvent.occurredOn).toBe("number");
16
+ });
17
+ });
@@ -0,0 +1,19 @@
1
+ import { domainEvent, DomainEvent } from "@lookiero/messaging";
2
+
3
+ export const UI_SETTING_UPDATED = "ui_setting_updated";
4
+
5
+ interface UiSettingUpdatedPayload {
6
+ readonly aggregateId: string;
7
+ readonly key: string;
8
+ }
9
+
10
+ export interface UiSettingUpdated extends DomainEvent<typeof UI_SETTING_UPDATED>, UiSettingUpdatedPayload {}
11
+
12
+ interface UiSettingUpdatedFunction {
13
+ (payload: UiSettingUpdatedPayload): UiSettingUpdated;
14
+ }
15
+
16
+ export const uiSettingUpdated: UiSettingUpdatedFunction = ({ aggregateId, key }) => ({
17
+ ...domainEvent({ aggregateId, name: UI_SETTING_UPDATED }),
18
+ key,
19
+ });
@@ -0,0 +1,6 @@
1
+ import { RepositoryGetFunction, RepositorySaveFunction } from "@lookiero/messaging";
2
+ import { UiSetting } from "./uiSetting";
3
+
4
+ export interface UiSettingGetFunction extends RepositoryGetFunction<UiSetting> {}
5
+
6
+ export interface UiSettingSaveFunction extends RepositorySaveFunction<UiSetting> {}
package/src/index.ts ADDED
@@ -0,0 +1,44 @@
1
+ import { FC } from "react";
2
+ import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
3
+ import { root, RootProps } from "./infrastructure/ui/Root";
4
+ import {
5
+ IsCheckoutAccessibleByCustomerIdProjection,
6
+ viewIsCheckoutAccessibleByCustomerId,
7
+ } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
8
+
9
+ interface IsCheckoutAccessibleFunctionArgs {
10
+ readonly customerId: string | undefined;
11
+ }
12
+
13
+ interface IsCheckoutAccessibleFunction {
14
+ (args: IsCheckoutAccessibleFunctionArgs): Promise<IsCheckoutAccessibleByCustomerIdProjection>;
15
+ }
16
+
17
+ interface BootstrapFunctionArgs {
18
+ readonly getAuthToken: () => string;
19
+ readonly apiUrl: string;
20
+ }
21
+
22
+ interface BootstrapFunctionReturn {
23
+ readonly Root: FC<RootProps>;
24
+ readonly isCheckoutAccessible: IsCheckoutAccessibleFunction;
25
+ }
26
+
27
+ interface BootstrapFunction {
28
+ (args: BootstrapFunctionArgs): BootstrapFunctionReturn;
29
+ }
30
+
31
+ const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken }) => {
32
+ const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
33
+ const Root = root({ Messaging });
34
+
35
+ const isCheckoutAccessible: IsCheckoutAccessibleFunction = ({ customerId }) =>
36
+ queryBus(viewIsCheckoutAccessibleByCustomerId({ customerId }));
37
+
38
+ return {
39
+ Root,
40
+ isCheckoutAccessible,
41
+ };
42
+ };
43
+
44
+ export { bootstrap };
@@ -0,0 +1,38 @@
1
+ import { bootstrap as messagingBootstrap, BuildBootstrapFunctionReturn } from "@lookiero/messaging-react";
2
+ import {
3
+ CheckoutItemStatus,
4
+ FirstAvailableCheckoutByCustomerIdView,
5
+ viewFirstAvailableCheckoutByCustomerIdHandler,
6
+ VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID,
7
+ } from "../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
8
+ import {
9
+ viewIsCheckoutAccessibleByCustomerIdHandler,
10
+ VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID,
11
+ } from "../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
12
+ import {
13
+ IsCheckoutEnabledByCustomerIdView,
14
+ viewIsCheckoutEnabledByCustomerIdHandler,
15
+ VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID,
16
+ } from "../../../projection/checkout/viewIsCheckoutEnabledByCustomerId";
17
+ import { startedCheckoutWithItems } from "./checkout.mock";
18
+
19
+ const firstAvailableCheckoutByCustomerIdView: FirstAvailableCheckoutByCustomerIdView = async () =>
20
+ startedCheckoutWithItems({ status: [CheckoutItemStatus.KEPT, CheckoutItemStatus.INITIAL] });
21
+ const isCheckoutEnabledByCustomerIdView: IsCheckoutEnabledByCustomerIdView = async () => true;
22
+
23
+ interface BootstrapFunction {
24
+ (): BuildBootstrapFunctionReturn;
25
+ }
26
+
27
+ const bootstrap: BootstrapFunction = () =>
28
+ messagingBootstrap({ id: "Checkout" })
29
+ .query(VIEW_FIRST_AVAILABLE_CHECKOUT_BY_CUSTOMER_ID, viewFirstAvailableCheckoutByCustomerIdHandler, {
30
+ view: firstAvailableCheckoutByCustomerIdView,
31
+ })
32
+ .query(VIEW_IS_CHECKOUT_ENABLED_BY_CUSTOMER_ID, viewIsCheckoutEnabledByCustomerIdHandler, {
33
+ view: isCheckoutEnabledByCustomerIdView,
34
+ })
35
+ .query(VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerIdHandler, {})
36
+ .build();
37
+
38
+ export { bootstrap };