refactor(api): remove legacy entity type in favor of kind
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 103
- Forks
- 18
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 555
Description
Why
Entity.kind is the canonical entity classification. The legacy multi-valued Entity.type field is no longer part of the product model, but API contracts and several callers still use it for catalog filters, entity creation, and presentation. This makes pages disagree about what an entity is.
API and data changes
- Replace the optional
typefilter onGET /entitieswith akindfilter using the entity-kind enum. - Replace or remove the
searchContext.typeinput where it represents entity classification. - Remove
typefrom entity create, update, detail, list, and search schemas. - Remove the legacy database column and generated types through the normal migration workflow.
- Update the typed mock API and fixtures to use only
kind. - Keep bottle roles explicit on Bottle (
brand,bottler, anddistillers); do not reconstruct them from entity kind.
Web use
/distillersrequestskind=distillery./brandsrequestskind=brand./bottlersrequestskind=bottler.- Entity forms select one kind rather than several types.
- Entity detail presentation and contextual actions use kind only.
Acceptance criteria
- No public API entity contract exposes or accepts
type. - Entity catalog filters paginate and sort correctly by
kind. - Existing entities retain their canonical kind after migration.
- Bottle brand, bottler, and distiller assignments remain unchanged.
- The mock API covers distillery, brand, bottler, blender, and company records without a type field.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the GET /entities API, the searchContext input, entity create/update/detail/list/search schemas, and the normal database migration workflow. Then trace the /distillers, /brands, and /bottlers requests and entity forms. Done means no public entity contract or mock fixture uses type, kind filters work, and bottle assignments and canonical kinds are preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, database, frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100