feat(api): add ledger entries read endpoint - #150
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The endpoint implementation follows existing cursor/auth patterns in the codebase and is backed by targeted and suite-wide passing tests covering the key acceptance criteria.
Pull request overview
Adds a new tenant-scoped, session-authenticated, read-only API endpoint for listing Ledger entries in the active workspace, including a strict public projection and session-bound signed keyset pagination per issue #149.
Changes:
- Introduces
GET /api/v1/ledger-entries/with a fixed output projection andno-storeresponses. - Implements opaque, signed, session-bound keyset cursors ordered by
occurred_onthenpk. - Adds API tests covering auth/membership rules, projection (including Decimal-as-string), cursor validation, and tamper/expiry handling.
File summaries
| File | Description |
|---|---|
| backend/api/ledger_views.py | New read-only ledger entries listing view with signed, session-bound keyset cursors and strict query contract. |
| backend/api/urls.py | Routes /api/v1/ledger-entries/ to the new list view. |
| backend/api/tests.py | Adds authorization, projection, cursor validation, and cursor storage pruning/cap tests for the new endpoint. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Closes #149
Summary
Changes
backend/api/ledger_views.pybackend/api/urls.py/api/v1/ledger-entries/.backend/api/tests.pyTesting
manage.py checkmanage.py makemigrations --check --dry-runmanage.py test api.tests --verbosity 0(86 passed)manage.py test --verbosity 0(319 passed, 14 expected skips)git diff --checkContributor checklist
type:*label