orders groups detail - BevvyTech/BrewskiDocs GitHub Wiki
Groups – Detail (/groups/:groupId)
Purpose
Provide a consolidated view of a brewery group, letting teams review members, invites, and associated orders in one place.
Offer quick actions for inviting new breweries, launching group orders, and managing membership status.
Data & Dependencies
Group metadata comes from groupsService.get(groupId, token) (members, invites, permissions, content versions).
Orders list uses ordersService.listGroupOrders(teamId, groupId, token, options) against GET /group-orders so it stays scoped to grouped shipments without touching the primary /orders endpoint.
The "Existing brewery" invite tab pulls options via groupsService.listEligibleTeams(groupId, token, { search }), excluding teams already active or invited so coordinators only see valid targets.
Membership actions reuse the same service calls as the index (acceptMembership, declineMembership, leave).
Sending invitations posts through groupsService.inviteExternal and appends the returned invite into local state.
Revoking pending invitations calls groupsService.revokeInvite(groupId, inviteId, token), expiring the invite server-side and removing it from the local list without a full refetch.
New group orders open AddOrderDialog with groupId so the created order is tagged against the group immediately.
Key Interactions
Header breadcrumbs mirror the top-level Groups navigation and surface Accept, Decline, or Leave group depending on the user's membership status.
Orders card lists recent group orders with claim-status chips and a New group order button; success navigates straight to the order detail screen.
Members card now lists only active/retired members (invited entries live under Pending invites) with badges for the current team; the pending invites panel shows expiry chips plus a Revoke invite action with confirmation before cancelling the request.
When a team is still in the invited state, the page stays read-only: the New group order button and member invite controls remain disabled until the invite is accepted, and declining routes back to the groups list.
Overview card surfaces the hero image (or a placeholder), description, region, Shop visibility, and chips for pending/approved content.
Edit details modal now exposes the group slug and colour alongside name/region/description. The slug field normalises to lowercase, caps entries at 160 characters, and surfaces a validation error if another group already uses the slug; the colour input enforces a 6-digit hex value and previews the swatch. The same dialog accepts JPG/PNG/WebP hero images up to 6 MB, recommends the 690×420 px hero crop, and only raises warnings (no blocking errors) when uploads fall below the suggested dimensions or aspect ratio before the resize + approval flow, where every image is flattened onto white and stored as JPEG.
Manual Refresh button re-fetches group metadata and orders to pick up changes made by other members.