Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d0a047602 | |||
| 8b2d3e7bef |
@@ -1,3 +1,12 @@
|
||||
## [1.5.29](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.28...v1.5.29) (2026-05-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add menu item fields ([#55](https://git.demonkernel.io.vn/FoodSurf/backend/issues/55)) ([dc5bc73](https://git.demonkernel.io.vn/FoodSurf/backend/commit/dc5bc731b3345663d2640a500ecfb77e81929ab2))
|
||||
* better graphql response ([#54](https://git.demonkernel.io.vn/FoodSurf/backend/issues/54)) ([d45ed26](https://git.demonkernel.io.vn/FoodSurf/backend/commit/d45ed26a07ca5af39ea63e82a9e6453e4aedf0c4))
|
||||
* trigger release version ([#56](https://git.demonkernel.io.vn/FoodSurf/backend/issues/56)) ([e72ccf4](https://git.demonkernel.io.vn/FoodSurf/backend/commit/e72ccf4e960b1623b604c85cbeef54ab8c8d97b3))
|
||||
|
||||
## [1.5.30](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.29...v1.5.30) (2026-05-13)
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.30</version>
|
||||
<version>1.5.29</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.drinkool.entities;
|
||||
import com.drinkool.Role;
|
||||
import com.drinkool.models.UserModel;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.30</version>
|
||||
<version>1.5.29</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -150,11 +150,11 @@ public class CartService {
|
||||
}
|
||||
|
||||
@Mutation("addItem")
|
||||
public Uni<Cart> addItem(
|
||||
public Cart addItem(
|
||||
@Name("cartId") UUID cartId,
|
||||
@Name("menuItemId") UUID menuItemId,
|
||||
@Name("quantity") long quantity
|
||||
) {
|
||||
) throws GraphQLException {
|
||||
String key = "cart:" + cartId;
|
||||
String priceKey = "cart_prices:" + cartId;
|
||||
|
||||
@@ -163,35 +163,27 @@ public class CartService {
|
||||
|
||||
UUID eateryId = UUID.fromString(eateryIdStr);
|
||||
|
||||
return eateryController
|
||||
Response response = eateryController
|
||||
.checkMenuItemExists(eateryId, menuItemId)
|
||||
.onItem()
|
||||
.transform(response -> {
|
||||
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
|
||||
throw new RuntimeException("NotFoundMenuItemInEatery");
|
||||
}
|
||||
.await()
|
||||
.indefinitely();
|
||||
|
||||
Double menuItemPrice = response.readEntity(Double.class);
|
||||
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
|
||||
throw new GraphQLException("NotFoundMenuItemInEatery");
|
||||
}
|
||||
|
||||
hashCommands.hincrby(key, menuItemId.toString(), quantity);
|
||||
Double menuItemPrice = response.readEntity(Double.class);
|
||||
|
||||
hashCommands.hset(
|
||||
priceKey,
|
||||
menuItemId.toString(),
|
||||
String.valueOf(menuItemPrice)
|
||||
);
|
||||
hashCommands.hincrby(key, menuItemId.toString(), quantity);
|
||||
hashCommands.hset(
|
||||
priceKey,
|
||||
menuItemId.toString(),
|
||||
String.valueOf(menuItemPrice)
|
||||
);
|
||||
|
||||
hashCommands.getDataSource().key().expire(key, Duration.ofDays(30));
|
||||
hashCommands
|
||||
.getDataSource()
|
||||
.key()
|
||||
.expire(priceKey, Duration.ofDays(30));
|
||||
hashCommands.getDataSource().key().expire(key, Duration.ofDays(30));
|
||||
hashCommands.getDataSource().key().expire(priceKey, Duration.ofDays(30));
|
||||
|
||||
try {
|
||||
return getCart(cartId);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
});
|
||||
return getCart(cartId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class CartServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddItem_Success() {
|
||||
void testAddItem_Success() throws GraphQLException {
|
||||
UUID cartId = UUID.randomUUID();
|
||||
UUID eateryId = UUID.randomUUID();
|
||||
UUID menuItemId = UUID.randomUUID();
|
||||
@@ -137,10 +137,7 @@ public class CartServiceTest {
|
||||
Uni.createFrom().item(Response.ok(17.0).build())
|
||||
);
|
||||
|
||||
Cart result = cartService
|
||||
.addItem(cartId, menuItemId, 2L)
|
||||
.await()
|
||||
.atMost(Duration.ofSeconds(5));
|
||||
Cart result = cartService.addItem(cartId, menuItemId, 2L);
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(cartId, result.getId());
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.30</version>
|
||||
<version>1.5.29</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.30</version>
|
||||
<version>1.5.29</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.30</version>
|
||||
<version>1.5.29</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: account-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/account-service:1.5.30
|
||||
image: git.demonkernel.io.vn/foodsurf/account-service:1.5.29
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: cart-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/cart-service:1.5.30
|
||||
image: git.demonkernel.io.vn/foodsurf/cart-service:1.5.29
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: eatery-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.30
|
||||
image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.29
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: file-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/file-service:1.5.30
|
||||
image: git.demonkernel.io.vn/foodsurf/file-service:1.5.29
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumeMounts:
|
||||
- name: file-volume
|
||||
|
||||
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: gateway-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.30
|
||||
image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.29
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.30</version>
|
||||
<version>1.5.29</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user