Modul Manajemen Toko mencakup pengaturan store, shipping config, warehouse, AI agent character, dan OTP verifikasi. Shipping sekarang masuk di sini (bukan modul terpisah).
File kunci
| File | Baris | Peran |
|---|
app/Http/Controllers/SettingController.php | 1.993 | Semua setting store |
app/Models/Store.php | 35 | Model store |
app/Models/Setting.php | 26 | Document polimorfik per store (shipping, followup, globalAssignation, dll) |
app/Models/PlatformSetting.php | 35 | Setting platform-level (withdraw fees) |
app/Models/Warehouse.php | — | Gudang merchant |
Model
Store
Field: username, sequence (untuk shortlink), plan ('trial'/lainnya), expired_at, features (array kuota_produk/batasan_produk), addresses, logo, phone, email, social_media.
Setting (document per store)
Field: followup_before_sales, followup_after_sales, shipping ({otomatic: {logistics: [...]}, province, city, postal_code, payment_method, cod_*}), general_setting, globalAssignation (rotator CS), warehouse_base_on, ai_agent_character, payment_qr, logo.
Controller method utama
| Method | Fungsi |
|---|
store_information() | Render Setting/StoreSetting — auto-tambah kurir “store_courier” |
update_shipping() | Update shipping config (2 mode: lama & baru) |
update_shipping_cost() | Update shipping_cost untuk kurir custom |
warehouse() | Render Setting/Warehouse |
store_warehouse() | Buat warehouse |
update_warehouse() | Update warehouse |
update_phone() / update_email() | Update + OTP via WaController |
update_logo() | Upload logo ke S3 |
update_social_media() | Update social media |
update_ai_agent_character() | Tambah karakter AI agent |
general_setting() | Render Setting/General/Index |
Route
Web (routes/web.php:325)
Prefix /setting:
| Method | Path | Fungsi |
|---|
| GET | /setting/store_information | Store info |
| GET | /setting/edit | Edit store |
| GET | /setting/warehouse | Warehouse |
| POST | /setting/warehouse-store | Buat warehouse |
| POST | /setting/warehouse-update | Update warehouse |
| POST | /setting/store/shipping/update | Update shipping |
| POST | /setting/store/shipping/update-cost | Update shipping cost |
| GET | /setting/verification | Verifikasi WA/email |
| GET | /setting/general | General setting |
| POST | /setting/general/update | Update general |
API (routes/api.php:443)
Prefix /setting:
| Method | Path | Fungsi |
|---|
| GET | /setting/list | Get setting + warehouse + addon |
| POST | /setting/update_logo | Update logo |
| POST | /setting/setting_warehouse | Setting warehouse config |
Prefix /warehouse:
| Method | Path | Fungsi |
|---|
| GET | /warehouse/list | List warehouse |
| DELETE | /warehouse/destroy/{id} | Hapus |
| GET | /warehouse/check-warehouse | Cek warehouse |
Frontend
| File | Baris | Catatan |
|---|
StoreSetting.vue | 1.397 | Yang dirender |
StoreInformation.vue | 584 | Orphan — sudah digantikan |
Warehouse.vue | 629 | |
AddWarehouse.vue | 698 | |
Shipping.vue | 611 | |
General/Index.vue | 702 | |
Integrasi
| Service | Untuk |
|---|
| AWS S3 | Upload logo, QR, social media |
Engine WA (via WaController) | OTP untuk update phone |
| Rajaongkir | Shipping expedition |
Temuan
store_information() GET request menulis ke MongoDB — auto-tambah store_courier saat GET. Side-effect melanggar REST
StoreInformation.vue (584 baris) orphan — sudah digantikan StoreSetting.vue (:743-744)
update_shipping() tidak return response — frontend tidak tahu sukses/gagal
setting_warehouse() validator tidak menghentikan — update jalan walau data invalid
- 3 tempat shipping config —
Shipping.vue, ShippingSetting.vue, embed di StoreSetting.vue. Risiko duplikat