implemented storing of tasks extended fields

This commit is contained in:
2025-07-25 14:38:11 +02:00
parent 10eff7a88f
commit 8dfa3c7a46
2 changed files with 21 additions and 9 deletions

View File

@@ -52,9 +52,16 @@ public record Task(long id, long projectId, Long parentTaskId, String name, Stri
};
var status = Status.OPEN;
Double estimatedTime = null; // TODO: provide form field
LocalDate startDate = null;
LocalDate dueDate = null;
Double estimatedTime = null;
if (json.has(ESTIMATED_TIME)) {
if (json.get(ESTIMATED_TIME) instanceof Number est) estimatedTime = est.doubleValue();
if (json.get(ESTIMATED_TIME) instanceof String est) try {
estimatedTime = Double.parseDouble(est);
} catch (NumberFormatException ignored) {
}
}
LocalDate startDate = json.has(START_DATE) && json.get(START_DATE) instanceof String d ? LocalDate.parse(d) : null;
LocalDate dueDate = json.has(DUE_DATE) && json.get(DUE_DATE) instanceof String d ? LocalDate.parse(d) : null;
var showClosed = json.has(SHOW_CLOSED) && json.get(SHOW_CLOSED) instanceof Boolean sc ? sc : false;
var noIndex = json.has(NO_INDEX) && json.get(NO_INDEX) instanceof Boolean ni ? ni : false;