fix: add payment features #52
@@ -65,7 +65,6 @@ public class CustomerService extends BaseService<CustomerEntity> {
|
||||
return Response.accepted()
|
||||
.header(InternalValue.userId, customer.id.toString())
|
||||
.header(InternalValue.role, Role.Customer)
|
||||
.entity(customer)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ public class ManagerService extends BaseService<ManagerEntity> {
|
||||
return Response.accepted()
|
||||
.header(InternalValue.userId, manager.id.toString())
|
||||
.header(InternalValue.role, Role.Manager)
|
||||
.entity(manager)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ public class StaffService extends BaseService<StaffEntity> {
|
||||
.header(InternalValue.userId, staff.id.toString())
|
||||
.header(InternalValue.managerId, staff.serve.id.toString())
|
||||
.header(InternalValue.role, Role.Staff)
|
||||
.entity(staff)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.eclipse.microprofile.graphql.GraphQLApi;
|
||||
@@ -63,7 +62,7 @@ public class CartService {
|
||||
|
||||
String cartId = UUID.randomUUID().toString();
|
||||
String redisKey = "cart:" + cartId;
|
||||
String ownerId = response.readEntity(String.class);
|
||||
String ownerId = response.getEntity().toString();
|
||||
|
||||
hashCommands.hset(
|
||||
redisKey,
|
||||
|
||||
@@ -7,6 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import com.drinkool.controllers.EateryController;
|
||||
import com.drinkool.controllers.ManagerController;
|
||||
import com.drinkool.dtos.Cart;
|
||||
import io.quarkus.redis.datasource.RedisDataSource;
|
||||
import io.quarkus.redis.datasource.hash.HashCommands;
|
||||
@@ -40,6 +41,11 @@ public class CartServiceTest {
|
||||
@RestClient
|
||||
EateryController eateryController;
|
||||
|
||||
|
||||
@InjectMock
|
||||
@RestClient
|
||||
ManagerController managerController;
|
||||
|
||||
@Inject
|
||||
RedisDataSource redisDataSource;
|
||||
|
||||
@@ -59,7 +65,7 @@ public class CartServiceTest {
|
||||
UUID eateryId = UUID.randomUUID();
|
||||
|
||||
when(eateryController.getEateryById(eateryId)).thenReturn(
|
||||
Uni.createFrom().item(Response.ok().build())
|
||||
Uni.createFrom().item(Response.ok(UUID.randomUUID()).build())
|
||||
);
|
||||
|
||||
String cartId = cartService
|
||||
@@ -129,7 +135,7 @@ public class CartServiceTest {
|
||||
hashCommands.hset(key, "_metadata_owner", UUID.randomUUID().toString());
|
||||
|
||||
when(eateryController.checkMenuItemExists(eateryId, menuItemId)).thenReturn(
|
||||
Uni.createFrom().item(Response.ok().build())
|
||||
Uni.createFrom().item(Response.ok(17.0).build())
|
||||
);
|
||||
|
||||
Cart result = cartService
|
||||
|
||||
Reference in New Issue
Block a user