@lookiero/checkout 0.8.17 → 0.8.19-beta.0

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 (137) hide show
  1. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +13 -0
  2. package/dist/domain/checkout/command/markCheckoutAsPaid.js +4 -0
  3. package/dist/domain/checkout/event/createModalNotificationWhenCheckoutSubmitted.d.ts +7 -0
  4. package/dist/domain/checkout/event/createModalNotificationWhenCheckoutSubmitted.js +12 -0
  5. package/dist/domain/checkout/model/checkoutPaid.d.ts +13 -0
  6. package/dist/domain/checkout/model/checkoutPaid.js +4 -0
  7. package/dist/domain/checkoutBooking/event/createToastNotificationWhenCheckoutBookingExpired.d.ts +7 -0
  8. package/dist/domain/checkoutBooking/event/createToastNotificationWhenCheckoutBookingExpired.js +13 -0
  9. package/dist/domain/checkoutItem/event/createModalNotificationWhenCheckoutItemReplaced.d.ts +7 -0
  10. package/dist/domain/checkoutItem/event/createModalNotificationWhenCheckoutItemReplaced.js +12 -0
  11. package/dist/domain/checkoutItem/model/checkoutItem.js +1 -0
  12. package/dist/index.d.ts +2 -1
  13. package/dist/index.js +2 -1
  14. package/dist/infrastructure/delivery/baseBootstrap.js +8 -2
  15. package/dist/infrastructure/delivery/mock/checkoutDataSource.js +4 -1
  16. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +5 -0
  17. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +13 -0
  18. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +13 -0
  19. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +16 -0
  20. package/dist/infrastructure/domain/checkout/react/useSubmitCheckout.js +2 -2
  21. package/dist/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +2 -2
  22. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +13 -0
  23. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +14 -0
  24. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem.js +2 -2
  25. package/dist/infrastructure/domain/checkoutFeedback/react/useGiveCheckoutFeedback.js +2 -2
  26. package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.js +3 -5
  27. package/dist/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.js +3 -6
  28. package/dist/infrastructure/domain/checkoutItem/react/useResetCheckoutItem.js +3 -5
  29. package/dist/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.js +3 -6
  30. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +10 -0
  31. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +11 -0
  32. package/dist/infrastructure/projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem.js +4 -1
  33. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +12 -0
  34. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +9 -0
  35. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +10 -0
  36. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +12 -0
  37. package/dist/infrastructure/projection/checkout/react/useViewFiveItemsDiscountByCustomerId.js +1 -1
  38. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +12 -0
  39. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +9 -0
  40. package/dist/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.js +1 -1
  41. package/dist/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +6 -1
  42. package/dist/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +6 -1
  43. package/dist/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.js +1 -1
  44. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +6 -0
  45. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +7 -0
  46. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +6 -0
  47. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +9 -0
  48. package/dist/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +2 -2
  49. package/dist/infrastructure/ui/hooks/useSubmitCheckout.js +2 -2
  50. package/dist/infrastructure/ui/i18n/translationEndpoint.d.ts +10 -1
  51. package/dist/infrastructure/ui/i18n/translationEndpoint.js +19 -1
  52. package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +54 -36
  53. package/dist/infrastructure/ui/routing/Routing.js +1 -7
  54. package/dist/infrastructure/ui/views/App.js +4 -4
  55. package/dist/infrastructure/ui/views/App.style.d.ts +4 -0
  56. package/dist/infrastructure/ui/views/App.style.js +16 -0
  57. package/dist/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +3 -7
  58. package/dist/infrastructure/ui/views/feedback/Feedback.js +10 -3
  59. package/dist/infrastructure/ui/views/header/Header.d.ts +15 -0
  60. package/dist/infrastructure/ui/views/header/Header.js +90 -0
  61. package/dist/infrastructure/ui/views/header/Header.style.d.ts +35 -0
  62. package/dist/infrastructure/ui/views/header/Header.style.js +38 -0
  63. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +7 -0
  64. package/dist/infrastructure/ui/views/header/components/Logo.js +11 -0
  65. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +7 -0
  66. package/dist/infrastructure/ui/views/header/components/Logo.style.js +8 -0
  67. package/dist/infrastructure/ui/views/intro/Intro.d.ts +6 -0
  68. package/dist/infrastructure/ui/views/intro/Intro.js +52 -0
  69. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +55 -0
  70. package/dist/infrastructure/ui/views/intro/Intro.style.js +58 -0
  71. package/dist/infrastructure/ui/views/item/Item.js +9 -53
  72. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.d.ts +1 -0
  73. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +10 -4
  74. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.d.ts +8 -1
  75. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.js +8 -1
  76. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +10 -0
  77. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +1 -0
  78. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +25 -0
  79. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +8 -0
  80. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +25 -0
  81. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +8 -0
  82. package/dist/projection/shared/country.d.ts +10 -10
  83. package/dist/projection/shared/locale.d.ts +11 -0
  84. package/dist/projection/shared/locale.js +12 -0
  85. package/dist/shared/logging/location.d.ts +3 -0
  86. package/dist/shared/logging/location.js +5 -0
  87. package/dist/shared/logging/matchRoutes.d.ts +3 -0
  88. package/dist/shared/logging/matchRoutes.js +7 -0
  89. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +29 -0
  90. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +134 -0
  91. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +22 -0
  92. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +15 -0
  93. package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +27 -0
  94. package/dist/shared/logging/reactRouterV6Instrumentation.native.js +115 -0
  95. package/dist/shared/notifications/domain/notification/command/createModalNotification.d.ts +18 -0
  96. package/dist/shared/notifications/domain/notification/command/createModalNotification.js +9 -0
  97. package/dist/shared/notifications/domain/notification/command/createToastNotification.d.ts +18 -0
  98. package/dist/shared/notifications/domain/notification/command/createToastNotification.js +9 -0
  99. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +1 -0
  100. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +9 -0
  101. package/dist/shared/notifications/domain/notification/model/notification.d.ts +11 -4
  102. package/dist/shared/notifications/domain/notification/model/notification.js +20 -4
  103. package/dist/shared/notifications/index.d.ts +3 -2
  104. package/dist/shared/notifications/index.js +3 -2
  105. package/dist/shared/notifications/infrastructure/delivery/bootstrap.js +7 -4
  106. package/dist/shared/notifications/infrastructure/domain/notification/model/storageNotifications.js +3 -1
  107. package/dist/shared/notifications/infrastructure/domain/notification/model/storageNotificationsCreate.d.ts +1 -1
  108. package/dist/shared/notifications/infrastructure/domain/notification/model/storageNotificationsCreate.js +3 -1
  109. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateModalNotification.d.ts +20 -0
  110. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateModalNotification.js +22 -0
  111. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateToastNotification.d.ts +21 -0
  112. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateToastNotification.js +22 -0
  113. package/dist/shared/notifications/infrastructure/persistence/notificationDto.d.ts +3 -1
  114. package/dist/shared/notifications/infrastructure/projection/notification/notification.d.ts +2 -2
  115. package/dist/shared/notifications/infrastructure/projection/notification/notification.js +16 -6
  116. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.d.ts +10 -0
  117. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +26 -0
  118. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.d.ts +16 -0
  119. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.js +19 -0
  120. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotifications.d.ts +8 -0
  121. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotifications.js +6 -0
  122. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotifications.style.d.ts +25 -0
  123. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotifications.style.js +18 -0
  124. package/dist/shared/notifications/infrastructure/ui/components/toastNotifications/ToastNotificationItem.d.ts +12 -0
  125. package/dist/shared/notifications/infrastructure/ui/components/toastNotifications/ToastNotificationItem.js +24 -0
  126. package/dist/shared/notifications/infrastructure/ui/components/toastNotifications/ToastNotifications.d.ts +9 -0
  127. package/dist/shared/notifications/infrastructure/ui/components/toastNotifications/ToastNotifications.js +20 -0
  128. package/dist/shared/notifications/infrastructure/ui/components/toastNotifications/ToastNotifications.style.d.ts +36 -0
  129. package/dist/shared/notifications/infrastructure/ui/components/toastNotifications/ToastNotifications.style.js +31 -0
  130. package/dist/shared/notifications/infrastructure/ui/views/Notifications.js +9 -3
  131. package/dist/shared/notifications/projection/notification/notification.d.ts +18 -2
  132. package/dist/shared/notifications/projection/notification/notification.js +8 -1
  133. package/dist/shared/ui/components/atoms/spinner/Spinner.d.ts +6 -1
  134. package/dist/shared/ui/components/atoms/spinner/Spinner.js +2 -2
  135. package/dist/shared/ui/components/layouts/modal/Modal.d.ts +1 -0
  136. package/dist/shared/ui/components/layouts/modal/Modal.js +2 -2
  137. package/package.json +7 -5
