@lookiero/checkout 2.2.2-beta.0 → 2.4.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 (122) hide show
  1. package/dist/domain/checkout/model/checkoutStarted.d.ts +3 -2
  2. package/dist/domain/checkout/model/checkoutStarted.js +2 -1
  3. package/dist/domain/checkout/model/checkoutSubmitted.d.ts +3 -2
  4. package/dist/domain/checkout/model/checkoutSubmitted.js +2 -1
  5. package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +3 -2
  6. package/dist/domain/checkoutBooking/model/checkoutBookingBooked.js +2 -1
  7. package/dist/domain/checkoutBooking/model/checkoutBookingExpired.d.ts +3 -2
  8. package/dist/domain/checkoutBooking/model/checkoutBookingExpired.js +2 -1
  9. package/dist/domain/checkoutFeedback/model/checkoutFeedbackGiven.d.ts +3 -2
  10. package/dist/domain/checkoutFeedback/model/checkoutFeedbackGiven.js +2 -1
  11. package/dist/domain/checkoutItem/model/checkoutItemKept.d.ts +3 -2
  12. package/dist/domain/checkoutItem/model/checkoutItemKept.js +2 -1
  13. package/dist/domain/checkoutItem/model/checkoutItemReplaced.d.ts +3 -2
  14. package/dist/domain/checkoutItem/model/checkoutItemReplaced.js +2 -1
  15. package/dist/domain/checkoutItem/model/checkoutItemReset.d.ts +3 -2
  16. package/dist/domain/checkoutItem/model/checkoutItemReset.js +2 -1
  17. package/dist/domain/checkoutItem/model/checkoutItemReturned.d.ts +3 -2
  18. package/dist/domain/checkoutItem/model/checkoutItemReturned.js +2 -1
  19. package/dist/domain/uiSetting/model/uiSettingUpdated.d.ts +3 -2
  20. package/dist/domain/uiSetting/model/uiSettingUpdated.js +2 -1
  21. package/dist/infrastructure/projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem.js +2 -4
  22. package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.js +9 -18
  23. package/dist/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +1 -2
  24. package/dist/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +4 -8
  25. package/dist/infrastructure/projection/pricing/pricing.d.ts +1 -0
  26. package/dist/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +4 -8
  27. package/dist/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.js +1 -2
  28. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +2 -2
  29. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +1 -3
  30. package/dist/projection/pricing/pricing.d.ts +1 -0
  31. package/dist/shared/notifications/domain/notification/model/notificationCreated.d.ts +3 -2
  32. package/dist/shared/notifications/domain/notification/model/notificationCreated.js +2 -1
  33. package/dist/shared/notifications/domain/notification/model/notificationRemoved.d.ts +3 -2
  34. package/dist/shared/notifications/domain/notification/model/notificationRemoved.js +2 -1
  35. package/dist/shared/notifications/projection/notification/react/useListNotifications.js +2 -4
  36. package/package.json +1 -1
  37. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +0 -13
  38. package/dist/domain/checkout/command/markCheckoutAsPaid.js +0 -4
  39. package/dist/domain/checkout/model/checkoutPaid.d.ts +0 -13
  40. package/dist/domain/checkout/model/checkoutPaid.js +0 -4
  41. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  42. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  43. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +0 -5
  44. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +0 -13
  45. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +0 -13
  46. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +0 -16
  47. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -13
  48. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +0 -14
  49. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  50. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  51. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
  52. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +0 -9
  53. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
  54. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +0 -12
  55. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +0 -12
  56. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +0 -9
  57. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  58. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  59. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  60. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  61. package/dist/infrastructure/ui/hooks/useToast.d.ts +0 -11
  62. package/dist/infrastructure/ui/hooks/useToast.js +0 -49
  63. package/dist/infrastructure/ui/views/App.style.d.ts +0 -4
  64. package/dist/infrastructure/ui/views/App.style.js +0 -16
  65. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  66. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  67. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  68. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  69. package/dist/infrastructure/ui/views/header/Header.d.ts +0 -15
  70. package/dist/infrastructure/ui/views/header/Header.js +0 -90
  71. package/dist/infrastructure/ui/views/header/Header.style.d.ts +0 -35
  72. package/dist/infrastructure/ui/views/header/Header.style.js +0 -38
  73. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +0 -7
  74. package/dist/infrastructure/ui/views/header/components/Logo.js +0 -11
  75. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +0 -7
  76. package/dist/infrastructure/ui/views/header/components/Logo.style.js +0 -8
  77. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  78. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  79. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -55
  80. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -58
  81. package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -15
  82. package/dist/infrastructure/ui/views/item/Item.style.js +0 -18
  83. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +0 -26
  84. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +0 -44
  85. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -45
  86. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +0 -53
  87. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  88. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  89. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  90. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  91. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -10
  92. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +0 -1
  93. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
  94. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
  95. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +0 -25
  96. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +0 -8
  97. package/dist/shared/logging/location.d.ts +0 -3
  98. package/dist/shared/logging/location.js +0 -5
  99. package/dist/shared/logging/matchRoutes.d.ts +0 -3
  100. package/dist/shared/logging/matchRoutes.js +0 -7
  101. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +0 -29
  102. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +0 -134
  103. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +0 -22
  104. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +0 -15
  105. package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +0 -27
  106. package/dist/shared/logging/reactRouterV6Instrumentation.native.js +0 -115
  107. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  108. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  109. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
  110. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +0 -9
  111. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  112. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  113. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  114. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  115. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  116. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  117. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  118. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
  119. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  120. package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
  121. package/dist/shared/ui/components/atoms/error/Error.style.d.ts +0 -6
  122. package/dist/shared/ui/components/atoms/error/Error.style.js +0 -9
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_STARTED = "checkout_started";
3
3
  interface CheckoutStartedPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface CheckoutStartedFunction {
9
9
  (payload: CheckoutStartedPayload): CheckoutStarted;
10
10
  }
11
11
  declare const checkoutStarted: CheckoutStartedFunction;
12
+ declare const isCheckoutStarted: (event: DomainEvent<MessageName>) => event is CheckoutStarted;
12
13
  export type { CheckoutStarted };
13
- export { CHECKOUT_STARTED, checkoutStarted };
14
+ export { CHECKOUT_STARTED, checkoutStarted, isCheckoutStarted };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const CHECKOUT_STARTED = "checkout_started";
3
3
  const checkoutStarted = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_STARTED });
4
- export { CHECKOUT_STARTED, checkoutStarted };
4
+ const isCheckoutStarted = (event) => event.name === CHECKOUT_STARTED;
5
+ export { CHECKOUT_STARTED, checkoutStarted, isCheckoutStarted };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_SUBMITTED = "checkout_submitted";
3
3
  interface CheckoutSubmittedPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface CheckoutSubmittedFunction {
9
9
  (payload: CheckoutSubmittedPayload): CheckoutSubmitted;
10
10
  }
11
11
  declare const checkoutSubmitted: CheckoutSubmittedFunction;
12
+ declare const isCheckoutSubmitted: (event: DomainEvent<MessageName>) => event is CheckoutSubmitted;
12
13
  export type { CheckoutSubmitted };
13
- export { CHECKOUT_SUBMITTED, checkoutSubmitted };
14
+ export { CHECKOUT_SUBMITTED, checkoutSubmitted, isCheckoutSubmitted };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const CHECKOUT_SUBMITTED = "checkout_submitted";
3
3
  const checkoutSubmitted = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_SUBMITTED });
