You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feed usage: promote out of the Inventory drill-down + wire feed/water into Daily Entry via the reserved DailyEntryId link #446
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, computes EstimatedCost (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/RecordFeedUsageValidator under src/Cluckwork.Application/Features/Inventory/RecordFeedUsage/.
Documented in specs/product/GLOSSARY.md:286-292 as "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 by FEEDABLE_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.
BothFeedUsage.cs:23-25 and WaterUsage.cs:24-25 already carry a Guid? DailyEntryId field with an identical comment: "Reserved for daily-entry integration (spec: daily_entry_id nullable); 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 DailyEntryId link on both FeedUsage and WaterUsage so 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.
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.RecordFeedUsageHandler/RecordFeedUsageCommand/RecordFeedUsageValidatorundersrc/Cluckwork.Application/Features/Inventory/RecordFeedUsage/.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:
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.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.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
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.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.