@@ -0,0 +1,13 @@
1
+ import { Command } from "@lookiero/messaging";
2
+ declare const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
+ interface MarkCheckoutAsPaidPayload {
4
+ readonly aggregateId: string;
5
+ }
6
+ interface MarkCheckoutAsPaid extends Command<typeof MARK_CHECKOUT_AS_PAID>, MarkCheckoutAsPaidPayload {
7
+ }
8
+ interface MarkCheckoutAsPaidFunction {
9
+ (payload: MarkCheckoutAsPaidPayload): MarkCheckoutAsPaid;
10
+ }
11
+ declare const markCheckoutAsPaid: MarkCheckoutAsPaidFunction;
12
+ export type { MarkCheckoutAsPaid };
13
+ export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -0,0 +1,4 @@
1
+ import { command } from "@lookiero/messaging";
2
+ const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
+ const markCheckoutAsPaid = ({ aggregateId }) => command({ aggregateId, name: MARK_CHECKOUT_AS_PAID });
4
+ export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -0,0 +1,7 @@
1
+ import { ProcessManagerFunction } from "@lookiero/messaging";
2
+ import { CheckoutSubmitted } from "../model/checkoutSubmitted";
3
+ declare const CHECKOUT_SUCCESS_NOTIFICATION_ID = "fa25dcdd-9f5d-4760-9e6f-27174205b1fa";
4
+ interface CreateModalNotificationWhenCheckoutSubmittedFunction extends ProcessManagerFunction<CheckoutSubmitted> {
5
+ }
6
+ declare const createModalNotificationWhenCheckoutSubmitted: CreateModalNotificationWhenCheckoutSubmittedFunction;
7
+ export { createModalNotificationWhenCheckoutSubmitted, CHECKOUT_SUCCESS_NOTIFICATION_ID };
@@ -0,0 +1,12 @@
1
+ import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
2
+ import { createModalNotification } from "../../../shared/notifications/domain/notification/command/createModalNotification";
3
+ const CHECKOUT_SUCCESS_NOTIFICATION_ID = "fa25dcdd-9f5d-4760-9e6f-27174205b1fa";
4
+ const createModalNotificationWhenCheckoutSubmitted = ({ commandBus }) => async () => {
5
+ await commandBus(createModalNotification({
6
+ aggregateId: CHECKOUT_SUCCESS_NOTIFICATION_ID,
7
+ titleI18nKey: I18nMessages.CHECKOUT_SUCCESS_MODAL_TITLE,
8
+ bodyI18nKey: I18nMessages.CHECKOUT_SUCCESS_MODAL_DESCRIPTION,
9
+ acceptI18nKey: I18nMessages.CHECKOUT_SUCCESS_MODAL_BUTTON,
10
+ }));
11
+ };
12
+ export { createModalNotificationWhenCheckoutSubmitted, CHECKOUT_SUCCESS_NOTIFICATION_ID };
@@ -0,0 +1,13 @@
1
+ import { DomainEvent } from "@lookiero/messaging";
2
+ declare const CHECKOUT_PAID = "checkout_paid";
3
+ interface CheckoutPaidPayload {
4
+ readonly aggregateId: string;
5
+ }
6
+ interface CheckoutPaid extends DomainEvent<typeof CHECKOUT_PAID>, CheckoutPaidPayload {
7
+ }
8
+ interface CheckoutPaidFunction {
9
+ (payload: CheckoutPaidPayload): CheckoutPaid;
10
+ }
11
+ declare const checkoutPaid: CheckoutPaidFunction;
12
+ export type { CheckoutPaid };
13
+ export { CHECKOUT_PAID, checkoutPaid };
@@ -0,0 +1,4 @@
1
+ import { domainEvent } from "@lookiero/messaging";
2
+ const CHECKOUT_PAID = "checkout_paid";
3
+ const checkoutPaid = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_PAID });
4
+ export { CHECKOUT_PAID, checkoutPaid };
@@ -0,0 +1,7 @@
1
+ import { ProcessManagerFunction } from "@lookiero/messaging";
2
+ import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
3
+ declare const CHECKOUT_BOOKING_EXPIRED_NOTIFICATION_ID = "d423934e-2499-46ab-8cfb-39e1e398237e";
4
+ interface CreateToastNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
5
+ }
6
+ declare const createToastNotificationWhenCheckoutBookingExpired: CreateToastNotificationWhenCheckoutBookingExpiredFunction;
7
+ export { createToastNotificationWhenCheckoutBookingExpired, CHECKOUT_BOOKING_EXPIRED_NOTIFICATION_ID };
@@ -0,0 +1,13 @@
1
+ import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
2
+ import { createToastNotification } from "../../../shared/notifications/domain/notification/command/createToastNotification";
3
+ import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
4
+ const CHECKOUT_BOOKING_EXPIRED_NOTIFICATION_ID = "d423934e-2499-46ab-8cfb-39e1e398237e";
5
+ const createToastNotificationWhenCheckoutBookingExpired = ({ commandBus }) => async () => {
6
+ await commandBus(createToastNotification({
7
+ aggregateId: CHECKOUT_BOOKING_EXPIRED_NOTIFICATION_ID,
8
+ level: NotificationLevel.ERROR,
9
+ titleI18nKey: undefined,
10
+ bodyI18nKey: I18nMessages.CHECKOUT_TOAST_BOOKING_EXPIRED,
11
+ }));
12
+ };
13
+ export { createToastNotificationWhenCheckoutBookingExpired, CHECKOUT_BOOKING_EXPIRED_NOTIFICATION_ID };
@@ -0,0 +1,7 @@
1
+ import { ProcessManagerFunction } from "@lookiero/messaging";
2
+ import { CheckoutItemReplaced } from "../model/checkoutItemReplaced";
3
+ declare const SIZE_CHANGE_NOTIFICATION_ID = "ce89b8b2-e025-4b54-8cdc-52520dc3dd23";
4
+ interface CreateModalNotificationWhenCheckoutItemReplacedFunction extends ProcessManagerFunction<CheckoutItemReplaced> {
5
+ }
6
+ declare const createModalNotificationWhenCheckoutItemReplaced: CreateModalNotificationWhenCheckoutItemReplacedFunction;
7
+ export { createModalNotificationWhenCheckoutItemReplaced, SIZE_CHANGE_NOTIFICATION_ID };
@@ -0,0 +1,12 @@
1
+ import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
2
+ import { createModalNotification } from "../../../shared/notifications/domain/notification/command/createModalNotification";
3
+ const SIZE_CHANGE_NOTIFICATION_ID = "ce89b8b2-e025-4b54-8cdc-52520dc3dd23";
4
+ const createModalNotificationWhenCheckoutItemReplaced = ({ commandBus }) => async () => {
5
+ await commandBus(createModalNotification({
6
+ aggregateId: SIZE_CHANGE_NOTIFICATION_ID,
7
+ titleI18nKey: I18nMessages.SIZE_CHANGE_MODAL_TITLE,
8
+ bodyI18nKey: I18nMessages.SIZE_CHANGE_MODAL_DESCRIPTION,
9
+ acceptI18nKey: I18nMessages.SIZE_CHANGE_MODAL_BUTTON,
10
+ }));
11
+ };
12
+ export { createModalNotificationWhenCheckoutItemReplaced, SIZE_CHANGE_NOTIFICATION_ID };
@@ -39,6 +39,7 @@ const resetCheckoutItemHandler = () => async ({ aggregateRoot, command }) => {
39
39
  const { aggregateId } = command;
40
40
  return {
41
41
  ...aggregateRoot,
42
+ status: CheckoutItemStatus.INITIAL,
42
43
  domainEvents: [checkoutItemReset({ aggregateId })],
43
44
  };
44
45
  };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { EndpointFunction } from "@lookiero/i18n";
2
2
  import { ComponentType } from "react";
3
3
  import { CheckoutStatus } from "./domain/checkout/model/checkout";
4
4
  import { RootProps } from "./infrastructure/ui/Root";
5
+ import { translationEndpoint, translationExternalEndpoint } from "./infrastructure/ui/i18n/translationEndpoint";
5
6
  import { CheckoutProjection } from "./projection/checkout/checkout";
6
7
  import { IsCheckoutAccessibleByCustomerIdProjection } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
7
8
  import { SentryLoggerFunctionArgs } from "./shared/logging/SentryLogger";
@@ -32,4 +33,4 @@ interface BootstrapFunction {
32
33
  (args: BootstrapFunctionArgs): BootstrapFunctionReturn;
33
34
  }
34
35
  declare const bootstrap: BootstrapFunction;
35
- export { bootstrap, CheckoutStatus };
36
+ export { bootstrap, translationEndpoint, translationExternalEndpoint, CheckoutStatus };
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import { CheckoutStatus } from "./domain/checkout/model/checkout";
3
3
  import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
4
4
  import { root } from "./infrastructure/ui/Root";
5
5
  import { fetchTranslations } from "./infrastructure/ui/i18n/fetchTranslations";
6
+ import { translationEndpoint, translationExternalEndpoint } from "./infrastructure/ui/i18n/translationEndpoint";
6
7
  import { viewFirstAvailableCheckoutByCustomerId } from "./projection/checkout/viewFirstAvailableCheckoutByCustomerId";
