Planning Service — Status
Last refreshed: 2026-06-16 (extracted from memory
project_planning_service.md).
Phase 1 — Extraction Status
🟢 ALL STEPS DONE — DEPLOYED 2026-06-11
| Step | Status | Notes |
|---|---|---|
| 1–3: Scaffold + kode + DB mig 001–003 | ✅ DONE | services/planning_service/ initialized |
4+5: DB reader+writer cutover (planningReadDB / planningWriteDB) | ✅ DONE 2026-06-11 | Dashboard_api dual-write removed setelah soak |
| 6: Soak (dual-write monitoring) | ✅ SELESAI | Zero planning_mirror_write_failed confirmed |
| 7: DROP legacy schemas (main DB) | ✅ DONE 2026-06-11 | Mig v1/106_drop_legacy_planning_schemas.sql: DROP SCHEMA IF EXISTS report CASCADE; DROP SCHEMA IF EXISTS planning CASCADE |
VM deploy planning-service | ✅ DONE 2026-06-11 | planning-service.service active port 8097; health check OK |
Nginx upstream planning-api | ✅ DONE | /merchant/planning-api/ → http://localhost:8097/ ada di VM nginx |
| HTTP proxy code (dashboard_api) | ✅ DONE 2026-06-11 | planning_service_proxy.go + server.go 6 route + config.go PlanningServiceBaseURL + .env.production PLANNING_SERVICE_BASE_URL=http://127.0.0.1:8097 |
Schema fix report.* → planning.* | ✅ DONE 2026-06-11 | dashboard_reports_scenarios_store.go 2 konstanta difix post mig 106 |
.env.example sync | ✅ DONE 2026-06-11 | Tambah PLANNING_POSTGRES_DSN + PLANNING_SERVICE_BASE_URL |
| Build + deploy dashboard_api binary baru ke VM | ✅ DONE 2026-06-11 | Purchasing 500 fix + planning proxy aktif + schema fix live |
Pending Items
| Item | Status | Notes |
|---|---|---|
| Break-even + Pricing Sensitivity schema decision | ❌ PENDING | Belum diputuskan perlu tabel skenario sendiri |
| Phase 2 — SaaS multi-tenant | ⏸️ PARKED | Tunggu tenant model decision |
| Branding final (Modelary vs Proyqo) | ⏸️ PARKED | Lihat plan §9 |
Architecture Saat Ini
planning_service hidup di VM port 8097. dashboard_api kode sudah punya proxy ke planning_service (via PLANNING_SERVICE_BASE_URL), dan binary baru sudah deployed 2026-06-11.
Satu binary menyelesaikan 3 masalah (DONE 2026-06-11)
Build + deploy dashboard_api baru dari codebase saat ini fix:
- ✅ Purchasing 500 —
INVENTORY_PURCHASING_READS_ENABLED=true→ HTTP ke inventory_service - ✅ Growth Projection scenario 500 — konstanta
planning.*schema (bukanreport.*legacy) - ✅ Planning proxy aktif —
PLANNING_SERVICE_BASE_URL=http://127.0.0.1:8097
DEPLOYED 2026-06-11 — PID 315949 live, purchasing + planning proxy + schema fix semua OK.
Smoke Test Verification
# Health check
curl -fsS http://127.0.0.1:8097/health
# → {"status":"ok","service":"planning-service","version":"0.1.0"}
# Internal API (dashboard_api proxy mode)
curl -fsS -H "X-Internal-API-Key: <key>" \
"http://127.0.0.1:8097/internal/scenarios?merchant_id=<uuid>"
# → [] (kosong setelah mig 106, hanya scenarios baru saja yang muncul)
Soak Metrics
Dual-write soak (Step 6) PASSED dengan zero planning_mirror_write_failed event di metrics. Setelah mig 106 (Step 7) di-apply, monitor:
planning_service_request_total(Prometheus, target steady)planning_service_request_duration_seconds{quantile=0.95}(target < 100ms)planning_service_db_query_duration_seconds(target < 50ms)
Deployment Files
| File | Path | Status |
|---|---|---|
| Service binary | services/planning_service/dist/planning-service | LIVE |
| VM directory | /home/<user>/kesles_merchant/merchant_planning/ (mirror pattern firebase) | LIVE |
| Systemd unit | planning-service.service | enabled+running |
| Nginx vhost | /etc/nginx/sites-enabled/api-merchant.kesles.com (block /merchant/planning-api/) | LIVE |
| DB | db_kesles_merchant_planning | 3 migs applied |
| Mig DROP legacy | db_kesles_merchant/migrations/v1/106_drop_legacy_planning_schemas.sql | applied |
Changelog
| Date | Change |
|---|---|
| 2026-06-10 | Plan ditulis (Phase 0 audit complete) |
| 2026-06-11 | Step 7 DROP DONE + VM deploy + HTTP proxy + dashboard_api binary deploy |
| 2026-06-16 | Site api_docs/planning/ dibuat — dokumentasi dipindah dari docs/plans/modelary-planning-extraction-plan.md |