# Expo Mobile Integration Mapping

The Laravel server is the source of truth for identity, permissions, schedules, appointments, queue/token state, billing and notification state.

| Mobile/local source | API replacement |
|---|---|
| demo/login-as state | `POST /api/v1/auth/login`, `GET /api/v1/bootstrap` |
| local patients array | `GET/POST/PATCH /api/v1/patients` |
| local appointments | appointment endpoints under `/api/v1/appointments` |
| static slots | `GET /api/v1/doctors/{doctor}/availability` |
| local token counter | queue check-in/token/call-next endpoints |
| local queue status | `/api/v1/queue` and queue status endpoints |
| local payment status | transaction/payment/refund/waiver endpoints |
| static doctor/location context | bootstrap + discovery APIs |
| local notification badge | `/api/v1/notifications` + read endpoint |

Store the Sanctum bearer token in Expo SecureStore, not AsyncStorage. Use one API client that sends `Authorization: Bearer <token>`, applies a timeout and parses the consistent error envelope.

Client handling baseline: clear session on `401`; show a permission message on `403`; on `409` show the booking/token conflict and refresh authoritative server state. After patient/token/appointment mutations, apply the returned server object or re-fetch it. Poll the queue every 10–20 seconds while the queue screen is active unless real-time broadcasting is introduced later.
