@lookiero/checkout 0.8.6-beta.2 → 0.8.6-beta.3

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.
@@ -1,6 +1,7 @@
1
1
  import { useQuery } from "@lookiero/messaging-react";
2
2
  import { CHECKOUT_STARTED } from "../../../../domain/checkout/model/checkoutStarted";
3
3
  import { CHECKOUT_SUBMITTED } from "../../../../domain/checkout/model/checkoutSubmitted";
4
+ import { CHECKOUT_BOOKING_BOOKED } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
4
5
  import { CHECKOUT_BOOKING_EXPIRED, } from "../../../../domain/checkoutBooking/model/checkoutBookingExpired";
5
6
  import { CHECKOUT_FEEDBACK_GIVEN, } from "../../../../domain/checkoutFeedback/model/checkoutFeedbackGiven";
6
7
  import { CHECKOUT_ITEM_KEPT } from "../../../../domain/checkoutItem/model/checkoutItemKept";
@@ -14,6 +15,7 @@ const isCheckoutItemReplaced = (event) => event.name === CHECKOUT_ITEM_REPLACED;
14
15
  const isCheckoutStarted = (event) => event.name === CHECKOUT_STARTED;
15
16
  const isCheckoutSubmitted = (event) => event.name === CHECKOUT_SUBMITTED;
16
17
  const isCheckoutFeedbackGiven = (event) => event.name === CHECKOUT_FEEDBACK_GIVEN;
18
+ const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
17
19
  const isCheckoutBookingExpired = (event) => event.name === CHECKOUT_BOOKING_EXPIRED;
18
20
  const shouldInvalidate = (event) => isCheckoutItemKept(event) ||
19
21
  isCheckoutItemReplaced(event) ||
@@ -21,11 +23,17 @@ const shouldInvalidate = (event) => isCheckoutItemKept(event) ||
21
23
  isCheckoutStarted(event) ||
22
24
  isCheckoutSubmitted(event) ||
23
25
  isCheckoutFeedbackGiven(event) ||
26
+ isCheckoutBookingBooked(event) ||
24
27
  isCheckoutBookingExpired(event);
25
28
  const useViewFirstAvailableCheckoutByCustomerId = ({ customerId }) => useQuery({
26
29
  query: viewFirstAvailableCheckoutByCustomerId({ customerId }),
27
30
  contextId: MESSAGING_CONTEXT_ID,
28
31
  invalidation: shouldInvalidate,
29
- options: { refetchOnMount: "always", staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
32
+ options: {
33
+ refetchOnMount: "always",
34
+ staleTime: Infinity,
35
+ retry: false,
36
+ refetchOnWindowFocus: false,
37
+ },
30
38
  });
31
39
  export { useViewFirstAvailableCheckoutByCustomerId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.8.6-beta.2",
3
+ "version": "0.8.6-beta.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [