Skip to content

feat(routes-f): implement audit trail endpoint with cursor pagination#311

Merged
davedumto merged 1 commit intoStreamFi-x:devfrom
Robinsonchiziterem:feat-284-routes-f-audit-trail
Feb 25, 2026
Merged

feat(routes-f): implement audit trail endpoint with cursor pagination#311
davedumto merged 1 commit intoStreamFi-x:devfrom
Robinsonchiziterem:feat-284-routes-f-audit-trail

Conversation

@Robinsonchiziterem
Copy link
Contributor

Description
Closes #284

Changes proposed
What were you told to do?
Backend: Implement routes-f audit trail endpoint.

What did you do?
I exposed a read-only endpoint to fetch audit events for Routes-F activities with the following changes:

Data Models: Added the
AuditEvent
interface and updated
MetricsKey
to include audit in
lib/routes-f/types.ts
.
Core Logic: Updated
lib/routes-f/store.ts
to include stable mock audit events and implemented a
getAuditTrail
function with cursor-based pagination (descending order).
Infrastructure: Updated
lib/routes-f/metrics.ts
to register and track the new audit metric.
API Endpoint: Created GET /api/routes-f/audit in
app/api/routes-f/audit/route.ts
with support for limit and cursor parameters, including rate limiting and metrics recording.
Testing: Added a comprehensive test suite in
app/api/routes-f/
tests
/audit.test.ts
covering ordering, pagination limits, and empty state behavior.
Check List (Check all the applicable boxes)
🚨Please review the
contribution guideline
for this repository.

My code follows the code style of this project.
This PR does not contain plagiarized content.
The title and description of the PR is clear and explains the approach.
I am making a pull request against the main branch (left side).
My commit messages styles matches our requested structure.
My code additions will fail neither code linting checks nor unit test.
I am only making changes to files I was requested to.
Screenshots/Videos

NOTE

The pagination logic has been verified via the included unit tests. Below is an example of the API response structure:
Screenshot 2026-02-24 114238

@vercel
Copy link

vercel bot commented Feb 24, 2026

@Robinsonchiziterem is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@davedumto davedumto merged commit 8bd3c0e into StreamFi-x:dev Feb 25, 2026
4 of 5 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.

Backend: Implement routes-f audit trail endpoint

2 participants