working on tag handling in accounting module
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -30,5 +30,7 @@ public interface TagService {
|
||||
|
||||
String save(String module, long entityId, Collection<Long> userIds, String tag);
|
||||
|
||||
Collection<String> search(String key, UmbrellaUser user);
|
||||
|
||||
void updateId(String module, Object oldId, Object newId);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class Path {
|
||||
public static final String STATE = "state";
|
||||
public static final String STOP = "stop";
|
||||
|
||||
public static final String TAGS = "tags";
|
||||
public static final String TAGGED = "tagged";
|
||||
public static final String TOKEN = "token";
|
||||
|
||||
|
||||
@@ -52,7 +52,12 @@ public class IdOrString implements Mappable {
|
||||
return map;
|
||||
}
|
||||
|
||||
public String value(){
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String value(){
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,8 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
public record Transaction(long id, long accountId, LocalDateTime date, IdOrString source, IdOrString destination, double amount, String purpose, Set<String> tags) implements Mappable {
|
||||
|
||||
|
||||
@@ -35,10 +37,16 @@ public record Transaction(long id, long accountId, LocalDateTime date, IdOrStrin
|
||||
Field.SOURCE, source.toMap(),
|
||||
Field.DESTINATION, destination.toMap(),
|
||||
Field.AMOUNT, amount,
|
||||
Field.PURPOSE, purpose
|
||||
Field.PURPOSE, purpose,
|
||||
Field.TAGS, tags
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return format("Transaction ({0} -[{1}]-> {2})",source,amount,destination);
|
||||
}
|
||||
|
||||
public Transaction withId(long id) {
|
||||
return new Transaction(id, accountId, date, source, destination, amount, purpose, new HashSet<>(tags));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user