Spaces:
Paused
Paused
Download models/audit_log.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 882 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/audit_log.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/models/audit_log.py
-
curl -L -o audit_log.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/audit_log.py
882 Bytes
| from sqlalchemy import Column, String, ForeignKey | |
| from sqlalchemy.dialects.postgresql import UUID, JSONB | |
| from core.database import Base | |
| from models.base import PrimaryKeyMixin, TimestampMixin | |
| class AuditLog(Base, PrimaryKeyMixin, TimestampMixin): | |
| __tablename__ = "audit_logs" | |
| workspace_id = Column(UUID(as_uuid=True), ForeignKey("workspaces.id"), nullable=True, index=True) | |
| entity_type = Column(String(50), nullable=False, index=True) # e.g., "ticket" | |
| entity_id = Column(UUID(as_uuid=True), nullable=False, index=True) | |
| action = Column(String(100), nullable=False) # e.g., "status_change", "reassignment" | |
| user_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True) # NULL if system/AI | |
| old_value = Column(JSONB, nullable=True) | |
| new_value = Column(JSONB, nullable=True) | |
| metadata_json = Column(JSONB, nullable=True, default={}) | |