|
|
|
@ -20,6 +20,7 @@ public class Task implements Mappable { |
|
|
|
private final long id, projectId; |
|
|
|
private final long id, projectId; |
|
|
|
private Long parentTaskId; |
|
|
|
private Long parentTaskId; |
|
|
|
private String description, name; |
|
|
|
private String description, name; |
|
|
|
|
|
|
|
private Set<Long> requiredTasksIds; |
|
|
|
private int status; |
|
|
|
private int status; |
|
|
|
private Double estimatedTime; |
|
|
|
private Double estimatedTime; |
|
|
|
private LocalDate dueDate, start; |
|
|
|
private LocalDate dueDate, start; |
|
|
|
@ -41,6 +42,7 @@ public class Task implements Mappable { |
|
|
|
this.showClosed = showClosed; |
|
|
|
this.showClosed = showClosed; |
|
|
|
this.noIndex = noIndex; |
|
|
|
this.noIndex = noIndex; |
|
|
|
this.members = members; |
|
|
|
this.members = members; |
|
|
|
|
|
|
|
this.requiredTasksIds = new HashSet<>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Task clean() { |
|
|
|
public Task clean() { |
|
|
|
@ -131,8 +133,6 @@ public class Task implements Mappable { |
|
|
|
default -> throw invalidFieldException(json.get(DESCRIPTION).getClass().getSimpleName(),"String or JSON"); |
|
|
|
default -> throw invalidFieldException(json.get(DESCRIPTION).getClass().getSimpleName(),"String or JSON"); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var status = Status.OPEN.code(); |
|
|
|
var status = Status.OPEN.code(); |
|
|
|
if (json.has(STATUS) && json.get(STATUS) instanceof JSONObject state){ |
|
|
|
if (json.has(STATUS) && json.get(STATUS) instanceof JSONObject state){ |
|
|
|
if (state.get(CODE) instanceof Number code) status = code.intValue(); |
|
|
|
if (state.get(CODE) instanceof Number code) status = code.intValue(); |
|
|
|
@ -185,6 +185,10 @@ public class Task implements Mappable { |
|
|
|
return projectId; |
|
|
|
return projectId; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Set<Long> requiredTasksIds(){ |
|
|
|
|
|
|
|
return requiredTasksIds; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean showClosed(){ |
|
|
|
public boolean showClosed(){ |
|
|
|
return showClosed; |
|
|
|
return showClosed; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -216,6 +220,7 @@ public class Task implements Mappable { |
|
|
|
map.put(SHOW_CLOSED,showClosed); |
|
|
|
map.put(SHOW_CLOSED,showClosed); |
|
|
|
map.put(NO_INDEX,noIndex); |
|
|
|
map.put(NO_INDEX,noIndex); |
|
|
|
map.put(MEMBERS,memberMap); |
|
|
|
map.put(MEMBERS,memberMap); |
|
|
|
|
|
|
|
map.put(REQUIRED_TASKS_IDS,requiredTasksIds); |
|
|
|
|
|
|
|
|
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
|