añadir nuevos requisitos en Empleado

This commit is contained in:
Melina Gutierrez 2024-11-23 19:37:35 -04:00 committed by Alex Prudencio
parent fc51e227a5
commit 1c54f1c595
2 changed files with 2 additions and 2 deletions

View File

@ -11,6 +11,6 @@ public interface EmployeeRepository extends JpaRepository<Employee, UUID> {
Optional<Employee> findByUsername(String username);
Optional<Employee> findByPersonalEmail(String personalEmail);
Optional<Employee> findByTeamIdAndLeadManagerTrue(UUID teamId);
Optional<Employee> findByTeamIdAndLeadManager(UUID teamId);
List<Employee> findByTeamName(String teamName);
}

View File

@ -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<Employee> leadManager = employeeRepository.findByTeamIdAndLeadManagerTrue(teamId);
Optional<Employee> leadManager = employeeRepository.findByTeamIdAndLeadManager(teamId);
return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName())
.orElse("No asignado");