Skip to content

feat: implement audit log for all admin operations#49

Merged
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
teeschima:feat/audit-logs
Jun 18, 2026
Merged

feat: implement audit log for all admin operations#49
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
teeschima:feat/audit-logs

Conversation

@teeschima

Copy link
Copy Markdown
Contributor

Summary

Implements a complete audit logging system for admin operations as specified in issue #37.

Changes

  • Migration: audit_logs table with INSERT-only design; triggers prevent UPDATE/DELETE
  • Decorator: @AuditAction(resource, action) to tag admin routes with audit metadata
  • Interceptor: AuditInterceptor captures actor, action, request/response state, IP, UA
  • Service: AuditService with log(), logWithBeforeAfter(), and findMany()
  • Endpoint: GET /admin/audit-logs with filters (actorWallet, action, resource, resourceId, search) and pagination
  • Module: AdminModule registered in app.module.ts

Acceptance Criteria

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

Closes #37

- Create audit_logs table with immutable INSERT-only design
- Add AuditAction decorator for tagging admin routes
- Add AuditInterceptor for automatic audit logging
- Add AdminModule with AuditService and AuditController
- Expose GET /admin/audit-logs endpoint with search/pagination

Closes StepFi-app#37
@EmeditWeb EmeditWeb merged commit 760d459 into StepFi-app:main Jun 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: implement audit log for all admin operations

2 participants