Skip to content

Add admin audit log for tracking admin actions #15

Description

@darshacharya

Description

There is no record of admin actions. When multiple admins are involved, it's important to track who approved/rejected which case and when.

Requirements

  • Create an `AuditLog` model to record admin actions
  • Log: case verification (approve/reject), document verification, any future admin actions
  • Store: admin user ID, action type, target (case/document ID), timestamp, details
  • Add `GET /api/admin/audit-log` endpoint (admin-only) with pagination
  • Add an audit log page in the admin panel

Tech Notes

  • New model: `backend/app/models/audit_log.py`
  • Hook into `backend/app/routers/admin.py` — `verify_case` and `verify_document`
  • Frontend: New page at `frontend/src/app/admin/audit/page.tsx`

Acceptance Criteria

  • All admin actions are logged
  • Audit log records who, what, when, and details
  • Admin can view the audit log
  • Log is paginated
  • Audit entries cannot be modified or deleted

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend relatedenhancementNew feature or requestsecuritySecurity improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions