# Dokumentasi migrasi CI3 → CI4

**Sumber (read-only):** `bij.mwp.co.id`  
**Target:** `bij.mwp.co.id-ci4`

## Indeks

| Dokumen | Isi |
|---------|-----|
| [controllers.md](controllers.md) | Inventaris controller CI3 |
| [models.md](models.md) | Model eksplisit + catatan query di `Json.php` |
| [modules.md](modules.md) | HMVC (admin, api, adminlte) |
| [routes.md](routes.md) | Routing CI3 vs CI4 |
| [auth.md](auth.md) | Ion Auth (web) vs token mobile |
| [risks.md](risks.md) | Risiko teknis & mitigasi |
| [json_api_map.md](json_api_map.md) | Pemetaan lengkap API mobile |
| [ROADMAP.md](ROADMAP.md) | Fase eksekusi & dependensi |
| [parity-checklist.md](parity-checklist.md) | Uji parity CI3 ↔ CI4 per endpoint |
| [parity-report.md](parity-report.md) | Hasil analisis parity, staging, readiness |
| [LAPORAN-MIGRASI-CI3-KE-CI4.md](LAPORAN-MIGRASI-CI3-KE-CI4.md) | Laporan gabungan awal |
| [audit-json-controller.md](audit-json-controller.md) | Audit method `Json.php` |

## Validasi staging (perintah)

```text
php spark api:staging-validate
php spark api:staging-validate --with-uploads
```

Laporan JSON: `writable/staging/last-validation.json`.

## Ringkasan implementasi CI4 (saat ini)

- API mobile: `App\Services\Mobile\MobileJsonService` + `App\Controllers\Api\MobileJsonController`.
- Rute: `POST /api/mobile/*` dan alias **`POST /json/*`** (kompatibilitas path CI3).
- Admin UI dasar: `GET /admin` + layout di `app/Views/layouts/*`, aset TailAdmin di `public/assets/tailadmin/`.
- Upload mobile: `public/assets/uploads/{dokcuti,aktifitas,absen,pengguna}`.

## Asumsi engineering

- Charset API mengikuti `LegacyUtf8Encoder` (setara `utf8ize` legacy untuk string ISO-8859-1).
- `save_istirahat`: jika `mulai` dan `selesai` keduanya kosong, CI4 **tidak** menjalankan `UPDATE` (menghindari error); legacy CI3 sebenarnya rawan *undefined variable* — perilaku aman di CI4.
