Align stock API with paginated backend and bump to v0.2.2
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-04-12 17:57:53 +02:00
parent ae8ad07d87
commit 39dd474813
9 changed files with 277 additions and 83 deletions
+5 -5
View File
@@ -164,9 +164,10 @@ Expected shapes today:
- `GET /{database}/kitchen/items?search_name=...`
Returns item definitions for autocomplete.
- `GET /{database}/kitchen/items`
Returns the current stock review list.
Returns the current stock review list. Endpoint is paginated (`limit`/`offset`, backend default `limit=100`); frontend helpers aggregate pages by default unless explicit pagination is passed.
- `GET /{database}/kitchen/items/grouped?expanded=0|1`
Returns grouped stock data; grouped review uses summary-first loading and hydrates item children in background.
Returns grouped stock data; grouped review uses summary-first loading (`expanded=0`) and hydrates item children in background (`expanded=1`).
With `expanded=0`, child `items` can be ID-only stubs (`{ id }`) instead of full item payloads.
- `GET /{database}/kitchen/items/{uuid_b64}`
Returns one item detail payload.
- `GET /{database}/kitchen/changes`
@@ -182,13 +183,12 @@ Expected shapes today:
- `POST /{database}/kitchen/items?label=1&preview=1`
Returns an image blob, `{ imageUrl }`, or `{ imageSvg }` for in-browser preview.
- `POST /{database}/kitchen/items/{uuid_b64}/stock`
Updates measured or descriptive stock state using `{ quantity }` or `{ level }`.
Creates a stock event for measured or descriptive updates using `{ quantity }` or `{ level }`.
Response shape is `{ status, stock }`; frontend re-fetches the item detail after successful update.
- `POST /{database}/kitchen/items/{uuid_b64}/use`
Marks an item used up (`gone`) via stock-event semantics.
- `POST /{database}/kitchen/items/{uuid_b64}/print-label`
Prints label for an existing item; called from the save flow when `Print` is enabled.
- `DELETE /{database}/kitchen/items/{uuid_b64}`
Compatibility fallback when `/use` is not available on the backend.
- `PATCH /{database}/kitchen/items/{uuid_b64}`
Used for item-level edits from stock detail (for example identifier code updates).
- `GET /{database}/kitchen/locations`