135dika / handover_verification_checklist.md

Last active 1 month ago

Like 0

135dika revised this gist 1 month ago · 5c74459

1 file changed, 2 insertions, 1 deletion

handover_verification_checklist.md
@@ -169,7 +169,8 @@ Berlaku di semua endpoint upload (check attachments, category import, dsb):
169 169 CORS_ORIGINS="https://app.example.com,https://admin.example.com"
170 170 ```
171 171
172 - - Tidak di-set → CORS mati (same-origin only) → browser frontend cross-origin akan block.
172 + - `CORS_ORIGINS="*"` → semua origin diizinkan (transisi sementara; ganti ke daftar asal begitu lengkap).
173 + - Kosong/tidak di-set → CORS mati (same-origin only) → browser frontend cross-origin akan block.
173 174 - **Wajib diisi di `.env` setiap environment sebelum deploy.**
174 175
175 176 ---

135dika revised this gist 1 month ago · e477024

1 file changed, 145 insertions, 34 deletions

handover_verification_checklist.md

Diff is too large to be shown

135dika revised this gist 1 month ago · 336bee1

1 file changed, 3 insertions, 2 deletions

handover_verification_checklist.md
@@ -68,8 +68,9 @@ CORS_ORIGINS="https://app.example.com,https://admin.example.com"
68 68 ## 9. Env baru (ops)
69 69
70 70 ```
71 - REDIS_HOST="localhost" # default localhost
72 - REDIS_PORT="6379" # default 6379
71 + REDIS_URL="redis://default:password@localhost:6379" # prioritas; support username+password
72 + #REDIS_HOST="localhost" # fallback kalau REDIS_URL kosong
73 + #REDIS_PORT="6379"
73 74 CORS_ORIGINS="" # wajib diisi untuk akses cross-origin
74 75 ```
75 76

135dika revised this gist 1 month ago · 14f00df

1 file changed, 79 insertions

handover_verification_checklist.md (file created)
@@ -0,0 +1,79 @@
1 + # Handover Backend → Frontend
2 +
3 + Perubahan perilaku API hasil audit. Wajib dibaca sebelum update klien.
4 +
5 + ## 1. Pagination (BREAKING untuk klien yang andalkan "return semua")
6 +
7 + Semua endpoint list kini dibatasi default **50 row** per request.
8 +
9 + - Web verification-checks: `GET /` dan `POST /find` menerima query `take` & `skip`.
10 + - `take` di-clamp ke 1–100, `skip` ≥ 0.
11 + - Tanpa param → `take: 50`.
12 + - Mobile verification-checks: endpoint list (`findManyByOwnerId`) sama, default 50.
13 +
14 + Untuk data lengkap: loop pakai `skip`/`take`, jangan harap semua row sekali jalan.
15 +
16 + ## 2. Status filter diperbaiki
17 +
18 + Sebelumnya `status=rejected` maupun `status=need_approval` **return semua row** (bug).
19 +
20 + Nilai `status` yang valid sekarang:
21 +
22 + | query `status` | hasil |
23 + | --------------------------------- | -------------------- |
24 + | `verified` / `approved` | hanya APPROVED |
25 + | `rejected` | hanya REJECTED |
26 + | `need_approval` / `need-approval` | hanya NEED_APPROVAL |
27 + | tidak dikirim / tidak dikenal | tanpa filter (semua) |
28 +
29 + ## 3. Web category list — shape response berubah (BREAKING)
30 +
31 + `category.findAll` (web) **tidak lagi mengembalikan nested `verificationChecks` array**.
32 + Response sekarang: field category + `verifiedCounter`.
33 +
34 + Kalau UI memakai field nested itu, sesuaikan; counter masih tersedia.
35 +
36 + ## 4. Mobile category findOne — sekarang berfungsi
37 +
38 + Dulu `id` param tidak terbaca (bug), endpoint selalu miss. Sekarang `@Param('id')` benar.
39 + Kalau sebelumnya ada workaround klien, hapus.
40 +
41 + ## 5. Mobile category import — return berisi
42 +
43 + `processImport` dulu **selalu return `[]`** (bug). Sekarang berisi kategori hasil import.
44 +
45 + ## 6. Error handling
46 +
47 + - JSON body tidak valid → **400** `Invalid JSON payload` (dulu 500 unhandled).
48 + - Error tak terduga → 500 generik `An unexpected error occurred.` (detail Prisma tidak lagi bocor ke klien).
49 +
50 + ## 7. Upload
51 +
52 + - Maks **10 file per request**, **10 MB per file** (dulu praktis unlimited). Lebih → ditolak multer.
53 + - Ekstensi file dipaksa dari mimetype whitelist: **jpg/jpeg/png/pdf saja**. Upload dengan
54 + ekstensi aneh (mis. `x.html` berlabel `image/png`) ditolak.
55 + - Request JSON dibatasi **1 MB**.
56 +
57 + ## 8. CORS (action needed per environment)
58 +
59 + `origin: '*'` dihapus. Sekarang dari env:
60 +
61 + ```
62 + CORS_ORIGINS="https://app.example.com,https://admin.example.com"
63 + ```
64 +
65 + - Tidak di-set → CORS mati (same-origin only) → browser frontend cross-origin akan block.
66 + - **Wajib diisi di `.env` setiap environment sebelum deploy.**
67 +
68 + ## 9. Env baru (ops)
69 +
70 + ```
71 + REDIS_HOST="localhost" # default localhost
72 + REDIS_PORT="6379" # default 6379
73 + CORS_ORIGINS="" # wajib diisi untuk akses cross-origin
74 + ```
75 +
76 + ## Catatan backend (bukan urusan frontend)
77 +
78 + - `prisma migrate dev` perlu dijalankan (index baru + kolom panjang `@db.Text`). Belum ada migration.
79 + - Auth/JWT: sengaja belum diimplementasi (keputusan owner). Semua endpoint masih publik.