Skip to content

feat(api): add ledger entries read endpoint - #150

Merged
Sam-24-dev merged 1 commit into
mainfrom
feat/api-ledger-read
Sep 1, 2026
Merged

Sam-24-dev merged 1 commit into
mainfrom
feat/api-ledger-read

Conversation

@Sam-24-dev

Copy link
Copy Markdown
Owner

Closes #149

Summary

  • Add a read-only tenant-scoped Ledger entries directory.
  • Return an explicit public projection with Decimal values serialized as strings.
  • Add signed, session-bound keyset pagination and authorization regression coverage.

Changes

File Change
backend/api/ledger_views.py Add the Ledger entries API view.
backend/api/urls.py Route /api/v1/ledger-entries/.
backend/api/tests.py Cover authorization, projection, and cursor behavior.

Testing

  • manage.py check
  • manage.py makemigrations --check --dry-run
  • manage.py test api.tests --verbosity 0 (86 passed)
  • manage.py test --verbosity 0 (319 passed, 14 expected skips)
  • git diff --check

Contributor checklist

  • Linked an approved issue
  • Exactly one type:* label
  • Conventional commit
  • No Co-Authored-By trailer

Copilot AI lite review requested due to automatic review settings September 1, 2026 05:19
@Sam-24-dev Sam-24-dev added the type:feature New product feature label Sep 1, 2026
@Sam-24-dev
Sam-24-dev merged commit e7f0b6c into main Sep 1, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 and no-store responses.
  • Implements opaque, signed, session-bound keyset cursors ordered by occurred_on then pk.
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(api): add ledger entries read endpoint

2 participants