From eb3dba08306cb53d62cead5979f56f5c2c496cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 18 Nov 2023 09:05:31 +0100 Subject: [PATCH 1/3] Allow Taskcreation without specifying start and deadline --- .../java/core/api/controller/TaskController.java | 5 +++++ .../models/timemanager/tasks/TaskFieldInfo.java | 1 + frontend/src/api/model/taskFieldInfo.ts | 4 ++-- frontend/src/api/model/taskOverviewInfo.ts | 5 +++-- .../task-overview/task-overview.component.ts | 5 +++-- .../tasks/task-editor/task-editor.component.ts | 16 ++++++++++++---- openapi.yaml | 2 -- 7 files changed, 26 insertions(+), 12 deletions(-) diff --git a/backend/src/main/java/core/api/controller/TaskController.java b/backend/src/main/java/core/api/controller/TaskController.java index a6dff2c..f47aeeb 100644 --- a/backend/src/main/java/core/api/controller/TaskController.java +++ b/backend/src/main/java/core/api/controller/TaskController.java @@ -11,6 +11,7 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; @@ -85,6 +86,10 @@ public class TaskController { return ResponseEntity.status(404).body(new SimpleStatusResponse("failed")); } + if(taskFieldInfo.getStartDate() == null) { + taskFieldInfo.setStartDate(LocalDate.now()); + } + ServiceResult creationResult = taskService.createTask(taskgroupPermissionResult.getResult(), taskFieldInfo); if(creationResult.getExitCode() == ServiceExitCode.ENTITY_ALREADY_EXIST) { return ResponseEntity.status(409).body(new SimpleStatusResponse("failed")); diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java index 1cf7335..add3e43 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java @@ -2,6 +2,7 @@ package core.api.models.timemanager.tasks; import com.fasterxml.jackson.annotation.JsonFormat; import org.hibernate.validator.constraints.Length; +import org.springframework.lang.Nullable; import javax.validation.constraints.NotBlank; import java.time.LocalDate; diff --git a/frontend/src/api/model/taskFieldInfo.ts b/frontend/src/api/model/taskFieldInfo.ts index 6f89152..85ed8db 100644 --- a/frontend/src/api/model/taskFieldInfo.ts +++ b/frontend/src/api/model/taskFieldInfo.ts @@ -23,10 +23,10 @@ export interface TaskFieldInfo { /** * date from which the task can be started */ - startDate: string; + startDate?: string; /** * date until the task has to be finished */ - deadline: string; + deadline?: string; } diff --git a/frontend/src/api/model/taskOverviewInfo.ts b/frontend/src/api/model/taskOverviewInfo.ts index b8a681c..63c1fc5 100644 --- a/frontend/src/api/model/taskOverviewInfo.ts +++ b/frontend/src/api/model/taskOverviewInfo.ts @@ -3,7 +3,7 @@ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,7 +12,7 @@ import { TaskgroupEntityInfo } from './taskgroupEntityInfo'; -export interface TaskOverviewInfo { +export interface TaskOverviewInfo { /** * internal id of task */ @@ -37,5 +37,6 @@ export interface TaskOverviewInfo { * number in minutes that was already worked on this task */ activeTime?: number; + taskgroupPath: Array; } diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.ts b/frontend/src/app/dashboard/task-overview/task-overview.component.ts index 1b6ae7d..c20d2f5 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.ts +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.ts @@ -80,13 +80,14 @@ export class TaskOverviewComponent { const dialogRef = this.dialog.open(TaskEditorComponent, {data: editorData, width: "600px"}) dialogRef.afterClosed().subscribe(res => { if(res != undefined) { - const taskOverviewInfo = { + const taskOverviewInfo: TaskOverviewInfo = { taskID: res.taskID, eta: res.eta, limit: res.deadline, taskName: res.taskName, activeTime: 0, - overdue: res.overdue + overdue: res.overdue, + taskgroupPath: [] } this.creationEmitter.emit({ task: taskOverviewInfo, diff --git a/frontend/src/app/tasks/task-editor/task-editor.component.ts b/frontend/src/app/tasks/task-editor/task-editor.component.ts index ab05b42..58c584f 100644 --- a/frontend/src/app/tasks/task-editor/task-editor.component.ts +++ b/frontend/src/app/tasks/task-editor/task-editor.component.ts @@ -49,13 +49,21 @@ export class TaskEditorComponent implements OnInit { } createTask() { - console.log(this.startDate.value) - console.log(this.endDate.value) + let endDate_formatted: string|undefined = undefined; + let startDate_formatted: string|undefined = undefined; + if(this.endDate.value.length > 0) { + endDate_formatted = moment(this.endDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ'); + } + + if(this.startDate.value.length > 0) { + startDate_formatted = moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ'); + } + this.taskService.tasksTaskgroupIDPut(this.editorData.taskgroupID, { taskName: this.nameCtrl.value, eta: this.etaCtrl.value, - startDate: moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), - deadline: moment(this.endDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ') + startDate: startDate_formatted, + deadline: endDate_formatted }).subscribe({ next: resp => { this.dialog.close(resp); diff --git a/openapi.yaml b/openapi.yaml index 6cc075a..a793c47 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2236,8 +2236,6 @@ components: required: - taskName - eta - - startDate - - deadline additionalProperties: false properties: taskName: -- 2.34.1 From de01f5a1000343b4bdc0d9dee3b4b2ae15f0229c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 18 Nov 2023 09:36:26 +0100 Subject: [PATCH 2/3] Unfinish task and allow unfinishable tasks --- .../timemanager/tasks/TaskEntityInfo.java | 11 +++++++ .../timemanager/tasks/TaskFieldInfo.java | 10 ++++++ .../timemanager/tasks/TaskOverviewInfo.java | 10 ++++++ .../timemanager/tasks/TaskShortInfo.java | 11 +++++++ .../timemanager/tasks/TaskTaskgroupInfo.java | 11 +++++++ .../java/core/entities/timemanager/Task.java | 32 +++++++++++++------ .../main/java/core/services/TaskService.java | 2 +- frontend/src/api/model/taskEntityInfo.ts | 4 +++ frontend/src/api/model/taskFieldInfo.ts | 4 +++ frontend/src/api/model/taskOverviewInfo.ts | 4 +++ frontend/src/api/model/taskShortInfo.ts | 4 +++ frontend/src/api/model/taskTaskgroupInfo.ts | 4 +++ .../active-schedule.component.html | 2 +- .../task-overview.component.html | 2 +- .../task-overview/task-overview.component.ts | 3 +- .../task-detail-overview.component.html | 2 +- .../task-detail-overview.component.ts | 8 +++++ .../task-editor/task-editor.component.html | 2 ++ .../task-editor/task-editor.component.ts | 9 ++++-- openapi.yaml | 20 ++++++++++++ 20 files changed, 138 insertions(+), 17 deletions(-) diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java index 3fcf030..1d271c3 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java @@ -22,6 +22,8 @@ public class TaskEntityInfo { private int workTime; + private boolean finishable; + public TaskEntityInfo(Task task) { this.taskID = task.getTaskID(); this.taskName = task.getTaskName(); @@ -33,6 +35,7 @@ public class TaskEntityInfo { } this.finished = task.isFinished(); this.workTime = task.getWorkTime(); + this.finishable = task.isFinishable(); } public long getTaskID() { @@ -98,4 +101,12 @@ public class TaskEntityInfo { public void setWorkTime(int workTime) { this.workTime = workTime; } + + public boolean isFinishable() { + return finishable; + } + + public void setFinishable(boolean finishable) { + this.finishable = finishable; + } } diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java index add3e43..5eae187 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java @@ -20,6 +20,8 @@ public class TaskFieldInfo { @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") private LocalDate deadline; + private boolean finishable; + public TaskFieldInfo() { } @@ -61,4 +63,12 @@ public class TaskFieldInfo { public void setDeadline(LocalDate deadline) { this.deadline = deadline; } + + public boolean isFinishable() { + return finishable; + } + + public void setFinishable(boolean finishable) { + this.finishable = finishable; + } } diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java index 80a5918..be7df3a 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java @@ -16,6 +16,7 @@ public class TaskOverviewInfo { private LocalDate limit; private boolean overdue; + private boolean finishable; public TaskOverviewInfo(Task task) { this.taskID = task.getTaskID(); @@ -26,6 +27,7 @@ public class TaskOverviewInfo { if(task.getDeadline() != null) { this.overdue = LocalDate.now().isAfter(task.getDeadline()); } + this.finishable = task.isFinishable(); } public long getTaskID() { @@ -75,4 +77,12 @@ public class TaskOverviewInfo { public void setOverdue(boolean overdue) { this.overdue = overdue; } + + public boolean isFinishable() { + return finishable; + } + + public void setFinishable(boolean finishable) { + this.finishable = finishable; + } } diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskShortInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskShortInfo.java index 9444fce..e422128 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskShortInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskShortInfo.java @@ -7,9 +7,12 @@ public class TaskShortInfo { private long taskID; private String taskName; + private boolean finishable; + public TaskShortInfo(Task task) { this.taskID = task.getTaskID(); this.taskName = task.getTaskName(); + this.finishable = task.isFinishable(); } public TaskShortInfo(long taskID, String taskName) { @@ -32,4 +35,12 @@ public class TaskShortInfo { public void setTaskName(String taskName) { this.taskName = taskName; } + + public boolean isFinishable() { + return finishable; + } + + public void setFinishable(boolean finishable) { + this.finishable = finishable; + } } diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskTaskgroupInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskTaskgroupInfo.java index b46e438..e82bba7 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskTaskgroupInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskTaskgroupInfo.java @@ -27,6 +27,8 @@ public class TaskTaskgroupInfo { private List taskgroups; + private boolean finishable; + public TaskTaskgroupInfo(Task task) { this.taskID = task.getTaskID(); this.taskName = task.getTaskName(); @@ -42,6 +44,7 @@ public class TaskTaskgroupInfo { List taskgroupList = Taskgroup.getAncestorList(task.getTaskgroup()); taskgroupList.add(task.getTaskgroup()); this.taskgroups = taskgroupList.stream().map(TaskgroupEntityInfo::new).toList(); + this.finishable = task.isFinishable(); } public long getTaskID() { @@ -115,4 +118,12 @@ public class TaskTaskgroupInfo { public void setTaskgroups(List taskgroups) { this.taskgroups = taskgroups; } + + public boolean isFinishable() { + return finishable; + } + + public void setFinishable(boolean finishable) { + this.finishable = finishable; + } } diff --git a/backend/src/main/java/core/entities/timemanager/Task.java b/backend/src/main/java/core/entities/timemanager/Task.java index a66ad31..e2fb81e 100644 --- a/backend/src/main/java/core/entities/timemanager/Task.java +++ b/backend/src/main/java/core/entities/timemanager/Task.java @@ -1,5 +1,7 @@ package core.entities.timemanager; +import core.api.models.timemanager.tasks.TaskFieldInfo; + import javax.persistence.*; import java.time.LocalDate; import java.time.LocalDateTime; @@ -29,21 +31,25 @@ public class Task { private boolean finished; + private boolean finishable; + @OneToMany(mappedBy = "task", cascade = CascadeType.ALL, fetch = FetchType.EAGER) private List basicTaskSchedules; private int workTime; - public Task(Taskgroup taskgroup, String taskName, LocalDate startDate, LocalDate deadline, int eta) { - this.taskgroup = taskgroup; - this.taskName = taskName; - this.startDate = startDate; - this.deadline = deadline; - this.eta = eta; - this.finished = false; + public Task() { } - public Task() { + public Task(Taskgroup taskgroup, TaskFieldInfo taskFieldInfo) { + this.taskgroup = taskgroup; + this.taskName = taskFieldInfo.getTaskName(); + this.startDate = taskFieldInfo.getStartDate(); + this.deadline = taskFieldInfo.getDeadline(); + this.eta = taskFieldInfo.getEta(); + this.finished = false; + this.finishable = taskFieldInfo.isFinishable(); + System.err.println(this.finishable); } public long getTaskID() { @@ -91,7 +97,7 @@ public class Task { } public void finish() { - this.finished = true; + this.finished = !this.finished; } public boolean isFinished() { @@ -171,4 +177,12 @@ public class Task { } return abstractSchedules; } + + public boolean isFinishable() { + return finishable; + } + + public void setFinishable(boolean finishable) { + this.finishable = finishable; + } } diff --git a/backend/src/main/java/core/services/TaskService.java b/backend/src/main/java/core/services/TaskService.java index c3bf170..73f9336 100644 --- a/backend/src/main/java/core/services/TaskService.java +++ b/backend/src/main/java/core/services/TaskService.java @@ -40,7 +40,7 @@ public class TaskService { return new ServiceResult<>(ServiceExitCode.INVALID_PARAMETER); } - Task task = new Task(taskgroup, taskFieldInfo.getTaskName(), taskFieldInfo.getStartDate(), taskFieldInfo.getDeadline(), taskFieldInfo.getEta()); + Task task = new Task(taskgroup, taskFieldInfo); taskgroup.getTasks().add(task); taskRepository.save(task); diff --git a/frontend/src/api/model/taskEntityInfo.ts b/frontend/src/api/model/taskEntityInfo.ts index a4bab1f..cfc6022 100644 --- a/frontend/src/api/model/taskEntityInfo.ts +++ b/frontend/src/api/model/taskEntityInfo.ts @@ -44,5 +44,9 @@ export interface TaskEntityInfo { * number in minutes that was already worked on this task */ workTime: number; + /** + * determines whether the task can be finished + */ + finishable: boolean; } diff --git a/frontend/src/api/model/taskFieldInfo.ts b/frontend/src/api/model/taskFieldInfo.ts index 85ed8db..9c55225 100644 --- a/frontend/src/api/model/taskFieldInfo.ts +++ b/frontend/src/api/model/taskFieldInfo.ts @@ -28,5 +28,9 @@ export interface TaskFieldInfo { * date until the task has to be finished */ deadline?: string; + /** + * determines whether the task can be finished + */ + finishable: boolean; } diff --git a/frontend/src/api/model/taskOverviewInfo.ts b/frontend/src/api/model/taskOverviewInfo.ts index 63c1fc5..6fe5cbe 100644 --- a/frontend/src/api/model/taskOverviewInfo.ts +++ b/frontend/src/api/model/taskOverviewInfo.ts @@ -38,5 +38,9 @@ export interface TaskOverviewInfo { */ activeTime?: number; taskgroupPath: Array; + /** + * determines whether the task can be finished + */ + finishable: boolean; } diff --git a/frontend/src/api/model/taskShortInfo.ts b/frontend/src/api/model/taskShortInfo.ts index 0038f44..7750b81 100644 --- a/frontend/src/api/model/taskShortInfo.ts +++ b/frontend/src/api/model/taskShortInfo.ts @@ -20,5 +20,9 @@ export interface TaskShortInfo { * name of task */ taskName: string; + /** + * determines whether the task can be finished + */ + finishable: boolean; } diff --git a/frontend/src/api/model/taskTaskgroupInfo.ts b/frontend/src/api/model/taskTaskgroupInfo.ts index 30743f1..ec77684 100644 --- a/frontend/src/api/model/taskTaskgroupInfo.ts +++ b/frontend/src/api/model/taskTaskgroupInfo.ts @@ -46,5 +46,9 @@ export interface TaskTaskgroupInfo { */ workTime: number; taskgroups: Array; + /** + * determines whether the task can be finished + */ + finishable: boolean; } diff --git a/frontend/src/app/dashboard/active-schedule/active-schedule.component.html b/frontend/src/app/dashboard/active-schedule/active-schedule.component.html index ff04003..e48ccb2 100644 --- a/frontend/src/app/dashboard/active-schedule/active-schedule.component.html +++ b/frontend/src/app/dashboard/active-schedule/active-schedule.component.html @@ -14,6 +14,6 @@ - + diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.html b/frontend/src/app/dashboard/task-overview/task-overview.component.html index f91fe12..07c8e49 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.html +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.html @@ -10,7 +10,7 @@ - + diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.ts b/frontend/src/app/dashboard/task-overview/task-overview.component.ts index c20d2f5..ef54dca 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.ts +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.ts @@ -87,7 +87,8 @@ export class TaskOverviewComponent { taskName: res.taskName, activeTime: 0, overdue: res.overdue, - taskgroupPath: [] + taskgroupPath: [], + finishable: res.finishable } this.creationEmitter.emit({ task: taskOverviewInfo, diff --git a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html index 880b8de..223e99c 100644 --- a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html +++ b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html @@ -23,7 +23,7 @@ - +
diff --git a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts index bacadd5..d9460b0 100644 --- a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts +++ b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts @@ -101,4 +101,12 @@ export class TaskDetailOverviewComponent implements OnInit { }); } } + + finishTask() { + this.taskService.tasksTaskIDFinishPost(this.task!.taskID).subscribe({ + next: resp => { + this.task!.finished = !this.task!.finished; + } + }) + } } diff --git a/frontend/src/app/tasks/task-editor/task-editor.component.html b/frontend/src/app/tasks/task-editor/task-editor.component.html index cc264a0..c413dff 100644 --- a/frontend/src/app/tasks/task-editor/task-editor.component.html +++ b/frontend/src/app/tasks/task-editor/task-editor.component.html @@ -24,6 +24,8 @@ + + Finishable
diff --git a/frontend/src/app/tasks/task-editor/task-editor.component.ts b/frontend/src/app/tasks/task-editor/task-editor.component.ts index 58c584f..954b88e 100644 --- a/frontend/src/app/tasks/task-editor/task-editor.component.ts +++ b/frontend/src/app/tasks/task-editor/task-editor.component.ts @@ -20,6 +20,8 @@ export class TaskEditorComponent implements OnInit { nameCtrl: FormControl = new FormControl('', [Validators.required, Validators.maxLength(255)]) etaCtrl: FormControl = new FormControl(0, [Validators.required, Validators.min(0)]) startDate: FormControl = new FormControl(Date.now(), [Validators.required]) + + finishable: boolean = true; endDate: FormControl = new FormControl(''); constructor(private dialog: MatDialogRef, private taskService: TaskService, @@ -58,12 +60,12 @@ export class TaskEditorComponent implements OnInit { if(this.startDate.value.length > 0) { startDate_formatted = moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ'); } - this.taskService.tasksTaskgroupIDPut(this.editorData.taskgroupID, { taskName: this.nameCtrl.value, eta: this.etaCtrl.value, startDate: startDate_formatted, - deadline: endDate_formatted + deadline: endDate_formatted, + finishable: this.finishable }).subscribe({ next: resp => { this.dialog.close(resp); @@ -89,7 +91,8 @@ export class TaskEditorComponent implements OnInit { taskName: this.nameCtrl.value, eta: this.etaCtrl.value, startDate: startingDate, - deadline: deadline + deadline: deadline, + finishable: this.finishable }).subscribe({ next: resp => { this.editorData.task!.taskName = this.nameCtrl.value; diff --git a/openapi.yaml b/openapi.yaml index a793c47..a424554 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2147,6 +2147,7 @@ components: - overdue - finished - workTime + - finishable additionalProperties: false properties: taskID: @@ -2182,6 +2183,9 @@ components: type: number description: number in minutes that was already worked on this task example: 10 + finishable: + type: boolean + description: determines whether the task can be finished TaskTaskgroupInfo: required: - taskID @@ -2193,6 +2197,7 @@ components: - finished - workTime - taskgroups + - finishable additionalProperties: false properties: taskID: @@ -2232,10 +2237,14 @@ components: type: array items: $ref: '#/components/schemas/TaskgroupEntityInfo' + finishable: + type: boolean + description: determines whether the task can be finished TaskFieldInfo: required: - taskName - eta + - finishable additionalProperties: false properties: taskName: @@ -2255,6 +2264,9 @@ components: type: string format: date description: date until the task has to be finished + finishable: + type: boolean + description: determines whether the task can be finished BasicScheduleEntityInfo: required: - scheduleID @@ -2347,6 +2359,7 @@ components: required: - taskID - taskName + - finishable additionalProperties: false properties: taskID: @@ -2357,6 +2370,9 @@ components: type: string description: name of task example: "Vorlesung zusammenfassen" + finishable: + type: boolean + description: determines whether the task can be finished ScheduleActivateInfo: required: - startTime @@ -2420,6 +2436,7 @@ components: - limit - overdue - taskgroupPath + - finishable additionalProperties: false properties: taskID: @@ -2451,6 +2468,9 @@ components: type: array items: $ref: '#/components/schemas/TaskgroupEntityInfo' + finishable: + type: boolean + description: determines whether the task can be finished ScheduleStatus: required: - activeMinutes -- 2.34.1 From fe9fae871a611355a2b15d37ff37969d64d5da19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 18 Nov 2023 09:43:44 +0100 Subject: [PATCH 3/3] Adapt testdata to newly introduced finishable attribute --- .../test/resources/taskRepositoryEntries.sql | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/backend/src/test/resources/taskRepositoryEntries.sql b/backend/src/test/resources/taskRepositoryEntries.sql index 7a3bd21..7106879 100644 --- a/backend/src/test/resources/taskRepositoryEntries.sql +++ b/backend/src/test/resources/taskRepositoryEntries.sql @@ -1,23 +1,23 @@ -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (1, NULL, 0, NULL, 'Task 1', 2, false, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (2, NULL, 0, NULL, 'Task 2', 2, true, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (3, '2022-03-20', 0, NULL, 'Task 3', 2, false, 0); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (1, NULL, 0, NULL, 'Task 1', 2, false, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (2, NULL, 0, NULL, 'Task 2', 2, true, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (3, '2022-03-20', 0, NULL, 'Task 3', 2, false, 0, true); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (4, '2022-03-20', 0, NULL, 'Task 4', 2, true, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (5, '2022-03-20', 0, '2021-03-20', 'Task 5', 2, false, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (6, '2022-03-20', 0, '2021-03-20', 'Task 6', 2, true, 0); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (4, '2022-03-20', 0, NULL, 'Task 4', 2, true, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (5, '2022-03-20', 0, '2021-03-20', 'Task 5', 2, false, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (6, '2022-03-20', 0, '2021-03-20', 'Task 6', 2, true, 0, true); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (7, NULL, 0, '2043-03-20', 'Task 6', 2, false, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (8, NULL, 0, '2043-03-20', 'Task 6', 2, true, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (9, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, false, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (10, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, true, 0); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (7, NULL, 0, '2043-03-20', 'Task 6', 2, false, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (8, NULL, 0, '2043-03-20', 'Task 6', 2, true, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (9, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, false, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (10, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, true, 0, true); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (11, NULL, 0, '2022-03-20', 'Task 6', 2, false, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (12, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, false, 0); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (11, NULL, 0, '2022-03-20', 'Task 6', 2, false, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (12, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, false, 0, true); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (13, NULL, 0, '2022-03-20', 'Task 6', 2, true, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (14, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, true, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (15, NULL, 0, NULL, 'Task 15', 2, false, 0); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (13, NULL, 0, '2022-03-20', 'Task 6', 2, true, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (14, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, true, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (15, NULL, 0, NULL, 'Task 15', 2, false, 0, true); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (16, NULL, 0, NULL, 'Task 15', 9, false, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (17, NULL, 0, NULL, 'Task 17', 9, false, 0); -INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (18, NULL, 0, NULL, 'Task 17', 10, true, 0); \ No newline at end of file +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (16, NULL, 0, NULL, 'Task 15', 9, false, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (17, NULL, 0, NULL, 'Task 17', 9, false, 0, true); +INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (18, NULL, 0, NULL, 'Task 17', 10, true, 0, true); \ No newline at end of file -- 2.34.1