#46 Perfil de Empleado - Registro Semanal de Horas trabajadas
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m24s

This commit is contained in:
Melina Gutierrez 2024-10-08 13:14:34 -04:00
parent 067941e540
commit 379e822572

View File

@ -45,9 +45,36 @@ public class HoursWorkedView extends VerticalLayout {
grid.addColumn(Actividad::getDomingo).setHeader("Domingo"); grid.addColumn(Actividad::getDomingo).setHeader("Domingo");
grid.setItems( grid.setItems(
new Actividad("Actividad 1", 3, 3, 3, 3, 3, 1, 2), new Actividad.Builder()
new Actividad("Actividad 2", 2, 2, 2, 2, 2, 0, 1), .nombre("Actividad 1")
new Actividad("Meeting 1", 0, 0.5, 0.5, 0, 0, 0.5, 0) .lunes(3)
.martes(3)
.miercoles(3)
.jueves(3)
.viernes(3)
.sabado(1)
.domingo(2)
.build(),
new Actividad.Builder()
.nombre("Actividad 2")
.lunes(2)
.martes(2)
.miercoles(2)
.jueves(2)
.viernes(2)
.sabado(0)
.domingo(1)
.build(),
new Actividad.Builder()
.nombre("Meeting 1")
.lunes(0)
.martes(0.5)
.miercoles(0.5)
.jueves(0)
.viernes(0)
.sabado(0.5)
.domingo(0)
.build()
); );
Button actualizarButton = new Button("Actualizar"); Button actualizarButton = new Button("Actualizar");
@ -59,30 +86,80 @@ public class HoursWorkedView extends VerticalLayout {
add(title, datePicker, filtersLayout, grid, buttonsLayout); add(title, datePicker, filtersLayout, grid, buttonsLayout);
} }
public static class Actividad { public static final class Actividad {
final private String nombre; private final String nombre;
final private double lunes; private final double lunes;
final private double martes; private final double martes;
final private double miercoles; private final double miercoles;
final private double jueves; private final double jueves;
final private double viernes; private final double viernes;
final private double sabado; private final double sabado;
final private double domingo; private final double domingo;
public Actividad( private Actividad(final Builder builder) {
final String nombre, final double lunes, this.nombre = builder.nombre;
final double martes, final double miercoles, this.lunes = builder.lunes;
final double jueves, final double viernes, this.martes = builder.martes;
final double sabado, final double domingo) this.miercoles = builder.miercoles;
{ this.jueves = builder.jueves;
this.nombre = nombre; this.viernes = builder.viernes;
this.lunes = lunes; this.sabado = builder.sabado;
this.martes = martes; this.domingo = builder.domingo;
this.miercoles = miercoles; }
this.jueves = jueves;
this.viernes = viernes; public static class Builder {
this.sabado = sabado; private String nombre;
this.domingo = domingo; private double lunes;
private double martes;
private double miercoles;
private double jueves;
private double viernes;
private double sabado;
private double domingo;
public Builder nombre(final String nombre) {
this.nombre = nombre;
return this;
}
public Builder lunes(final double lunes) {
this.lunes = lunes;
return this;
}
public Builder martes(final double martes) {
this.martes = martes;
return this;
}
public Builder miercoles(final double miercoles) {
this.miercoles = miercoles;
return this;
}
public Builder jueves(final double jueves) {
this.jueves = jueves;
return this;
}
public Builder viernes(final double viernes) {
this.viernes = viernes;
return this;
}
public Builder sabado(final double sabado) {
this.sabado = sabado;
return this;
}
public Builder domingo(final double domingo) {
this.domingo = domingo;
return this;
}
public Actividad build() {
return new Actividad(this);
}
} }
public String getNombre() { public String getNombre() {