Agregar condicion para tomar dia libre por cumpleaños

This commit is contained in:
jesus.pelaez 2024-11-20 10:07:53 -04:00 committed by Alex Prudencio
parent 290c5532df
commit aebae5d550

View File

@ -191,6 +191,10 @@ public class RequestRegisterView extends VerticalLayout {
private boolean isCategoryAvailable(final List<TimeOffRequest> employeeRequests,
final TimeOffRequestType category) {
if (category == TimeOffRequestType.CUMPLEAÑOS && employee.getBirthday() == null) {
return false;
}
List<TimeOffRequest> requestsByCategory = employeeRequests.stream()
.filter(request -> request.getCategory() == category)
.toList();