diff --git a/.paul/ROADMAP.md b/.paul/ROADMAP.md index 16c0420..c628173 100644 --- a/.paul/ROADMAP.md +++ b/.paul/ROADMAP.md @@ -19,8 +19,8 @@ SMS flow: On-prem TapTrack polls Hub every 30s → Hub queues SMS jobs → Hub s ## Current Milestone **v1.0 — Foundation & Core Services** -Status: Phase 5 complete — Phase 6 next -Phases: 5 of 15 complete +Status: Phase 6 complete — Phase 7 next +Phases: 6 of 15 complete --- @@ -33,7 +33,7 @@ Phases: 5 of 15 complete | 3 | On-Prem License Validation | 1 | ✅ Complete | 2026-03-15 | | 4 | SMS Gateway (credits + queue) | 2 | ✅ Complete | 2026-03-15 | | 5 | On-Prem SMS Polling Agent | 1 | ✅ Complete | 2026-03-16 | -| 6 | Super Admin Dashboard UI | TBD | Not started | — | +| 6 | Super Admin Dashboard UI | 1 | ✅ Complete | 2026-03-16 | | 7 | School Admin Portal UI | TBD | Not started | — | | 8 | Billing Engine + Invoice PDF | TBD | Not started | — | | 9 | Email Dispatcher | TBD | Not started | — | diff --git a/.paul/STATE.md b/.paul/STATE.md index e41d556..7665b6a 100644 --- a/.paul/STATE.md +++ b/.paul/STATE.md @@ -3,16 +3,16 @@ ## Current Position Milestone: v1.0 — Foundation & Core Services -Phase: 5 of 15 (On-Prem SMS Polling Agent — complete) -Plan: Phase 5 complete — Phase 6 next -Status: **Phase 5 applied — ready to begin Phase 6** -Last activity: 2026-03-16 — Phase 5 complete (sync/poll hardening: credit deduction, failed job reporting, feature flags, suspension flag, stale job reclaim) +Phase: 6 of 15 (Super Admin Dashboard UI — complete) +Plan: Phase 6 complete — Phase 7 next +Status: **Phase 6 applied — ready to begin Phase 7** +Last activity: 2026-03-16 — Phase 6 complete (rich dashboard: KPI row, SMS volume chart, revenue snapshot, school health table with sort/filter, quick actions, refresh button) ## Loop Position ``` PLAN ──▶ APPLY ──▶ UNIFY - · · · [No active plan — Phase 6 planning next] + · · · [No active plan — Phase 7 planning next] ``` ## Progress @@ -24,7 +24,7 @@ PLAN ──▶ APPLY ──▶ UNIFY - Phase 3 (On-Prem License Validation): [██████████] 100% ✓ - Phase 4 (SMS Gateway): [██████████] 100% ✓ - Phase 5 (On-Prem SMS Polling Agent): [██████████] 100% ✓ -- Phase 6 (Super Admin Dashboard UI): [░░░░░░░░░░] 0% +- Phase 6 (Super Admin Dashboard UI): [██████████] 100% ✓ - Phase 7 (School Admin Portal UI): [░░░░░░░░░░] 0% - Phase 8 (Billing Engine + Invoice PDF): [░░░░░░░░░░] 0% - Phase 9 (Email Dispatcher): [░░░░░░░░░░] 0% @@ -37,8 +37,8 @@ PLAN ──▶ APPLY ──▶ UNIFY ## Next Action -Run: `/paul:plan` for Phase 6 — Super Admin Dashboard UI -Resume file: .paul/ROADMAP.md → Phase 6 +Run: `/paul:plan` for Phase 7 — School Admin Portal UI +Resume file: .paul/ROADMAP.md → Phase 7 ## Repo diff --git a/.paul/phases/06-super-admin-dashboard/README.md b/.paul/phases/06-super-admin-dashboard/README.md index af0a277..8e253eb 100644 --- a/.paul/phases/06-super-admin-dashboard/README.md +++ b/.paul/phases/06-super-admin-dashboard/README.md @@ -1,9 +1,29 @@ # Phase 06: Super Admin Dashboard UI -**Status:** Not started +**Status:** Complete +**Completed:** 2026-03-16 ## Goal -Rich dashboard with KPI cards, school health table, SMS volume chart, revenue snapshot. -## Plans -- [ ] TBD — run /paul:plan when Phase 5 is complete +Replace the minimal DashboardPage skeleton with a rich, data-driven super admin dashboard. + +## What was built + +### Backend (already existed from Phase 1/4 scaffolding) +- `GET /api/dashboard/summary` — KPI counts +- `GET /api/dashboard/school-health` — school list with license/credit health +- `GET /api/dashboard/revenue` — MRR, outstanding, overdue, paid this month + +### Frontend — DashboardPage.vue (full rewrite) + +1. **KPI row (5 cards):** Total Schools, Active, Expiring Licenses, Open Tickets, SMS Today +2. **School Health Table:** name, status badge, tier, SMS credits (with low-credit warning), license expiry countdown, last seen timestamp — sortable columns, status filter, search +3. **SMS Volume Chart:** 30-day bar chart (sent/failed), reused from SmsPage pattern +4. **Revenue Snapshot panel:** MRR, Paid This Month, Outstanding (count), Overdue (count + red highlight) +5. **Quick Actions:** Add School (→ /schools), SMS Gateway (→ /sms), Billing (→ /billing) +6. **Refresh button** with last-updated timestamp + +### api.ts additions +- `getDashboardSchoolHealth(params)` — calls `/dashboard/school-health` +- `getDashboardRevenue()` — calls `/dashboard/revenue` +- `getDashboardSmsChart()` — calls `/sms/stats?days=30` (reuse existing) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 6c821b2..ec000d6 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -31,7 +31,9 @@ export const changePassword = (current_password: string, new_password: string) = api.put('/auth/me/password', { current_password, new_password }) // ── Dashboard ───────────────────────────────────────────────────────────────── -export const getDashboardSummary = () => api.get('/dashboard/summary').then(r => r.data) +export const getDashboardSummary = () => api.get('/dashboard/summary').then(r => r.data) +export const getDashboardSchoolHealth = (params?: object) => api.get('/dashboard/school-health', { params }).then(r => r.data) +export const getDashboardRevenue = () => api.get('/dashboard/revenue').then(r => r.data) // ── Schools ─────────────────────────────────────────────────────────────────── export interface School { diff --git a/frontend/src/pages/DashboardPage.vue b/frontend/src/pages/DashboardPage.vue index 050a4a0..7fa22cc 100644 --- a/frontend/src/pages/DashboardPage.vue +++ b/frontend/src/pages/DashboardPage.vue @@ -1,57 +1,395 @@