Feed Roster
The Feed Roster is the daily feeding control surface for animals currently in care. It tracks last-fed timestamps, computes when each animal is next due for a feed, flags overdue animals, and lets carers log a new feeding record without leaving the page. A summary of the same data is surfaced on the home dashboard so coordinators and admins can see organisation-wide feeding status at a glance, and individual carers can see only their own caseload.
Overview
Feeding is the single highest-frequency task in wildlife rehabilitation, and missed feeds are one of the most common preventable welfare issues. The Feed Roster centralises every in-care animal's feeding state, derives feeding intervals from the animal's recent feeding history, falls back to species- and life-stage-based recommendations when no history exists, and presents a sortable schedule sorted by the most overdue animals first.
The roster is role-aware: every user sees the subset of animals they are authorised to view, with the same RBAC rules used elsewhere in the application.
Accessing the Feed Roster
There are two entry points:
- Tools menu — open
/toolsfrom the navigation header and choose Feed Roster, or go directly to/tools/feed-roster. - Home dashboard — the summary widgets (described below) display feed roster status on the home page, with a button to open the full roster.
Roster Page (/tools/feed-roster)
Summary Cards
Three cards at the top of the page show the headline numbers for the visible roster:
| Card | Meaning |
|---|---|
| Animals in roster | Total animals currently IN_CARE or READY_FOR_RELEASE that are visible to your role |
| Overdue or unrecorded | Animals past due for a feed, or with no feeding record on file |
| Currently on schedule | Animals whose next-due time is in the future |
Daily Schedule Table
Each row represents one in-care animal, with the following columns:
| Column | Description |
|---|---|
| Animal | Name, species, age/age class, and the assigned carer |
| Last feed | Timestamp of the most recent FEEDING record |
| Time since | Elapsed hours/minutes since the last feed |
| Next due | Computed timestamp for the next feed, plus a status badge |
| Notes | Notes from the last feeding record |
| Action | Log Feed — opens the quick-add dialog |
Rows are colour-flagged red when overdue. The table can be sorted by Most overdue (default) or Next feed due.
How "Next Due" Is Calculated
The roster derives the recommended feeding interval in two ways:
- From feeding history — if the animal has at least two recent
FEEDINGrecords, the interval is the gap between the two most recent feeds, clamped between 2 and 24 hours. - From life stage — if there is fewer than two records, a fallback interval is applied based on the animal's species, age, age class, and life stage:
| Life stage signal | Default interval |
|---|---|
| Pinkie / neonate / newborn / unfurred / pouch / hatchling | 3 hours |
| Joey / chick / juvenile / fledgling / young | 4 hours |
| Subadult / adult | 12 hours |
| Anything else | 6 hours |
The next-due time is last feed + interval. If no feed has been recorded, the animal is shown as overdue immediately.
Quick Log Feed Dialog
Selecting Log Feed opens a dialog with:
- Fed at (datetime) — defaults to now
- Food type (free text) — e.g., formula, browse, insects
- Amount (free text) — e.g., 20mL, 15g
- Notes (free text) — appetite, behaviour, leftovers
Submitting writes a new FEEDING record via /api/records. Authorisation is enforced server-side: a carer can only log feeds for animals they are authorised to access. After saving, the page refreshes and the roster recomputes.
Dashboard Summary Widgets
The home dashboard surfaces a feed roster summary tailored to the viewer's role. Both widgets share the same compute (the shared lib src/lib/feed-roster.ts) so numbers always match the full Feed Roster page.
Carer View
Carers (and CARER_ALL) see a single card titled My Feeding Schedule (or Feeding Schedule (Organisation) for CARER_ALL):
- Three count tiles — Overdue, Due soon (within 2 hours), On track
- Top 5 animals — sorted by most overdue first, with last-fed time, due time, and a status badge
- Open feed roster button — links to
/tools/feed-roster - Overdue alert banner — when any animals are overdue, a red banner reminds the carer to log feeds or escalate
If the carer has no animals assigned, the widget shows an empty state with a friendly message.
Admin and Coordinator View
Admins and coordinators see a wider card titled Feeding Roster Overview, placed between the Call Log and Dashboard Stats:
- Four count tiles — In-care animals, Overdue, Due soon, On track
- Carer breakdown — every carer with at least one in-care animal, sorted by overdue count, with badges for overdue, due soon, or on track. Animals without an assigned carer are bucketed under Unassigned in orange to flag a workflow issue.
- Most overdue animals — top 5 most-overdue rows with carer name, last-fed time, and status badge
- Open feed roster button — links to
/tools/feed-roster - Follow-up banner — when there are overdue feeds, a red banner reminds coordinators to confirm with carers or reassign
Role-Based Visibility
The roster respects the organisation-wide RBAC rules:
| Role | Animals visible in feed roster |
|---|---|
ADMIN | All in-care animals in the organisation |
COORDINATOR_ALL | All in-care animals in the organisation |
CARER_ALL | All in-care animals in the organisation |
COORDINATOR | In-care animals in their assigned species groups, plus any animals personally assigned to them |
CARER | Only in-care animals where carerId matches their user id |
In-care is defined as status IN (IN_CARE, READY_FOR_RELEASE). Animals with status ADMITTED, RELEASED, DECEASED, TRANSFERRED, or PERMANENT_CARE are not shown.
Data Model
The Feed Roster does not introduce its own database table. It reads from existing models:
Animal— the source of truth for in-care status, species, age, age class, life stage, and carer assignmentRecord(withtype = FEEDING) — used to compute last-fed time and to derive intervals from feeding historyCarerProfileand Clerk org members — used to display carer names
When Log Feed is submitted, a new Record row is created with type = FEEDING.
API Endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/api/feed-roster | GET | Returns the role-filtered list of FeedRosterItem for the active organisation. Used by the home dashboard for client-side refresh. |
/api/records | POST | Creates a new FEEDING record from the quick-add dialog. Enforces canAccessAnimal() server-side. |
Both endpoints require an authenticated Clerk session and a matching active organisation.
See Also
- Daily Operations — broader daily care workflow
- Animal Record History — full per-animal record listing
- Roles and Permissions — RBAC matrix used to filter the roster