Tidak ada migration sebagai acuan skema di dazoapp. Bentuk dokumen diturunkan dari model + controller + seeder. Halaman ini mendokumentasikan 6 koleksi kritis.
Konvensi umum
- Semua model memakai
MongoDB\Laravel\Eloquent\Model(77/79 model) - Primary key: UUID string di-generate di
static::creating():php $model->id = (string) Str::uuid(); $incrementing = false; $keyType = 'string'; $primaryKey = 'id'- Timestamps otomatis (
created_at/updated_at) — kecuali yang eksplisit$timestamps = false - Tidak ada index DB di semua 6 koleksi. Multi-tenant scoping via
store_idhanya di layer aplikasi, tidak didukung index compound — potensi masalah performa untuk koleksi besar
Koleksi terdokumentasi
| Koleksi | Model | SoftDeletes | Casts | Status |
|---|---|---|---|---|
wallets | Wallet | ✅ | ✅ | — |
wallet_transactions | WalletTransaction | ❌ | ✅ | — |
orders | Order | ❌ | ❌ | — |
user_stores | UserStore | ✅ | ❌ | — |
devices | Device | ✅ | ❌ | — |
customers | Customer | ✅ | ❌ (commented) | — |
Inkonsistensi lintas-koleksi
| Masalah | Detail |
|---|---|
| Type literal vs konstanta | WalletTransaction::TYPE_WITHDRAWAL = 'withdrawal' tapi controller tulis type='withdraw' |
| Status case | STATUS_PENDING = 'pending' (lowercase) tapi controller tulis 'PENDING' (uppercase) |
Bentuk addresses | Order: flat string vs {label, value} object — tidak seragam antar method |
address vs addresses | Customer: dua nama field berbeda untuk data sama (ShortlinkController.php:243 vs ContactController.php:209) |
tags type | Customer: string (lama) vs UUID (baru) — RefactorTagInCustomer.php |
utm_campaing | Order: typo yang terlanjur dipakai (OrderController.php:1798) |
| Virtual vs persisted | wallet.processing_balance & total_withdrawn accessor menimpa nilai DB yang di-persist |
| Device field naming | iduser, tgl_expired, idpaket (non-standard) vs user_id, user_store_id di koleksi lain |
Catatan verifikasi
Field yang ditulis di luar controller yang diperiksa (mis. command, job, service lain) mungkin terlewat. Disarankan verifikasi dengan db.<collection>.findOne() di staging sebelum dokumentasi ini dijadikan acuan.