4
- export { CHECKOUT_SUBMITTED, checkoutSubmitted };
4
+ const isCheckoutSubmitted = (event) => event.name === CHECKOUT_SUBMITTED;
5
+ export { CHECKOUT_SUBMITTED, checkoutSubmitted, isCheckoutSubmitted };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_BOOKING_BOOKED = "checkout_booking_booked";
3
3
  interface CheckoutBookingBookedPayload {
4
4
  readonly aggregateId: string;
@@ -10,5 +10,6 @@ interface CheckoutBookingBookedFunction {
10
10
  (payload: CheckoutBookingBookedPayload): CheckoutBookingBooked;
11
11
  }
12
12
  declare const checkoutBookingBooked: CheckoutBookingBookedFunction;
13
+ declare const isCheckoutBookingBooked: (event: DomainEvent<MessageName>) => event is CheckoutBookingBooked;
13
14
  export type { CheckoutBookingBooked };
14
- export { CHECKOUT_BOOKING_BOOKED, checkoutBookingBooked };
15
+ export { CHECKOUT_BOOKING_BOOKED, checkoutBookingBooked, isCheckoutBookingBooked };
@@ -4,4 +4,5 @@ const checkoutBookingBooked = ({ aggregateId, ...payload }) => ({
4
4
  ...domainEvent({ aggregateId, name: CHECKOUT_BOOKING_BOOKED }),
5
5
  ...payload,
6
6
  });
7
- export { CHECKOUT_BOOKING_BOOKED, checkoutBookingBooked };
7
+ const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
8
+ export { CHECKOUT_BOOKING_BOOKED, checkoutBookingBooked, isCheckoutBookingBooked };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_BOOKING_EXPIRED = "checkout_booking_expired";
3
3
  interface CheckoutBookingExpiredPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface CheckoutBookingExpiredFunction {
9
9
  (payload: CheckoutBookingExpiredPayload): CheckoutBookingExpired;
10
10
  }
11
11
  declare const checkoutBookingExpired: CheckoutBookingExpiredFunction;
12
+ declare const isCheckoutBookingExpired: (event: DomainEvent<MessageName>) => event is CheckoutBookingExpired;
12
13
  export type { CheckoutBookingExpired };
13
- export { CHECKOUT_BOOKING_EXPIRED, checkoutBookingExpired };
14
+ export { CHECKOUT_BOOKING_EXPIRED, checkoutBookingExpired, isCheckoutBookingExpired };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const CHECKOUT_BOOKING_EXPIRED = "checkout_booking_expired";
3
3
  const checkoutBookingExpired = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_BOOKING_EXPIRED });
4
- export { CHECKOUT_BOOKING_EXPIRED, checkoutBookingExpired };
4
+ const isCheckoutBookingExpired = (event) => event.name === CHECKOUT_BOOKING_EXPIRED;
5
+ export { CHECKOUT_BOOKING_EXPIRED, checkoutBookingExpired, isCheckoutBookingExpired };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_FEEDBACK_GIVEN = "checkout_feedback_given";
3
3
  interface CheckoutFeedbackGivenPayload {
4
4
  readonly aggregateId: string;
@@ -10,5 +10,6 @@ interface CheckoutFeedbackGivenFunction {
10
10
  (payload: CheckoutFeedbackGivenPayload): CheckoutFeedbackGiven;
11
11
  }
12
12
  declare const checkoutFeedbackGiven: CheckoutFeedbackGivenFunction;
13
+ declare const isCheckoutFeedbackGiven: (event: DomainEvent<MessageName>) => event is CheckoutFeedbackGiven;
13
14
  export type { CheckoutFeedbackGiven };
14
- export { CHECKOUT_FEEDBACK_GIVEN, checkoutFeedbackGiven };
15
+ export { CHECKOUT_FEEDBACK_GIVEN, checkoutFeedbackGiven, isCheckoutFeedbackGiven };
@@ -4,4 +4,5 @@ const checkoutFeedbackGiven = ({ aggregateId, ...payload }) => ({
4
4
  ...domainEvent({ aggregateId, name: CHECKOUT_FEEDBACK_GIVEN }),
5
5
  ...payload,
6
6
  });
7
- export { CHECKOUT_FEEDBACK_GIVEN, checkoutFeedbackGiven };
7
+ const isCheckoutFeedbackGiven = (event) => event.name === CHECKOUT_FEEDBACK_GIVEN;
8
+ export { CHECKOUT_FEEDBACK_GIVEN, checkoutFeedbackGiven, isCheckoutFeedbackGiven };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_ITEM_KEPT = "checkout_item_kept";
3
3
  interface CheckoutItemKeptPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface CheckoutItemKeptFunction {
9
9
  (payload: CheckoutItemKeptPayload): CheckoutItemKept;
10
10
  }
11
11
  declare const checkoutItemKept: CheckoutItemKeptFunction;
12
+ declare const isCheckoutItemKept: (event: DomainEvent<MessageName>) => event is CheckoutItemKept;
12
13
  export type { CheckoutItemKept };
13
- export { CHECKOUT_ITEM_KEPT, checkoutItemKept };
14
+ export { CHECKOUT_ITEM_KEPT, checkoutItemKept, isCheckoutItemKept };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const CHECKOUT_ITEM_KEPT = "checkout_item_kept";
3
3
  const checkoutItemKept = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_ITEM_KEPT });
