<aside> 🔁 Synced from GitHub #d88bf742253d. Edit in the paidhr-system-docs repository, not here: changes made in Notion are overwritten.

</aside>

Control panel

Repo: control-battlefield (package pade-control-panel) · Vite + React, Tailwind, Radix

In one paragraph

The control panel is PaidHR staff's own admin tool. Staff sign in with a separate control session (Control/Authenticate in core-backend, with its own 2FA) and see across all customers rather than inside one.

Screens in control-battlefield

Route Purpose
dashboard Overview
ewa/overview, ewa/companies, ewa/companies/:id/{analytics,enrolled-employees,withdrawals}, ewa/employees EWA across companies
ewa/billing-and-invoice EWA invoices to employers
ewa/registrations Companies applying for EWA
access, admin, admin/new-admin, admin/edit-admin Staff accounts and roles
business-operations, payroll-run-count Operational reporting. The payroll-run-count table has a Currency column you can filter on (one currency at a time; changing it returns to page 1). The CSV download keeps the filter (currency_code on /control/analytics/getpayrollrunstats and downloadpayrollrunstats). The business-operations payroll trend now refetches when either end of its date range changes
extras/audit Audit log across all companies: filter by staff user, action type, organisation and date range; download as a CSV file. The Successful/Unsuccessful status badge was fixed — it had been showing "Unsuccessful" for every entry
What's New (engagements) Staff write, edit, publish, archive and delete the product What's New announcements that employees see in the web app (login popup and the What's New page). See web app. The list also shows Views, CTA clicks and CTR per announcement. Each row's menu has View (a read-only drawer: the popup and page previews, who sees it, when, links, a "So far" figure and the history of who created and edited it) and, for published or archived announcements only, Analytics (route engagements/whats-new/:id/analytics; drafts have never been shown, so they have none)

Inner Circle screen Status: Built

Route engagements/inner-circle (sidebar: Engagements → Inner Circle) runs the PaidLife "Inner Circle" chest game, "Living the Paid Life", at a live event. The game is its own small service. This screen calls its /api/admin endpoint with the signed-in staff member's token (the game checks the token itself) and refreshes every 5 seconds. If the build has no game address (VITE_INNER_CIRCLE_URL), the screen only says so and calls nothing.

How guests earn keys automatically Status: Built

The "automatic" (blue) keys come from the PaidHR services themselves: when a guest does the action for a key, that service tells the game. ewa-service and wallet-service are on staging, the bot on develop.

Key The guest… Reported by
1 Opens the app so it registers their phone for push notifications (PUT user/update-device-token) ewa-service
2 Opens the EWA screen (GET earnings/wallet) ewa-service
3 Opens the loans screen or checks loan offers (GET loans, GET loans/providers, POST loans/generate-details). It counts even if they turn out not to be eligible ewa-service
4 Creates a virtual card, or opens the cards page when they already have one (so a card made before the event still counts) wallet-service
5 Sends any message from a WhatsApp or Telegram chat that is linked (signed in) to their PaidHR account paid-ussd-whatsapp-bot
6 Dials the USSD code and the phone number matches exactly one active employee (a USSD session starts) ewa-service