Admin console (NOT VERIFIED IN UI)
Last updated 30 September 2026
Role identified in application implementation, but UI workflow could not be safely verified during this documentation run. The admin console shows real customers' emails, payment slips, spend and margins. Granting the QA account admin rights and capturing that data would have exposed private information, so the console was deliberately not opened. Everything below is VERIFIED THROUGH CODE only.
Overview#
/admin is visible only to accounts with profiles.is_admin (checked by getAdminContext() in lib/admin-guard.ts). Anyone else gets a 404. Settings shows admins a Payment approvals & users link.
Sections (from app/(app)/admin/page.tsx and components)#
| Section | Purpose | Source |
|---|---|---|
| Card capacity this month | Gemini + Recall spend against the configured capacity; alert past a threshold | app/(app)/admin/page.tsx |
| Spend | Model spend today / this month, unit economics per credit, credits sold | components/admin-spend.tsx |
| Vendors | Vendor balances, reconciliation, payments ledger | components/admin-vendors.tsx |
| Costs | Cost per customer (Gemini / Recall / total / margin), daily spend | components/admin-costs.tsx |
| Contracts | Activate a contract (account, contract, PO reference, start, term); pause/resume grants, call-off, renew, end | components/admin-contracts.tsx |
| Slips | Pending payment slips (oldest 25), view slip, Approve / Reject with reason | components/admin-client.tsx |
| Users | 50 per page; wallet and pool; minutes and asks this month; Add credits; Make admin / Remove admin (not yourself) | components/admin-client.tsx |
Approvals, plan changes and admin grants run as audited SQL functions (e.g. review_payment_slip, activate_contract).
Notes#
- The payment workflow a customer sees is in Plans, credits & payment. The admin approval that completes it is not verified here.
- Admins are deliberately not allowed to read other people's meetings:
mayReadMeetingreturns 404 for them.