Added inventory amount per food package management

This commit is contained in:
Joren de Graaf
2026-10-11 15:46:22 +02:00
parent 400e8254c0
commit cb12c23732
19 changed files with 927 additions and 35 deletions
+4
View File
@@ -62,6 +62,10 @@ Image interpretation belongs to the AI client. For a grocery photograph, identif
For ambiguous candidates, ask the user to select one or supply more identifying details. Report batch item statuses individually: `added`, `needs_review`, or `skipped`. A batch can return `partial_success`; successful items remain added while failed items do not leave partial product or inventory writes. A changed payload with the same idempotency key returns a conflict.
## Partial inventory use
`inventory_get_stock` returns owned products, remaining totals, and individual packages. Use a product ID for a definite match; a text query returns candidates. `inventory_preview_consumption` is read only and shows package deductions and any shortage. `inventory_consume` requires a product ID, positive decimal amount, compatible unit, and idempotency key. It uses opened packages first, then best-before date and age. Set `allow_partial` only after the user explicitly accepts a shortage. `inventory_undo_consumption` records a reversal when the affected package quantities have not changed. All four tools enforce the existing inventory read or write scopes through the HTTP API.
Example tool arguments:
```json