# Roles and loops

## Personas

Platform roles: `STUDENT`, `CORPORATE`, `INSTRUCTOR`, `EMPLOYER`, `ADMIN`, `SUPER_ADMIN`.

| Role | Who | Default home | Primary job |
|------|-----|--------------|-------------|
| **STUDENT** | Learner | `/dashboard` | Intake, coaching, skills, publish profile |
| **CORPORATE** | L&D / team buyer (legacy LMS) | `/dashboard` | Teams + courses |
| **INSTRUCTOR** | Coach (and/or course creator) | `/dashboard` | Coach setup, clients, reviews |
| **EMPLOYER** | Hiring company | `/dashboard/talent` | Search, pipeline, jobs, billing |
| **ADMIN / SUPER_ADMIN** | Ops | `/admin` | Approvals, tracks, match override, mark invoices paid |

Permissions live in `backend/src/config/permissions.ts` and `frontend/src/lib/permissions.ts`. Employers get `talent:search`, `jobs:manage`, `placements:manage`.

## Account creation

| Path | UI | Result |
|------|----|--------|
| Learner | `/auth/register` | STUDENT; email verify |
| Coach | `/become-instructor` | Pending approval → coach setup |
| Employer | `/auth/register/employer` | EMPLOYER → `/dashboard/talent` |

## End-to-end loops

```text
Learner                          Coach                         Employer
───────                          ─────                         ────────
Register                         Apply (/become-instructor)    Register employer
Intake (/dashboard/intake)       Admin approves                Create company org
Match → coach profile            Coach setup checklist         Request seats invoice
Sessions / evidence              Clients + skill reviews       Admin marks invoice paid
Publish /u/[slug]                Featured (system)             Search verified talent
                                 Attest                        Shortlist → intro → hire
```

### Learner

1. Intake — `/dashboard/intake`  
2. Coaching hub — `/dashboard/coaching/hub`  
3. Evidence — `/dashboard/skills`, practice  
4. Publish — `/u/[slug]`  
5. Optional credential — `/credentials/[code]`

### Coach

1. Apply → approval  
2. Setup — `/dashboard/coaching/availability` (tracks, availability, active offering → **match ready**)  
3. Clients / reviews; public page `/instructors/[id]` (coaching first)  
4. Admin may use match override for early matches  

### Employer

| Route | Purpose |
|-------|---------|
| `/dashboard/talent` | Search |
| `/dashboard/talent/pipeline` | Intros, cohorts, placements |
| `/dashboard/talent/jobs` | Thin job posts |
| `/dashboard/talent/billing` | Seats, credits, invoices |

### Admin

- Approve instructors  
- Manage tracks & skills — `/admin/career/tracks`  
- Match override; mark employer invoices paid
