Categoria vacaciones - traducirlo al español

This commit is contained in:
jesus.pelaez 2024-10-31 01:42:33 -04:00
parent a02499d53f
commit c0cc1e86de
3 changed files with 47 additions and 47 deletions

View File

@ -1,29 +1,29 @@
package com.primefactorsolutions.model;
public enum TimeOffRequestType {
ALL,
NEW_YEAR,
MONDAY_CARNIVAL,
TUESDAY_CARNIVAL,
GOOD_FRIDAY,
LABOR_DAY,
INDEPENDENCE_DAY,
CHRISTMAS,
PRURINATIONAL_STATE_DAY,
TODOS,
AÑO_NUEVO,
LUNES_CARNAVAL,
MARTES_CARNAVAL,
VIERNES_SANTO,
DIA_DEL_TRABAJADOR,
DIA_DE_LA_INDEPENDENCIA,
NAVIDAD,
DIA_DEL_ESTADO_PLURINACIONAL,
CORPUS_CHRISTI,
ANDEAN_NEW_YEAR,
DEPARTMENTAL_ANNIVERSARY,
ALL_SOULS_DAY,
AÑO_NUEVO_ANDINO,
ANIVERSARIO_DEPARTAMENTAL,
DIA_DE_TODOS_LOS_DIFUNTOS,
BIRTHDAY,
MATERNITY,
PATERNITY,
MARRIAGE,
FATHERS_DAY,
MOTHERS_DAY,
INTERNATIONAL_WOMENS_DAY,
NATIONAL_WOMENS_DAY,
HEALTH_PERMIT,
VACATION_CURRENT_MANAGEMENT,
VACATION_PREVIOUS_MANAGEMENT,
CUMPLEAÑOS,
MATERNIDAD,
PATERNIDAD,
MATRIMONIO,
DIA_DEL_PADRE,
DIA_DE_LA_MADRE,
DIA_DE_LA_MUJER_INTERNACIONAL,
DIA_DE_LA_MUJER_NACIONAL,
PERMISOS_DE_SALUD,
VACACION_GESTION_ACTUAL,
VACACION_GESTION_ANTERIOR,
}

View File

