Resolver errores de checkstyle
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m36s
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m36s
This commit is contained in:
parent
8e1f0fdd7d
commit
b1e95cf8a5
@ -240,7 +240,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter<String>
|
||||
.sum();
|
||||
}
|
||||
|
||||
private int getStartDateYear(TimeOffRequest request) {
|
||||
private int getStartDateYear(final TimeOffRequest request) {
|
||||
if (request.getStartDate() != null) {
|
||||
return request.getStartDate().getYear();
|
||||
}
|
||||
@ -349,19 +349,19 @@ public class RequestEmployeeView extends Div implements HasUrlParameter<String>
|
||||
return employeeService.getEmployee(employeeId).getGender() == Employee.Gender.MALE;
|
||||
}
|
||||
|
||||
private boolean isValidRequestType(TimeOffRequestType type, boolean isMale) {
|
||||
private boolean isValidRequestType(final TimeOffRequestType type, final boolean isMale) {
|
||||
return !getStandardExclusions().contains(type)
|
||||
&& !(isMale && getMaleSpecificExclusions().contains(type))
|
||||
&& type != TimeOffRequestType.TODOS;
|
||||
}
|
||||
|
||||
private TimeOffRequest createRequest(TimeOffRequestType type) {
|
||||
private TimeOffRequest createRequest(final TimeOffRequestType type) {
|
||||
TimeOffRequest request = new TimeOffRequest();
|
||||
request.setCategory(type);
|
||||
return request;
|
||||
}
|
||||
|
||||
private boolean isVacationExpired(TimeOffRequest request) {
|
||||
private boolean isVacationExpired(final TimeOffRequest request) {
|
||||
Vacation vacation = vacationService.findVacationByCategory(request.getCategory());
|
||||
|
||||
if (vacation != null && vacation.getMonthOfYear() != null && vacation.getDayOfMonth() != null) {
|
||||
@ -376,7 +376,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter<String>
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean shouldIncludeRequest(TimeOffRequestType type) {
|
||||
private boolean shouldIncludeRequest(final TimeOffRequestType type) {
|
||||
List<TimeOffRequest> existingRequest = requestService.findByEmployeeAndCategory(employeeId, type);
|
||||
return existingRequest.isEmpty();
|
||||
}
|
||||
|
@ -196,8 +196,9 @@ public class RequestsListView extends Main {
|
||||
return employeeRequests.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(request -> request.getStartDate() != null && (
|
||||
request.getStartDate().getYear() == currentYear ||
|
||||
(request.getCategory().name().startsWith("VACACION") && request.getStartDate().getYear() == currentYear - 1)
|
||||
request.getStartDate().getYear() == currentYear
|
||||
|| (request.getCategory().name().startsWith("VACACION")
|
||||
&& request.getStartDate().getYear() == currentYear - 1)
|
||||
))
|
||||
.mapToDouble(request -> request.getDaysToBeTake() != null ? request.getDaysToBeTake() : 0.0)
|
||||
.sum();
|
||||
|
Loading…
Reference in New Issue
Block a user