@lookiero/checkout 0.3.22 → 0.3.24
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.
- package/dist/package.json +1 -1
- package/dist/src/domain/checkout/model/checkout.d.ts +1 -1
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckoutBookings.js +2 -1
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckouts.js +2 -2
- package/dist/src/infrastructure/domain/checkout/model/httpCheckouts.js +1 -1
- package/dist/src/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +1 -1
- package/dist/src/infrastructure/projection/checkout/checkout.d.ts +1 -1
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +2 -1
- package/dist/src/infrastructure/ui/views/item/Item.js +2 -2
- package/dist/src/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -1
- package/dist/src/projection/checkout/checkout.d.ts +1 -1
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -12,7 +12,7 @@ interface Checkout extends AggregateRoot {
|
|
|
12
12
|
readonly status: CheckoutStatus;
|
|
13
13
|
readonly customerId: string;
|
|
14
14
|
readonly boxId: string;
|
|
15
|
-
readonly
|
|
15
|
+
readonly checkoutBookingId: string;
|
|
16
16
|
readonly expiresOn: Date;
|
|
17
17
|
}
|
|
18
18
|
declare const startCheckoutHandler: CommandHandlerFunction<StartCheckout, Checkout>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import invariant from "tiny-invariant";
|
|
2
|
+
import { v4 as uuid } from "uuid";
|
|
2
3
|
import { viewBookedSizeChangeProductsVariantsForCheckoutItem, } from "../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
|
|
3
4
|
const toCheckoutBookingDomain = (checkoutBooking) => {
|
|
4
5
|
invariant(checkoutBooking, "No checkoutBooking found!");
|
|
5
6
|
return {
|
|
6
|
-
aggregateId:
|
|
7
|
+
aggregateId: uuid(),
|
|
7
8
|
checkoutItemIds: checkoutBooking.productVariants.map((productVariant) => productVariant.id),
|
|
8
9
|
domainEvents: [],
|
|
9
10
|
};
|
|
@@ -7,7 +7,7 @@ const toCheckoutDomain = (checkout) => {
|
|
|
7
7
|
status: checkout.status,
|
|
8
8
|
customerId: checkout.customerId,
|
|
9
9
|
boxId: checkout.boxId,
|
|
10
|
-
|
|
10
|
+
checkoutBookingId: checkout.checkoutBookingId,
|
|
11
11
|
expiresOn: checkout.expiresOn,
|
|
12
12
|
aggregateId: checkout.id,
|
|
13
13
|
domainEvents: [],
|
|
@@ -18,7 +18,7 @@ const toCheckoutProjection = (checkout) => ({
|
|
|
18
18
|
status: checkout.status,
|
|
19
19
|
customerId: checkout.customerId,
|
|
20
20
|
boxId: checkout.boxId,
|
|
21
|
-
|
|
21
|
+
checkoutBookingId: checkout.checkoutBookingId,
|
|
22
22
|
expiresOn: checkout.expiresOn,
|
|
23
23
|
items: [],
|
|
24
24
|
});
|
|
@@ -9,7 +9,7 @@ const toDomain = (checkout) => {
|
|
|
9
9
|
status: checkout.status,
|
|
10
10
|
customerId: checkout.customerId,
|
|
11
11
|
boxId: checkout.boxId,
|
|
12
|
-
|
|
12
|
+
checkoutBookingId: checkout.checkoutBookingId,
|
|
13
13
|
expiresOn: checkout.expiresOn,
|
|
14
14
|
aggregateId: checkout.id,
|
|
15
15
|
domainEvents: [],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
|
|
2
2
|
const response = await httpPost({
|
|
3
|
-
endpoint: "/view-booked-
|
|
3
|
+
endpoint: "/view-booked-product-variants-for-checkout-item",
|
|
4
4
|
body: { checkoutItemId },
|
|
5
5
|
signal,
|
|
6
6
|
});
|
|
@@ -5,7 +5,7 @@ interface CheckoutDto {
|
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly customerId: string;
|
|
7
7
|
readonly boxId: string;
|
|
8
|
-
readonly
|
|
8
|
+
readonly checkoutBookingId: string;
|
|
9
9
|
readonly status: CheckoutStatus;
|
|
10
10
|
readonly expiresOn: string;
|
|
11
11
|
readonly items: CheckoutItemProjection[];
|
|
@@ -58,7 +58,8 @@ const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner,
|
|
|
58
58
|
}
|
|
59
59
|
/* Navigate to the summary if required */
|
|
60
60
|
if (firstItemWithoutCustomerDecision === undefined &&
|
|
61
|
-
!(summaryRouteMatch || itemDetailRouteMatch || checkoutRouteMatch)
|
|
61
|
+
!(summaryRouteMatch || itemDetailRouteMatch || checkoutRouteMatch) &&
|
|
62
|
+
checkout?.status !== CheckoutStatus.PAID) {
|
|
62
63
|
return React.createElement(Navigate, { to: `${basePath}/${Routes.SUMMARY}`, replace: true });
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -79,8 +79,8 @@ const Item = ({ customerId }) => {
|
|
|
79
79
|
checkoutItemId: checkoutItem.id,
|
|
80
80
|
});
|
|
81
81
|
useEffect(() => {
|
|
82
|
-
|
|
83
|
-
}, [bookCheckouBooking,
|
|
82
|
+
checkout && !checkout?.checkoutBookingId && bookCheckouBooking();
|
|
83
|
+
}, [bookCheckouBooking, checkout]);
|
|
84
84
|
const [returnQuestions, returnQuestionsStatus] = useListReturnQuestionsByCheckoutItemId({
|
|
85
85
|
checkoutItemId: checkoutItem.id,
|
|
86
86
|
});
|
package/dist/src/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ interface ProductVariantProjection {
|
|
|
4
4
|
readonly size: SizeProjection;
|
|
5
5
|
}
|
|
6
6
|
interface BookedSizeChangeProductsVariantsProjection {
|
|
7
|
-
readonly bookingId: string;
|
|
8
7
|
readonly productVariants: ProductVariantProjection[];
|
|
9
8
|
}
|
|
10
9
|
export type { BookedSizeChangeProductsVariantsProjection, ProductVariantProjection };
|
|
@@ -4,7 +4,7 @@ interface CheckoutProjection {
|
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly customerId: string;
|
|
6
6
|
readonly boxId: string;
|
|
7
|
-
readonly
|
|
7
|
+
readonly checkoutBookingId: string;
|
|
8
8
|
readonly status: CheckoutStatus;
|
|
9
9
|
readonly expiresOn: Date;
|
|
10
10
|
readonly items: CheckoutItemProjection[];
|