Merge branch 'module/journal' into dev

This commit is contained in:
2026-01-10 22:26:24 +01:00
25 changed files with 295 additions and 54 deletions

View File

@@ -75,5 +75,4 @@ CREATE TABLE IF NOT EXISTS {0} ( {1} VARCHAR(255) PRIMARY KEY, {2} VARCHAR(255)
throw new RuntimeException(e);
}
}
}

View File

@@ -8,10 +8,7 @@ public class Constants {
private Constants(){}
public static final String ACTION = "action";
public static final String ADDRESS = "address";
public static final String ALLOWED_STATES = "allowed_states";
public static final String ATTACHMENTS = "attachments";
@@ -163,4 +160,5 @@ public class Constants {
public static final String VERSION = "version";
public static final String VERSIONS = "versions";
public static final String WIKI = "wiki";
}

View File

@@ -8,6 +8,7 @@ import static java.lang.System.Logger.Level.ERROR;
import static java.lang.System.Logger.Level.WARNING;
import static java.net.HttpURLConnection.HTTP_FORBIDDEN;
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
import static java.text.MessageFormat.format;
public class UmbrellaException extends RuntimeException{
@@ -43,7 +44,12 @@ public class UmbrellaException extends RuntimeException{
return new UmbrellaException(HTTP_FORBIDDEN,message,fills);
}
public static UmbrellaException invalidFieldException(String field,String expected){
@Override
public String getMessage() {
return format(super.getMessage(),fills);
}
public static UmbrellaException invalidFieldException(String field, String expected){
return new UmbrellaException(HTTP_UNPROCESSABLE, ERROR_INVALID_FIELD, field, expected);
}

View File

@@ -27,7 +27,7 @@ public class Task implements Mappable {
private boolean noIndex, showClosed;
private final Map<Long, Member> members;
private final Set<String> dirtyFields = new HashSet<>();
private final Set<String> tags = new HashSet<>();
public Task (long id, long projectId, Long parentTaskId, String name, String description, int status, Double estimatedTime, LocalDate start, LocalDate dueDate, boolean showClosed, boolean noIndex, Map<Long,Member> members, int priority){
this.id = id;
@@ -218,6 +218,16 @@ public class Task implements Mappable {
return status;
}
public Task tags(Collection<String> newValue){
tags.clear();
tags.addAll(newValue);
return this;
}
public Set<String> tags(){
return tags;
}
@Override
public Map<String, Object> toMap() {
var map = new HashMap<String,Object>();
@@ -240,7 +250,7 @@ public class Task implements Mappable {
map.put(REQUIRED_TASKS_IDS,requiredTasksIds);
map.put(SHOW_CLOSED,showClosed);
map.put(TOTAL_PRIO,totalPrio());
map.put(TAGS,tags);
return map;
}