Skip to main content

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 /tools from 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:

CardMeaning
Animals in rosterTotal animals currently IN_CARE or READY_FOR_RELEASE that are visible to your role
Overdue or unrecordedAnimals past due for a feed, or with no feeding record on file
Currently on scheduleAnimals whose next-due time is in the future

Daily Schedule Table

Each row represents one in-care animal, with the following columns:

ColumnDescription
AnimalName, species, age/age class, and the assigned carer
Last feedTimestamp of the most recent FEEDING record
Time sinceElapsed hours/minutes since the last feed
Next dueComputed timestamp for the next feed, plus a status badge
NotesNotes from the last feeding record
ActionLog 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:

  1. From feeding history — if the animal has at least two recent FEEDING records, the interval is the gap between the two most recent feeds, clamped between 2 and 24 hours.
  2. 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 signalDefault interval
Pinkie / neonate / newborn / unfurred / pouch / hatchling3 hours
Joey / chick / juvenile / fledgling / young4 hours
Subadult / adult12 hours
Anything else6 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:

RoleAnimals visible in feed roster
ADMINAll in-care animals in the organisation
COORDINATOR_ALLAll in-care animals in the organisation
CARER_ALLAll in-care animals in the organisation
COORDINATORIn-care animals in their assigned species groups, plus any animals personally assigned to them
CAREROnly 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 assignment
  • Record (with type = FEEDING) — used to compute last-fed time and to derive intervals from feeding history
  • CarerProfile and Clerk org members — used to display carer names

When Log Feed is submitted, a new Record row is created with type = FEEDING.

API Endpoints

EndpointMethodPurpose
/api/feed-rosterGETReturns the role-filtered list of FeedRosterItem for the active organisation. Used by the home dashboard for client-side refresh.
/api/recordsPOSTCreates 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