7
8
  import { viewIsCheckoutAccessibleByCustomerId, } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
8
9
  const bootstrap = ({ apiUrl, getAuthToken, translations, sentry }) => {
@@ -20,4 +21,4 @@ const bootstrap = ({ apiUrl, getAuthToken, translations, sentry }) => {
20
21
  firstAvailableCheckoutByCustomerId,
21
22
  };
22
23
  };
23
- export { bootstrap, CheckoutStatus };
24
+ export { bootstrap, translationEndpoint, translationExternalEndpoint, CheckoutStatus };
@@ -1,10 +1,12 @@
1
1
  import { bootstrap as messagingBootstrap } from "@lookiero/messaging-react";
2
2
  import { START_CHECKOUT } from "../../domain/checkout/command/startCheckout";
3
3
  import { SUBMIT_CHECKOUT } from "../../domain/checkout/command/submitCheckout";
4
+ import { createModalNotificationWhenCheckoutSubmitted } from "../../domain/checkout/event/createModalNotificationWhenCheckoutSubmitted";
4
5
  import { submitCheckoutHandler, startCheckoutHandler } from "../../domain/checkout/model/checkout";
6
+ import { CHECKOUT_SUBMITTED } from "../../domain/checkout/model/checkoutSubmitted";
5
7
  import { BLOCK_CHECKOUT_BOOKING } from "../../domain/checkoutBooking/command/blockCheckoutBooking";
6
8
  import { BOOK_CHECKOUT_BOOKING_FOR_CHECKOUT_ITEM } from "../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
7
- import { createNotificationWhenCheckoutBookingExpired } from "../../domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired";
9
+ import { createToastNotificationWhenCheckoutBookingExpired } from "../../domain/checkoutBooking/event/createToastNotificationWhenCheckoutBookingExpired";
8
10
  import { blockCheckoutBookingHandler, bookCheckoutBookingForCheckoutItemHandler, } from "../../domain/checkoutBooking/model/checkoutBooking";
9
11
  import { CHECKOUT_BOOKING_EXPIRED } from "../../domain/checkoutBooking/model/checkoutBookingExpired";
10
12
  import { GIVE_CHECKOUT_FEEDBACK } from "../../domain/checkoutFeedback/command/giveCheckoutFeedback";
@@ -13,7 +15,9 @@ import { KEEP_CHECKOUT_ITEM } from "../../domain/checkoutItem/command/keepChecko
13
15
  import { REPLACE_CHECKOUT_ITEM } from "../../domain/checkoutItem/command/replaceCheckoutItem";
14
16
  import { RESET_CHECKOUT_ITEM } from "../../domain/checkoutItem/command/resetCheckoutItem";
15
17
  import { RETURN_CHECKOUT_ITEM } from "../../domain/checkoutItem/command/returnCheckoutItem";
18
+ import { createModalNotificationWhenCheckoutItemReplaced } from "../../domain/checkoutItem/event/createModalNotificationWhenCheckoutItemReplaced";
16
19
  import { keepCheckoutItemHandler, replaceCheckoutItemHandler, resetCheckoutItemHandler, returnCheckoutItemHandler, } from "../../domain/checkoutItem/model/checkoutItem";
