Files
Dokumenten-Check/Scripts/DC_DOCUMENT_PROGRESS_ALTER.sql
Philipp Ostmeyer c75f460ec5 feat: Externe Dokument-Referenzen erkennen, herunterladen & mitbewerten
Nach der Transkription eines Dokuments werden referenzierte externe
Dokumente (AGB, Verhaltenskodex) erkannt, sicher heruntergeladen und ihr
Text dem Hauptdokument fuer die "Summen"-Bewertung angehaengt (Option D).
Die Referenzen werden zusaetzlich als eigene, herunterladbare Zeilen
gespeichert.

- DB: dc_project_documents um parent_document_id, is_reference, source_url
  erweitert (DC_REFERENCES_ALTER.sql)
- ORDS: Dokumentenliste um die Felder erweitert; neue Endpunkte
  POST /documents/:id/references und DELETE /projects/:id/references;
  q-Quote-Parserfehler im ai-costs-Handler ('[]') behoben
- Backend: ReferenceDownloadService (SSRF-sicher via DNS-/Public-IP-
  Validierung, Redirect-Pruefung, Groessen-/Timeout-Limits, jsoup fuer HTML),
  EvaluationService.extractReferenceUrls (LLM-basierte URL-Erkennung),
  Orchestrierung (Discovery in Phase A, Referenz-Skip + combinedText in Phase B)
- Config: dc.references.* in application.properties

Verifiziert an Projekt 144: AGB-PDF/-HTML heruntergeladen, verknuepft,
"Summen"-Bewertung zitiert AGB-Klauseln aus dem Referenzdokument.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:45:55 +02:00

51 lines
1.3 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- =============================================================================
-- DC_DOCUMENT_PROGRESS_ALTER.sql
-- Ergänzt dc_project_documents um status und progress für Dokument-Fortschritt.
-- Idempotent: Fehler "Spalte existiert bereits" wird ignoriert.
-- =============================================================================
BEGIN
EXECUTE IMMEDIATE '
ALTER TABLE dc_project_documents ADD (
status VARCHAR2(20) DEFAULT ''PENDING'',
progress NUMBER DEFAULT 0
)
';
DBMS_OUTPUT.PUT_LINE('Spalten status/progress angelegt.');
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE = -1430 THEN
DBMS_OUTPUT.PUT_LINE('Spalten existieren bereits kein Änderungsbedarf.');
ELSE
RAISE;
END IF;
END;
/
-- Bestehende Zeilen initialisieren
UPDATE dc_project_documents
SET status = 'PENDING',
progress = 0
WHERE status IS NULL;
COMMIT;
-- Check-Constraint (idempotent)
BEGIN
EXECUTE IMMEDIATE '
ALTER TABLE dc_project_documents
ADD CONSTRAINT dc_project_documents_status_ck
CHECK (status IN (''PENDING'', ''IN_PROGRESS'', ''COMPLETED'', ''ERROR''))
';
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE IN (-2264, -2261) THEN NULL; -- Constraint existiert bereits
ELSE RAISE;
END IF;
END;
/
COMMIT;
EXIT;