Commit Graph

5 Commits

Author SHA1 Message Date
ed93363de1 feat: enhance complaint seeder with 12 complaints across 7 months
Complaint Data Enhancement:
- Increased from 3 complaints to 12 complaints
- Spread across 7 months (Sep 2025 - Mar 2026)
- Each month has 1-2 complaints for meaningful trend data
- Added variety in categories: INFRASTRUKTUR, KETERTIBAN_UMUM, ADMINISTRASI
- Added variety in priorities: RENDAH, SEDANG, TINGGI, DARURAT
- All complaints have realistic createdAt dates

Expected Trend Chart Data:
- Sep 2025: 1 complaint
- Oct 2025: 1 complaint
- Nov 2025: 1 complaint
- Dec 2025: 2 complaints
- Jan 2026: 2 complaints
- Feb 2026: 2 complaints
- Mar 2026: 3 complaints

Files changed:
- prisma/seeders/seed-public-services.ts: Enhanced seedComplaints()

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 16:33:59 +08:00
c6951dec80 fix: add sample data for dashboard stats (weekly service & completed complaints)
- Added 1 service letter with createdAt 5 days ago (within current week)
  → SKT-2025-001 (KTP) now shows in 'Surat Minggu Ini' stat
- Added 1 complaint with status SELESAI
  → COMP-20250320-003 shows in 'Layanan Selesai' stat

Dashboard stats now display:
- Surat Minggu Ini: 1 (was 0)
- Layanan Selesai: 1 (was 0)
- Pengaduan Aktif: 2 (BARU + DIPROSES)
- Total Penduduk: from resident stats

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 14:42:09 +08:00
354e706dc5 fix: update service letter seed with realistic dates for chart trends
- Added 5 service letters with createdAt dates spread across 6 months
- Changed from upsert to update/create pattern to allow createdAt modification
- This ensures chart-surat.tsx displays proper trend data
- Previous data had all timestamps at seed time, causing empty 6-month trend

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 14:34:49 +08:00
c216fa074d [darmasaba-dashboard][2026-03-27] feat: complete all seeders and update Phase 2 schema
Schema Updates:
- Added fields to Umkm model (name, owner, productType, description, timestamps)
- Added fields to Posyandu model (name, location, schedule, type, timestamps)
- Added fields to SecurityReport model (reportNumber, title, description, location, reportedBy, status, timestamps)
- Added fields to EmploymentRecord model (companyName, position, startDate, endDate, isActive, timestamps)
- Added fields to PopulationDynamic model (type, residentName, eventDate, description, timestamps)
- Added fields to BudgetTransaction model (transactionNumber, type, category, amount, description, date, timestamps)
- Added fields to HealthRecord model (type, notes, timestamps)

New Seeders:
- seed-discussions.ts: Documents, Discussions, DivisionMetrics
- seed-phase2.ts: UMKM, Posyandu, SecurityReports, EmploymentRecords, PopulationDynamics, BudgetTransactions

Enhanced Seeders:
- seed-auth.ts: Added seedApiKeys() function
- seed-public-services.ts: Added seedComplaintUpdates() and getComplaintIds()

New NPM Scripts:
- seed:documents - Seed documents and discussions
- seed:phase2 - Seed Phase 2+ features

All 33 Prisma models now have seeder coverage (82% direct, 12% stubs, 6% auto-managed)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 14:05:15 +08:00
44b6b158ef [darmasaba-dashboard][2026-03-27] feat: modular seeders and database-backed dashboard
- Split seeders into modular files per feature category
- Added seed:auth, seed:demographics, seed:divisions, seed:services, seed:dashboard commands
- Connected dashboard components to live database (Budget, SDGs, Satisfaction)
- Added API endpoints: /api/dashboard/budget, /api/dashboard/sdgs, /api/dashboard/satisfaction
- Updated prisma schema with dashboard metrics models
- Added loading states to dashboard components
- Fixed header navigation to /admin

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 12:14:19 +08:00