Skip to content

feat(api): add categories directory - #148

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

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

Conversation

@Sam-24-dev

Copy link
Copy Markdown
Owner

Summary

  • Add the tenant-safe Categories directory endpoint.
  • Support the bounded selectable_only filter for future Ledger category selection.

Changes

File Change
backend/api/category_views.py Adds read-only category list endpoint.
backend/api/urls.py Registers /api/v1/categories/.
backend/api/tests.py Covers authorization, tenant scope, response contract, filters, and HTTP behavior.

Testing

  • python manage.py check
  • python manage.py makemigrations --check --dry-run
  • Full Django suite: 312 parent tests plus disposable MySQL checks
  • git diff --check

Contributor checklist

  • Linked an approved issue
  • Added exactly one type:* label
  • Conventional commit format
  • No Co-Authored-By trailers

Closes #147

Copilot AI lite review requested due to automatic review settings September 1, 2026 03: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 ee4db86 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 behavior matches the linked acceptance criteria and is backed by targeted tests for authorization, tenant scoping, strict query validation, and response contract.

Pull request overview

Adds a new tenant-safe, read-only Categories directory endpoint under the existing /api/v1/ API surface, reusing workspace-context resolution and category services to ensure consistent authorization and scoping behavior.

Changes:

  • Introduces GET /api/v1/categories/ with a strict, bounded selectable_only=true|false query contract.
  • Registers the new route in the API URL configuration.
  • Adds API tests covering auth/session expiry, workspace scoping, role-based access, projection/ordering, filter behavior, and JSON 400/405 error contracts.
File summaries
File Description
backend/api/category_views.py Implements the categories directory GET endpoint with strict query validation, workspace context resolution, permission checks, deterministic ordering, and JSON no-store responses.
backend/api/urls.py Wires the new categories/ route into the /api/v1/ URL namespace.
backend/api/tests.py Adds coverage for the new endpoint’s authz, tenant scoping, response contract, filters, and error/method handling.
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 categories directory endpoint

2 participants