From a02499d53f45ecc3ff634e601eae60d49f900fff Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 31 Oct 2024 01:34:18 -0400 Subject: [PATCH] =?UTF-8?q?Estado=20de=20la=20solicitud=20-=20traducirlo?= =?UTF-8?q?=20al=20espa=C3=B1ol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/TimeOffRequestStatus.java | 22 +++++++++---------- .../views/RequestEmployeeView.java | 2 +- .../views/RequestRegisterView.java | 14 ++++++------ .../views/RequestsListView.java | 4 ++-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/model/TimeOffRequestStatus.java b/src/main/java/com/primefactorsolutions/model/TimeOffRequestStatus.java index e549c4e..ac6f552 100644 --- a/src/main/java/com/primefactorsolutions/model/TimeOffRequestStatus.java +++ b/src/main/java/com/primefactorsolutions/model/TimeOffRequestStatus.java @@ -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 } diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index fc58d29..ba59a9a 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -170,7 +170,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter : 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) { diff --git a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java index a3b1f54..304b84f 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java @@ -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 existingRequests = requestService.findByEmployeeAndCategory(employee.getId(), request.getCategory()); diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index 58f991d..7721c1c 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -130,7 +130,7 @@ public class RequestsListView extends Main { filteredEmployees = filteredEmployees.stream() .filter(emp -> { Optional 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 activeRequest = requestService - .findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.IN_USE); + .findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.EN_USO); return activeRequest.isPresent() ? "EN_DESCANSO" : "ACTIVO"; }