Skip to content

Commit

Permalink
Rename properties for semantic reasons (i.e. plurals for lists)
Browse files Browse the repository at this point in the history
  • Loading branch information
mechakdotdev committed Nov 23, 2024
1 parent 7f00298 commit ccaa418
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/taskmanager/dto/TaskDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lombok.*;

import java.util.Date;
import java.time.LocalDate;
import java.util.List;

@Data
Expand All @@ -13,6 +13,6 @@ public class TaskDTO {
private List<Long> labelIds;
private String title;
private Integer priority;
private Date dueDate;
private LocalDate dueDate;
private String description;
}
6 changes: 3 additions & 3 deletions src/main/java/taskmanager/entity/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import jakarta.persistence.*;
import lombok.*;

import java.util.Date;
import java.time.LocalDate;
import java.util.List;

@Entity
Expand All @@ -23,7 +23,7 @@ public class Task {

@OneToMany(fetch = FetchType.LAZY, mappedBy = "task")
@NonNull
private List<Label> label;
private List<Label> labels;

@NonNull
private String title;
Expand All @@ -32,7 +32,7 @@ public class Task {
private Integer priority;

@NonNull
private Date dueDate;
private LocalDate dueDate;

@NonNull
private String description;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/taskmanager/mapper/TaskMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static TaskDTO toDto(Task task) {
return new TaskDTO(
task.getId(),
task.getProject().getId(),
task.getLabel().stream().map(Label::getId).collect(Collectors.toList()),
task.getLabels().stream().map(Label::getId).collect(Collectors.toList()),
task.getTitle(),
task.getPriority(),
task.getDueDate(),
Expand Down

0 comments on commit ccaa418

Please sign in to comment.