From 0f63ee58a255850dce5c97b0e931954b91e4c282 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Tue, 27 Aug 2024 11:13:11 -0400 Subject: [PATCH] #7 Perfil de Personal Administrativo - Listado de empleados (CORRECCIONES v2) --- .../java/com/primefactorsolutions/model/Employee.java | 8 +++++++- .../primefactorsolutions/views/EmployeesListView.java | 2 +- src/main/resources/data.sql | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/model/Employee.java b/src/main/java/com/primefactorsolutions/model/Employee.java index e65d3c8..6e883f0 100644 --- a/src/main/java/com/primefactorsolutions/model/Employee.java +++ b/src/main/java/com/primefactorsolutions/model/Employee.java @@ -19,5 +19,11 @@ import java.util.List; public class Employee extends BaseEntity { private String firstName; private String lastName; - private enum status { ACTIVE, INACTIVE}; + @Enumerated(EnumType.STRING) + private Status status; + + public enum Status { + ACTIVE, + INACTIVE + } } diff --git a/src/main/java/com/primefactorsolutions/views/EmployeesListView.java b/src/main/java/com/primefactorsolutions/views/EmployeesListView.java index 145ff28..59fbb3f 100644 --- a/src/main/java/com/primefactorsolutions/views/EmployeesListView.java +++ b/src/main/java/com/primefactorsolutions/views/EmployeesListView.java @@ -48,7 +48,7 @@ public class EmployeesListView extends Main { }); hl.add(employeeListDescendingOrder); final VGrid grid = new VGrid<>(Employee.class); - grid.setColumns("name", "lastName", "status"); + grid.setColumns("firstName", "lastName", "status"); grid.setAllRowsVisible(true); grid.addComponentColumn((ValueProvider) employee -> { ComboBox statusComboBox = new ComboBox<>(); diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index f653182..f797344 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -9,8 +9,8 @@ insert into ASSESSMENT_QUESTIONS (assessment_id, question_id) values ('46b153f4- insert into ASSESSMENT_QUESTIONS (assessment_id, question_id) values ('46b153f4-23fd-462f-8430-fbe67b83caab', '8a4b213c-ca81-4c38-b56d-d7028c2dde88'); -insert into employee (id, version, name, last_name, status) values ('e99b7af5-7d3a-4c0f-b8bc-e8d0388d8fc4', 1, 'Juan', 'Perez Condori', 'Inactivo'); -insert into employee (id, version, name, last_name, status) values ('f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 1, 'Ana', 'Garcia Rojas', 'Activo'); -insert into employee (id, version, name, last_name, status) values ('2e2293b1-3f9a-4f3d-abc8-32639b0a5e15', 1, 'Carlos', 'Lopez Mendoza', 'Inactivo'); -insert into employee (id, version, name, last_name, status) values ('4b1c6c35-4627-4b35-b6e9-dc75c68b2c31', 1, 'Maria', 'Fernandez Villca', 'Activo'); -insert into employee (id, version, name, last_name, status) values ('afc5c741-f70a-4394-853b-39d51b118927', 1, 'Luis', 'Gutierrez Mamani', 'Activo'); \ No newline at end of file +insert into employee (id, version, first_name, last_name, status) values ('e99b7af5-7d3a-4c0f-b8bc-e8d0388d8fc4', 1, 'Juan', 'Perez Condori', 'INACTIVE'); +insert into employee (id, version, first_name, last_name, status) values ('f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 1, 'Ana', 'Garcia Rojas', 'ACTIVE'); +insert into employee (id, version, first_name, last_name, status) values ('2e2293b1-3f9a-4f3d-abc8-32639b0a5e15', 1, 'Carlos', 'Lopez Mendoza', 'INACTIVE'); +insert into employee (id, version, first_name, last_name, status) values ('4b1c6c35-4627-4b35-b6e9-dc75c68b2c31', 1, 'Maria', 'Fernandez Villca', 'ACTIVE'); +insert into employee (id, version, first_name, last_name, status) values ('afc5c741-f70a-4394-853b-39d51b118927', 1, 'Luis', 'Gutierrez Mamani', 'ACTIVE'); \ No newline at end of file