#45-Registro Semanal de Horas Trabajadas corregir employee solucionar error
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m45s
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m45s
This commit is contained in:
parent
249a8cb1ee
commit
21d1313b69
@ -11,7 +11,7 @@ public interface EmployeeRepository extends JpaRepository<Employee, UUID> {
|
|||||||
Optional<Employee> findByUsername(String username);
|
Optional<Employee> findByUsername(String username);
|
||||||
|
|
||||||
Optional<Employee> findByPersonalEmail(String personalEmail);
|
Optional<Employee> findByPersonalEmail(String personalEmail);
|
||||||
Optional<Employee> findByTeamIdAndLeadManagerTrue(UUID teamId);
|
Optional<Employee> findByTeamId(UUID teamId);
|
||||||
|
|
||||||
List<Employee> findByTeamName(String teamName);
|
List<Employee> findByTeamName(String teamName);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ public class EmployeeService {
|
|||||||
|
|
||||||
public String getTeamLeadName(final UUID teamId) {
|
public String getTeamLeadName(final UUID teamId) {
|
||||||
// Encuentra al empleado con el rol de lead_manager en el equipo especificado
|
// Encuentra al empleado con el rol de lead_manager en el equipo especificado
|
||||||
Optional<Employee> leadManager = employeeRepository.findByTeamIdAndLeadManagerTrue(teamId);
|
Optional<Employee> leadManager = employeeRepository.findByTeamId(teamId);
|
||||||
|
|
||||||
return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName())
|
return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName())
|
||||||
.orElse("No asignado");
|
.orElse("No asignado");
|
||||||
|
Loading…
Reference in New Issue
Block a user