Initial mobile app implementation
This commit is contained in:
268
mobile-api-blueprint.md
Normal file
268
mobile-api-blueprint.md
Normal file
@ -0,0 +1,268 @@
|
||||
# Mobile API Blueprint
|
||||
|
||||
Dokumen ini merangkum:
|
||||
- endpoint mobile per role
|
||||
- layar minimum yang dibutuhkan aplikasi mobile
|
||||
- batas scope mobile yang sengaja dipertahankan agar tetap praktis
|
||||
|
||||
## Prinsip
|
||||
|
||||
- Mobile memakai auth yang sama dengan web.
|
||||
- Login lewat `POST /api/v1/auth/login`, lalu kirim `Authorization: Bearer <session_token>`.
|
||||
- Semua endpoint mobile berada di prefix `/api/v1/mobile`.
|
||||
- Mobile fokus ke operasi cepat, scan, input lapangan, monitoring, dan closing ringan.
|
||||
- Fitur admin berat seperti `users`, `settings`, `audit-trail`, dan master data lengkap tetap web-only.
|
||||
|
||||
## Role Mobile
|
||||
|
||||
Role yang didukung di mobile:
|
||||
- `WAREHOUSE`
|
||||
- `QC`
|
||||
- `SALES`
|
||||
- `PURCHASING`
|
||||
- `OWNER`
|
||||
|
||||
Role yang tidak menjadi target mobile utama:
|
||||
- `ADMIN`
|
||||
- `SYSTEM_ADMIN`
|
||||
|
||||
## Bootstrap Umum
|
||||
|
||||
Semua role mobile memakai:
|
||||
- `GET /api/v1/mobile/bootstrap`
|
||||
- `GET /api/v1/mobile/dashboard?locale=id|en`
|
||||
|
||||
`/mobile/bootstrap` mengembalikan:
|
||||
- user session
|
||||
- daftar modul yang boleh diakses role tersebut
|
||||
- summary ringkas operasional
|
||||
- grade aktif
|
||||
- gudang aktif dan lokasi aktif
|
||||
- master transformation mode
|
||||
|
||||
## Matriks Endpoint Per Role
|
||||
|
||||
### Warehouse
|
||||
|
||||
Tujuan:
|
||||
- scan lot
|
||||
- submit purchase yang otomatis membuat receipt dan lot
|
||||
- buat penyesuaian stok
|
||||
- kirim / selesaikan washing
|
||||
|
||||
Endpoint:
|
||||
- `GET /api/v1/mobile/bootstrap`
|
||||
- `GET /api/v1/mobile/dashboard`
|
||||
- `GET /api/v1/mobile/lots`
|
||||
- `GET /api/v1/mobile/lots/:id`
|
||||
- `GET /api/v1/mobile/lots/scan?code=...`
|
||||
- `GET /api/v1/mobile/purchases`
|
||||
- `GET /api/v1/mobile/purchases/:id`
|
||||
- `POST /api/v1/mobile/purchases/:id/submit`
|
||||
- `GET /api/v1/mobile/stock-adjustments/bootstrap`
|
||||
- `GET /api/v1/mobile/stock-adjustments`
|
||||
- `POST /api/v1/mobile/stock-adjustments`
|
||||
- `GET /api/v1/mobile/washing/bootstrap`
|
||||
- `GET /api/v1/mobile/washing`
|
||||
- `POST /api/v1/mobile/washing`
|
||||
- `PUT /api/v1/mobile/washing/:id`
|
||||
- `POST /api/v1/mobile/washing/:id/complete`
|
||||
|
||||
### QC
|
||||
|
||||
Tujuan:
|
||||
- scan lot
|
||||
- lihat detail lineage lot
|
||||
- ubah grade / mixing
|
||||
- bantu washing completion
|
||||
- buat penyesuaian stok terkait QC
|
||||
|
||||
Endpoint:
|
||||
- `GET /api/v1/mobile/bootstrap`
|
||||
- `GET /api/v1/mobile/dashboard`
|
||||
- `GET /api/v1/mobile/lots`
|
||||
- `GET /api/v1/mobile/lots/:id`
|
||||
- `GET /api/v1/mobile/lots/scan?code=...`
|
||||
- `GET /api/v1/mobile/washing/bootstrap`
|
||||
- `GET /api/v1/mobile/washing`
|
||||
- `PUT /api/v1/mobile/washing/:id`
|
||||
- `POST /api/v1/mobile/washing/:id/complete`
|
||||
- `GET /api/v1/mobile/lot-transformations`
|
||||
- `POST /api/v1/mobile/lot-transformations`
|
||||
- `GET /api/v1/mobile/lot-transformations/:id`
|
||||
- `GET /api/v1/mobile/stock-adjustments/bootstrap`
|
||||
- `GET /api/v1/mobile/stock-adjustments`
|
||||
- `POST /api/v1/mobile/stock-adjustments`
|
||||
|
||||
### Sales
|
||||
|
||||
Tujuan:
|
||||
- lihat stok jual
|
||||
- buat penjualan reguler
|
||||
- buat penjualan JIT
|
||||
- buat titip jual
|
||||
- tutup transaksi
|
||||
|
||||
Endpoint:
|
||||
- `GET /api/v1/mobile/bootstrap`
|
||||
- `GET /api/v1/mobile/dashboard`
|
||||
- `GET /api/v1/mobile/lots`
|
||||
- `GET /api/v1/mobile/lots/:id`
|
||||
- `GET /api/v1/mobile/lots/scan?code=...`
|
||||
- `GET /api/v1/mobile/sales-regular/bootstrap`
|
||||
- `GET /api/v1/mobile/sales-regular`
|
||||
- `POST /api/v1/mobile/sales-regular`
|
||||
- `GET /api/v1/mobile/sales-regular/:id`
|
||||
- `POST /api/v1/mobile/sales-regular/:id/close`
|
||||
- `GET /api/v1/mobile/sales-jit/bootstrap`
|
||||
- `GET /api/v1/mobile/sales-jit`
|
||||
- `POST /api/v1/mobile/sales-jit`
|
||||
- `GET /api/v1/mobile/sales-jit/:id`
|
||||
- `POST /api/v1/mobile/sales-jit/:id/close`
|
||||
- `GET /api/v1/mobile/consignments/bootstrap`
|
||||
- `GET /api/v1/mobile/consignments`
|
||||
- `POST /api/v1/mobile/consignments`
|
||||
- `GET /api/v1/mobile/consignments/:id`
|
||||
- `POST /api/v1/mobile/consignments/lines/:lineId/close`
|
||||
|
||||
### Purchasing
|
||||
|
||||
Tujuan:
|
||||
- buat draft pembelian
|
||||
- edit / submit pembelian
|
||||
- buat permintaan dana
|
||||
- monitor analisis dan realisasi pembelian
|
||||
|
||||
Endpoint:
|
||||
- `GET /api/v1/mobile/bootstrap`
|
||||
- `GET /api/v1/mobile/dashboard`
|
||||
- `GET /api/v1/mobile/purchases`
|
||||
- `POST /api/v1/mobile/purchases`
|
||||
- `GET /api/v1/mobile/purchases/:id`
|
||||
- `PUT /api/v1/mobile/purchases/:id`
|
||||
- `POST /api/v1/mobile/purchases/:id/submit`
|
||||
- `POST /api/v1/mobile/purchases/:id/cancel`
|
||||
- `GET /api/v1/mobile/fund-requests/bootstrap`
|
||||
- `GET /api/v1/mobile/fund-requests`
|
||||
- `POST /api/v1/mobile/fund-requests`
|
||||
- `GET /api/v1/mobile/purchase-analyses`
|
||||
- `GET /api/v1/mobile/purchase-analyses/:purchaseId`
|
||||
- `GET /api/v1/mobile/purchase-realizations`
|
||||
- `GET /api/v1/mobile/purchase-realizations/:purchaseId`
|
||||
|
||||
### Owner
|
||||
|
||||
Tujuan:
|
||||
- monitoring dashboard
|
||||
- lihat analisis pembelian
|
||||
- lihat realisasi pembelian
|
||||
- lihat status transaksi penting
|
||||
|
||||
Endpoint minimum:
|
||||
- `GET /api/v1/mobile/bootstrap`
|
||||
- `GET /api/v1/mobile/dashboard`
|
||||
- `GET /api/v1/mobile/purchases`
|
||||
- `GET /api/v1/mobile/purchases/:id`
|
||||
- `GET /api/v1/mobile/fund-requests`
|
||||
- `GET /api/v1/mobile/purchase-analyses`
|
||||
- `GET /api/v1/mobile/purchase-analyses/:purchaseId`
|
||||
- `GET /api/v1/mobile/purchase-realizations`
|
||||
- `GET /api/v1/mobile/purchase-realizations/:purchaseId`
|
||||
- `GET /api/v1/mobile/sales-regular`
|
||||
- `GET /api/v1/mobile/sales-jit`
|
||||
- `GET /api/v1/mobile/consignments`
|
||||
- `GET /api/v1/mobile/washing`
|
||||
|
||||
## Layar Minimum Per Role
|
||||
|
||||
### Warehouse
|
||||
|
||||
Layar minimum:
|
||||
1. Login
|
||||
2. Dashboard ringkas
|
||||
3. Scan lot
|
||||
4. Detail lot
|
||||
5. Daftar pembelian siap submit
|
||||
6. Submit pembelian yang otomatis membuat receipt + lot
|
||||
7. Penyesuaian stok
|
||||
8. Daftar washing
|
||||
9. Buat washing
|
||||
10. Selesaikan washing
|
||||
|
||||
### QC
|
||||
|
||||
Layar minimum:
|
||||
1. Login
|
||||
2. Dashboard ringkas
|
||||
3. Scan lot
|
||||
4. Detail lot dan turunan lot
|
||||
5. Daftar transformasi
|
||||
6. Buat mixing / ubah grade
|
||||
7. Daftar washing
|
||||
8. Selesaikan washing
|
||||
9. Penyesuaian stok QC
|
||||
|
||||
### Sales
|
||||
|
||||
Layar minimum:
|
||||
1. Login
|
||||
2. Dashboard ringkas
|
||||
3. Stok siap jual
|
||||
4. Scan lot
|
||||
5. Buat penjualan reguler
|
||||
6. Detail dan tutup penjualan reguler
|
||||
7. Buat penjualan JIT
|
||||
8. Detail dan tutup penjualan JIT
|
||||
9. Buat titip jual
|
||||
10. Detail dan tutup item titip jual
|
||||
|
||||
### Purchasing
|
||||
|
||||
Layar minimum:
|
||||
1. Login
|
||||
2. Dashboard ringkas
|
||||
3. Daftar pembelian
|
||||
4. Form draft pembelian
|
||||
5. Detail pembelian
|
||||
6. Submit pembelian
|
||||
7. Daftar permintaan dana
|
||||
8. Form permintaan dana
|
||||
9. Daftar analisis pembelian
|
||||
10. Daftar realisasi pembelian
|
||||
|
||||
### Owner
|
||||
|
||||
Layar minimum:
|
||||
1. Login
|
||||
2. Dashboard ringkas
|
||||
3. Daftar pembelian
|
||||
4. Detail pembelian
|
||||
5. Daftar analisis pembelian
|
||||
6. Detail analisis pembelian
|
||||
7. Daftar realisasi pembelian
|
||||
8. Detail realisasi pembelian
|
||||
9. Daftar transaksi keluar
|
||||
10. Daftar washing
|
||||
|
||||
## Scope Yang Sengaja Tidak Dibawa ke Mobile
|
||||
|
||||
- manajemen user
|
||||
- pengaturan sistem
|
||||
- audit trail penuh
|
||||
- master data lengkap
|
||||
- office buyout
|
||||
- print label / dokumen
|
||||
- laporan web yang kompleks
|
||||
|
||||
## Urutan Implementasi UI Mobile yang Disarankan
|
||||
|
||||
1. Warehouse
|
||||
2. QC
|
||||
3. Sales
|
||||
4. Purchasing
|
||||
5. Owner
|
||||
|
||||
Alasannya:
|
||||
- Warehouse dan QC paling sering butuh scan dan aksi lapangan cepat
|
||||
- Sales di urutan berikutnya karena butuh transaksi tapi tidak banyak input master
|
||||
- Purchasing dan Owner lebih banyak monitoring dan persetujuan ringan
|
||||
Reference in New Issue
Block a user