added code to update notes referencing stock items

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-16 13:23:14 +02:00
parent 5ca6e3c3b8
commit cfa5dd7ed1
7 changed files with 67 additions and 8 deletions

View File

@@ -7,7 +7,6 @@ import static de.srsoftware.umbrella.core.ModuleRegistry.stockService;
import static java.text.MessageFormat.format;
import de.srsoftware.tools.Mappable;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

View File

@@ -11,7 +11,41 @@ import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.Map;
public record Note(long id, String module, String entityId, long authorId, String text, LocalDateTime timestamp) implements Mappable {
public class Note implements Mappable {
private long authorId, id;
private String entityId, module, text;
private LocalDateTime timestamp;
public Note(long id, String module, String entityId, long authorId, String text, LocalDateTime timestamp){
this.id = id;
this.module = module;
this.entityId = entityId;
this.authorId = authorId;
this.text = text;
this.timestamp = timestamp;
}
public long authorId(){
return authorId;
}
public String entityId(){
return entityId;
}
public Note entityId(String newVal){
entityId = newVal;
return this;
}
public long id(){
return id;
}
public String module(){
return module;
}
public static Note of(ResultSet rs) throws SQLException {
return new Note(
rs.getLong(ID),
@@ -23,6 +57,14 @@ public record Note(long id, String module, String entityId, long authorId, Strin
);
}
public String text() {
return text;
}
public LocalDateTime timestamp(){
return timestamp;
}
@Override
public Map<String, Object> toMap() {
return Map.of(