# BEEB BEEB — Domain context

## Products → Laravel models

| Product (SRS) | Model | API prefix |
|---------------|-------|------------|
| Rider app | `Client` | `/api/client/*` |
| Investor dashboard | `Provider` | `/api/provider/*` |
| Admin panel | `Admin` | `/admin/*` |
| Scooter | `Scooter` | (admin + client map API) |
| Ride | `Ride` | (admin + client ride API) |

## Client status (computed on `ClientResource`, not stored)

| Flag | Meaning |
|------|---------|
| `is_profile_completed` | Verified email (`email` + `email_verified_at`) |
| `in_ride` | Active ride in progress |
| `balance_low` | Wallet below threshold |
| `can_start_ride` | Active, not blocked, profile complete, sufficient balance, not in ride |
| `is_blocked` / `is_active` | Admin / activation flags |

## Provider approval (stored flags)

| Field | Meaning |
|-------|---------|
| `is_approved` | `null` = pending KYC review, `true` = approved, `false` = rejected (`rejection_reason`) |
| `is_active` | Can receive login OTP after approval |
| `is_blocked` | Admin block |
| `is_verified` | Computed: approved and not blocked |
| `has_vehicles` | Computed: at least one active scooter assigned |

**Login (`I-AUTH-01`):** `POST /api/provider/login` with `email`, `password`, `device_type` — no OTP step. Pending approval → `needApproval`.

## Ride lifecycle (`RideStatus`)

`SCANNING` → `ACTIVE` → `ENDING` → `COMPLETED` (+ `CANCELLED`)

## Scooter statuses (`ScooterStatus`)

`ACTIVE`, `IN_RIDE`, `MAINTENANCE`, `INACTIVE`, `OUT_OF_SERVICE`

## Business constants

Stored in `SettingService` — see Appendix C in `# BEEB BEEB (بيب بيب) — Complete Feature.md`.

## SRS

Full spec: `docs/SRS.pdf` (v1.2).
