Appearance
Settings — Registro y Onboarding
The Registro y Onboarding tab under Settings allows agency administrators to control whether the public business registration endpoint is open for their agency. It displays live capacity data and surfaces all pre-condition errors with localized messages.
For the backend logic behind this UI, see Business Registration Gates.
Tab Location
Settings → Registro y Onboarding (section=onboarding query parameter on the settings view).
This tab is visible only to users with the agency-admin role. Business-type organizations do not have this tab because the allowBusinessRegistration flag is not applicable to them.
What the Tab Shows
On mount, the tab fetches GET /organization/my/registration-status and renders:
| UI Element | Source field | Description |
|---|---|---|
| Toggle — Registro público habilitado | allowBusinessRegistration | ON/OFF toggle for the registration gate |
| Usuarios registrados | userCount / userLimit | Displays X / Y or X / ilimitado when userLimit === null |
| Planes activos | hasActivePlans | Inline indicator — turns into a warning badge when false |
| Subscription banner | limitSource === 'no_subscription' | Warning banner when the agency has no active platform subscription |
Subscription Warning Banner
When limitSource === 'no_subscription', a prominent warning banner appears:
Sin suscripción activa — Tu agencia no tiene una suscripción de plataforma activa. Los registros nuevos se permiten por ahora, pero contacta al administrador de la plataforma para regularizar tu suscripción.
This is informational only — registration is not blocked in this case. See Gate 3 — User Capacity Check.
Toggle Behaviour (Pessimistic Update)
The toggle uses a pessimistic update pattern:
- Admin clicks the toggle.
- The UI shows a loading state.
- The panel calls
PATCH /organization/mywith{ allowBusinessRegistration: <newValue> }. - On success: toggle updates to new state, success toast is shown.
- On error: toggle reverts to previous state, error toast is shown with a localized message.
Optimistic updates are intentionally avoided because the whole point of the guards is surfacing errors to the admin — a premature state change would hide the failure behind a rollback flicker.
Localized Error Messages
| Backend code | Toast message (Spanish) |
|---|---|
IDENTITY.CANNOT_ENABLE_REGISTRATION_WITHOUT_PLANS | "No puedes habilitar el registro sin al menos un plan activo. Crea o activa un plan primero." |
IDENTITY.FLAG_NOT_APPLICABLE_TO_BUSINESS | (Should never reach this tab — BUSINESS orgs don't have it.) |
| Generic 5xx | "No se pudo actualizar la configuración. Inténtalo de nuevo." |
API Calls Made by the Tab
| Method | Endpoint | When |
|---|---|---|
GET | /organization/my/registration-status | On tab mount |
PATCH | /organization/my | When admin toggles the flag |
Both endpoints require an authenticated agency-admin JWT.
Registration status response shape:
json
{
"allowBusinessRegistration": false,
"hasActivePlans": true,
"userCount": 3,
"userLimit": 10,
"limitSource": "platform_plan"
}See GET /organization/my/registration-status for the full response contract.
Prerequisites for Enabling Registration
Before an admin can enable the toggle, at least one active, public plan must exist. If no plans exist, attempting to enable the flag returns IDENTITY.CANNOT_ENABLE_REGISTRATION_WITHOUT_PLANS (HTTP 409) and the toggle reverts.
Step-by-step guide: See How to enable business registration.
Related Docs
- Business Registration Gates — backend logic
- Runbook — Enable Business Registration — step-by-step
- Plans Catalog and Management — managing agency plans