FastAPI backend with auth, user, instance, ticket, query, dashboard APIs. React + TypeScript frontend with mock data UI (10 pages). SQLite + async SQLAlchemy, JWT auth, role-based access control. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
17 lines
609 B
Python
17 lines
609 B
Python
from sqlalchemy import Column, Integer, String, Text, DateTime, func
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
class AuditLog(Base):
|
|
__tablename__ = "audit_logs"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
user_id = Column(Integer, nullable=False)
|
|
action = Column(String(50), nullable=False)
|
|
target_type = Column(String(50), nullable=False) # ticket / instance / user / query
|
|
target_id = Column(Integer, nullable=True)
|
|
detail = Column(Text, nullable=True)
|
|
ip_address = Column(String(50), nullable=True)
|
|
created_at = Column(DateTime, server_default=func.now())
|