diff options
| author | Tom Flux <tom@tomflux.xyz> | 2026-06-23 21:07:18 +0100 |
|---|---|---|
| committer | Tom Flux <tom@tomflux.xyz> | 2026-06-23 21:07:18 +0100 |
| commit | d118726d3010d5b0133c7665fc20008c055f2757 (patch) | |
| tree | 175493aa0e26314998e29f760dfb83d134564787 /kitchen/apps.py | |
| parent | 95c04f07c6b554baa88d539d57b6bea0c1caf336 (diff) | |
Phase 3a: close the Django API gaps for the MCP server
Backend prerequisites for the FastMCP service (mcp.md ยง6) โ no model
changes, no migration.
- log_cook: accepts `rating`, validates via full_clean (enforces the
exactly-one-recipe rule), and returns `used_ingredients` as a
suggestion set instead of mutating the pantry. Auto-deduct path and
_deduct_ingredient removed โ pantry state changes only via set-state
after the user confirms.
- New POST /api/pantry/set-state/ โ set in/low/out by ingredient name
(alias-aware), optional location; registered before the router so the
pantry detail route doesn't capture "set-state" as a pk.
- what_can_i_cook: presence-based (exclude 'out', tolerate null
quantity) so the API matcher agrees with the web one.
- bulk-pantry-add: restocks an existing ingredient+location row to 'in'
instead of duplicating; quantity is an optional int.
Tests cover all four + that pantry `state` is serialized (24 pass).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'kitchen/apps.py')
0 files changed, 0 insertions, 0 deletions
