Compare commits

..

No commits in common. "5a270d679528279af4eded52ed10dadf5e2fb4ed" and "7d3b63f6a822661b78dc8f55cb44cb55c5178c4b" have entirely different histories.

5 changed files with 108 additions and 123 deletions

View File

@ -1,14 +1,11 @@
package com.primefactorsolutions.repositories; package com.primefactorsolutions.repositories;
import com.primefactorsolutions.model.TimeOffRequest; import com.primefactorsolutions.model.TimeOffRequest;
import com.primefactorsolutions.model.TimeOffRequestStatus;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.UUID; import java.util.UUID;
public interface TimeOffRequestRepository extends JpaRepository<TimeOffRequest, UUID> { public interface TimeOffRequestRepository extends JpaRepository<TimeOffRequest, UUID> {
List<TimeOffRequest> findByEmployeeId(UUID idEmployee); List<TimeOffRequest> findByEmployeeId(UUID idEmployee);
Optional<TimeOffRequest> findByEmployeeIdAndState(UUID employeeId, TimeOffRequestStatus state);
} }

View File

@ -34,8 +34,4 @@ public class TimeOffRequestService {
public List<TimeOffRequest> findRequestsByEmployeeId(final UUID idEmployee) { public List<TimeOffRequest> findRequestsByEmployeeId(final UUID idEmployee) {
return timeOffRequestRepository.findByEmployeeId(idEmployee); return timeOffRequestRepository.findByEmployeeId(idEmployee);
} }
public Optional<TimeOffRequest> findByEmployeeAndState(final UUID employeeId, final TimeOffRequestStatus state) {
return timeOffRequestRepository.findByEmployeeIdAndState(employeeId, state);
}
} }

View File

