feat(routes-f): implement audit trail endpoint with cursor pagination#311
Merged
davedumto merged 1 commit intoStreamFi-x:devfrom Feb 25, 2026
Merged
Conversation
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
