Overview
Once audit logs are recorded (BE-67), administrators need an endpoint to read them for compliance, investigation, and reporting purposes. Without this endpoint, audit data accumulates in the database with no way to access it through the API.
Background
Files to create:
backend/src/audit/audit.controller.ts
Endpoint:
GET /api/audit — admin-only, protected with JwtAuthGuard + RolesGuard
Query params:
actorId — filter by actor
action — filter by action type
targetType — filter by target entity type
startDate / endDate — ISO date range filter
page, limit — pagination
Response: { data: AuditLog[], total, page, limit }
The endpoint should also support CSV export via ?format=csv for compliance downloads (optional stretch goal).
Acceptance Criteria
Overview
Once audit logs are recorded (BE-67), administrators need an endpoint to read them for compliance, investigation, and reporting purposes. Without this endpoint, audit data accumulates in the database with no way to access it through the API.
Background
Files to create:
backend/src/audit/audit.controller.tsEndpoint:
GET /api/audit— admin-only, protected withJwtAuthGuard+RolesGuardQuery params:
actorId— filter by actoraction— filter by action typetargetType— filter by target entity typestartDate/endDate— ISO date range filterpage,limit— paginationResponse:
{ data: AuditLog[], total, page, limit }The endpoint should also support CSV export via
?format=csvfor compliance downloads (optional stretch goal).Acceptance Criteria
403for non-admin users