Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4fa6e0a
Adds the initial taskboard setup
jonassavas Feb 5, 2026
de925e6
Adds the updated taskgroup API paths to be scoped by its taskboard
jonassavas Feb 5, 2026
64ebc2f
Adds the current progress for the taskboard
jonassavas Feb 7, 2026
823b93d
Adds the current progress, switching PC
jonassavas Feb 9, 2026
0c52d4f
Adds the current progress, switching PC
jonassavas Feb 9, 2026
b9fe5cf
Adds todays progress on the taskboard
jonassavas Feb 9, 2026
923af30
Current changes, checking out another branch
jonassavas Feb 10, 2026
d7771ce
Fixes taskGroupRepository tests to require the correct chain of non-n…
jonassavas Feb 10, 2026
b87c641
Adds the current updates to the test suite to correctly include taskb…
jonassavas Feb 10, 2026
8e88826
Adds the test suite updates to the task controller to correctly requi…
jonassavas Feb 10, 2026
5543663
Fixes the problem with the taskGroupMappers when requiring a valid ta…
jonassavas Feb 11, 2026
e02fba7
Fixes surefire config to work on linux and makes mvnw executable
jonassavas Feb 12, 2026
3e57431
Fixes surefire config to work on linux and makes mvnw executable
jonassavas Feb 12, 2026
e7cbf3c
Fixes the taskGroup bug where setting the taskBoardId in the request …
jonassavas Feb 12, 2026
9630482
Fixes the taskGroupController tests to require a taskboard
jonassavas Feb 13, 2026
2317f42
Adds the taskboardmapper
jonassavas Feb 14, 2026
8c32148
Adds the methods for the TaskBoardService
jonassavas Feb 16, 2026
ad6e9eb
Improves the structure for generating the test data
jonassavas Feb 17, 2026
8df4f37
Adds taskboardrepository tests
jonassavas Feb 17, 2026
00f9e5b
Adds the final changes for today
jonassavas Feb 17, 2026
a846558
Improves the file structure and adds the taskBoard-creation through i…
jonassavas Feb 18, 2026
93482ed
Adds 'delete' for the taskboardcontroller
jonassavas Feb 18, 2026
908e4a2
Adds the taskboardcontroller endpoints
jonassavas Feb 19, 2026
35b873d
Adds the method-signatures for the tests to be implemented first thin…
jonassavas Feb 19, 2026
71c295b
Adds the taskboardcontroller tests and fixes the update method for th…
jonassavas Feb 20, 2026
dfafb5c
Cleans up unused imports
jonassavas Feb 20, 2026
3975f82
Moves the DTO-mapping of the tasks to the service layer
jonassavas Feb 22, 2026
477ebee
Removes unused/commented code
jonassavas Feb 22, 2026
8c021b6
Adds the final progress for today (broken state)
jonassavas Feb 22, 2026
b781ec2
Moves DTO-mapping of the taskgroups to the service layer
jonassavas Feb 23, 2026
ab3a5fa
Cleans up the TaskGroupController tests and changes its use of the se…
jonassavas Feb 23, 2026
fcdcb86
Cleans up the test classes
jonassavas Feb 23, 2026
0af24fc
Cleans up the controllers
jonassavas Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified mvnw
100644 → 100755
Empty file.
15 changes: 12 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,19 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<annotationProcessorPaths>
<path>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MapperConfig {
@Bean
public ModelMapper modelmapper(){
ModelMapper modelMapper = new ModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE);
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
return modelMapper;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.jonassavas.spring_task_api.controllers;

import java.util.List;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.jonassavas.spring_task_api.domain.dto.task_board.TaskBoardDto;
import com.jonassavas.spring_task_api.domain.dto.task_board.TaskBoardRequestDto;
import com.jonassavas.spring_task_api.services.TaskBoardService;


@RestController
public class TaskBoardController {

private TaskBoardService taskBoardService;


public TaskBoardController(TaskBoardService taskBoardService){

this.taskBoardService = taskBoardService;
}

// Do we need a way to get everything?
// TaskBoard --> TaskGroups --> Tasks ?

@PostMapping(path = "/boards")
public ResponseEntity<TaskBoardDto> createTaskBoard(@RequestBody TaskBoardRequestDto requestDto) {
TaskBoardDto responseDto = taskBoardService.createTaskBoard(requestDto);
return new ResponseEntity<>(responseDto, HttpStatus.CREATED);
}

@DeleteMapping(path = "/boards/{boardId}")
public ResponseEntity deleteTaskBoard(@PathVariable("boardId") Long boardId){
taskBoardService.delete(boardId);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}

@GetMapping("/boards")
public List<TaskBoardDto> listTaskGroups() {
return taskBoardService.findAll();
}

@PatchMapping(path = "/boards/{boardId}")
public ResponseEntity<TaskBoardDto> updateTaskBoard(
@PathVariable("boardId") Long boardId,
@RequestBody TaskBoardRequestDto requestDto){
TaskBoardDto responseDto = taskBoardService.update(boardId, requestDto);
return new ResponseEntity<>(responseDto, HttpStatus.OK);
}
}
Original file line number Diff line number Diff line change
@@ -1,70 +1,60 @@
package com.jonassavas.spring_task_api.controllers;

import org.springframework.web.bind.annotation.RestController;

import com.jonassavas.spring_task_api.domain.dto.TaskRequestDto;
import com.jonassavas.spring_task_api.domain.dto.TaskDto;
import com.jonassavas.spring_task_api.domain.entities.TaskEntity;
import com.jonassavas.spring_task_api.mappers.Mapper;
import com.jonassavas.spring_task_api.services.TaskGroupService;
import com.jonassavas.spring_task_api.services.TaskService;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.jonassavas.spring_task_api.domain.dto.task.TaskDto;
import com.jonassavas.spring_task_api.domain.dto.task.TaskRequestDto;
import com.jonassavas.spring_task_api.services.TaskGroupService;
import com.jonassavas.spring_task_api.services.TaskService;


@RestController
//@RequestMapping(path = "/taskgroups/{groupId}/tasks")
public class TaskController {

private Mapper<TaskEntity, TaskDto> taskMapper;
private Mapper<TaskEntity, TaskRequestDto> taskRequestMapper;

private TaskService taskService;
private TaskGroupService taskGroupService;


public TaskController(Mapper<TaskEntity, TaskDto> taskMapper,
TaskService taskService,
TaskGroupService taskGroupService,
Mapper<TaskEntity, TaskRequestDto> taskRequestMapper){
this.taskMapper = taskMapper;
public TaskController(
TaskService taskService,
TaskGroupService taskGroupService){
this.taskService = taskService;
this.taskGroupService = taskGroupService;
this.taskRequestMapper = taskRequestMapper;
}


@PostMapping("/taskgroups/{groupId}/tasks")
@PostMapping("/groups/{groupId}/tasks")
public ResponseEntity<TaskDto> createTask(
@PathVariable Long groupId,
@RequestBody TaskDto dto) {

@RequestBody TaskRequestDto dto) {
// Can't create a task without a valid task group
if(!taskGroupService.isExist(groupId)){
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}

TaskEntity taskEntity = taskMapper.mapFrom(dto);
TaskEntity savedTask = taskService.createTask(groupId, taskEntity);
TaskDto responseDto = taskMapper.mapTo(savedTask);
}
TaskDto responseDto = taskService.createTask(groupId, dto);
return new ResponseEntity<>(responseDto, HttpStatus.CREATED);
}

@DeleteMapping(path = "/tasks/{id}")
public ResponseEntity deleteTask(@PathVariable("id") Long id){

@DeleteMapping(path = "/tasks/{taskId}")
public ResponseEntity deleteTask(@PathVariable("taskId") Long id){
taskService.delete(id);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}

@PatchMapping(path = "/tasks/{id}")
public ResponseEntity<TaskRequestDto> update(@PathVariable Long id, @RequestBody TaskRequestDto dto){
TaskEntity updated = taskService.update(id, dto);

return new ResponseEntity<>(taskRequestMapper.mapTo(updated), HttpStatus.OK);

@PatchMapping(path = "/tasks/{taskId}")
public ResponseEntity<TaskDto> update(
@PathVariable("taskId") Long taskId,
@RequestBody TaskRequestDto requestDto) {
TaskDto responseDto = taskService.update(taskId, requestDto);
return new ResponseEntity<>(responseDto, HttpStatus.OK);
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
package com.jonassavas.spring_task_api.controllers;

import org.springframework.web.bind.annotation.RestController;

import com.jonassavas.spring_task_api.domain.dto.TaskGroupRequestDto;
import com.jonassavas.spring_task_api.domain.dto.TaskDto;
import com.jonassavas.spring_task_api.domain.dto.TaskGroupDto;
import com.jonassavas.spring_task_api.domain.dto.TaskGroupWithTasksDto;
import com.jonassavas.spring_task_api.domain.entities.TaskEntity;
import com.jonassavas.spring_task_api.domain.entities.TaskGroupEntity;
import com.jonassavas.spring_task_api.mappers.Mapper;
import com.jonassavas.spring_task_api.services.TaskGroupService;
import com.jonassavas.spring_task_api.services.TaskService;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand All @@ -23,40 +10,42 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jonassavas.spring_task_api.domain.dto.task_group.TaskGroupDto;
import com.jonassavas.spring_task_api.domain.dto.task_group.TaskGroupRequestDto;
import com.jonassavas.spring_task_api.domain.dto.task_group.TaskGroupWithTasksDto;
import com.jonassavas.spring_task_api.services.TaskBoardService;
import com.jonassavas.spring_task_api.services.TaskGroupService;


@RestController
public class TaskGroupController {
private TaskGroupService taskGroupService;

private Mapper<TaskGroupEntity, TaskGroupRequestDto> taskGroupRequestMapper;
private Mapper<TaskGroupEntity, TaskGroupWithTasksDto> taskGroupWithTasksMapper;
private Mapper<TaskGroupEntity, TaskGroupDto> taskGroupMapper;

private TaskBoardService taskBoardService;

public TaskGroupController(TaskGroupService taskGroupService,
Mapper<TaskGroupEntity, TaskGroupRequestDto> taskGroupRequestMapper,
Mapper<TaskGroupEntity, TaskGroupDto> taskGroupMapper,
Mapper<TaskGroupEntity, TaskGroupWithTasksDto> taskGroupWithTasksMapper){
TaskBoardService taskBoardService){
this.taskGroupService = taskGroupService;
this.taskGroupRequestMapper = taskGroupRequestMapper;
this.taskGroupMapper = taskGroupMapper;
this.taskGroupWithTasksMapper = taskGroupWithTasksMapper;
this.taskBoardService = taskBoardService;
}

@PostMapping(path = "/taskgroups")
public ResponseEntity<TaskGroupRequestDto> createTaskGroup(@RequestBody TaskGroupRequestDto taskGroup) {
TaskGroupEntity taskGroupEntity = taskGroupRequestMapper.mapFrom(taskGroup);
TaskGroupEntity savedTaskGroupEntity = taskGroupService.save(taskGroupEntity);
return new ResponseEntity<>(taskGroupRequestMapper.mapTo(savedTaskGroupEntity), HttpStatus.CREATED);
@PostMapping(path = "/boards/{boardId}/groups")
public ResponseEntity<TaskGroupDto> createTaskGroup(
@PathVariable("boardId") Long boardId,
@RequestBody TaskGroupRequestDto requestDto) {
if(!taskBoardService.isExist(boardId)){
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
TaskGroupDto responseDto = taskGroupService.createTaskGroup(boardId, requestDto);
return new ResponseEntity<>(responseDto, HttpStatus.CREATED);
}

@GetMapping("/taskgroups")
@GetMapping("/boards/{boardId}/groups")
public List<TaskGroupDto> listTaskGroups() {
return taskGroupService.findAll()
.stream()
.map(taskGroupMapper::mapTo)
.toList();
return taskGroupService.findAll();
}

// @GetMapping("/taskgroups/{id}/tasks")
Expand All @@ -67,12 +56,9 @@ public List<TaskGroupDto> listTaskGroups() {
// .toList();
// }

@GetMapping("/taskgroups/with-tasks")
@GetMapping("/boards/{boardId}/groups/with-tasks")
public List<TaskGroupWithTasksDto> listTaskGroupsWithTasks() {
return taskGroupService.findAllWithTasks()
.stream()
.map(taskGroupWithTasksMapper::mapTo)
.toList();
return taskGroupService.findAllWithTasks();
}


Expand All @@ -83,22 +69,24 @@ public List<TaskGroupWithTasksDto> listTaskGroupsWithTasks() {
// return taskGroups.stream().map(taskGroupMapper::mapTo).collect(Collectors.toList());
// }

@DeleteMapping(path = "/taskgroups/{id}")
public ResponseEntity deleteTaskGroup(@PathVariable("id") Long id){
taskGroupService.delete(id);
@DeleteMapping(path = "/boards/{boardId}/groups/{groupId}")
public ResponseEntity deleteTaskGroup(@PathVariable("groupId") Long groupId){
taskGroupService.delete(groupId);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}

@DeleteMapping(path = "/taskgroups/{groupId}/tasks")
@DeleteMapping(path = "/boards/{boardId}/groups/{groupId}/tasks")
public ResponseEntity deleteAllTasks(@PathVariable("groupId") Long groupId){
taskGroupService.deleteAllTasks(groupId);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}

@PatchMapping(path = "/taskgroups/{id}")
public ResponseEntity<TaskGroupRequestDto> updateTaskGroup(@PathVariable Long id, @RequestBody TaskGroupRequestDto dto){
TaskGroupEntity updated = taskGroupService.update(id, dto);
return new ResponseEntity<>(taskGroupRequestMapper.mapTo(updated), HttpStatus.OK);
@PatchMapping(path = "/boards/{boardId}/groups/{groupId}")
public ResponseEntity<TaskGroupDto> updateTaskGroup(
@PathVariable("groupId") Long groupId,
@RequestBody TaskGroupRequestDto requestDto) {
TaskGroupDto responseDto = taskGroupService.update(groupId, requestDto);
return new ResponseEntity<>(responseDto, HttpStatus.OK);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jonassavas.spring_task_api.domain.dto;
package com.jonassavas.spring_task_api.domain.dto.task;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -10,9 +10,9 @@
@NoArgsConstructor
@Builder
public class TaskDto {
private Long taskGroupId;

private Long id;

private Long taskGroupId;

private String taskName;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jonassavas.spring_task_api.domain.dto;
package com.jonassavas.spring_task_api.domain.dto.task;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.jonassavas.spring_task_api.domain.dto.task_board;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TaskBoardDto {
private Long id;
private String taskBoardName;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.jonassavas.spring_task_api.domain.dto.task_board;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TaskBoardRequestDto {
private String taskBoardName;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.jonassavas.spring_task_api.domain.dto.task_board;

import java.util.List;

import com.jonassavas.spring_task_api.domain.dto.task_group.TaskGroupDto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TaskBoardWithGroupsDto {
private Long id;
private String taskBoardName;
private List<TaskGroupDto> taskGroups;
}
Loading