Skip to content

core: implement audit log for all admin operations #37

@EmeditWeb

Description

@EmeditWeb

Problem

Admin operations leave no audit trail. If something
goes wrong there is no record of who did what.

What To Build

  1. Create audit_logs table in Supabase
  2. Create AuditService and AuditInterceptor
  3. GET /admin/audit-logs endpoint
  4. Immutable INSERT-only design

Files To Touch

  • src/audit/ (new module)
  • src/common/interceptors/audit.interceptor.ts
  • All admin controllers
  • supabase/migrations/[ts]_audit_logs.sql

Acceptance Criteria

  • All admin actions logged
  • Before and after state captured
  • Logs immutable (no updates allowed)
  • Searchable via endpoint
  • npm run build passes

Mandatory Checks Before PR

  • npm run build passes
  • No any types
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions