beers detail - BevvyTech/BrewskiDocs GitHub Wiki

Beers Detail (/beers/:beerId)

Purpose

  • Central workspace for reviewing and updating a single beer’s specification, public visibility, default pricing, and badge assets.
  • Entry point for operational actions tied to the beer (create batches, view recent brews, tweak default container pricing/BBE values).

Data & Dependencies

  • Loads GET /beers/:beerId plus supporting fetches for containers, pricebooks, team settings, and recent batch activity.
  • Requires active team membership; state updates and badge upload endpoints demand an access token.

Key Interactions

  • Header actions allow editing the beer, creating a new batch, and archiving (pending implementation for archive flow). The edit dialog now enforces BJCP style selection, including the bespoke X Sours grouping: users pick a style family, then a category or substyle to store the BJCP (or Sours) code, with legacy free-text styles surfaced as helper text until replaced.
  • The page supports two layouts: the default “Full” view and a lean “Shop” view. Link to the shop view with ?show=shop (or by pushing location.state.showMode = "shop" in navigation) to hide the Tools card and recent batches block (the Price calculator remains visible in both layouts so manual beers can still run one-off pricing). Manual beers automatically use Shop mode, removing the “Add batch” CTA and locking the selector to avoid exposing production-only utilities.
  • Inventory mode is only selectable during beer creation when the team operates in hybrid mode. Shop-only teams auto-fill Manual, brewery-only teams auto-fill Managed, and the edit dialog just shows the stored mode as read-only context. When a beer runs in Manual mode the estimated finishing gravity input (and the overview field) are hidden so operators only see that metric for managed inventory.
  • Inventory mode is surfaced as a pill beside the breadcrumb; managed beers keep the “Add batch” CTA, while manual beers hide it and the edit dialog shows the mode read-only.
  • Overview card summarises style, status (with inline toggle), public visibility, ABV/FG, allergens, ingredients, description, and tasting notes with placeholder fallbacks.
  • Pricing section lets users manage default container prices, including enabling containers, editing amounts, capturing percentage discounts, and persisting changes per container id.
  • Gallery button on the badge card opens a full-screen dialog where team members can upload, tag (keg / cask / smallpack / universal), caption, reorder, open, and delete beer photos; operations hit the new gallery endpoints and update the card count live.
  • Badge panel supports uploading/removing badge images and reflects generator status/error messages; interactions respect size/type guards.
  • New Breww sync card preloads the connected Breww catalogue (integration required) into a dropdown grouped by Breww beer (containerName), then lets operators choose the matching package format; selecting a container triggers the API mapping update and clearing the choice removes the Breww link so downstream sync jobs track the right external IDs. The fullscreen dialog now renders the search popper within the sheet so results stay visible instead of sitting beneath the overlay, and each enabled Brewski container defaults to a “Don’t sync” state so only the row you interact with reflects the active Breww package before linking.
  • Super-user operators can click the Breww card logo to open a full-screen debug console listing the Breww API calls (search/link/unlink) with inspectable request/response payloads for troubleshooting.
  • Default BBE section collapses to reveal per-container defaults when configured.
  • Sidebar surfaces recent brews via DashboardRecentBrews, giving context on latest production runs.
⚠️ **GitHub.com Fallback** ⚠️