Implement upsert label flow and use-based mark gone handling
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-04-10 15:43:39 +02:00
parent caa6ca6ce1
commit 1dc1bb4912
24 changed files with 948 additions and 76 deletions
+12 -5
View File
@@ -147,8 +147,8 @@ Default endpoint placeholders live in [`src/app/config.js`](/Users/blaz/PycharmP
Expected shapes today:
- Kitchen-scoped application resources use:
`/{database}/kitchen/{kitchen_id}/{resource}`
- Kitchen application resources use database-scoped routes:
`/{database}/kitchen/{resource}`
- User application key management uses:
`/{database}/user/application/`
@@ -165,14 +165,20 @@ Expected shapes today:
Returns the current stock review list.
- `GET /{database}/kitchen/items/{uuid_b64}`
Returns one item detail payload.
- `GET /{database}/kitchen/changes`
Returns `{ since, next_cursor, changes }` feed payload for item/stock updates.
- `POST /{database}/kitchen/items/upsert?mode=preview|apply`
Used by label submit flow for create-or-update behavior and conflict-safe matching.
- `POST /{database}/kitchen/items?label=1`
Creates a stock item plus label-related output on the backend side.
Used for label image preview rendering.
- `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 }`.
- `POST /{database}/kitchen/items/{uuid_b64}/use`
Marks an item used up (`gone`) via stock-event semantics.
- `DELETE /{database}/kitchen/items/{uuid_b64}`
Marks an individual stock item gone.
Compatibility fallback when `/use` is not available on the backend.
- `GET /{database}/kitchen/locations`
Returns a nested location tree.
@@ -181,4 +187,5 @@ Expected shapes today:
- Hash-based routing is used to keep static deployment simple.
- Local storage only keeps non-sensitive app config, session payload, active kitchen, and label draft state.
- Kitchen context now lives in the URL path instead of a custom header.
- `includeKitchen: false` in the API client only removes the kitchen path segment; it does not disable bearer authentication.
- The API client now builds database-scoped kitchen routes by default; it always keeps bearer authentication handling separate from URL shaping.
- Label submit now uses upsert-first apply semantics; auto-print is intentionally deferred.