latest changes

This commit is contained in:
Joren de Graaf
2026-10-17 11:38:57 +02:00
parent 86e3afaca7
commit 76c76bc281
31 changed files with 4562 additions and 41 deletions
+8
View File
@@ -98,6 +98,14 @@ The corresponding HTTP routes are listed in `GET /api/v1/schema/`. Recipe meal d
`inventory_update` accepts an absolute `remaining_amount` for one owned package. Reductions use the same consumption service as `inventory_consume`; zero archives the package. It can update `opened` and `notes` in the same request. A rejected quantity returns `success: false` with `error.details.field` and `error.details.reason`.
### Bulk inventory housekeeping
`inventory_bulk_update` accepts 1–20 `{item_id, changes}` entries. `changes` uses the same fields and stock rules as `inventory_update`; omitted fields stay unchanged. Optional `expected_updated_at` rejects an item that changed since it was read. `dry_run` defaults to true and returns per-item before/after snapshots without saving. Set `dry_run: false` and provide an `idempotency_key` to apply. The default allows valid entries to succeed when others fail; `atomic: true` rolls back the whole batch on any failure. Duplicate IDs and oversized batches are rejected before writes.
For example, preview two location changes with `items: [{"item_id": "…", "changes": {"location": "Metalen stellingkast"}}, {"item_id": "…", "changes": {"location": "Zwarte stellingkast"}}]`. Use the returned IDs and current item timestamps for execution. To correct expiry dates, set `best_before` to `YYYY-MM-DD` (or `null` to clear it).
`inventory_bulk_delete` accepts 1–20 explicit `item_ids` and defaults to a read-only preview showing names, quantities and locations. To archive those exact rows, use `dry_run: false`, `confirm: true` and a new `idempotency_key`. It never deletes food products or consumption history. Reuse the same key and payload for retries; a changed payload with the same key is rejected. Both tools report `validated`, `changed`, `unchanged`, `failed` or `rolled_back` per item and aggregate counts. Re-read inventory before cleanup after an interrupted request.
Example tool arguments:
```json