beers stock - BevvyTech/BrewskiDocs GitHub Wiki

Beers Stock (/beers/stock)

Purpose

  • Surface packaged inventory for every beer that currently has stock on the active team.
  • Provide a quick way to spot remaining packaged volume per container type without diving into individual batches.

Data & Dependencies

  • Fetches GET /beers/stock (team-scoped aggregation of packaging lots, including container summaries) with the shared pagination contract (page, pageSize, total, pages, results). Search input debounces into the search query param and resets the page to 1.
  • Requires an active team membership; otherwise the page shows an info alert instead of querying.

Key Interactions

  • Dedicated search field filters beers by name as the user types (updates after a short debounce).
  • Each beer row is fully clickable and routes to the Beer Detail page for the selected record.
  • Rows list the badge, name/style, last batch date (absolute and relative), and one chip per container that reports available / total packaged counts.
  • Manual-inventory beers show the same inventory mode pill and replace the last batch column with guidance that brewing workflows are disabled.
  • Empty states distinguish between “no packaged stock recorded yet” and “no beers matched the search”.
  • Inline error messaging appears when the stock request fails; the card shows a linear progress bar while data is loading.
  • Pagination uses the shared footer component so the 10/25/50/100 selector and “Page X of Y” copy stay in sync with the API’s page/total.
⚠️ **GitHub.com Fallback** ⚠️