mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 05:57:21 -05:00
Add v0.2 pillars: chaos inbox, identity center, command palette
This commit is contained in:
21
backend/app/models/compliance_event.py
Normal file
21
backend/app/models/compliance_event.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""Lightweight compliance and ops events"""
|
||||
from sqlalchemy import Column, Integer, String, DateTime, JSON
|
||||
from sqlalchemy.sql import func
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class ComplianceEvent(Base):
|
||||
"""Event log for compliance and ops visibility."""
|
||||
|
||||
__tablename__ = "compliance_events"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
actor = Column(String(255))
|
||||
action = Column(String(255))
|
||||
resource = Column(String(255))
|
||||
metadata = Column(JSON, default=dict)
|
||||
severity = Column(String(50), default="info")
|
||||
timestamp = Column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
def __repr__(self):
|
||||
return f"<ComplianceEvent {self.action} by {self.actor}>"
|
||||
Reference in New Issue
Block a user