@ -111,11 +111,11 @@ public class RequestView extends BeanValidationForm<TimeOffRequest> implements H
setRequestFieldValues(request); setRequestFieldValues(request);
requestService.saveTimeOffRequest(request); requestService.saveTimeOffRequest(request);
Notification.show("Request saved successfully."); Notification.show("Request saved successfully.");
closeForm(); clearForm();
} }
} }
private void setRequestFieldValues(final TimeOffRequest request) { private void setRequestFieldValues(TimeOffRequest request) {
request.setState(state.getValue()); request.setState(state.getValue());
request.setExpiration(expiration.getValue()); request.setExpiration(expiration.getValue());
request.setStartDate(startDate.getValue()); request.setStartDate(startDate.getValue());
@ -137,6 +137,15 @@ public class RequestView extends BeanValidationForm<TimeOffRequest> implements H
&& daysToBeTake.getValue() != null; && daysToBeTake.getValue() != null;
} }
private void clearForm() {
state.clear();
expiration.clear();
startDate.clear();
endDate.clear();
availableDays.clear();
daysToBeTake.clear();
}
private void configureViewOrEditAction(final String action) { private void configureViewOrEditAction(final String action) {
if ("edit".equals(action) && !request.getId().toString().isEmpty()) { if ("edit".equals(action) && !request.getId().toString().isEmpty()) {
setFieldsReadOnly(false); setFieldsReadOnly(false);

View File

@ -7,6 +7,7 @@ import com.primefactorsolutions.service.TimeOffRequestService;
import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.combobox.ComboBox; import com.vaadin.flow.component.combobox.ComboBox;
import com.vaadin.flow.component.html.Main; import com.vaadin.flow.component.html.Main;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.notification.Notification; import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.PageTitle;
@ -16,7 +17,9 @@ import jakarta.annotation.security.PermitAll;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
import org.vaadin.firitin.components.grid.PagingGrid; import org.vaadin.firitin.components.grid.PagingGrid;
import java.util.*; import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@SpringComponent @SpringComponent
@ -29,25 +32,23 @@ public class RequestsListView extends Main {
private final TimeOffRequestService requestService; private final TimeOffRequestService requestService;
private final EmployeeService employeeService; private final EmployeeService employeeService;
private final TeamService teamService; private final TeamService teamService;
private final PagingGrid<Employee> requestGrid = new PagingGrid<>(); private final PagingGrid<TimeOffRequest> requestGrid = new PagingGrid<>(TimeOffRequest.class);
private List<TimeOffRequest> requests = Collections.emptyList();
private List<Employee> employees = Collections.emptyList();
private ComboBox<Employee> employeeFilter; private ComboBox<Employee> employeeFilter;
private ComboBox<Team> teamFilter; private ComboBox<Team> teamFilter;
private ComboBox<TimeOffRequestType> categoryFilter; private ComboBox<TimeOffRequestType> categoryFilter;
private ComboBox<Status> stateFilter; private ComboBox<TimeOffRequestStatus> stateFilter;
private UUID selectedEmployeeId; private UUID selectedEmployeeId;
public RequestsListView(final TimeOffRequestService requestService, public RequestsListView(final TimeOffRequestService requestService,
final EmployeeService employeeService, final EmployeeService employeeService,
final TeamService teamService) { final TeamService teamService) {
this.requestService = requestService; this.requestService = requestService;
this.employeeService = employeeService; this.employeeService = employeeService;
this.teamService = teamService; this.teamService = teamService;
this.employees = employeeService.findAllEmployees(); this.requests = requestService.findAllTimeOffRequests();
initializeView(); initializeView();
refreshGeneralRequestGrid(null, null, null, null); refreshRequestGrid(null, null, null, null);
} }
private void initializeView() { private void initializeView() {
@ -65,20 +66,24 @@ public class RequestsListView extends Main {
} }
private void setupRequestGrid() { private void setupRequestGrid() {
requestGrid.addColumn(this::getEmployeeFullName).setHeader("Employee"); requestGrid.setColumns(
requestGrid.addColumn(this::getTeamName).setHeader("Team"); "category",
requestGrid.addColumn(this::getEmployeeStatus).setHeader("State"); "state",
requestGrid.addColumn(this::getCategory).setHeader("Category"); "availableDays",
requestGrid.addColumn(this::getStartDate).setHeader("Start Date"); "expiration",
requestGrid.addColumn(this::getEndDate).setHeader("End Date"); "startDate",
requestGrid.addColumn(this::getDaysBalance).setHeader("Days Balance"); "endDate",
"daysToBeTake",
"daysBalance"
);
requestGrid.addComponentColumn(this::createEmployeeSpan).setHeader("Employee");
requestGrid.addComponentColumn(this::createTeamSpan).setHeader("Team");
requestGrid.setPaginationBarMode(PagingGrid.PaginationBarMode.BOTTOM); requestGrid.setPaginationBarMode(PagingGrid.PaginationBarMode.BOTTOM);
requestGrid.setPageSize(5); requestGrid.setPageSize(5);
requestGrid.asSingleSelect().addValueChangeListener(event -> { requestGrid.asSingleSelect().addValueChangeListener(event -> {
Employee selectedRequest = event.getValue(); TimeOffRequest selectedRequest = event.getValue();
if (selectedRequest != null) { if (selectedRequest != null) {
selectedEmployeeId = selectedRequest.getId(); selectedEmployeeId = selectedRequest.getEmployee().getId();
} }
}); });
} }
@ -95,114 +100,90 @@ public class RequestsListView extends Main {
return new HorizontalLayout(viewButton, closeButton); return new HorizontalLayout(viewButton, closeButton);
} }
private void refreshGeneralRequestGrid(final Employee employee, private void refreshRequestGrid(final Employee employee,
final Team team, final Team team,
final TimeOffRequestType category, final TimeOffRequestType category,
final Status state) { final TimeOffRequestStatus state) {
requestGrid.setPagingDataProvider((page, pageSize) -> { requestGrid.setPagingDataProvider((page, pageSize) -> {
requests = requestService.findAllTimeOffRequests();
int start = (int) (page * requestGrid.getPageSize()); int start = (int) (page * requestGrid.getPageSize());
return fetchFilteredEmployees(start, pageSize, employee, team, category, state); if (allFiltersAreNull(employee, team, category, state)) {
return fetchTimeOffRequests(start, pageSize);
} else {
return fetchFilteredTimeOffRequests(start, pageSize, employee, team, category, state);
}
}); });
requestGrid.getDataProvider().refreshAll(); requestGrid.getDataProvider().refreshAll();
} }
private List<Employee> fetchFilteredEmployees(final int start, private boolean allFiltersAreNull(final Employee employee,
final int pageSize, final Team team,
final Employee employee, final TimeOffRequestType category,
final Team team, final TimeOffRequestStatus state) {
final TimeOffRequestType category, return employee == null && team == null && category == null && state == null;
final Status state) { }
List<Employee> filteredEmployees = employeeService.findAllEmployees();
private List<TimeOffRequest> fetchTimeOffRequests(final int start, final int pageSize) {
int end = start + pageSize;
if (end > requests.size()) {
end = requests.size();
}
return requests.subList(start, end);
}
private List<TimeOffRequest> fetchFilteredTimeOffRequests(final int start,
final int pageSize,
final Employee employee,
final Team team,
final TimeOffRequestType category,
final TimeOffRequestStatus state) {
if (employee != null && !"ALL".equals(employee.getFirstName())) { if (employee != null && !"ALL".equals(employee.getFirstName())) {
filteredEmployees = filteredEmployees.stream() requests = requests.stream()
.filter(emp -> emp.getId().equals(employee.getId())) .filter(request -> request.getEmployee().getId().equals(employee.getId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (team != null && !"ALL".equals(team.getName())) { if (team != null && !"ALL".equals(team.getName())) {
filteredEmployees = filteredEmployees.stream() requests = requests.stream()
.filter(emp -> emp.getTeam() != null && emp.getTeam().getId().equals(team.getId())) .filter(request -> request.getEmployee().getTeam().getId().equals(team.getId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (category != null && !"ALL".equals(category.name())) {
if (category != null && category != TimeOffRequestType.values()[0]) { requests = requests.stream()
filteredEmployees = filteredEmployees.stream() .filter(request -> request.getCategory().equals(category))
.filter(emp -> {
Optional<TimeOffRequest> request = requestService
.findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.TAKEN);
return request.isPresent() && request.get().getCategory() == category;
})
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (state != null && !"ALL".equals(state.name())) {
if (state != null && state != Status.ALL) { requests = requests.stream()
filteredEmployees = filteredEmployees.stream() .filter(request -> request.getState().equals(state))
.filter(emp -> {
Optional<TimeOffRequest> request = requestService
.findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.TAKEN);
return state == Status.IDLE ? request.isPresent() : request.isEmpty();
})
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
int end = start + pageSize;
int end = Math.min(start + pageSize, filteredEmployees.size()); if (end > requests.size()) {
return filteredEmployees.subList(start, end); end = requests.size();
} }
return requests.subList(start, end);
private String getEmployeeFullName(final Employee employee) {
return "ALL".equals(employee.getFirstName()) ? "ALL" : employee.getFirstName() + " " + employee.getLastName();
}
private String getTeamName(final Employee employee) {
Team team = employee.getTeam();
return team != null ? team.getName() : "Unassigned";
}
private String getTeamLabel(final Team team) {
return "ALL".equals(team.getName()) ? "ALL" : team.getName();
} }
private String getEmployeeStatus(final Employee employee) { private Span createEmployeeSpan(final TimeOffRequest timeOffRequest) {
Optional<TimeOffRequest> activeRequest = requestService Employee employee = timeOffRequest.getEmployee();
.findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.TAKEN); return new Span(employee.getFirstName() + " " + employee.getLastName());
return activeRequest.isPresent() ? "IDLE" : "ACTIVE";
} }
private String getCategory(final Employee employee) { private Span createTeamSpan(final TimeOffRequest timeOffRequest) {
Optional<TimeOffRequest> activeRequest = requestService return new Span(timeOffRequest.getEmployee().getTeam().getName());
.findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.TAKEN);
return activeRequest.map(request -> request.getCategory().toString()).orElse("");
}
private String getStartDate(final Employee employee) {
Optional<TimeOffRequest> activeRequest = requestService
.findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.TAKEN);
return activeRequest.map(request -> request.getStartDate().toString()).orElse("");
}
private String getEndDate(final Employee employee) {
Optional<TimeOffRequest> activeRequest = requestService
.findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.TAKEN);
return activeRequest.map(request -> request.getEndDate().toString()).orElse("");
}
private String getDaysBalance(final Employee employee) {
Optional<TimeOffRequest> activeRequest = requestService
.findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.TAKEN);
return activeRequest.map(request -> request.getDaysBalance().toString()).orElse("");
} }
private ComboBox<Employee> createEmployeeFilter() { private ComboBox<Employee> createEmployeeFilter() {
employeeFilter = new ComboBox<>("Employee"); employeeFilter = new ComboBox<>("Employee");
List<Employee> employees = new ArrayList<>(employeeService.findAllEmployees()); List<Employee> employees = employeeService.findAllEmployees();
employees.addFirst(createAllEmployeesOption()); employees.addFirst(createAllEmployeesOption());
employeeFilter.setItems(employees); employeeFilter.setItems(employees);
employeeFilter.setItemLabelGenerator(this::getEmployeeFullName); employeeFilter.setItemLabelGenerator(this::getEmployeeLabel);
employeeFilter.setValue(employees.getFirst()); employeeFilter.setValue(employees.getFirst());
employeeFilter.addValueChangeListener(event -> employeeFilter.addValueChangeListener(event ->
refreshGeneralRequestGrid( refreshRequestGrid(
event.getValue(), event.getValue(),
teamFilter.getValue(), teamFilter.getValue(),
categoryFilter.getValue(), categoryFilter.getValue(),
@ -214,13 +195,13 @@ public class RequestsListView extends Main {
private ComboBox<Team> createTeamFilter() { private ComboBox<Team> createTeamFilter() {
teamFilter = new ComboBox<>("Team"); teamFilter = new ComboBox<>("Team");
List<Team> teams = new ArrayList<>(teamService.findAllTeams()); List<Team> teams = teamService.findAllTeams();
teams.addFirst(createAllTeamsOption()); teams.addFirst(createAllTeamsOption());
teamFilter.setItems(teams); teamFilter.setItems(teams);
teamFilter.setItemLabelGenerator(this::getTeamLabel); teamFilter.setItemLabelGenerator(this::getTeamLabel);
teamFilter.setValue(teams.getFirst()); teamFilter.setValue(teams.getFirst());
teamFilter.addValueChangeListener(event -> teamFilter.addValueChangeListener(event ->
refreshGeneralRequestGrid( refreshRequestGrid(
employeeFilter.getValue(), employeeFilter.getValue(),
event.getValue(), event.getValue(),
categoryFilter.getValue(), categoryFilter.getValue(),
@ -235,7 +216,7 @@ public class RequestsListView extends Main {
categoryFilter.setItems(TimeOffRequestType.values()); categoryFilter.setItems(TimeOffRequestType.values());
categoryFilter.setValue(TimeOffRequestType.values()[0]); categoryFilter.setValue(TimeOffRequestType.values()[0]);
categoryFilter.addValueChangeListener(event -> categoryFilter.addValueChangeListener(event ->
refreshGeneralRequestGrid( refreshRequestGrid(
employeeFilter.getValue(), employeeFilter.getValue(),
teamFilter.getValue(), teamFilter.getValue(),
event.getValue(), event.getValue(),
@ -245,12 +226,12 @@ public class RequestsListView extends Main {
return categoryFilter; return categoryFilter;
} }
private ComboBox<Status> createStateFilter() { private ComboBox<TimeOffRequestStatus> createStateFilter() {
stateFilter = new ComboBox<>("State"); stateFilter = new ComboBox<>("State");
stateFilter.setItems(Status.values()); stateFilter.setItems(TimeOffRequestStatus.values());
stateFilter.setValue(Status.values()[0]); stateFilter.setValue(TimeOffRequestStatus.values()[0]);
stateFilter.addValueChangeListener(event -> stateFilter.addValueChangeListener(event ->
refreshGeneralRequestGrid( refreshRequestGrid(
employeeFilter.getValue(), employeeFilter.getValue(),
teamFilter.getValue(), teamFilter.getValue(),
categoryFilter.getValue(), categoryFilter.getValue(),
@ -260,12 +241,6 @@ public class RequestsListView extends Main {
return stateFilter; return stateFilter;
} }
private enum Status {
ALL,
IDLE,
ACTIVE
}
private Employee createAllEmployeesOption() { private Employee createAllEmployeesOption() {
Employee allEmployeesOption = new Employee(); Employee allEmployeesOption = new Employee();
allEmployeesOption.setFirstName("ALL"); allEmployeesOption.setFirstName("ALL");
@ -278,6 +253,14 @@ public class RequestsListView extends Main {
return allTeamsOption; return allTeamsOption;
} }
private String getEmployeeLabel(final Employee employee) {
return "ALL".equals(employee.getFirstName()) ? "ALL" : employee.getFirstName() + " " + employee.getLastName();
}
private String getTeamLabel(final Team team) {
return "ALL".equals(team.getName()) ? "ALL" : team.getName();
}
private void navigateToMainView() { private void navigateToMainView() {
getUI().ifPresent(ui -> ui.navigate(MainView.class)); getUI().ifPresent(ui -> ui.navigate(MainView.class));
} }

View File

@ -43,26 +43,26 @@ values ('2fa314bc-f547-4b12-a8b6-bb789feabc12', 1, '19b5a76e-d7b1-4b76-8b02-4d07
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('d5f6341a-913d-4e7f-a0b2-cfe0786acd34', 1, 'cba3efb7-32bc-44be-9fdc-fc5e4f211254', 'FIXED_HOLIDAY', 'IN_USE', 20, '2025-11-30', '2024-11-10', '2024-11-20', 10, 10); values ('d5f6341a-913d-4e7f-a0b2-cfe0786acd34', 1, 'cba3efb7-32bc-44be-9fdc-fc5e4f211254', 'FIXED_HOLIDAY', 'IN_USE', 20, '2025-11-30', '2024-11-10', '2024-11-20', 10, 10);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('4f913b23-ff23-4527-bcd6-adfe01234567', 1, 'e99b7af5-7d3a-4c0f-b8bc-e8d0388d8fc4', 'MATERNITY', 'IN_USE', 18, '2025-06-30', '2024-07-01', '2024-07-15', 10, 8); values ('4f913b23-ff23-4527-bcd6-adfe01234567', 1, 'e99b7af5-7d3a-4c0f-b8bc-e8d0388d8fc4', 'MATERNITY', 'TAKEN', 18, '2025-06-30', '2024-07-01', '2024-07-15', 10, 8);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('8c653f2a-f9a3-4d67-b3b6-12ad98fe0983', 1, 'f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 'VACATION', 'REQUESTED', 10, '2025-10-31', '2024-09-15', '2024-09-20', 5, 5); values ('8c653f2a-f9a3-4d67-b3b6-12ad98fe0983', 1, 'f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 'VACATION', 'REQUESTED', 10, '2025-10-31', '2024-09-15', '2024-09-20', 5, 5);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('fb9d9d75-b2ab-4ea4-b8b3-0a8f89e5c123', 1, '2e2293b1-3f9a-4f3d-abc8-32639b0a5e15', 'FIXED_HOLIDAY', 'IN_USE', 12, '2025-08-31', '2024-08-05', '2024-08-15', 6, 6); values ('fb9d9d75-b2ab-4ea4-b8b3-0a8f89e5c123', 1, '2e2293b1-3f9a-4f3d-abc8-32639b0a5e15', 'FIXED_HOLIDAY', 'IN_USE', 12, '2025-08-31', '2024-08-05', '2024-08-15', 6, 6);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('1c913a12-46e9-47b7-9e31-ab903fedc789', 1, '4b1c6c35-4627-4b35-b6e9-dc75c68b2c31', 'BIRTHDAY', 'APPROVED', 14, '2025-12-31', '2024-10-20', '2024-10-25', 5, 9); values ('1c913a12-46e9-47b7-9e31-ab903fedc789', 1, '4b1c6c35-4627-4b35-b6e9-dc75c68b2c31', 'BIRTHDAY', 'TAKEN', 14, '2025-12-31', '2024-10-20', '2024-10-25', 5, 9);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('b1249d3a-cc34-4954-88d9-1e4f67fe2436', 1, 'afc5c741-f70a-4394-853b-39d51b118927', 'MATERNITY', 'APPROVED', 20, '2025-11-30', '2024-11-05', '2024-11-12', 7, 13); values ('b1249d3a-cc34-4954-88d9-1e4f67fe2436', 1, 'afc5c741-f70a-4394-853b-39d51b118927', 'MATERNITY', 'APPROVED', 20, '2025-11-30', '2024-11-05', '2024-11-12', 7, 13);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('6fdc47a8-127b-41c4-8d12-7fc12098ab12', 1, 'b2436b82-7b9f-4f0d-9463-f2c3173a45c3', 'VACATION', 'PENDING', 18, '2025-06-30', '2024-07-10', '2024-07-20', 8, 10); values ('6fdc47a8-127b-41c4-8d12-7fc12098ab12', 1, 'b2436b82-7b9f-4f0d-9463-f2c3173a45c3', 'VACATION', 'TAKEN', 18, '2025-06-30', '2024-07-10', '2024-07-20', 8, 10);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('12ec8b74-983d-4a17-b67e-134f45ae904c', 1, '5c1a7b82-832d-4f24-8377-54b77b91b6a8', 'FIXED_HOLIDAY', 'PENDING', 15, '2025-12-31', '2024-09-01', '2024-09-05', 4, 11); values ('12ec8b74-983d-4a17-b67e-134f45ae904c', 1, '5c1a7b82-832d-4f24-8377-54b77b91b6a8', 'FIXED_HOLIDAY', 'PENDING', 15, '2025-12-31', '2024-09-01', '2024-09-05', 4, 11);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('89bc4b2a-943f-487c-a9f3-bacf78145e67', 1, 'cba3efb7-32bc-44be-9fdc-fc5e4f211254', 'VACATION', 'APPROVED', 20, '2025-11-30', '2024-10-25', '2024-11-05', 9, 11); values ('89bc4b2a-943f-487c-a9f3-bacf78145e67', 1, 'cba3efb7-32bc-44be-9fdc-fc5e4f211254', 'VACATION', 'APPROVED', 20, '2025-11-30', '2024-10-25', '2024-11-05', 9, 11);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('37adfc2a-7463-4b2d-a7c1-fae04567cdef', 1, 'e99b7af5-7d3a-4c0f-b8bc-e8d0388d8fc4', 'BIRTHDAY', 'REQUESTED', 18, '2025-06-30', '2024-06-01', '2024-06-10', 6, 12); values ('37adfc2a-7463-4b2d-a7c1-fae04567cdef', 1, 'e99b7af5-7d3a-4c0f-b8bc-e8d0388d8fc4', 'BIRTHDAY', 'TAKEN', 18, '2025-06-30', '2024-06-01', '2024-06-10', 6, 12);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('2bc138ea-12db-4b89-a0b4-78e045e34b4e', 1, 'f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 'MATERNITY', 'REQUESTED', 10, '2025-10-31', '2024-10-01', '2024-10-10', 3, 7); values ('2bc138ea-12db-4b89-a0b4-78e045e34b4e', 1, 'f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 'MATERNITY', 'REQUESTED', 10, '2025-10-31', '2024-10-01', '2024-10-10', 3, 7);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('14de1a56-6893-4e12-90f3-4faec457f002', 1, 'cd80e1d0-9a08-44a6-bd63-2c63eaa003d4', 'FIXED_HOLIDAY', 'PENDING', 22, '2025-08-31', '2024-07-15', '2024-07-25', 8, 14); values ('14de1a56-6893-4e12-90f3-4faec457f002', 1, 'cd80e1d0-9a08-44a6-bd63-2c63eaa003d4', 'FIXED_HOLIDAY', 'PENDING', 22, '2025-08-31', '2024-07-15', '2024-07-25', 8, 14);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance) insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('fb08a6c9-cd17-42e8-b9e2-734ec834cae2', 1, '4b1c6c35-4627-4b35-b6e9-dc75c68b2c31', 'VACATION', 'PENDING', 16, '2025-12-31', '2024-09-30', '2024-10-05', 4, 12); values ('fb08a6c9-cd17-42e8-b9e2-734ec834cae2', 1, '4b1c6c35-4627-4b35-b6e9-dc75c68b2c31', 'VACATION', 'TAKEN', 16, '2025-12-31', '2024-09-30', '2024-10-05', 4, 12);