From 1c54f1c595281af488c4b805a19b4555fffa8776 Mon Sep 17 00:00:00 2001 From: Melina Gutierrez Date: Sat, 23 Nov 2024 19:37:35 -0400 Subject: [PATCH] =?UTF-8?q?a=C3=B1adir=20nuevos=20requisitos=20en=20Emplea?= =?UTF-8?q?do?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../primefactorsolutions/repositories/EmployeeRepository.java | 2 +- .../java/com/primefactorsolutions/service/EmployeeService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java index 8c0c22f..79e228b 100644 --- a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java +++ b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java @@ -11,6 +11,6 @@ public interface EmployeeRepository extends JpaRepository { Optional findByUsername(String username); Optional findByPersonalEmail(String personalEmail); - Optional findByTeamIdAndLeadManagerTrue(UUID teamId); + Optional findByTeamIdAndLeadManager(UUID teamId); List findByTeamName(String teamName); } \ No newline at end of file diff --git a/src/main/java/com/primefactorsolutions/service/EmployeeService.java b/src/main/java/com/primefactorsolutions/service/EmployeeService.java index 5e89c05..ac42734 100644 --- a/src/main/java/com/primefactorsolutions/service/EmployeeService.java +++ b/src/main/java/com/primefactorsolutions/service/EmployeeService.java @@ -50,7 +50,7 @@ public class EmployeeService { public String getTeamLeadName(final UUID teamId) { // Encuentra al empleado con el rol de lead_manager en el equipo especificado - Optional leadManager = employeeRepository.findByTeamIdAndLeadManagerTrue(teamId); + Optional leadManager = employeeRepository.findByTeamIdAndLeadManager(teamId); return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName()) .orElse("No asignado");