feat(phase-2): school registry + license management UI

Plan 2-01: School create/edit modal + license editor
- SchoolsPage: full create/edit modal (name, city, address, tier, contact,
  billing email, SMS sender name, student limit, status, notes); debounced
  search + status filter; Edit button per row opens pre-filled modal
- SchoolDetailPage: Activate / Suspend / Edit quick-action buttons in header;
  license panel with key copy, expiry, last seen (time-ago); license editor
  (expiry date, max students, tier) calls PUT /api/licenses/{id}; Revoke
  button calls POST /api/licenses/{id}/revoke
- Backend: GET /api/licenses/school/{school_id} — fetch license by school
- api.ts: getSchoolLicense added

Plan 2-02: Subscription setup + SMS credit top-up + ledger
- SchoolDetailPage: subscription panel (monthly fee, SMS cost per msg,
  billing cycle, next billing date) upserts via billing API
- SMS Credits panel: color-coded credit meter (green/amber/red based on
  balance), preset +100/+500/+1000 buttons, custom amount + note field,
  recent 5 ledger entries, link to full SMS page
- All operations toast on success/error

PAUL: Phase 2 marked complete, STATE + ROADMAP updated
This commit is contained in:
kevin-asprec
2026-03-16 08:09:59 +08:00
parent 2306094605
commit b435847a39
7 changed files with 784 additions and 79 deletions

View File

@@ -3,10 +3,10 @@
## Current Position
Milestone: v1.0 — Foundation & Core Services
Phase: 1 of 15 (Project Setup & Infrastructure — complete)
Plan: Phase 1 complete — no active plan
Status: **Phase 1 applied — ready to begin Phase 2**
Last activity: 2026-03-15 — Phase 1 complete (full stack scaffold: Docker Compose, all backend models/routers/tasks, Vue 3 frontend skeleton with all page stubs)
Phase: 2 of 15 (School Registry + License Management — complete)
Plan: Phase 2 complete — Phase 3 next
Status: **Phase 2 applied — ready to begin Phase 3**
Last activity: 2026-03-15 — Phase 2 complete (school create/edit modal, license editor, activate/suspend, subscription plan, SMS credit top-up, ledger)
## Loop Position
@@ -20,7 +20,7 @@ PLAN ──▶ APPLY ──▶ UNIFY
### v1.0 Foundation
- Phase 1 (Project Setup & Infrastructure): [██████████] 100% ✓
- Phase 2 (School Registry + License Mgmt): [░░░░░░░░░░] 0%
- Phase 2 (School Registry + License Mgmt): [██████████] 100% ✓
- Phase 3 (On-Prem License Validation): [░░░░░░░░░░] 0%
- Phase 4 (SMS Gateway): [░░░░░░░░░░] 0%
- Phase 5 (On-Prem SMS Polling Agent): [░░░░░░░░░░] 0%
@@ -37,8 +37,8 @@ PLAN ──▶ APPLY ──▶ UNIFY
## Next Action
Run: `/paul:plan` for Phase 2School Registry + License Management
Resume file: .paul/ROADMAP.md → Phase 2
Run: `/paul:plan` for Phase 3On-Prem License Validation
Resume file: .paul/ROADMAP.md → Phase 3
## Repo