fix: Vorbereitung-Module auf 100% — Feld-Fixes, Backend-Persistenz, Endpoints

- ScopeExportTab: 11 Feldnamen-Mismatches gegen ScopeDecision Interface korrigiert
  (level→determinedLevel, riskScore→risk_score, hardTriggers→triggeredHardTriggers,
  depthDescription→depth, effortEstimate→estimatedEffort, isMandatory→required,
  triggeredByHardTrigger→triggeredBy, effortDays→estimatedEffort)
- Company Profile: GET vom Backend beim Mount, snake_case→camelCase, SDK State Fallback
- Modules: Aktivierung/Deaktivierung ans Backend schreiben (activate/deactivate Endpoints)
- Obligations: Explizites Fehler-Banner statt stiller Fallback bei Backend-Fehler
- Source Policy: BlockedContentDB Model + GET /api/v1/admin/blocked-content Endpoint
- Import: Offline-Modus Label fuer Backend-Fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-02 12:02:40 +01:00
parent 80a988dc58
commit f7a0b11e41
10 changed files with 278 additions and 39 deletions

View File

@@ -85,6 +85,28 @@ class PIIRuleDB(Base):
)
class BlockedContentDB(Base):
"""Blocked content entries tracked by source policy enforcement."""
__tablename__ = 'compliance_blocked_content'
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
url = Column(Text, nullable=True)
domain = Column(String(255), nullable=False)
block_reason = Column(String(100), nullable=False) # unlicensed, pii, blacklisted, etc.
rule_id = Column(UUID(as_uuid=True), nullable=True) # PII rule or source that triggered block
details = Column(JSON, nullable=True)
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
__table_args__ = (
Index('idx_blocked_content_domain', 'domain'),
Index('idx_blocked_content_created', 'created_at'),
)
def __repr__(self):
return f"<BlockedContent {self.domain}: {self.block_reason}>"
class SourcePolicyAuditDB(Base):
"""Audit trail for source policy changes."""