20
+ import { CHECKOUT_ITEM_REPLACED } from "../../domain/checkoutItem/model/checkoutItemReplaced";
17
21
  import { UPDATE_UI_SETTING } from "../../domain/uiSetting/command/updateUiSetting";
18
22
  import { updateUiSettingHandler } from "../../domain/uiSetting/model/uiSetting";
19
23
  import { viewBookedProductsVariantsForCheckoutItemHandler, VIEW_BOOKED_PRODUCT_VARIANTS_FOR_CHECKOUT_ITEM, } from "../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
@@ -81,7 +85,9 @@ const baseBootstrap = ({ checkoutByIdView, firstAvailableCheckoutByCustomerIdVie
81
85
  view: uiSettingByKeyView,
82
86
  })
83
87
  .command(UPDATE_UI_SETTING, updateUiSettingHandler)(getUiSetting, saveUiSetting, ...uiSettingsDependencies)
84
- .processManager(CHECKOUT_BOOKING_EXPIRED, createNotificationWhenCheckoutBookingExpired);
88
+ .processManager(CHECKOUT_BOOKING_EXPIRED, createToastNotificationWhenCheckoutBookingExpired)
89
+ .processManager(CHECKOUT_ITEM_REPLACED, createModalNotificationWhenCheckoutItemReplaced)
90
+ .processManager(CHECKOUT_SUBMITTED, createModalNotificationWhenCheckoutSubmitted);
85
91
  messaging = bootstrapNotifications({ messaging, storage: inMemoryStorageNotifications() });
86
92
  return messaging.build();
87
93
  };
@@ -6,7 +6,10 @@ const checkoutDataSource = ({ data: initialData }) => {
6
6
  };
7
7
  const getCheckoutItem = (id) => data.items.find((item) => item.id === id) || null;
8
8
  const saveCheckoutItem = (checkoutItem) => {
9
- data = { ...data, items: data.items.map((item) => (item.id === checkoutItem.id ? checkoutItem : item)) };
9
+ data = {
10
+ ...data,
11
+ items: data.items.map((item) => item.id === checkoutItem.id ? { ...checkoutItem, productVariant: item.productVariant } : item),
12
+ };
10
13
  };
11
14
  return {
12
15
  getCheckout,
@@ -0,0 +1,5 @@
1
+ import { HttpCheckoutsSaveFunction } from "./httpCheckouts";
2
+ interface HttpCheckoutsMarkAsPaidFunction extends HttpCheckoutsSaveFunction {
3
+ }
4
+ declare const httpCheckoutsMarkAsPaid: HttpCheckoutsMarkAsPaidFunction;
5
+ export { httpCheckoutsMarkAsPaid };
@@ -0,0 +1,13 @@
1
+ import { CHECKOUT_PAID } from "../../../../domain/checkout/model/checkoutPaid";
2
+ const isCheckoutPaid = (event) => event.name === CHECKOUT_PAID;
3
+ const httpCheckoutsMarkAsPaid = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
4
+ const checkoutPaid = domainEvents.find(isCheckoutPaid);
5
+ if (!checkoutPaid) {
6
+ return;
7
+ }
8
+ await httpPost({
9
+ endpoint: "/mark-checkout-as-paid",
10
+ body: { checkoutId: aggregateId },
11
+ });
12
+ };
13
+ export { httpCheckoutsMarkAsPaid };
@@ -0,0 +1,13 @@
1
+ import { CommandStatus } from "@lookiero/messaging-react";
2
+ interface MarkAsPaidFunction {
3
+ (): Promise<void>;
4
+ }
5
+ type UseMarkCheckoutAsPaid = [markAsPaid: MarkAsPaidFunction, status: CommandStatus];
6
+ interface UseMarkCheckoutAsPaidFunctionArgs {
7
+ readonly checkoutId?: string;
8
+ }
9
+ interface UseMarkCheckoutAsPaidFunction {
10
+ (args: UseMarkCheckoutAsPaidFunctionArgs): UseMarkCheckoutAsPaid;
11
+ }
12
+ declare const useMarkCheckoutAsPaid: UseMarkCheckoutAsPaidFunction;
13
+ export { useMarkCheckoutAsPaid };
@@ -0,0 +1,16 @@
1
+ import { useCommand } from "@lookiero/messaging-react";
2
+ import { useCallback } from "react";
3
+ import invariant from "tiny-invariant";
4
+ import { markCheckoutAsPaid } from "../../../../domain/checkout/command/markCheckoutAsPaid";
5
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
+ const useMarkCheckoutAsPaid = ({ checkoutId }) => {
7
+ const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
+ const markAsPaid = useCallback(() => {
9
+ invariant(checkoutId, "CheckoutId must be defined in order to mark the checkout as paid");
10
+ return commandBus(markCheckoutAsPaid({
11
+ aggregateId: checkoutId,
12
+ }));
13
+ }, [checkoutId, commandBus]);
14
+ return [markAsPaid, status];
15
+ };
16
+ export { useMarkCheckoutAsPaid };
@@ -2,13 +2,13 @@ import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import invariant from "tiny-invariant";
4
4
  import { submitCheckout } from "../../../../domain/checkout/command/submitCheckout";
5
- import { useCreateNotification } from "../../../../shared/notifications";
5
+ import { useCreateToastNotification } from "../../../../shared/notifications";
6
6
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
7
7
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
8
8
  import { I18nMessages } from "../../../ui/i18n/i18n";