4
- export { CHECKOUT_ITEM_KEPT, checkoutItemKept };
4
+ const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
5
+ export { CHECKOUT_ITEM_KEPT, checkoutItemKept, isCheckoutItemKept };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_ITEM_REPLACED = "checkout_item_replaced";
3
3
  interface CheckoutItemReplacedPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface CheckoutItemReplacedFunction {
9
9
  (payload: CheckoutItemReplacedPayload): CheckoutItemReplaced;
10
10
  }
11
11
  declare const checkoutItemReplaced: CheckoutItemReplacedFunction;
12
+ declare const isCheckoutItemReplaced: (event: DomainEvent<MessageName>) => event is CheckoutItemReplaced;
12
13
  export type { CheckoutItemReplaced };
13
- export { CHECKOUT_ITEM_REPLACED, checkoutItemReplaced };
14
+ export { CHECKOUT_ITEM_REPLACED, checkoutItemReplaced, isCheckoutItemReplaced };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const CHECKOUT_ITEM_REPLACED = "checkout_item_replaced";
3
3
  const checkoutItemReplaced = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_ITEM_REPLACED });
4
- export { CHECKOUT_ITEM_REPLACED, checkoutItemReplaced };
4
+ const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
5
+ export { CHECKOUT_ITEM_REPLACED, checkoutItemReplaced, isCheckoutItemReplaced };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_ITEM_RESET = "checkout_item_reset";
3
3
  interface CheckoutItemResetPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface CheckoutItemResetFunction {
9
9
  (payload: CheckoutItemResetPayload): CheckoutItemReset;
10
10
  }
11
11
  declare const checkoutItemReset: CheckoutItemResetFunction;
12
+ declare const isCheckoutItemReset: (event: DomainEvent<MessageName>) => event is CheckoutItemReset;
12
13
  export type { CheckoutItemReset };
13
- export { CHECKOUT_ITEM_RESET, checkoutItemReset };
14
+ export { CHECKOUT_ITEM_RESET, checkoutItemReset, isCheckoutItemReset };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const CHECKOUT_ITEM_RESET = "checkout_item_reset";
3
3
  const checkoutItemReset = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_ITEM_RESET });
4
- export { CHECKOUT_ITEM_RESET, checkoutItemReset };
4
+ const isCheckoutItemReset = (event) => event.name === CHECKOUT_ITEM_RESET;
5
+ export { CHECKOUT_ITEM_RESET, checkoutItemReset, isCheckoutItemReset };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const CHECKOUT_ITEM_RETURNED = "checkout_item_returned";
3
3
  interface CheckoutItemReturnedPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface CheckoutItemReturnedFunction {
9
9
  (payload: CheckoutItemReturnedPayload): CheckoutItemReturned;
10
10
  }
11
11
  declare const checkoutItemReturned: CheckoutItemReturnedFunction;
12
+ declare const isCheckoutItemReturned: (event: DomainEvent<MessageName>) => event is CheckoutItemReturned;
12
13
  export type { CheckoutItemReturned };
13
- export { CHECKOUT_ITEM_RETURNED, checkoutItemReturned };
14
+ export { CHECKOUT_ITEM_RETURNED, checkoutItemReturned, isCheckoutItemReturned };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const CHECKOUT_ITEM_RETURNED = "checkout_item_returned";
3
3
  const checkoutItemReturned = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_ITEM_RETURNED });
