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
+14 -2
View File
@@ -110,17 +110,29 @@ Reason:
- grouped result is a better template for “new item from existing definition”
- not expanding children keeps the query lighter
### List pagination
- `GET /{database}/kitchen/items` and `GET /{database}/kitchen/items/grouped` are paginated (`limit`/`offset`, backend default `limit=100`)
- frontend API helpers aggregate pages when no explicit `limit`/`offset` is requested
### Grouped stock view
Grouped stock view uses:
- `GET /{database}/kitchen/items/grouped?expanded=1`
- `GET /{database}/kitchen/items/grouped?expanded=0` for summary
- `GET /{database}/kitchen/items/grouped?expanded=1` for hydrated child details
Important:
- group-level fields are meaningful and should be used
- group expiration status should follow the backend-provided “first item expires” semantics
- do not assume grouped child records are always returned unless `expanded=1`
- with `expanded=0`, grouped child `items` may be ID-only stubs (`{ id }`)
- do not assume grouped child records are fully returned unless `expanded=1`
### Stock updates
- `POST /{database}/kitchen/items/{uuid_b64}/stock` creates a stock event and returns `{ status, stock }`
- frontend refreshes item details with `GET /{database}/kitchen/items/{uuid_b64}` after stock updates
## UX rules that should be preserved