Skip to content

feat: add /api/audit/counts summary endpoint#531

Open
thewealthyplace wants to merge 1 commit into
Predictify-org:mainfrom
thewealthyplace:feature/audit-counts-summary
Open

feat: add /api/audit/counts summary endpoint#531
thewealthyplace wants to merge 1 commit into
Predictify-org:mainfrom
thewealthyplace:feature/audit-counts-summary

Conversation

@thewealthyplace

Copy link
Copy Markdown

Summary

  • Adds GET /api/audit/counts, an admin-only endpoint that returns a per-action counts summary of audit_logs entries (optionally scoped to a startDate/endDate range), for use in dashboards.
  • Adds getAuditCounts to src/repositories/auditLogRepo.ts (groups by action, orders by count descending).
  • Documents the endpoint in the OpenAPI registry and README, and registers it in scripts/check-openapi.ts.

Test plan

  • npm run lint — no errors
  • npx tsc -p tsconfig.json --noEmit — no new errors introduced (diffed against main)
  • npx jest tests/auditCounts.test.ts tests/auditLogRepo.test.ts — all passing (auth, validation, rate limiting, happy path)
  • Confirmed no regressions in the broader test suite (compared against main baseline)

Closes #384

Adds a per-action counts aggregate over the audit_logs table (optionally
scoped to a startDate/endDate range) so admin dashboards can render audit
activity summaries without paginating through the full log.

Closes Predictify-org#384
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@thewealthyplace Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add /api/audit/counts summary endpoint (buffer2 #1)

1 participant