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, payments, 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 |
| Payments | Card payments Bank of Maldives confirmed but that could not be added automatically (oldest 25), with the reason; Approve to add them, or refund in the BML merchant dashboard and then Reject with a 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).
Each card payment also sends the operator one Telegram alert: the product, the amount, the payment and BML ids and a link to the admin page. It never includes the customer's email or card details.
Notes#
- The payment workflow a customer sees is in Plans, credits & payment. Most card payments are added as soon as the bank confirms them; the admin approval for the rest is not verified here.
- Admins are deliberately not allowed to read other people's meetings:
mayReadMeetingreturns 404 for them.