Skip to content

FAC-118 feat: add audit trail query endpoints#282

Merged
y4nder merged 2 commits intodevelopfrom
claude/audit-trail-query-endpoints-qnvxD
Apr 11, 2026
Merged

FAC-118 feat: add audit trail query endpoints#282
y4nder merged 2 commits intodevelopfrom
claude/audit-trail-query-endpoints-qnvxD

Conversation

@y4nder
Copy link
Copy Markdown
Member

@y4nder y4nder commented Apr 11, 2026

Summary

  • Add GET /audit-logs endpoint with paginated, filtered list (action, actorId, actorUsername, resourceType, resourceId, date range, text search)
  • Add GET /audit-logs/:id endpoint for single audit log detail
  • Both endpoints restricted to SUPER_ADMIN

Details

  • New AuditQueryService (separate from write-focused AuditService) with filter builder and LIKE escaping
  • New AuditController registered in existing AuditModule
  • All queries use filters: { softDelete: false } to bypass global MikroORM filter
  • Request/response DTOs following established patterns (PaginationQueryDto, PaginationMeta)
  • 25 new unit tests (22 service + 3 controller)

Closes #248

Test plan

  • npm run lint — 0 errors
  • npm run build — compiles clean
  • All 42 audit test suite tests pass (npx jest --testPathPatterns=audit)
  • Manual: hit GET /audit-logs and GET /audit-logs/:id with SUPER_ADMIN JWT

https://claude.ai/code/session_01D6jVaVQiXM5y8P8XmsmzG5

Add GET /audit-logs (paginated, filtered list) and GET /audit-logs/:id
(single record) endpoints for superadmin audit log visibility.

https://claude.ai/code/session_01D6jVaVQiXM5y8P8XmsmzG5
@y4nder y4nder linked an issue Apr 11, 2026 that may be closed by this pull request
@y4nder y4nder self-assigned this Apr 11, 2026
@y4nder y4nder merged commit 2de5a94 into develop Apr 11, 2026
2 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.

FAC-118 feat: add audit trail query endpoints

2 participants