dcramer / dcramer/peated

feat(api): filter entities by current owner

Open
#772 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
103
Forks
18
Avg merge
1h 19m
Merged PRs (30d)
555

Description

Why

The redesigned entity detail page uses entity.kind for its presentation. Company records need to show their owned distilleries, brands, bottlers, and other companies. The current entity details response exposes only ownerId, and entities.list cannot filter by owner. The web page must not infer a company portfolio from bottle relationships.

API contract

  • Add an optional numeric owner filter to GET /entities.
  • Filter on the entity current-owner relationship (ownerId).
  • Preserve the existing cursor, limit, type, sort, and location behavior.
  • Support the same filter in the typed mock API.
  • Return the existing entity-list envelope and serialized entity records; no new response shape is needed.

Web use

The company entity detail page will request owned entities, group the supplied records by kind, and link to their detail pages. Until this capability exists, the redesign will show the company identity and owned core facts but will not invent a portfolio section from the entity catalog.

Acceptance criteria

  • entities.list({ owner: companyId }) returns only entities whose current ownerId matches the company.
  • The filter composes with type, sort, and cursor inputs.
  • Unknown or empty portfolios return the standard empty list response.
  • The mock API includes a company with owned entities so the web page can be reviewed locally.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the GET /entities implementation and the entities.list typed mock API entry point. Add the optional owner filter while preserving type, sort, cursor, limit, location, and the existing response envelope; verify matching, empty, and composed-filter behavior, including a mock company with owned entities.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.