diff --git a/src/main/java/de/hmmh/pmt/db/Project.java b/src/main/java/de/hmmh/pmt/db/Project.java index 9c9891f..c66731a 100644 --- a/src/main/java/de/hmmh/pmt/db/Project.java +++ b/src/main/java/de/hmmh/pmt/db/Project.java @@ -19,7 +19,7 @@ import java.time.LocalDateTime; @Table(name = "project") public class Project { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotBlank @@ -43,5 +43,10 @@ public class Project { private LocalDateTime plannedEnd; private LocalDateTime realEnd; // Cant be named just "end" because it's and SQL Keyword + + + public boolean isValid() { + return plannedEnd.isAfter(start) && (realEnd == null || realEnd.isAfter(start)); + } }