feat: Dokumentengenerator — Vollständige Vorlage-Bibliothek + Frontend-Redesign
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 31s
CI / test-python-document-crawler (push) Successful in 23s
CI / test-python-dsms-gateway (push) Successful in 18s
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 31s
CI / test-python-document-crawler (push) Successful in 23s
CI / test-python-dsms-gateway (push) Successful in 18s
- Migration 020: Typ-Renames (data_processing_agreement→dpa, withdrawal_policy→widerruf) + 11 neue MIT-Templates (NDA DE/EN, SLA, AUP, Community Guidelines, Copyright Policy, Cloud Service Agreement, Data Usage Clause, Cookie Banner, AGB, Liability Clause) - Backend: VALID_DOCUMENT_TYPES auf 16 Typen erweitert; /legal-templates/status nutzt jetzt dynamisches GROUP BY statt Hard-coded Felder - searchTemplates.ts: loadAllTemplates() für Library-First UX - page.tsx: Vollständig-Rewrite — Template-Bibliothek (immer sichtbar) mit Kategorie-Pills, Sprache-Toggle, optionaler Suche, Inline-Preview-Expand und Kachel-Grid; Generator-Section erscheint per Scroll wenn Vorlage gewählt - Tests: 52/52 bestanden, TestLegalTemplateNewTypes (19 neue Tests) + aktualisierte Typ-Checks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
49
scripts/apply_legal_templates_020_migration.sh
Executable file
49
scripts/apply_legal_templates_020_migration.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# Apply Migration 020: Legal Templates — Typ-Renames + 11 neue Templates
|
||||
set -e
|
||||
|
||||
CONTAINER="bp-compliance-backend"
|
||||
MIGRATION_FILE="backend-compliance/migrations/020_legal_templates_new_types.sql"
|
||||
REPO="/Users/benjaminadmin/Projekte/breakpilot-compliance"
|
||||
|
||||
echo "=== Migration 020: Legal Templates Typ-Renames + neue Templates ==="
|
||||
|
||||
# 1. Copy migration file to container
|
||||
echo "[1/3] Kopiere Migration in Container..."
|
||||
ssh macmini "/usr/local/bin/docker cp ${REPO}/${MIGRATION_FILE} ${CONTAINER}:/tmp/020_legal_templates_new_types.sql"
|
||||
|
||||
# 2. Execute migration
|
||||
echo "[2/3] Fuehre Migration aus..."
|
||||
ssh macmini "/usr/local/bin/docker exec ${CONTAINER} bash -c '
|
||||
python3 -c \"
|
||||
import sys
|
||||
sys.path.insert(0, \\\"/app\\\")
|
||||
from classroom_engine.database import engine
|
||||
with engine.connect() as conn:
|
||||
with open(\\\"/tmp/020_legal_templates_new_types.sql\\\") as f:
|
||||
sql = f.read()
|
||||
conn.execute(__import__(\\\"sqlalchemy\\\").text(sql))
|
||||
conn.commit()
|
||||
print(\\\"Migration 020 erfolgreich ausgefuehrt\\\")
|
||||
\"
|
||||
'"
|
||||
|
||||
# 3. Verify
|
||||
echo "[3/3] Verifiziere..."
|
||||
ssh macmini "/usr/local/bin/docker exec ${CONTAINER} bash -c '
|
||||
python3 -c \"
|
||||
import sys
|
||||
sys.path.insert(0, \\\"/app\\\")
|
||||
from classroom_engine.database import engine
|
||||
from sqlalchemy import text
|
||||
with engine.connect() as conn:
|
||||
rows = conn.execute(text(\\\"SELECT document_type, COUNT(*) as cnt FROM compliance_legal_templates GROUP BY document_type ORDER BY document_type\\\")).fetchall()
|
||||
print(\\\"Typen in DB:\\\")
|
||||
for r in rows:
|
||||
print(f\\\" {r[0]}: {r[1]} Template(s)\\\")
|
||||
total = conn.execute(text(\\\"SELECT COUNT(*) FROM compliance_legal_templates\\\")).scalar()
|
||||
print(f\\\"Gesamt: {total} Templates\\\")
|
||||
\"
|
||||
'"
|
||||
|
||||
echo "=== Migration 020 abgeschlossen ==="
|
||||
Reference in New Issue
Block a user