feat: OCR pipeline with NDJSON streaming and real-time progress (#226, #227, #231) #229

Merged
marcel merged 74 commits from feat/issue-226-227-ocr-pipeline-polygon into main 2026-04-13 12:39:04 +02:00
5 changed files with 21 additions and 0 deletions
Showing only changes of commit d194b6b225 - Show all commits

View File

@@ -5,6 +5,7 @@ import java.util.List;
import java.util.UUID;
import lombok.Data;
import org.raddatz.familienarchiv.model.ScriptType;
@Data
public class DocumentUpdateDTO {
@@ -18,4 +19,5 @@ public class DocumentUpdateDTO {
private List<UUID> receiverIds;
private String tags;
private Boolean metadataComplete;
private ScriptType scriptType;
}

View File

@@ -91,6 +91,12 @@ public class Document {
@Builder.Default
private boolean metadataComplete = false;
@Enumerated(EnumType.STRING)
@Column(name = "script_type", nullable = false)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
@Builder.Default
private ScriptType scriptType = ScriptType.UNKNOWN;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "document_receivers", joinColumns = @JoinColumn(name = "document_id"), inverseJoinColumns = @JoinColumn(name = "person_id"))
@Builder.Default

View File

@@ -0,0 +1,8 @@
package org.raddatz.familienarchiv.model;
public enum ScriptType {
UNKNOWN,
TYPEWRITER,
HANDWRITING_LATIN,
HANDWRITING_KURRENT
}

View File

@@ -222,6 +222,10 @@ public class DocumentService {
doc.setMetadataComplete(dto.getMetadataComplete());
}
if (dto.getScriptType() != null) {
doc.setScriptType(dto.getScriptType());
}
// 4. Datei austauschen (nur wenn eine neue ausgewählt wurde)
if (newFile != null && !newFile.isEmpty()) {
FileService.UploadResult upload = fileService.uploadFile(newFile, newFile.getOriginalFilename());

View File

@@ -0,0 +1 @@
ALTER TABLE documents ADD COLUMN script_type VARCHAR(30) NOT NULL DEFAULT 'UNKNOWN';