diff --git a/src/main/bundles/prod.bundle b/src/main/bundles/prod.bundle index ae88724..2d36e74 100644 Binary files a/src/main/bundles/prod.bundle and b/src/main/bundles/prod.bundle differ diff --git a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java index 90b6919..a72f647 100644 --- a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java +++ b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java @@ -9,8 +9,7 @@ import java.util.UUID; public interface EmployeeRepository extends JpaRepository { Optional findByUsername(String username); - Optional findByPersonalEmail(String personalEmail); - Optional findByTeamId(UUID teamId); + List findAllByTeamId(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 bb42d32..1f374e8 100644 --- a/src/main/java/com/primefactorsolutions/service/EmployeeService.java +++ b/src/main/java/com/primefactorsolutions/service/EmployeeService.java @@ -1,4 +1,5 @@ package com.primefactorsolutions.service; +import com.google.common.base.Strings; import com.primefactorsolutions.model.Employee; import jakarta.persistence.EntityManager; import lombok.AllArgsConstructor; @@ -50,7 +51,10 @@ 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.findByTeamId(teamId); + List teamMembers = employeeRepository.findAllByTeamId(teamId); + Optional leadManager = teamMembers.stream() + .filter(e -> Strings.isNullOrEmpty(e.getLeadManager())) + .findFirst(); return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName()) .orElse("No asignado");