Skip to content

feat: implement audit trail system#224

Merged
llinsss merged 2 commits into
DogStark:mainfrom
codewithzubair07:feature/audit-clean
Mar 26, 2026
Merged

feat: implement audit trail system#224
llinsss merged 2 commits into
DogStark:mainfrom
codewithzubair07:feature/audit-clean

Conversation

@codewithzubair07
Copy link
Copy Markdown

🚀 Audit Trail Implementation

📌 Description

This PR introduces an audit trail system to track API actions, user activities, and system events with tamper-proof logging.


✅ Features

  • Automatic logging using NestJS interceptor
  • Tracks API actions (CRUD + auth events)
  • Tamper-proof logs using SHA-256 hashing
  • Audit log entity with structured metadata
  • Endpoint to retrieve logs (GET /audit)

⚙️ Implementation

  • Created AuditModule, AuditService, and AuditLog entity
  • Added global interceptor for automatic logging
  • Integrated module into AppModule and main.ts
  • Logs are immutable (no update/delete operations)

⚠️ Notes

  • Existing TypeScript errors in the repository are unrelated to this PR
  • No unrelated files were modified

🧪 Testing

@llinsss llinsss merged commit a0dc0ae into DogStark:main Mar 26, 2026
1 of 4 checks 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.

[DB] Audit Trail Implementation

3 participants