Craig
0c239cdbd4
TICKET-008 (backend): POST /api/foods/{id}/restore — idempotent, history intact
2026-07-26 17:45:11 +01:00
Craig
a8aed9a84f
TICKET-007 (backend): meals — from-log, unpack, components, recursive nutrition, cycle detection
2026-07-26 17:27:15 +01:00
Craig
32461b7405
TICKET-006 (backend): OFF normalization, scan/search/refresh, restore-on-rescan
...
- services/off.py: single normalizer module (kcal/kJ fallback, not-found
rule); fetch_product/search_off degrade gracefully on upstream errors
(503/timeout → None / []), never 500; User-Agent + timeouts on all calls
- routers/off.py: thin routes for GET /api/off/product/{barcode},
GET /api/off/search, POST /api/off/refresh/{food_id} (404 unknown id,
400 no-barcode)
- services/foods.py: restore-on-rescan (§3.1) — barcode collision on a
soft-deleted food clears deleted_at + updates row instead of 409;
GET /api/foods/recent ordered by most-recent daily_log appearance,
deduped, soft-deleted excluded
- tests: httpx mocked at the boundary (MockTransport, no real OFF);
48 new tests (normalizer unit + router + restore + recent + error paths)
- 152 passing (was 104)
2026-07-26 15:46:24 +01:00
Craig
3f2c765c84
TICKET-001: Foods CRUD with soft-delete
...
- POST/GET/PUT/DELETE /api/foods per spec 3.1 (minus restore)
- Service layer (services/foods.py) with shared soft-delete query helper
- FoodCreate extended, FoodUpdate/FoodRead schemas added
- Barcode conflict returns 409; deleted foods hidden from search,
visible by id and via include_deleted=true
- 29 new tests, full suite green (36 passed)
2026-07-26 12:56:59 +01:00
Craig
e047d884b6
Initial project scaffold: FastAPI backend + Svelte 5 frontend
...
Backend (uv): FastAPI app with routers (foods, log, targets, OFF proxy),
SQLAlchemy models, Pydantic schemas, migration runner + 0001 initial schema,
example pytest suite (7 tests).
Frontend (npm): Vite 7 + Svelte 5 runes, lib/ (api, stores, scanner, format)
per spec §7, placeholder components, example vitest suite (4 tests).
SPEC.md §1: registered uvicorn and Vitest (rule §8.3.3).
2026-07-26 10:26:08 +01:00