diff --git a/src/main/java/com/primefactorsolutions/service/TimeOffRequestService.java b/src/main/java/com/primefactorsolutions/service/TimeOffRequestService.java index 4001143..65651a8 100644 --- a/src/main/java/com/primefactorsolutions/service/TimeOffRequestService.java +++ b/src/main/java/com/primefactorsolutions/service/TimeOffRequestService.java @@ -18,7 +18,7 @@ public class TimeOffRequestService { timeOffRequestRepository.save(newTimeOffRequest); } - public void saveAll(List requests) { + public void saveAll(final List requests) { timeOffRequestRepository.saveAll(requests); } @@ -35,7 +35,7 @@ public class TimeOffRequestService { return timeOffRequest.orElse(null); } - public List findRequestsByState(TimeOffRequestStatus state) { + public List findRequestsByState(final TimeOffRequestStatus state) { return timeOffRequestRepository.findByState(state); } diff --git a/src/main/java/com/primefactorsolutions/views/MainView.java b/src/main/java/com/primefactorsolutions/views/MainView.java index 8c44b5a..bc3239d 100644 --- a/src/main/java/com/primefactorsolutions/views/MainView.java +++ b/src/main/java/com/primefactorsolutions/views/MainView.java @@ -19,7 +19,7 @@ public class MainView extends Main { private final TimeOffRequestService requestService; - public MainView(TimeOffRequestService requestService) { + public MainView(final TimeOffRequestService requestService) { this.requestService = requestService; add(new Text("Welcome")); updateRequestStatuses(); diff --git a/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java b/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java index e1311ea..1ef9f4e 100644 --- a/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/PendingRequestsListView.java @@ -84,7 +84,7 @@ public class PendingRequestsListView extends Main { return new HorizontalLayout(approveButton, rejectButton, closeButton); } - private Button createActionButton(String caption, TimeOffRequestStatus status) { + private Button createActionButton(final String caption, final TimeOffRequestStatus status) { return new Button(caption, event -> { if (selectedRequestId != null) { TimeOffRequest request = requestService.findTimeOffRequest(selectedRequestId); @@ -112,7 +112,8 @@ public class PendingRequestsListView extends Main { final Employee employee, final Team team, final TimeOffRequestType category) { - List filteredPendingRequests = requestService.findRequestsByState(TimeOffRequestStatus.PENDIENTE); + List filteredPendingRequests + = requestService.findRequestsByState(TimeOffRequestStatus.PENDIENTE); if (employee != null && !"TODOS".equals(employee.getFirstName())) { filteredPendingRequests = filteredPendingRequests.stream() @@ -122,7 +123,8 @@ public class PendingRequestsListView extends Main { if (team != null && !"TODOS".equals(team.getName())) { filteredPendingRequests = filteredPendingRequests.stream() - .filter(emp -> emp.getEmployee().getTeam() != null && emp.getEmployee().getTeam().getId().equals(team.getId())) + .filter(emp -> emp.getEmployee().getTeam() != null + && emp.getEmployee().getTeam().getId().equals(team.getId())) .collect(Collectors.toList()); } @@ -142,7 +144,8 @@ public class PendingRequestsListView extends Main { } private String getEmployeeFullNameLabel(final Employee employee) { - return "TODOS".equals(employee.getFirstName()) ? "TODOS" : employee.getFirstName() + " " + employee.getLastName(); + return "TODOS".equals(employee.getFirstName()) + ? "TODOS" : employee.getFirstName() + " " + employee.getLastName(); } private String getTeamName(final TimeOffRequest request) { @@ -154,7 +157,7 @@ public class PendingRequestsListView extends Main { return "TODOS".equals(team.getName()) ? "TODOS" : team.getName(); } - private String getCategory(TimeOffRequest request){ + private String getCategory(final TimeOffRequest request) { return String.valueOf(request.getCategory()); } diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index 00f2eac..f2e0088 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -21,7 +21,6 @@ import com.vaadin.flow.spring.annotation.SpringComponent; import jakarta.annotation.security.PermitAll; import org.springframework.context.annotation.Scope; -import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.UUID; diff --git a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java index 8abc086..b01ed9b 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestRegisterView.java @@ -136,7 +136,8 @@ public class RequestRegisterView extends VerticalLayout { List availableCategories = allCategories.stream() .filter(category -> isCategoryAvailable(employeeRequests, category)) .filter(category -> isCategoryAllowedByGender(category, employee.getGender())) - .filter(category -> category != TimeOffRequestType.VACACION_GESTION_ANTERIOR && category != TimeOffRequestType.TODOS) + .filter(category -> category != TimeOffRequestType.VACACION_GESTION_ANTERIOR + && category != TimeOffRequestType.TODOS) .toList(); categoryComboBox.setItems(availableCategories); @@ -235,7 +236,8 @@ public class RequestRegisterView extends VerticalLayout { endDate = null; UUID employeeId = employee.getId(); - List previousRequests = requestService.findByEmployeeAndCategory(employeeId, vacation.getCategory()); + List previousRequests + = requestService.findByEmployeeAndCategory(employeeId, vacation.getCategory()); int startYear = calculateStartYear(previousRequests); diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index facfb69..8b6465c 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -141,7 +141,8 @@ public class RequestsListView extends Main { } private String getEmployeeFullName(final Employee employee) { - return "TODOS".equals(employee.getFirstName()) ? "TODOS" : employee.getFirstName() + " " + employee.getLastName(); + return "TODOS".equals(employee.getFirstName()) + ? "TODOS" : employee.getFirstName() + " " + employee.getLastName(); } private String getTeamName(final Employee employee) {