En-desarrollo #65

Merged
alex merged 29 commits from En-desarrollo into main 2024-11-09 12:15:26 +00:00
4 changed files with 21 additions and 21 deletions
Showing only changes of commit a02499d53f - Show all commits

View File

@ -1,15 +1,15 @@
package com.primefactorsolutions.model;
public enum TimeOffRequestStatus {
ALL,
TAKEN,
REQUESTED,
APPROVED,
IN_USE,
UNDER_REVIEW,
PENDING,
REJECTED,
COMPLETED,
CANCELLED,
EXPIRED
TODOS,
TOMADO,
SOLICITADO,
APROBADO,
EN_USO,
EN_REVISION,
PENDIENTE,
RECHAZADO,
COMPLETADO,
CANCELADO,
VENCIDO
}

View File

@ -170,7 +170,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter<String>
: fetchFilteredTimeOffRequests(category, state);
for (TimeOffRequest request : filteredRequests) {
if (request.getExpiration().isBefore(LocalDate.now())) {
request.setState(TimeOffRequestStatus.EXPIRED);
request.setState(TimeOffRequestStatus.VENCIDO);
}
}
for (TimeOffRequest request : filteredRequests) {

View File

@ -148,10 +148,10 @@ public class RequestRegisterView extends VerticalLayout {
if (category == TimeOffRequestType.HEALTH_PERMIT
|| category == TimeOffRequestType.VACATION_CURRENT_MANAGEMENT
|| category == TimeOffRequestType.VACATION_PREVIOUS_MANAGEMENT) {
return latestRequest.getState() == TimeOffRequestStatus.EXPIRED
|| (latestRequest.getState() == TimeOffRequestStatus.TAKEN && latestRequest.getDaysBalance() > 0);
return latestRequest.getState() == TimeOffRequestStatus.VENCIDO
|| (latestRequest.getState() == TimeOffRequestStatus.TOMADO && latestRequest.getDaysBalance() > 0);
} else {
return latestRequest.getState() == TimeOffRequestStatus.EXPIRED;
return latestRequest.getState() == TimeOffRequestStatus.VENCIDO;
}
}
@ -181,13 +181,13 @@ public class RequestRegisterView extends VerticalLayout {
if (vacation != null) {
TimeOffRequest requestWithBalance = requests.stream()
.filter(request -> request.getDaysBalance() > 0
&& request.getState() != TimeOffRequestStatus.EXPIRED)
&& request.getState() != TimeOffRequestStatus.VENCIDO)
.max(Comparator.comparing(TimeOffRequest::getStartDate))
.orElse(null);
if (requestWithBalance != null) {
if (requestWithBalance.getState() == TimeOffRequestStatus.TAKEN) {
if (requestWithBalance.getState() == TimeOffRequestStatus.TOMADO) {
availableDaysField.setValue(requestWithBalance.getDaysBalance());
} else if (requestWithBalance.getState() == TimeOffRequestStatus.EXPIRED) {
} else if (requestWithBalance.getState() == TimeOffRequestStatus.VENCIDO) {
availableDaysField.setValue(vacation.getDuration());
}
} else if (vacation.getCategory() == TimeOffRequestType.VACATION_CURRENT_MANAGEMENT) {
@ -330,7 +330,7 @@ public class RequestRegisterView extends VerticalLayout {
} else {
request.setExpiration(endDate);
}
request.setState(TimeOffRequestStatus.REQUESTED);
request.setState(TimeOffRequestStatus.SOLICITADO);
List<TimeOffRequest> existingRequests =
requestService.findByEmployeeAndCategory(employee.getId(), request.getCategory());

View File

@ -130,7 +130,7 @@ public class RequestsListView extends Main {
filteredEmployees = filteredEmployees.stream()
.filter(emp -> {
Optional<TimeOffRequest> request = requestService
.findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.IN_USE);
.findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.EN_USO);
return state == Status.EN_DESCANSO ? request.isPresent() : request.isEmpty();
})
.collect(Collectors.toList());
@ -155,7 +155,7 @@ public class RequestsListView extends Main {
private String getEmployeeStatus(final Employee employee) {
Optional<TimeOffRequest> activeRequest = requestService
.findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.IN_USE);
.findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.EN_USO);
return activeRequest.isPresent() ? "EN_DESCANSO" : "ACTIVO";
}