9
9
  const useSubmitCheckout = ({ checkoutId, logger }) => {
10
10
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
11
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
12
12
  const submit = useCallback(async () => {
13
13
  invariant(checkoutId, "CheckoutId must be defined in order to submit checkout");
14
14
  try {
@@ -1,13 +1,13 @@
1
1
  import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import { blockCheckoutBooking as blockCheckoutBookingCommand } from "../../../../domain/checkoutBooking/command/blockCheckoutBooking";
4
- import { useCreateNotification } from "../../../../shared/notifications";
4
+ import { useCreateToastNotification } from "../../../../shared/notifications";
5
5
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
6
6
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
7
  import { I18nMessages } from "../../../ui/i18n/i18n";
8
8
  const useBlockCheckoutBooking = ({ checkoutBookingId, logger }) => {
9
9
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
10
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
10
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
11
  const blockCheckoutBooking = useCallback(async () => {
12
12
  try {
13
13
  await commandBus(blockCheckoutBookingCommand({
@@ -0,0 +1,13 @@
1
+ import { CommandStatus } from "@lookiero/messaging-react";
2
+ interface BookFunction {
3
+ (): Promise<void>;
4
+ }
5
+ type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
6
+ interface UseBookCheckouBookingForCheckoutItemFunctionArgs {
7
+ readonly checkoutItemId: string;
8
+ }
9
+ interface UseBookCheckouBookingForCheckoutItemFunction {
10
+ (args: UseBookCheckouBookingForCheckoutItemFunctionArgs): UseBookCheckouBookingForCheckoutItem;
11
+ }
12
+ declare const useBookCheckouBookingForCheckoutItem: UseBookCheckouBookingForCheckoutItemFunction;
13
+ export { useBookCheckouBookingForCheckoutItem };
@@ -0,0 +1,14 @@
1
+ import { useCommand } from "@lookiero/messaging-react";
2
+ import { useCallback } from "react";
3
+ import { v4 as uuid } from "uuid";
4
+ import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
5
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
+ const useBookCheckouBookingForCheckoutItem = ({ checkoutItemId }) => {
7
+ const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
+ const book = useCallback(() => commandBus(bookCheckoutBookingForCheckoutItem({
9
+ aggregateId: uuid(),
10
+ checkoutItemId,
11
+ })), [checkoutItemId, commandBus]);
12
+ return [book, status];
13
+ };
14
+ export { useBookCheckouBookingForCheckoutItem };
@@ -2,13 +2,13 @@ import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import { v4 as uuid } from "uuid";
4
4
  import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
5
- import { useCreateNotification } from "../../../../shared/notifications";
5
+ import { useCreateToastNotification } from "../../../../shared/notifications";
6
6
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
7
7
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
8
8
  import { I18nMessages } from "../../../ui/i18n/i18n";
9
9
  const useBookCheckoutBookingForCheckoutItem = ({ checkoutItemId, checkoutBookingId, logger, }) => {
10
10
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
11
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
12
12
  const book = useCallback(async () => {
13
13
  try {
14
14
  await commandBus(bookCheckoutBookingForCheckoutItem({
@@ -1,13 +1,13 @@
1
1
  import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import { giveCheckoutFeedback as giveCheckoutFeedbackCommand } from "../../../../domain/checkoutFeedback/command/giveCheckoutFeedback";
4
- import { useCreateNotification } from "../../../../shared/notifications";
4
+ import { useCreateToastNotification } from "../../../../shared/notifications";
5
5
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
6
6
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
7
  import { I18nMessages } from "../../../ui/i18n/i18n";
8
8
  const useGiveCheckoutFeedback = ({ checkoutId, logger }) => {
9
9
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
10
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
10
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
11
  const giveCheckoutFeedback = useCallback(async ({ feedbacks }) => {
12
12
  try {
13
13
  await commandBus(giveCheckoutFeedbackCommand({
@@ -1,18 +1,16 @@
1
1
  import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import { keepCheckoutItem } from "../../../../domain/checkoutItem/command/keepCheckoutItem";
4
- import { useCreateNotification } from "../../../../shared/notifications";
4
+ import { useCreateToastNotification } from "../../../../shared/notifications";
5
5
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
6
6
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
7
  import { I18nMessages } from "../../../ui/i18n/i18n";
8
8
  const useKeepCheckoutItem = ({ checkoutItemId, logger }) => {
9
9
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
10
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
10
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
11
  const keep = useCallback(async () => {
12
12
  try {
13
- await commandBus(keepCheckoutItem({
14
- aggregateId: checkoutItemId,
15
- }));
13
+ await commandBus(keepCheckoutItem({ aggregateId: checkoutItemId }));
16
14
  }
17
15
  catch (error) {
18
16
  logger.captureException(error);
@@ -1,19 +1,16 @@
1
1
  import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import { replaceCheckoutItem } from "../../../../domain/checkoutItem/command/replaceCheckoutItem";
4
- import { useCreateNotification } from "../../../../shared/notifications";
4
+ import { useCreateToastNotification } from "../../../../shared/notifications";
5
5
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
6
6
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
7
  import { I18nMessages } from "../../../ui/i18n/i18n";
8
8
  const useReplaceCheckoutItem = ({ checkoutItemId, logger }) => {
9
9
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
10
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
10
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
11
  const replace = useCallback(async ({ replacedForId }) => {
12
12
  try {
13
- await commandBus(replaceCheckoutItem({
14
- aggregateId: checkoutItemId,
15
- replacedForId,
16
- }));
13
+ await commandBus(replaceCheckoutItem({ aggregateId: checkoutItemId, replacedForId }));
17
14
  }
18
15
  catch (error) {
19
16
  logger.captureException(error);
@@ -1,18 +1,16 @@
1
1
  import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import { resetCheckoutItem } from "../../../../domain/checkoutItem/command/resetCheckoutItem";
4
- import { useCreateNotification } from "../../../../shared/notifications";
4
+ import { useCreateToastNotification } from "../../../../shared/notifications";
5
5
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
6
6
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
7
  import { I18nMessages } from "../../../ui/i18n/i18n";
8
8
  const useResetCheckoutItem = ({ checkoutItemId, logger }) => {
9
9
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
10
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
10
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
11
  const reset = useCallback(async () => {
12
12
  try {
13
- await commandBus(resetCheckoutItem({
14
- aggregateId: checkoutItemId,
15
- }));
13
+ await commandBus(resetCheckoutItem({ aggregateId: checkoutItemId }));
16
14
  }
17
15
  catch (error) {
18
16
  logger.captureException(error);
@@ -1,19 +1,16 @@
1
1
  import { useCommand } from "@lookiero/messaging-react";
2
2
  import { useCallback } from "react";
3
3
  import { returnCheckoutItem as returnCheckoutItemCommand } from "../../../../domain/checkoutItem/command/returnCheckoutItem";
4
- import { useCreateNotification } from "../../../../shared/notifications";
4
+ import { useCreateToastNotification } from "../../../../shared/notifications";
5
5
  import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
6
6
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
7
  import { I18nMessages } from "../../../ui/i18n/i18n";
8
8
  const useReturnCheckoutItem = ({ checkoutItemId, logger }) => {
9
9
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
10
- const [createNotification] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
10
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
11
11
  const returnCheckoutItem = useCallback(async ({ feedbacks }) => {
12
12
  try {
13
- await commandBus(returnCheckoutItemCommand({
14
- aggregateId: checkoutItemId,
15
- feedbacks,
16
- }));
13
+ await commandBus(returnCheckoutItemCommand({ aggregateId: checkoutItemId, feedbacks }));
17
14
  }
18
15
  catch (error) {
19
16
  logger.captureException(error);
@@ -0,0 +1,10 @@
1
+ import { CommandStatus } from "@lookiero/messaging-react";
2
+ interface IncrementIntroShownCountFunction {
3
+ (): Promise<void>;
4
+ }
5
+ type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
6
+ interface UseIncrementIntroShownCountFunction {
7
+ (): UseIncrementIntroShownCount;
8
+ }
9
+ declare const useIncrementIntroShownCount: UseIncrementIntroShownCountFunction;
10
+ export { useIncrementIntroShownCount };
@@ -0,0 +1,11 @@
1
+ import { useCallback } from "react";
2
+ import { useViewIntroShownCount } from "../../../projection/uiSetting/react/useViewIntroShownCount";
3
+ import { UISettings } from "../../../ui/settings/UISettings";
4
+ import { useUpdateUiSetting } from "./useUpdateUiSetting";
5
+ const useIncrementIntroShownCount = () => {
6
+ const [update, status] = useUpdateUiSetting();
7
+ const [introShownCount] = useViewIntroShownCount();
8
+ const incrementIntroShownCount = useCallback(() => update({ key: UISettings.INTRO_SHOWN_COUNT, value: introShownCount + 1 }), [introShownCount, update]);
9
+ return [incrementIntroShownCount, status];
10
+ };
11
+ export { useIncrementIntroShownCount };
@@ -1,12 +1,15 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
2
  import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
+ import { CHECKOUT_BOOKING_EXPIRED } from "../../../../domain/checkoutBooking/model/checkoutBookingExpired";
3
4
  import { viewBookedProductsVariantsForCheckoutItem } from "../../../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
4
5
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
6
  const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
7
+ const isCheckoutBookingExpired = (event) => event.name === CHECKOUT_BOOKING_EXPIRED;
8
+ const shouldInvalidate = (event) => isCheckoutBookingBooked(event) || isCheckoutBookingExpired(event);
6
9
  const useViewBookedProductsVariantsForCheckoutItem = ({ checkoutItemId, }) => useQuery({
7
10
  query: viewBookedProductsVariantsForCheckoutItem({ checkoutItemId }),
8
11
  contextId: MESSAGING_CONTEXT_ID,
9
- invalidation: isCheckoutBookingBooked,
12
+ invalidation: shouldInvalidate,
10
13
  options: { refetchOnMount: "always", staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
11
14
  });
12
15
  export { useViewBookedProductsVariantsForCheckoutItem };
@@ -0,0 +1,12 @@
1
+ import { BookedSizeChangeProductsVariantsForCheckoutItemView } from "../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
2
+ import { HttpPostFunction } from "../../delivery/http/httpClient";
3
+ interface HttpBookedSizeChangeProductsVariantsForCheckoutItemView extends BookedSizeChangeProductsVariantsForCheckoutItemView {
4
+ }
5
+ interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs {
6
+ readonly httpPost: HttpPostFunction;
7
+ }
8
+ interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction {
9
+ (args: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs): HttpBookedSizeChangeProductsVariantsForCheckoutItemView;
10
+ }
11
+ declare const httpBookedSizeChangeProductsVariantsForCheckoutItemView: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction;
12
+ export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
@@ -0,0 +1,9 @@
1
+ const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
2
+ const response = await httpPost({
3
+ endpoint: "/view-booked-size-change-product-variants-for-checkout-item",
4
+ body: { checkoutItemId },
5
+ signal,
6
+ });
7
+ return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
+ };
9
+ export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
@@ -0,0 +1,10 @@
1
+ import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
+ import { BookedSizeChangeProductsVariantsProjection } from "../../../../projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants";
3
+ interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs {
4
+ readonly checkoutItemId: string;
5
+ }
6
+ interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction {
7
+ (args: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs): UseQueryFunctionResult<BookedSizeChangeProductsVariantsProjection>;
8
+ }
9
+ declare const useViewBookedSizeChangeProductsVariantsForCheckoutItem: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction;
10
+ export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
@@ -0,0 +1,12 @@
1
+ import { useQuery } from "@lookiero/messaging-react";
2
+ import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
+ import { viewBookedSizeChangeProductsVariantsForCheckoutItem } from "../../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
4
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
+ const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
6
+ const useViewBookedSizeChangeProductsVariantsForCheckoutItem = ({ checkoutItemId }) => useQuery({
7
+ query: viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId }),
8
+ contextId: MESSAGING_CONTEXT_ID,
9
+ invalidation: isCheckoutBookingBooked,
10
+ options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
11
+ });
12
+ export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
@@ -4,6 +4,6 @@ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
4
4
  const useViewFiveItemsDiscountByCustomerId = ({ customerId }) => useQuery({
5
5
  query: viewFiveItemsDiscountByCustomerId({ customerId }),
6
6
  contextId: MESSAGING_CONTEXT_ID,
7
- options: { refetchOnMount: "always", staleTime: Infinity, cacheTime: 0 },
7
+ options: { staleTime: Infinity },
8
8
  });
9
9
  export { useViewFiveItemsDiscountByCustomerId };
@@ -0,0 +1,12 @@
1
+ import { CheckoutFeedbackByCheckoutIdView } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId";
2
+ import { HttpPostFunction } from "../../delivery/http/httpClient";
3
+ interface HttpCheckoutFeebackByCheckoutIdView extends CheckoutFeedbackByCheckoutIdView {
4
+ }
5
+ interface HttpCheckoutFeebackByCheckoutIdViewFunctionArgs {
6
+ readonly httpPost: HttpPostFunction;
7
+ }
8
+ interface HttpCheckoutFeebackByCheckoutIdViewFunction {
9
+ (args: HttpCheckoutFeebackByCheckoutIdViewFunctionArgs): HttpCheckoutFeebackByCheckoutIdView;
10
+ }
11
+ declare const httpCheckoutFeebackByCheckoutIdView: HttpCheckoutFeebackByCheckoutIdViewFunction;
12
+ export { httpCheckoutFeebackByCheckoutIdView };
@@ -0,0 +1,9 @@
1
+ const httpCheckoutFeebackByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => {
2
+ const response = await httpPost({
3
+ endpoint: "/view-checkout-feedback-by-checkout-id",
4
+ body: { checkoutId },
5
+ signal,
6
+ });
7
+ return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
+ };
9
+ export { httpCheckoutFeebackByCheckoutIdView };
@@ -4,6 +4,6 @@ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
4
4
  const useListCheckoutQuestionsByCheckoutId = ({ checkoutId }) => useQuery({
5
5
  query: listCheckoutQuestionsByCheckoutId({ checkoutId }),
6
6
  contextId: MESSAGING_CONTEXT_ID,
7
- options: { refetchOnMount: "always", staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
7
+ options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
8
8
  });
9
9
  export { useListCheckoutQuestionsByCheckoutId };
@@ -1,13 +1,18 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
2
  import { CHECKOUT_ITEM_KEPT } from "../../../../domain/checkoutItem/model/checkoutItemKept";
3
3
  import { CHECKOUT_ITEM_REPLACED, } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
4
+ import { CHECKOUT_ITEM_RESET } from "../../../../domain/checkoutItem/model/checkoutItemReset";
4
5
  import { CHECKOUT_ITEM_RETURNED, } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
5
6
  import { viewPaymentFlowPayloadByCheckoutId } from "../../../../projection/payment/viewPaymentFlowPayloadByCheckoutId";
6
7
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
7
8
  const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
8
9
  const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
9
10
  const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
10
- const shouldInvalidate = (event) => isCheckoutItemKept(event) || isCheckoutItemReplaced(event) || isCheckoutItemReturned(event);
11
+ const isCheckoutItemReset = (event) => event.name === CHECKOUT_ITEM_RESET;
12
+ const shouldInvalidate = (event) => isCheckoutItemKept(event) ||
13
+ isCheckoutItemReplaced(event) ||
14
+ isCheckoutItemReturned(event) ||
15
+ isCheckoutItemReset(event);
11
16
  const useViewPaymentFlowPayloadByCheckoutId = ({ checkoutId }) => useQuery({
12
17
  query: viewPaymentFlowPayloadByCheckoutId({ checkoutId: checkoutId }),
13
18
  contextId: MESSAGING_CONTEXT_ID,