Repository navigation
Closed
Labels
Description
Problem
Feed given to the flock is only tracked as inventory/stock in the visible UI (Supplies/Inventory section), which reads like it's missing the daily-consumption tracking that Water usage already has as a first-class page. Also worth considering: move feed/water entry into the Daily Entry flow, alongside egg counts, since they're recorded on the same cadence (per flock, per day).
What actually exists already (this changes the scope)
Daily feed consumption tracking already exists in the domain and backend — it isn't just stock tracking:
src/Cluckwork.Domain/Inventory/FeedUsage.cs— a full daily feeding event: flock + date + inventory item + quantity, FIFO-draws from stock lots, computesEstimatedCost(comment at line 3: "how much of an item a flock consumed on a day", spec §12.4). Create-only, corrected via compensating adjustment.- Backend:
RecordFeedUsageHandler/RecordFeedUsageCommand/RecordFeedUsageValidatorundersrc/Cluckwork.Application/Features/Inventory/RecordFeedUsage/. - Documented in
specs/product/GLOSSARY.md:286-292as "Feed usage" — a named, first-class concept, same shape as "Water usage" (GLOSSARY.md:301-307).
The actual gap is UX placement, not missing functionality:
- Feed usage is only reachable via a dialog opened from a drill-down panel on the Inventory screen (
web/src/routes/InventoryPage.tsx:8,22-29,36-38, gated byFEEDABLE_CATEGORIES) — buried under Supplies, not a dedicated page. Water usage, by contrast, is a first-class top-level page (web/src/routes/WaterPage.tsx) with its own capture form + history table.GLOSSARY.md:763-774(the Inline add/edit forms → modal dialogs (less-intrusive capture) #131 dialog-migration list) explicitly names Daily entry, Water, and Expense recording as page-based capture forms — Feed usage isn't in that list, confirming it was left dialog-based while its sibling feature wasn't. - Both
FeedUsage.cs:23-25andWaterUsage.cs:24-25already carry aGuid? DailyEntryIdfield with an identical comment: "Reserved for daily-entry integration (spec:daily_entry_idnullable); not populated by any path yet." — so linking feed/water entries to a Daily Entry was explicitly planned in the schema, just never wired up on either side. - Scoping lines up cleanly for that integration: Daily Entry (
src/Cluckwork.Domain/Eggs/DailyEntry.cs:11-14,55-56) is unique per(account, farm, house, flock, date)— the same flock+date scoping Feed/Water usage already use. No structural mismatch blocks bringing them together.
Suggested scope
- Promote Feed usage to a first-class page (or at minimum a prominent capture form), matching Water's UX pattern, so it's not hidden inside an Inventory drill-down.
- Wire the existing
DailyEntryIdlink on bothFeedUsageandWaterUsageso recording feed/water for a flock+date can happen from — or link back to — that day's Daily Entry, since the scoping already matches. - Open question for whoever picks this up: should feed/water entry become inline steps within the Daily Entry page itself, or stay separate pages that simply cross-link via
DailyEntryId? Worth a quick design decision before implementation — inlining touches more UI, cross-linking is the smaller, already-half-built option (the FK exists, just unused).
Docs
Update specs/product/GLOSSARY.md's Feed/Water usage sections and the SPA Help page/in-app glossary per AGENTS.md's doc-sync rule once implemented.
Activity
fix(#446): honor stale feed deep links and drop superseded history re…
fix(#446): clear stale feed rows on filtered-reload failure, drain st…
fix(#446): hide load-more while a filtered reload is in flight
Feed: first-class page + Daily Entry cross-link via the reserved Dail…
fix(e2e): wait for the daily-entry prefill to settle before filling c…
feat(stock): let an admin write off lost egg stock without restating …