2.0 KiB
2.0 KiB
Context
Four quick wins (tuxedo board): dashboard insights, users→tags, customer pause, public pages. All small; no new external deps.
Goals / Non-Goals
Goals:
- Dashboard shows customers + revenue (needs orders.amount).
- Admin sees each customer's tags; can pause a customer.
- Public About/What-is-this/Contact pages exist.
Non-Goals:
- Fancy contact form backend (mailto suffices until email infra exists).
- Revenue breakdowns by period/tag (later).
- Pause ≠ billing automation (still manual; renewals are a later slice).
Decisions
users.paused(idempotent bool, default false): simplest customer-level kill switch.shouldAlertloads the owner (GetUserByIDontag.OwnerID) and returns false when paused; the contact path checks the same. Scan recording continues.orders.amount NUMERIC(10,2) DEFAULT 0(idempotent): revenue =SUM(amount) WHERE status='paid'(Eloquent aggregate). OrderResource gains an amount input. Existing orders default 0 → revenue is accurate going forward.- Public pages: three templates extending
base.html(about / what-is-this / contact), handlers mirroringHome, routes in main.go. Contact = contact details +mailto:(no email system yet). - Admin: StatsOverview adds Customers + Revenue stats; UserResource gains a
pausedToggle + aTagsRelationManager(Filament v3 auto-discoversUserResource/RelationManagers/*).
Risks / Trade-offs
- [Pause is all-or-nothing per customer] → matches the 2014 model; per-tag suspend already exists separately.
- [Revenue 0 for existing orders] → accepted; going forward the admin enters amounts.
- [Public pages minimal] → intentional; expand with the info-tag/multilingual work later.
Migration Plan
make db-up(two ALTERs); sqlc regen.- Go: pause gate + 3 pages; build.
- Admin: stats, relation manager, pause toggle, order amount.
- Verify (new suite + regressions); deploy (frontend binary+templates; admin rebuild).
Open Questions
- None blocking.