shop stock - BevvyTech/BrewskiDocs GitHub Wiki

Shop – Stock (/shop/stock)

Shows packaged availability for every beer that can be sold through the Shop. The page lives inside the Shop navigation group and exposes two second-level tabs:

  • In stock (/shop/stock): default view listing beers (managed or manual inventory) that currently have stock available. Uses GET /beers/stock without extras so only beers with positive totals are returned.
  • All beers (/shop/stock/all): same layout but passes includeEmpty=true, letting operators surface beers with zero on-hand stock so they can top-up manual counts or prep packaging runs.
  • Both tabs show a Manage stock action for each beer. Manual-inventory beers open an editor to update unit counts per container (writes to /inventory/manual/overrides); managed beers display read-only packaging totals.

Key behaviours

  • Data source: GET /beers/stock filtered by the active team and search string. Managed beers aggregate packaging lots; manual beers surface their storefront inventory variants. Both tab views pass page/pageSize and consume the API’s page/total metadata so the shared pagination footer stays accurate.
  • Search box debounces queries (200 ms) and filters both sub-views.
  • The “New beer” CTA mirrors the Beers module flow and opens the shared AddBeerDialog, keeping post-create navigation in the core Beers area.
  • Each row links to /beers/:beerId detail. Container badges show per-packaging availability, inventoryMode chip highlights Manual vs Managed handling, and empty-state messaging adapts to search vs default.

Permissions / feature flags

  • Requires the user to belong to the active team; inventory counts honour the existing API auth.
  • Manual inventory adjustments (Manage stock dialog) are available to any team member when the team runs in Shop or Hybrid mode; owners/admins retain access elsewhere.
  • No dedicated feature flag — visibility comes from Shop operating mode and standard menu resolution logic.
⚠️ **GitHub.com Fallback** ⚠️