From 82b0c88fccbb86d1dea4f4e795f3c72780ff21e3 Mon Sep 17 00:00:00 2001 From: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Date: Tue, 12 May 2026 01:45:58 +0000 Subject: [PATCH] chore: update --- .../src/main/java/com/drinkool/services/ShiftService.java | 2 +- .../test/java/com/drinkool/services/ShiftServiceTest.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eatery-service/src/main/java/com/drinkool/services/ShiftService.java b/eatery-service/src/main/java/com/drinkool/services/ShiftService.java index 96a6a34..b789b95 100644 --- a/eatery-service/src/main/java/com/drinkool/services/ShiftService.java +++ b/eatery-service/src/main/java/com/drinkool/services/ShiftService.java @@ -161,7 +161,7 @@ public class ShiftService { @Description("Quản lý xóa một ca trực") @RolesAllowed(Role.Manager) @Transactional - public boolean deleteShift(@Name("id") Long id) throws GraphQLException { + public boolean deleteShift(@Name("id") UUID id) throws GraphQLException { String ownerId = request.getHeader(InternalValue.userId); EateryEntity eatery = EateryEntity.findByOwnerId(ownerId); diff --git a/eatery-service/src/test/java/com/drinkool/services/ShiftServiceTest.java b/eatery-service/src/test/java/com/drinkool/services/ShiftServiceTest.java index 88f4033..4108692 100644 --- a/eatery-service/src/test/java/com/drinkool/services/ShiftServiceTest.java +++ b/eatery-service/src/test/java/com/drinkool/services/ShiftServiceTest.java @@ -145,6 +145,8 @@ public class ShiftServiceTest { given() .contentType("application/json") .header(InternalValue.userId, staffId.toString()) + .header(InternalValue.managerId, ownerId.toString()) + .header(InternalValue.role, Role.Staff) .body("{ \"query\": \"" + mutation + "\" }") .when() .post("/graphql") @@ -164,8 +166,7 @@ public class ShiftServiceTest { "12:00:00", eatery ); - UUID staffId = UUID.randomUUID(); - registerStaffToShift(staffId, shift); + registerStaffToShift(UUID.randomUUID(), shift); String mutation = String.format( "mutation { deleteShift(id: \\\"%s\\\") }", @@ -173,6 +174,8 @@ public class ShiftServiceTest { ); given() + .header(InternalValue.userId, ownerId.toString()) + .header(InternalValue.role, Role.Manager) .contentType("application/json") .body("{ \"query\": \"" + mutation + "\" }") .when()