4
- export { CHECKOUT_ITEM_RETURNED, checkoutItemReturned };
4
+ const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
5
+ export { CHECKOUT_ITEM_RETURNED, checkoutItemReturned, isCheckoutItemReturned };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const UI_SETTING_UPDATED = "ui_setting_updated";
3
3
  interface UiSettingUpdatedPayload {
4
4
  readonly aggregateId: string;
@@ -10,5 +10,6 @@ interface UiSettingUpdatedFunction {
10
10
  (payload: UiSettingUpdatedPayload): UiSettingUpdated;
11
11
  }
12
12
  declare const uiSettingUpdated: UiSettingUpdatedFunction;
13
+ declare const isUiSettingUpdated: (event: DomainEvent<MessageName>) => event is UiSettingUpdated;
13
14
  export type { UiSettingUpdated };
14
- export { UI_SETTING_UPDATED, uiSettingUpdated };
15
+ export { UI_SETTING_UPDATED, uiSettingUpdated, isUiSettingUpdated };
@@ -4,4 +4,5 @@ const uiSettingUpdated = ({ aggregateId, key }) => ({
4
4
  ...domainEvent({ aggregateId, name: UI_SETTING_UPDATED }),
5
5
  key,
6
6
  });
7
- export { UI_SETTING_UPDATED, uiSettingUpdated };
7
+ const isUiSettingUpdated = (event) => event.name === UI_SETTING_UPDATED;
8
+ export { UI_SETTING_UPDATED, uiSettingUpdated, isUiSettingUpdated };
@@ -1,10 +1,8 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
- import { CHECKOUT_BOOKING_EXPIRED } from "../../../../domain/checkoutBooking/model/checkoutBookingExpired";
2
+ import { isCheckoutBookingBooked } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
+ import { isCheckoutBookingExpired } from "../../../../domain/checkoutBooking/model/checkoutBookingExpired";
4
4
  import { viewBookedProductsVariantsForCheckoutItem } from "../../../../projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem";
5
5
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
- const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
7
- const isCheckoutBookingExpired = (event) => event.name === CHECKOUT_BOOKING_EXPIRED;
8
6
  const shouldInvalidate = (event) => isCheckoutBookingBooked(event) || isCheckoutBookingExpired(event);
9
7
  const useViewBookedProductsVariantsForCheckoutItem = ({ checkoutItemId, }) => useQuery({
10
8
  query: viewBookedProductsVariantsForCheckoutItem({ checkoutItemId }),
@@ -1,24 +1,15 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { CHECKOUT_STARTED } from "../../../../domain/checkout/model/checkoutStarted";
3
- import { CHECKOUT_SUBMITTED } from "../../../../domain/checkout/model/checkoutSubmitted";
4
- import { CHECKOUT_BOOKING_BOOKED } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
5
- import { CHECKOUT_BOOKING_EXPIRED, } from "../../../../domain/checkoutBooking/model/checkoutBookingExpired";
6
- import { CHECKOUT_FEEDBACK_GIVEN, } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
7
- import { CHECKOUT_ITEM_KEPT } from "../../../../domain/checkoutItem/model/checkoutItemKept";
8
- import { CHECKOUT_ITEM_REPLACED, } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
9
- import { CHECKOUT_ITEM_RESET } from "../../../../domain/checkoutItem/model/checkoutItemReset";
10
- import { CHECKOUT_ITEM_RETURNED, } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
2
+ import { isCheckoutStarted } from "../../../../domain/checkout/model/checkoutStarted";
3
+ import { isCheckoutSubmitted } from "../../../../domain/checkout/model/checkoutSubmitted";
4
+ import { isCheckoutBookingBooked } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
5
+ import { isCheckoutBookingExpired } from "../../../../domain/checkoutBooking/model/checkoutBookingExpired";
6
+ import { isCheckoutFeedbackGiven } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
7
+ import { isCheckoutItemKept } from "../../../../domain/checkoutItem/model/checkoutItemKept";
8
+ import { isCheckoutItemReplaced } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
9
+ import { isCheckoutItemReset } from "../../../../domain/checkoutItem/model/checkoutItemReset";
10
+ import { isCheckoutItemReturned } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
11
11
  import { viewFirstAvailableCheckoutByCustomerId } from "../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
12
12
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
13
- const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
14
- const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
15
- const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
16
- const isCheckoutItemReset = (event) => event.name === CHECKOUT_ITEM_RESET;
17
- const isCheckoutStarted = (event) => event.name === CHECKOUT_STARTED;
18
- const isCheckoutSubmitted = (event) => event.name === CHECKOUT_SUBMITTED;
19
- const isCheckoutFeedbackGiven = (event) => event.name === CHECKOUT_FEEDBACK_GIVEN;
20
- const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
21
- const isCheckoutBookingExpired = (event) => event.name === CHECKOUT_BOOKING_EXPIRED;
22
13
  const shouldInvalidate = (event) => isCheckoutItemKept(event) ||
23
14
  isCheckoutItemReplaced(event) ||
24
15
  isCheckoutItemReturned(event) ||
@@ -1,8 +1,7 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { CHECKOUT_FEEDBACK_GIVEN, } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
2
+ import { isCheckoutFeedbackGiven } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
3
3
  import { viewIsCheckoutAccessibleByCustomerId, } from "../../../../projection/checkout/viewIsCheckoutAccessibleByCustomerId";
4
4
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
- const isCheckoutFeedbackGiven = (event) => event.name === CHECKOUT_FEEDBACK_GIVEN;
6
5
  const useViewIsCheckoutAccessibleByCustomerId = ({ customerId }) => useQuery({
7
6
  query: viewIsCheckoutAccessibleByCustomerId({ customerId }),
8
7
  contextId: MESSAGING_CONTEXT_ID,
@@ -1,14 +1,10 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { CHECKOUT_ITEM_KEPT } from "../../../../domain/checkoutItem/model/checkoutItemKept";
3
- import { CHECKOUT_ITEM_REPLACED, } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
4
- import { CHECKOUT_ITEM_RESET } from "../../../../domain/checkoutItem/model/checkoutItemReset";
5
- import { CHECKOUT_ITEM_RETURNED, } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
2
+ import { isCheckoutItemKept } from "../../../../domain/checkoutItem/model/checkoutItemKept";
3
+ import { isCheckoutItemReplaced } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
4
+ import { isCheckoutItemReset } from "../../../../domain/checkoutItem/model/checkoutItemReset";
5
+ import { isCheckoutItemReturned } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
6
6
  import { viewPaymentFlowPayloadByCheckoutId } from "../../../../projection/payment/viewPaymentFlowPayloadByCheckoutId";
7
7
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
8
- const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
9
- const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
10
- const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
11
- const isCheckoutItemReset = (event) => event.name === CHECKOUT_ITEM_RESET;
12
8
  const shouldInvalidate = (event) => isCheckoutItemKept(event) ||
13
9
  isCheckoutItemReplaced(event) ||
14
10
  isCheckoutItemReturned(event) ||
@@ -8,6 +8,7 @@ interface PricingDto {
8
8
  readonly pendingToPay: PriceProjection;
9
9
  readonly service: ServiceProjection;
10
10
  readonly subtotal: PriceProjection;
11
+ readonly paidWithPromocode?: boolean;
11
12
  }
12
13
  interface ToPricingProjectionFunction {
13
14
  (pricingDto: PricingDto): PricingProjection;
@@ -1,14 +1,10 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { CHECKOUT_ITEM_KEPT } from "../../../../domain/checkoutItem/model/checkoutItemKept";
3
- import { CHECKOUT_ITEM_REPLACED, } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
4
- import { CHECKOUT_ITEM_RESET } from "../../../../domain/checkoutItem/model/checkoutItemReset";
5
- import { CHECKOUT_ITEM_RETURNED, } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
2
+ import { isCheckoutItemKept } from "../../../../domain/checkoutItem/model/checkoutItemKept";
3
+ import { isCheckoutItemReplaced } from "../../../../domain/checkoutItem/model/checkoutItemReplaced";
4
+ import { isCheckoutItemReset } from "../../../../domain/checkoutItem/model/checkoutItemReset";
5
+ import { isCheckoutItemReturned } from "../../../../domain/checkoutItem/model/checkoutItemReturned";
6
6
  import { viewPricingByCheckoutId } from "../../../../projection/pricing/viewPricingByCheckoutId";
7
7
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
8
- const isCheckoutItemKept = (event) => event.name === CHECKOUT_ITEM_KEPT;
9
- const isCheckoutItemReturned = (event) => event.name === CHECKOUT_ITEM_RETURNED;
10
- const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
11
- const isCheckoutItemReset = (event) => event.name === CHECKOUT_ITEM_RESET;
12
8
  const shouldInvalidate = (event) => isCheckoutItemKept(event) ||
13
9
  isCheckoutItemReplaced(event) ||
14
10
  isCheckoutItemReturned(event) ||
@@ -1,8 +1,7 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { UI_SETTING_UPDATED } from "../../../../domain/uiSetting/model/uiSettingUpdated";
2
+ import { isUiSettingUpdated } from "../../../../domain/uiSetting/model/uiSettingUpdated";
3
3
  import { viewUiSettingByKey } from "../../../../projection/uiSetting/viewUiSettingByKey";
4
4
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
- const isUiSettingUpdated = (event) => event.name === UI_SETTING_UPDATED;
6
5
  const useViewUiSettingByKey = ({ key }) => useQuery({
7
6
  query: viewUiSettingByKey({ key }),
8
7
  contextId: MESSAGING_CONTEXT_ID,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Platform, ScrollView } from "react-native";
2
+ import { ScrollView } from "react-native";
3
3
  import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import { theme } from "../../theme/theme";
5
5
  import { style } from "./SafeAreaScrollView.style.ts";
@@ -10,7 +10,7 @@ const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"]
10
10
  React.createElement(ScrollView, { contentContainerStyle: [
11
11
  {
12
12
  paddingTop: scrollerPaddingTop,
13
- paddingBottom: safeAreaInsetBottom + (Platform.OS !== "ios" ? spaceXXL : 0),
13
+ paddingBottom: safeAreaInsetBottom + spaceXXL,
14
14
  },
15
15
  customStyle?.scrollView,
16
16
  ] }, children),
@@ -10,7 +10,6 @@ import { style } from "./Pricing.style";
10
10
  import { ArrowDown } from "./icons/ArrowDown";
11
11
  import { ArrowUp } from "./icons/ArrowUp";
12
12
  const { colorGrayscaleS } = theme();
13
- const PS_SERVICE_FREE_INDICATOR = 100;
14
13
  const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
15
14
  React.createElement(Text, { level: level, action: true, upperCase: true }, text),
16
15
  children));
@@ -29,7 +28,6 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
29
28
  }) || "";
30
29
  const creditText = useI18nMessage({ id: I18nMessages.SUMMARY_CREDIT }) || "";
31
30
  const feeText = useI18nMessage({ id: I18nMessages.SUMMARY_FEE }) || "";
32
- const isPSServiceFree = service.discount.amount === PS_SERVICE_FREE_INDICATOR;
33
31
  const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
34
32
  const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
35
33
  return (React.createElement(Pressable, { testID: "pricing", onPress: collapsible ? onPress : null },
@@ -49,7 +47,7 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
49
47
  React.createElement(Price, { price: discount, variant: "subtotal" }))),
50
48
  balanceDiscount && balanceDiscount.amount !== 0 && (React.createElement(Row, { text: creditText },
51
49
  React.createElement(Price, { price: balanceDiscount, variant: "subtotal" }))),
52
- React.createElement(Row, { text: feeText }, isPSServiceFree ? (React.createElement(Text, { level: 3, action: true, upperCase: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
50
+ React.createElement(Row, { text: feeText }, service.paidWithPromocode ? (React.createElement(Text, { level: 3, action: true, upperCase: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
53
51
  React.createElement(View, { style: style.divider }),
54
52
  React.createElement(Row, { level: 2, text: totalText },
55
53
  React.createElement(Price, { price: pendingToPay, variant: "total" })),
@@ -5,6 +5,7 @@ interface ServiceProjection {
5
5
  readonly originalPrice: PriceProjection;
6
6
  readonly prepaid: boolean;
7
7
  readonly reference: string;
8
+ readonly paidWithPromocode?: boolean;
8
9
  }
9
10
  interface PricingProjection {
10
11
  readonly balanceDiscount: PriceProjection;
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const NOTIFICATION_CREATED = "notification_created";
3
3
  interface NotificationCreatedPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface NotificationCreatedFunction {
9
9
  (payload: NotificationCreatedPayload): NotificationCreated;
10
10
  }
11
11
  declare const notificationCreated: NotificationCreatedFunction;
12
+ declare const isNotificationCreated: (event: DomainEvent<MessageName>) => event is NotificationCreated;
12
13
  export type { NotificationCreated };
13
- export { NOTIFICATION_CREATED, notificationCreated };
14
+ export { NOTIFICATION_CREATED, notificationCreated, isNotificationCreated };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const NOTIFICATION_CREATED = "notification_created";
3
3
  const notificationCreated = ({ aggregateId }) => domainEvent({ aggregateId, name: NOTIFICATION_CREATED });
4
- export { NOTIFICATION_CREATED, notificationCreated };
4
+ const isNotificationCreated = (event) => event.name === NOTIFICATION_CREATED;
5
+ export { NOTIFICATION_CREATED, notificationCreated, isNotificationCreated };
@@ -1,4 +1,4 @@
1
- import { DomainEvent } from "@lookiero/messaging";
1
+ import { DomainEvent, MessageName } from "@lookiero/messaging";
2
2
  declare const NOTIFICATION_REMOVED = "notification_removed";
3
3
  interface NotificationRemovedPayload {
4
4
  readonly aggregateId: string;
@@ -9,5 +9,6 @@ interface NotificationRemovedFunction {
9
9
  (payload: NotificationRemovedPayload): NotificationRemoved;
10
10
  }
11
11
  declare const notificationRemoved: NotificationRemovedFunction;
12
+ declare const isNotificationRemoved: (event: DomainEvent<MessageName>) => event is NotificationRemoved;
12
13
  export type { NotificationRemoved };
13
- export { NOTIFICATION_REMOVED, notificationRemoved };
14
+ export { NOTIFICATION_REMOVED, notificationRemoved, isNotificationRemoved };
@@ -1,4 +1,5 @@
1
1
  import { domainEvent } from "@lookiero/messaging";
2
2
  const NOTIFICATION_REMOVED = "notification_removed";
3
3
  const notificationRemoved = ({ aggregateId }) => domainEvent({ aggregateId, name: NOTIFICATION_REMOVED });
4
- export { NOTIFICATION_REMOVED, notificationRemoved };
4
+ const isNotificationRemoved = (event) => event.name === NOTIFICATION_REMOVED;
5
+ export { NOTIFICATION_REMOVED, notificationRemoved, isNotificationRemoved };
@@ -1,9 +1,7 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
- import { NOTIFICATION_CREATED } from "../../../domain/notification/model/notificationCreated";
3
- import { NOTIFICATION_REMOVED } from "../../../domain/notification/model/notificationRemoved";
2
+ import { isNotificationCreated } from "../../../domain/notification/model/notificationCreated";
3
+ import { isNotificationRemoved } from "../../../domain/notification/model/notificationRemoved";
4
4
  import { listNotifications } from "../listNotifications";
5
- const isNotificationCreated = (event) => event.name === NOTIFICATION_CREATED;
6
- const isNotificationRemoved = (event) => event.name === NOTIFICATION_REMOVED;
7
5
  const shouldInvalidate = (event) => isNotificationCreated(event) || isNotificationRemoved(event);
8
6
  const useListNotifications = ({ contextId }) => useQuery({
9
7
  query: listNotifications(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "2.2.2-beta.0",
3
+ "version": "2.4.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,13 +0,0 @@
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 };
@@ -1,4 +0,0 @@
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 };
@@ -1,13 +0,0 @@
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 };
@@ -1,4 +0,0 @@
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 };
@@ -1,6 +0,0 @@
1
- import { ProcessManagerFunction } from "@lookiero/messaging";
2
- import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
3
- interface CreateNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
4
- }
5
- declare const createNotificationWhenCheckoutBookingExpired: CreateNotificationWhenCheckoutBookingExpiredFunction;
6
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,13 +0,0 @@
1
- import { v4 as uuid } from "uuid";
2
- import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
3
- import { createNotification } from "../../../shared/notifications/domain/notification/command/createNotification";
4
- import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
5
- const createNotificationWhenCheckoutBookingExpired = ({ commandBus }) => async () => {
6
- await commandBus(createNotification({
7
- aggregateId: uuid(),
8
- level: NotificationLevel.ERROR,
9
- titleI18nKey: undefined,
10
- bodyI18nKey: I18nMessages.CHECKOUT_TOAST_BOOKING_EXPIRED,
11
- }));
12
- };
13
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,5 +0,0 @@
1
- import { HttpCheckoutsSaveFunction } from "./httpCheckouts";
2
- interface HttpCheckoutsMarkAsPaidFunction extends HttpCheckoutsSaveFunction {
3
- }
4
- declare const httpCheckoutsMarkAsPaid: HttpCheckoutsMarkAsPaidFunction;
5
- export { httpCheckoutsMarkAsPaid };
@@ -1,13 +0,0 @@
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 };
@@ -1,13 +0,0 @@
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 };
@@ -1,16 +0,0 @@
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 };