@ -145,9 +145,9 @@ public class RequestRegisterView extends VerticalLayout {
.max(Comparator.comparing(TimeOffRequest::getStartDate))
.orElse(null);
if (category == TimeOffRequestType.HEALTH_PERMIT
|| category == TimeOffRequestType.VACATION_CURRENT_MANAGEMENT
|| category == TimeOffRequestType.VACATION_PREVIOUS_MANAGEMENT) {
if (category == TimeOffRequestType.PERMISOS_DE_SALUD
|| category == TimeOffRequestType.VACACION_GESTION_ACTUAL
|| category == TimeOffRequestType.VACACION_GESTION_ANTERIOR) {
return latestRequest.getState() == TimeOffRequestStatus.VENCIDO
|| (latestRequest.getState() == TimeOffRequestStatus.TOMADO && latestRequest.getDaysBalance() > 0);
} else {
@ -157,13 +157,13 @@ public class RequestRegisterView extends VerticalLayout {
private boolean isCategoryAllowedByGender(final TimeOffRequestType category, final Employee.Gender gender) {
if (gender == Employee.Gender.MALE) {
return category != TimeOffRequestType.MATERNITY
&& category != TimeOffRequestType.MOTHERS_DAY
&& category != TimeOffRequestType.INTERNATIONAL_WOMENS_DAY
&& category != TimeOffRequestType.NATIONAL_WOMENS_DAY;
return category != TimeOffRequestType.MATERNIDAD
&& category != TimeOffRequestType.DIA_DE_LA_MADRE
&& category != TimeOffRequestType.DIA_DE_LA_MUJER_INTERNACIONAL
&& category != TimeOffRequestType.DIA_DE_LA_MUJER_NACIONAL;
} else {
return category != TimeOffRequestType.FATHERS_DAY
&& category != TimeOffRequestType.PATERNITY;
return category != TimeOffRequestType.DIA_DEL_PADRE
&& category != TimeOffRequestType.PATERNIDAD;
}
}
@ -190,7 +190,7 @@ public class RequestRegisterView extends VerticalLayout {
} else if (requestWithBalance.getState() == TimeOffRequestStatus.VENCIDO) {
availableDaysField.setValue(vacation.getDuration());
}
} else if (vacation.getCategory() == TimeOffRequestType.VACATION_CURRENT_MANAGEMENT) {
} else if (vacation.getCategory() == TimeOffRequestType.VACACION_GESTION_ACTUAL) {
LocalDate dateOfEntry = employeeComboBox.getValue().getDateOfEntry();
LocalDate currentDate = LocalDate.now();
long yearsOfService = ChronoUnit.YEARS.between(dateOfEntry, currentDate);
@ -244,13 +244,13 @@ public class RequestRegisterView extends VerticalLayout {
vacation.getDayOfMonth().intValue());
endDate = startDate.plusDays(vacation.getExpiration().intValue() - 1);
} else {
if (vacation.getCategory() == TimeOffRequestType.BIRTHDAY && employee.getBirthday() != null) {
if (vacation.getCategory() == TimeOffRequestType.CUMPLEAÑOS && employee.getBirthday() != null) {
startDate = LocalDate.of(
startYear,
employee.getBirthday().getMonth(),
employee.getBirthday().getDayOfMonth());
endDate = startDate.plusDays(vacation.getExpiration().intValue() - 1);
} else if (vacation.getCategory() == TimeOffRequestType.HEALTH_PERMIT) {
} else if (vacation.getCategory() == TimeOffRequestType.PERMISOS_DE_SALUD) {
startDate = LocalDate.now();
endDate = LocalDate.of(startYear, 12, 31);
} else {
@ -260,7 +260,7 @@ public class RequestRegisterView extends VerticalLayout {
startDatePicker.setValue(startDate);
if ((vacation.getDuration() != null && vacation.getDuration() == 0.5)
|| vacation.getCategory() == TimeOffRequestType.HEALTH_PERMIT) {
|| vacation.getCategory() == TimeOffRequestType.PERMISOS_DE_SALUD) {
endDatePicker.setValue(startDate);
} else {
int durationDays = (vacation.getDuration() != null ? vacation.getDuration().intValue() - 1 : 0);
@ -291,7 +291,7 @@ public class RequestRegisterView extends VerticalLayout {
if (startDate != null && endDate != null) {
double daysToBeTaken = java.time.temporal.ChronoUnit.DAYS.between(startDate, endDate) + 1;
if (vacation.getCategory() == TimeOffRequestType.HEALTH_PERMIT || vacation.getDuration() == 0.5) {
if (vacation.getCategory() == TimeOffRequestType.PERMISOS_DE_SALUD || vacation.getDuration() == 0.5) {
daysToBeTakenField.setValue(0.5);
} else {
daysToBeTakenField.setValue(daysToBeTaken);
@ -335,7 +335,7 @@ public class RequestRegisterView extends VerticalLayout {
List<TimeOffRequest> existingRequests =
requestService.findByEmployeeAndCategory(employee.getId(), request.getCategory());
int maxRequests = request.getCategory() == TimeOffRequestType.HEALTH_PERMIT ? 4 : 2;
int maxRequests = request.getCategory() == TimeOffRequestType.PERMISOS_DE_SALUD ? 4 : 2;
if (existingRequests.size() >= maxRequests) {
existingRequests.stream()
@ -355,8 +355,8 @@ public class RequestRegisterView extends VerticalLayout {
List<TimeOffRequest> requests = requestService.findByEmployeeAndCategory(
newRequest.getEmployee().getId(), newRequest.getCategory());
if (vacation.getCategory() == TimeOffRequestType.HEALTH_PERMIT
&& vacation.getCategory() == TimeOffRequestType.VACATION_CURRENT_MANAGEMENT) {
if (vacation.getCategory() == TimeOffRequestType.PERMISOS_DE_SALUD
&& vacation.getCategory() == TimeOffRequestType.VACACION_GESTION_ACTUAL) {
for (TimeOffRequest request : requests) {
double newBalance = request.getDaysBalance() - newRequest.getDaysToBeTake();
request.setDaysBalance(newBalance);

View File

@ -170,18 +170,18 @@ public class RequestsListView extends Main {
private Set<TimeOffRequestType> getExcludedCategories() {
return Set.of(
TimeOffRequestType.MATERNITY,
TimeOffRequestType.PATERNITY,
TimeOffRequestType.MARRIAGE,
TimeOffRequestType.FATHERS_DAY,
TimeOffRequestType.MOTHERS_DAY
TimeOffRequestType.MATERNIDAD,
TimeOffRequestType.PATERNIDAD,
TimeOffRequestType.MATRIMONIO,
TimeOffRequestType.DIA_DEL_PADRE,
TimeOffRequestType.DIA_DE_LA_MADRE
);
}
private Set<TimeOffRequestType> getGenderSpecificExclusions() {
return Set.of(
TimeOffRequestType.INTERNATIONAL_WOMENS_DAY,
TimeOffRequestType.NATIONAL_WOMENS_DAY
TimeOffRequestType.DIA_DE_LA_MUJER_INTERNACIONAL,
TimeOffRequestType.DIA_DE_LA_MUJER_NACIONAL
);
}