from sqlalchemy import Boolean, Column, Integer, String

from app.models.base import BaseModel


class PermissionAuditLog(BaseModel):
    __tablename__ = "permission_audit_logs"
    __table_args__ = {"schema": "public"}
    action_type = Column(String(20), nullable=False, index=True)
    user_id = Column(Integer, nullable=False, index=True)
    tenant_id = Column(Integer, nullable=False, index=True)
    resource = Column(String(100))
    action = Column(String(50))
    role_id = Column(Integer)
    result = Column(Boolean)
    ip_address = Column(String(50))
    user_agent = Column(String(500))
    request_path = Column(String(500))
