feat(phase-9): implement MVP polishing and closure
T-032: User management admin panel - backend users router with CRUD, frontend UsersPage with modals T-033: Audit log viewer - backend audit router with filters/pagination, frontend AuditLogPage T-034: Global error handling - ErrorBoundary, LoadingSpinner, ErrorMessage, Toast components T-035: Backend tests - pytest setup with SQLite, tests for health/auth/techniques/tests T-036: Documentation - Updated README with testing section, created docs/API.md
This commit is contained in:
31
backend/app/schemas/audit.py
Normal file
31
backend/app/schemas/audit.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Pydantic schemas for Audit Log endpoints."""
|
||||
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class AuditLogOut(BaseModel):
|
||||
"""Complete representation of an audit log entry."""
|
||||
|
||||
id: uuid.UUID
|
||||
user_id: uuid.UUID | None = None
|
||||
username: str | None = None # Populated from user relationship
|
||||
action: str
|
||||
entity_type: str | None = None
|
||||
entity_id: str | None = None
|
||||
timestamp: datetime
|
||||
details: dict[str, Any] | None = None
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class AuditLogPage(BaseModel):
|
||||
"""Paginated response for audit logs."""
|
||||
|
||||
items: list[AuditLogOut]
|
||||
total: int
|
||||
offset: int
|
||||
limit: int
|
||||
Reference in New Issue
Block a user