Files
where_woof/openspec/changes/admin-insights-pages/proposal.md

31 lines
1.7 KiB
Markdown

## Why
Four small, high-visibility gaps from the tuxedo board: the admin dashboard lacks customer/revenue numbers, the Users resource doesn't show a customer's tags, there's no way to pause an unpaid customer (alerts continue), and the public site has no About/Contact pages. All quick wins that make the product feel complete while testing.
## What Changes
- **Dashboard insights**: StatsOverview gains **Customers** (users) and **Revenue** (sum of `orders.amount` where status `paid`). Requires an `orders.amount` column (idempotent, default 0) + an amount field in the Order resource.
- **Customers → Tags**: UserResource gains a **Tags relation manager** (lists the customer's tags with status).
- **Pause customer**: `users.paused` flag (idempotent) + a toggle in UserResource; paused owners' tags record scans but send **no alerts** (Go `shouldAlert` + contact path).
- **Public pages**: `/about`, `/what-is-this`, `/contact` static pages (Go templates, base layout). Contact is contact details + mailto for now.
## Capabilities
### New Capabilities
- `public-pages`: About / What-is-this / Contact pages.
- `customer-pause`: admin pause flag gating owner alerts.
### Modified Capabilities
- `admin-dashboard`: ADDED — customers + revenue stats.
- `admin-users`: ADDED — tags relation manager + pause toggle.
- `database`: ADDED — `users.paused`, `orders.amount`.
## Impact
- **Schema**: two idempotent ALTERs; `make db-up`; sqlc regen.
- **Go**: `shouldAlert` + contact notify check owner paused; 3 page handlers + templates + routes.
- **Admin**: StatsOverview, OrderResource amount, UserResource paused + relation manager.
- No changes to the alert pipeline beyond the pause gate.