From 376cab65c383bdcbac2f3980305ae951390491f6 Mon Sep 17 00:00:00 2001 From: Pezcue Date: Fri, 12 Apr 2024 16:41:39 -0400 Subject: [PATCH] Base de Datos y DTO --- .../java/com/example/rest/DTO/ProjectDTO.java | 34 ++++++ .../java/com/example/rest/DTO/TaskDTO.java | 66 +++++++++++ .../example/rest/Services/ProjectService.java | 3 +- .../rest/Services/ProjectServiceImpl.java | 27 +++-- .../example/rest/Services/TaskService.java | 21 ++++ .../rest/Services/TaskServiceImpl.java | 67 +++++++++++ .../rest/SpringBootRestApplication.java | 3 + .../rest/controllers/ProjectController.java | 11 +- .../rest/controllers/TareaController.java | 5 - .../rest/controllers/TaskController.java | 43 +++++++ .../com/example/rest/entities/Project.java | 2 +- .../java/com/example/rest/entities/Task.java | 105 +++++++++++++++++- .../com/example/rest/entities/TaskStatus.java | 5 + .../rest/repositories/TaskRepository.java | 11 ++ src/main/resources/application.properties | 2 +- src/main/resources/import.sql | 50 +++++++-- 16 files changed, 414 insertions(+), 41 deletions(-) create mode 100644 src/main/java/com/example/rest/DTO/ProjectDTO.java create mode 100644 src/main/java/com/example/rest/DTO/TaskDTO.java create mode 100644 src/main/java/com/example/rest/Services/TaskService.java create mode 100644 src/main/java/com/example/rest/Services/TaskServiceImpl.java delete mode 100644 src/main/java/com/example/rest/controllers/TareaController.java create mode 100644 src/main/java/com/example/rest/controllers/TaskController.java create mode 100644 src/main/java/com/example/rest/entities/TaskStatus.java create mode 100644 src/main/java/com/example/rest/repositories/TaskRepository.java diff --git a/src/main/java/com/example/rest/DTO/ProjectDTO.java b/src/main/java/com/example/rest/DTO/ProjectDTO.java new file mode 100644 index 0000000..c6865db --- /dev/null +++ b/src/main/java/com/example/rest/DTO/ProjectDTO.java @@ -0,0 +1,34 @@ +package com.example.rest.DTO; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class ProjectDTO { + private String name; + private String description;gi + + public ProjectDTO() { + } + + public ProjectDTO(String name, String description) { + this.name = name; + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/src/main/java/com/example/rest/DTO/TaskDTO.java b/src/main/java/com/example/rest/DTO/TaskDTO.java new file mode 100644 index 0000000..f63869d --- /dev/null +++ b/src/main/java/com/example/rest/DTO/TaskDTO.java @@ -0,0 +1,66 @@ +package com.example.rest.DTO; + +import org.springframework.stereotype.Component; + +import java.time.LocalDate; + +@Component +public class TaskDTO { + + private String name; + private String description; + private String type; + private LocalDate startDate; + private LocalDate dueDate; + + public TaskDTO(String name, String description, String type, LocalDate startDate, LocalDate dueDate) { + this.name = name; + this.description = description; + this.type = type; + this.startDate = startDate; + this.dueDate = dueDate; + } + + public TaskDTO() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + public LocalDate getDueDate() { + return dueDate; + } + + public void setDueDate(LocalDate dueDate) { + this.dueDate = dueDate; + } +} diff --git a/src/main/java/com/example/rest/Services/ProjectService.java b/src/main/java/com/example/rest/Services/ProjectService.java index e8980ed..f3f2492 100644 --- a/src/main/java/com/example/rest/Services/ProjectService.java +++ b/src/main/java/com/example/rest/Services/ProjectService.java @@ -1,11 +1,12 @@ package com.example.rest.Services; +import com.example.rest.DTO.ProjectDTO; import com.example.rest.entities.Project; public interface ProjectService { // para crear projectos - Project createProject(Project project); + Project createProject(ProjectDTO projectDTO); // para editar projectos Project editProject(Long id, Project project); diff --git a/src/main/java/com/example/rest/Services/ProjectServiceImpl.java b/src/main/java/com/example/rest/Services/ProjectServiceImpl.java index 1eb2287..b8db108 100644 --- a/src/main/java/com/example/rest/Services/ProjectServiceImpl.java +++ b/src/main/java/com/example/rest/Services/ProjectServiceImpl.java @@ -1,5 +1,6 @@ package com.example.rest.Services; +import com.example.rest.DTO.ProjectDTO; import com.example.rest.entities.Project; import com.example.rest.entities.projectStatus; import com.example.rest.repositories.ProjectRepository; @@ -20,22 +21,20 @@ public ProjectServiceImpl(ProjectRepository projectRepository) { } @Override - public Project createProject(Project project) { - - // Chequear que el projecto no sea nulo y tenga un nombre - if (project == null || project.getName() == null || project.getName().isEmpty()) { - throw new IllegalArgumentException("Invalid project details"); - } - - // Aregarle los atributos por defecto - project.setStatus(projectStatus.ACTIVE); - project.setCreateDate(LocalDateTime.now()); - - // Guardar (?) Preguntar - return projectRepository.save(project); + public Project createProject(ProjectDTO projectDTO) { + + Project newProject = new Project(); + newProject.setName(projectDTO.getName()); + newProject.setDescription(projectDTO.getDescription()); + newProject.setStatus(projectStatus.ACTIVE.toString()); + newProject.setCreateDate(LocalDateTime.now()); + newProject.setLastUpdatedDate(LocalDateTime.now()); + + // Guardar + Project savedProject = projectRepository.save(newProject); + return savedProject; } - @Override public Project editProject(Long id, Project project) { diff --git a/src/main/java/com/example/rest/Services/TaskService.java b/src/main/java/com/example/rest/Services/TaskService.java new file mode 100644 index 0000000..4a92e59 --- /dev/null +++ b/src/main/java/com/example/rest/Services/TaskService.java @@ -0,0 +1,21 @@ +package com.example.rest.Services; + +import com.example.rest.DTO.TaskDTO; +import com.example.rest.entities.Task; + +public interface TaskService { + + + // para crea tareas + + Task createTask(long project_id, TaskDTO taskDTO); + + // para eliminar tareas + + void deleteTask(Long task_id); + + // para obtener tareas + + Task getTaskById(Long task_id); + +} diff --git a/src/main/java/com/example/rest/Services/TaskServiceImpl.java b/src/main/java/com/example/rest/Services/TaskServiceImpl.java new file mode 100644 index 0000000..fe5111d --- /dev/null +++ b/src/main/java/com/example/rest/Services/TaskServiceImpl.java @@ -0,0 +1,67 @@ +package com.example.rest.Services; + +import com.example.rest.DTO.TaskDTO; +import com.example.rest.entities.Project; +import com.example.rest.entities.Task; +import com.example.rest.entities.TaskStatus; +import com.example.rest.repositories.ProjectRepository; +import com.example.rest.repositories.TaskRepository; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Optional; + +@Service +public class TaskServiceImpl implements TaskService { + + private final TaskRepository taskRepository; + private final ProjectRepository projectRepository; + + public TaskServiceImpl(TaskRepository taskRepository, ProjectRepository projectRepository) { + this.taskRepository = taskRepository; + this.projectRepository = projectRepository; + } + + @Override + public Task createTask(long project_id, TaskDTO taskDTO) { + + Project proyectoBaseDeDatos = projectRepository.findProjectById(project_id); + if (proyectoBaseDeDatos != null) { + throw new RuntimeException("Ya existe en la base de datos"); + } + + Task newTask = new Task(); + newTask.setName(taskDTO.getName()); + newTask.setDescription(taskDTO.getDescription()); + newTask.setTaskStatus(TaskStatus.TODO.toString()); + newTask.setType(taskDTO.getType()); + newTask.setStartDate(taskDTO.getStartDate()); + newTask.setDueDate(taskDTO.getDueDate()); + newTask.setCreateDate(LocalDate.now()); + newTask.setLastUpdatedDate(LocalDateTime.now()); + + Task savedTask = taskRepository.save(newTask); + return newTask; + } + + @Override + public void deleteTask(Long task_id) { + Optional taskOptional = taskRepository.findById(task_id); + if(taskOptional.isPresent()){ + taskRepository.deleteById(task_id); + } else { + throw new RuntimeException("La tarea no existe"); // cambiar + } + } + + @Override + public Task getTaskById(Long task_id) { + Optional taskOptional = taskRepository.findById(task_id); + if(taskOptional.isPresent()){ + return taskOptional.get(); + } else { + throw new RuntimeException("La tarea no existe"); // cambiar + } + } +} diff --git a/src/main/java/com/example/rest/SpringBootRestApplication.java b/src/main/java/com/example/rest/SpringBootRestApplication.java index 83246de..7174ae2 100644 --- a/src/main/java/com/example/rest/SpringBootRestApplication.java +++ b/src/main/java/com/example/rest/SpringBootRestApplication.java @@ -1,5 +1,6 @@ package com.example.rest; +import com.example.rest.entities.Project; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -8,6 +9,8 @@ public class SpringBootRestApplication { public static void main(String[] args) { SpringApplication.run(SpringBootRestApplication.class, args); + + } } diff --git a/src/main/java/com/example/rest/controllers/ProjectController.java b/src/main/java/com/example/rest/controllers/ProjectController.java index 5857685..6c58848 100644 --- a/src/main/java/com/example/rest/controllers/ProjectController.java +++ b/src/main/java/com/example/rest/controllers/ProjectController.java @@ -1,5 +1,6 @@ package com.example.rest.controllers; +import com.example.rest.DTO.ProjectDTO; import com.example.rest.Services.ProjectServiceImpl; import com.example.rest.entities.Project; import org.springframework.beans.factory.annotation.Autowired; @@ -23,9 +24,9 @@ public ProjectController(ProjectServiceImpl projectService) { //POST -> /v1/projects crear un Project - @PostMapping - public ResponseEntity createProject(@RequestBody Project project) { - Project projectoCreado = projectService.createProject(project); + @PostMapping("/") + public ResponseEntity createProject(@RequestBody ProjectDTO projectDTO) { + Project projectoCreado = projectService.createProject(projectDTO); return ResponseEntity.created(URI.create("/v1/projects" + projectoCreado.getId())) .body(projectoCreado); } @@ -48,11 +49,9 @@ public ResponseEntity eliminarProjecto(@PathVariable("id") Long id) { // GET -> /v1/projects/{id} obtener un Project por id @GetMapping("/{id}") - public ResponseEntity obtenerProjecto(@PathVariable("id") Long id) { + public ResponseEntity getProject(@PathVariable("id") Long id) { Project project = projectService.getProjectById(id); return ResponseEntity.ok(project); } - - } diff --git a/src/main/java/com/example/rest/controllers/TareaController.java b/src/main/java/com/example/rest/controllers/TareaController.java deleted file mode 100644 index da451b5..0000000 --- a/src/main/java/com/example/rest/controllers/TareaController.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.rest.controllers; - -public class TareaController { - -} diff --git a/src/main/java/com/example/rest/controllers/TaskController.java b/src/main/java/com/example/rest/controllers/TaskController.java new file mode 100644 index 0000000..4e0002a --- /dev/null +++ b/src/main/java/com/example/rest/controllers/TaskController.java @@ -0,0 +1,43 @@ +package com.example.rest.controllers; + +import com.example.rest.DTO.TaskDTO; +import com.example.rest.Services.TaskServiceImpl; +import com.example.rest.entities.Task; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.net.URI; + +@RestController +@RequestMapping("/v1/task/") +public class TaskController { + + //Injeccion del servicio para Task + + private TaskServiceImpl taskService; + + // POST // Crear tarea + @PostMapping("/project/{id}") + public ResponseEntity createTask(@PathVariable("id") Long project_id, @RequestBody TaskDTO taskDTO) { + Task tareaCreada = taskService.createTask(project_id, taskDTO); + return ResponseEntity.created(URI.create("/v1/task" + tareaCreada.getId())) + .body(tareaCreada); + } + + // DELETE // Eliminar un Task + + public ResponseEntity deleteTask(@PathVariable("id") Long task_id) { + taskService.deleteTask(task_id); + return ResponseEntity.noContent() + .build(); + } + + // GET // Obtener un Task + + @GetMapping("/{id}") + public ResponseEntity getTask(@PathVariable("id") Long task_id){ + Task task = taskService.getTaskById(task_id); + return ResponseEntity.ok(task); + } + +} diff --git a/src/main/java/com/example/rest/entities/Project.java b/src/main/java/com/example/rest/entities/Project.java index c72708c..368a4f3 100644 --- a/src/main/java/com/example/rest/entities/Project.java +++ b/src/main/java/com/example/rest/entities/Project.java @@ -28,7 +28,7 @@ public class Project { private String description; @Column(name = "status") - private projectStatus status; + private String status; @Column(name = "fecha_creacion") private LocalDateTime createDate; diff --git a/src/main/java/com/example/rest/entities/Task.java b/src/main/java/com/example/rest/entities/Task.java index 9d9bdc5..af626ae 100644 --- a/src/main/java/com/example/rest/entities/Task.java +++ b/src/main/java/com/example/rest/entities/Task.java @@ -3,7 +3,8 @@ import jakarta.persistence.*; import lombok.*; -import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; @Setter @Getter @@ -21,10 +22,108 @@ public class Task { @Column(name = "nombre") private String name; - @Column(name = "precio") - private BigDecimal price; + @Column(name = "descripcion") + private String description; + + @Column(name = "status") + private String taskStatus; + + @Column(name = "tipo") + private String type; + + @Column(name = "fecha_inicio") + private LocalDate startDate; + + @Column(name = "fecha_entrega") + private LocalDate dueDate; + + @Column(name = "fecha_creacion") + private LocalDate createDate; + + @Column(name = "fecha_actualizacion") + private LocalDateTime lastUpdatedDate; @ManyToOne @JoinColumn(name = "id_proyecto", nullable = false) private Project project; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + public LocalDate getDueDate() { + return dueDate; + } + + public void setDueDate(LocalDate dueDate) { + this.dueDate = dueDate; + } + + public LocalDate getCreateDate() { + return createDate; + } + + public void setCreateDate(LocalDate createDate) { + this.createDate = createDate; + } + + public LocalDateTime getLastUpdatedDate() { + return lastUpdatedDate; + } + + public void setLastUpdatedDate(LocalDateTime lastUpdatedDate) { + this.lastUpdatedDate = lastUpdatedDate; + } + + public Project getProject() { + return project; + } + + public void setProject(Project project) { + this.project = project; + } } diff --git a/src/main/java/com/example/rest/entities/TaskStatus.java b/src/main/java/com/example/rest/entities/TaskStatus.java new file mode 100644 index 0000000..9fa93cb --- /dev/null +++ b/src/main/java/com/example/rest/entities/TaskStatus.java @@ -0,0 +1,5 @@ +package com.example.rest.entities; + +public enum TaskStatus { + TODO, INPROGRESS, BLOCKED, DONE +} diff --git a/src/main/java/com/example/rest/repositories/TaskRepository.java b/src/main/java/com/example/rest/repositories/TaskRepository.java new file mode 100644 index 0000000..063b2dd --- /dev/null +++ b/src/main/java/com/example/rest/repositories/TaskRepository.java @@ -0,0 +1,11 @@ +package com.example.rest.repositories; + +import com.example.rest.entities.Task; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskRepository extends JpaRepository { + + Task findTaskById(Long id); +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f9d2b77..4bda246 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,6 +5,6 @@ spring.datasource.password=Hola123@123 #Configuracion de Hibernate spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect -spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true \ No newline at end of file diff --git a/src/main/resources/import.sql b/src/main/resources/import.sql index 75dd13f..a61beab 100644 --- a/src/main/resources/import.sql +++ b/src/main/resources/import.sql @@ -1,10 +1,40 @@ -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Matemáticas', 'Desarrollar un programa para resolver ecuaciones', 'ACTIVE', '2024-04-01 10:00:00', '2024-04-01 10:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Arreglar el Jardín', 'Limpiar el jardín y plantar nuevas flores', 'INACTIVE', '2024-04-02 11:00:00', '2024-04-02 11:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Preparar Presentación de Ventas', 'Crear una presentación para la reunión de ventas', 'PAUSED', '2024-04-03 12:00:00', '2024-04-03 12:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Investigación Histórica', 'Investigar eventos históricos para un artículo', 'ACTIVE', '2024-04-04 13:00:00', '2024-04-04 13:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Reorganizar el Armario', 'Clasificar la ropa y deshacerse de lo que ya no se usa', 'INACTIVE', '2024-04-05 14:00:00', '2024-04-05 14:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Desarrollo de Software', 'Desarrollar una nueva aplicación móvil', 'PAUSED', '2024-04-06 15:00:00', '2024-04-06 15:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Planificar el Viaje de Vacaciones', 'Organizar itinerario y reservas para las vacaciones', 'ACTIVE', '2024-04-07 16:00:00', '2024-04-07 16:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Decorar la Sala de Estar', 'Comprar muebles y decorar la sala de estar', 'INACTIVE', '2024-04-08 17:00:00', '2024-04-08 17:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Estudiar para el Examen Final', 'Repasar material y hacer ejercicios de práctica', 'PAUSED', '2024-04-09 18:00:00', '2024-04-09 18:00:00'); -INSERT INTO Project (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Mejora de Procesos', 'Analizar procesos y proponer mejoras para la eficiencia', 'ACTIVE', '2024-04-10 19:00:00', '2024-04-10 19:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Matemáticas', 'Desarrollar un programa para resolver ecuaciones', 'ACTIVE', '2024-04-01 10:00:00', '2024-04-01 10:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Arreglar el Jardín', 'Limpiar el jardín y plantar nuevas flores', 'INACTIVE', '2024-04-02 11:00:00', '2024-04-02 11:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Preparar Presentación de Ventas', 'Crear una presentación para la reunión de ventas', 'PAUSED', '2024-04-03 12:00:00', '2024-04-03 12:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Investigación Histórica', 'Investigar eventos históricos para un artículo', 'ACTIVE', '2024-04-04 13:00:00', '2024-04-04 13:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Reorganizar el Armario', 'Clasificar la ropa y deshacerse de lo que ya no se usa', 'INACTIVE', '2024-04-05 14:00:00', '2024-04-05 14:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Desarrollo de Software', 'Desarrollar una nueva aplicación móvil', 'PAUSED', '2024-04-06 15:00:00', '2024-04-06 15:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Planificar el Viaje de Vacaciones', 'Organizar itinerario y reservas para las vacaciones', 'ACTIVE', '2024-04-07 16:00:00', '2024-04-07 16:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Decorar la Sala de Estar', 'Comprar muebles y decorar la sala de estar', 'INACTIVE', '2024-04-08 17:00:00', '2024-04-08 17:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Estudiar para el Examen Final', 'Repasar material y hacer ejercicios de práctica', 'PAUSED', '2024-04-09 18:00:00', '2024-04-09 18:00:00'); +INSERT INTO Proyecto (nombre, descripcion, status, fecha_creacion, fecha_actualizacion) VALUES ('Proyecto de Mejora de Procesos', 'Analizar procesos y proponer mejoras para la eficiencia', 'ACTIVE', '2024-04-10 19:00:00', '2024-04-10 19:00:00'); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Investigar métodos de resolución de ecuaciones', 'Investigar y documentar diferentes métodos matemáticos para resolver ecuaciones', 'Pendiente', 'Investigación', '2024-04-01', '2024-04-20', '2024-04-01', '2024-04-10 19:38:56', 1); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Limpiar área del jardín', 'Limpiar el área designada del jardín y prepararla para plantar', 'Pendiente', 'Tareas Domésticas', '2024-04-02', '2024-04-15', '2024-04-02', '2024-04-10 19:38:56', 2); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Preparar diapositivas de la presentación', 'Diseñar y preparar las diapositivas para la presentación de ventas', 'Pendiente', 'Presentación', '2024-04-03', '2024-04-25', '2024-04-03', '2024-04-10 19:38:56', 3); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Investigar eventos históricos relevantes', 'Realizar investigación en fuentes históricas para recopilar información', 'Pendiente', 'Investigación', '2024-04-04', '2024-05-01', '2024-04-04', '2024-04-10 19:38:56', 4); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Clasificar prendas de vestir', 'Clasificar la ropa por tipo y temporada en el armario', 'Pendiente', 'Organización', '2024-04-05', '2024-04-18', '2024-04-05', '2024-04-10 19:38:56', 5); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Analizar requisitos de la aplicación', 'Revisar y analizar los requisitos del proyecto de desarrollo de software', 'Pendiente', 'Análisis', '2024-04-06', '2024-04-30', '2024-04-06', '2024-04-10 19:38:56', 6); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Investigar destinos de vacaciones', 'Investigar destinos y opciones de alojamiento para el viaje de vacaciones', 'Pendiente', 'Investigación', '2024-04-07', '2024-04-22', '2024-04-07', '2024-04-10 19:38:56', 7); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Comprar muebles para la sala de estar', 'Buscar y comprar muebles para renovar la sala de estar', 'Pendiente', 'Compras', '2024-04-08', '2024-04-28', '2024-04-08', '2024-04-10 19:38:56', 8); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Estudiar tema por tema para el examen', 'Dedicar tiempo a estudiar cada tema del examen final', 'Pendiente', 'Estudio', '2024-04-09', '2024-05-05', '2024-04-09', '2024-04-10 19:38:56', 9); + +INSERT INTO tarea (nombre, descripcion, status, tipo, fecha_inicio, fecha_entrega, fecha_creacion, fecha_actualizacion, id_proyecto) +VALUES ('Realizar análisis de procesos actuales', 'Analizar procesos existentes y buscar áreas de mejora para el proyecto', 'Pendiente', 'Análisis', '2024-04-10', '2024-05-10', '2024-04-10', '2024-04-10 19:38:56', 10);