Part of Phase 1.1 (epic #14). Spec §12.1–12.4, §6 Phase 1.1 list ("Feed inventory and feed usage").
Scope
Inventory foundation (general, feed-first):
InventoryItem — name, category (spec enum: feed/supplement/additive/medication/…/other), unit, default cost, active flag. CRUD + list; Version token per AGENTS.md.
InventoryLot — receipt of stock: item, received date, quantity received/available, unit cost, optional lot number/expiry. Recording a purchase creates the lot + a purchase movement.
InventoryMovement — append-only ledger (BirdMovement pattern: repo seam rejects Update/Remove): purchase / usage / adjustment / discard, quantity delta, optional flock ref, reason. Current stock per item = Σ deltas (or lot quantity_available sum, single source of truth — pick one and enforce).
Feed usage:
FeedUsage — date, flock, item, optional lot, quantity, unit, optional note; saving generates a usage movement and decrements lot availability (FIFO by received date when no lot chosen, mirroring egg-lot allocation locking).
- Estimated cost from lot cost (costing_method lot_cost; other methods later).
- Optional link to the day's daily entry (
daily_entry_id nullable — full daily-entry capture integration can follow later; standalone recording first).
SPA: Feed & Inventory screen — items CRUD, record purchase, record usage, current stock per item, movement history per item. Responsive per #49 patterns.
Out of scope (later slices)
- Medication/vaccine/withdrawal logic (§13), suppliers, transfers, reconciliation, expiry alerts, average/manual costing, water (separate: see water-usage issue), FCR reports (§19).
Acceptance
- Purchase 500 kg feed → stock 500; record usage 20 kg for a flock → stock 480, usage movement + cost recorded; lot never goes negative (guarded like EggLot.Allocate, race-tested with Version delta assertions).
- Usage against a depleted/archived flock blocked consistently with
CanRecordProductionOn semantics.
Part of Phase 1.1 (epic #14). Spec §12.1–12.4, §6 Phase 1.1 list ("Feed inventory and feed usage").
Scope
Inventory foundation (general, feed-first):
InventoryItem— name, category (spec enum: feed/supplement/additive/medication/…/other), unit, default cost, active flag. CRUD + list; Version token per AGENTS.md.InventoryLot— receipt of stock: item, received date, quantity received/available, unit cost, optional lot number/expiry. Recording a purchase creates the lot + apurchasemovement.InventoryMovement— append-only ledger (BirdMovement pattern: repo seam rejects Update/Remove): purchase / usage / adjustment / discard, quantity delta, optional flock ref, reason. Current stock per item = Σ deltas (or lot quantity_available sum, single source of truth — pick one and enforce).Feed usage:
FeedUsage— date, flock, item, optional lot, quantity, unit, optional note; saving generates ausagemovement and decrements lot availability (FIFO by received date when no lot chosen, mirroring egg-lot allocation locking).daily_entry_idnullable — full daily-entry capture integration can follow later; standalone recording first).SPA: Feed & Inventory screen — items CRUD, record purchase, record usage, current stock per item, movement history per item. Responsive per #49 patterns.
Out of scope (later slices)
Acceptance
CanRecordProductionOnsemantics.