Commit Graph

108 Commits

Author SHA1 Message Date
2c5fa52608 tasks/noc-integration/update-village-id-to-desa1-and-fix-sync-logic/20260330-1522 2026-03-30 15:27:12 +08:00
f066defcba fix(noc): resolve 401 error on sync endpoint and allow public GET access to monitoring 2026-03-30 14:56:43 +08:00
fd52b0d281 test(noc): add API and E2E tests for NOC synchronization 2026-03-30 14:52:40 +08:00
65844bac7e feat(noc): implement sync management UI and backend integration 2026-03-30 14:48:47 +08:00
3125bc1002 feat(noc): implement NOC API module and sync strategy task 2026-03-30 14:32:12 +08:00
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
8e2608a2be fix: complaint trends API response type
- Changed response type from strict object to t.Any()
- Fixes 422 Unprocessable Entity error
- Allows flexible response format matching generated types

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 16:29:28 +08:00
0736df8523 feat: connect pengaduan-layanan-publik to live database
New API Endpoint:
- GET /api/complaint/trends - Fetch complaint trends for last 7 months

Component Updates:
- Removed hardcoded trenData array (7 months mock data)
- Removed hardcoded ideInovatif array (2 mock ideas)
- Added API calls to /api/complaint/trends and /api/complaint/innovation-ideas
- Added loading states for trend chart and innovation ideas
- Added empty states for both sections
- Connected LineChart to real complaint data
- Connected Innovation Ideas list to real InnovationIdea model

Features Added:
- Real-time complaint trend visualization
- Real innovation ideas from database
- Proper TypeScript typing for API responses
- Loading skeletons during data fetch
- Empty state messages when no data

Files changed:
- src/api/complaint.ts: Added /trends endpoint
- src/components/pengaduan-layanan-publik.tsx: Connected to APIs
- generated/api.ts: Regenerated types

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 16:26:24 +08:00
097f9f34cc chore: regenerate API types for new division endpoints
- Generated TypeScript types for /api/division/discussions
- Generated TypeScript types for /api/division/documents/stats
- Generated TypeScript types for /api/division/activities/stats
- Fixes TypeScript errors in progress-chart.tsx component

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 15:44:56 +08:00
75c7bc249e feat: connect kinerja divisi components to live database
New API Endpoints (src/api/division.ts):
- GET /api/division/discussions - Fetch recent discussions with sender info
- GET /api/division/documents/stats - Fetch document counts by type
- GET /api/division/activities/stats - Fetch activity status breakdown with percentages

Components Connected to Database:
- discussion-panel.tsx: Now fetches from /api/division/discussions
- document-chart.tsx: Now fetches from /api/division/documents/stats
- progress-chart.tsx: Now fetches from /api/division/activities/stats

Features Added:
- Loading states with Loader component
- Empty states with friendly messages
- Date formatting using date-fns with Indonesian locale
- Real-time data from database instead of hardcoded values
- Proper TypeScript typing for API responses

Files changed:
- src/api/division.ts: Added 3 new API endpoints
- src/components/kinerja-divisi/discussion-panel.tsx
- src/components/kinerja-divisi/document-chart.tsx
- src/components/kinerja-divisi/progress-chart.tsx

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 15:43:58 +08:00
b77822f2dd fix: chart surat BigInt serialization error
Root Cause:
- PostgreSQL COUNT(*) returns BigInt (1n)
- Elysia cannot serialize BigInt to JSON
- Frontend receives error instead of data

Solution:
- Cast COUNT(*) to INTEGER in SQL query
- Changed: COUNT(*) as count
- To: COUNT(*)::INTEGER as count
- Now returns regular number instead of BigInt

Files changed:
- src/api/complaint.ts: Fixed service-trends endpoint

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 15:04:53 +08:00
5058e2cc1c feat: add enhanced debugging for chart surat
- Added detailed console logging with response structure dump
- Added Array.isArray check for data validation
- Added test data fallback (commented out) for manual testing
- Added emoji indicators for easier debugging

Testing instructions:
1. Open browser DevTools console
2. Look for 📊 📈  ⚠️  emoji logs
3. If no data appears, check if API returns 401 (unauthorized)
4. To test chart rendering, uncomment the DEBUG useEffect block

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 14:59:16 +08:00
3bed181805 fix: chart surat barchart not rendering - fix multiple issues
1. ResponsiveContainer Layout Issue:
   - Wrapped in Box with explicit height (300px)
   - Changed ResponsiveContainer height to "100%" (relative to parent)
   - Fixes chart not rendering due to height constraint issue

2. Bar Fill Color:
   - Changed from CSS variable "var(--mantine-color-blue-filled)"
   - To direct hex colors: #3B82F6 (light) / #60A5FA (dark)
   - Fixes bar color not resolving

3. Empty Data Handling:
   - Added check for data.length > 0
   - Shows friendly message when no data available
   - Prevents rendering empty chart

4. YAxis Improvement:
   - Added allowDecimals={false} for cleaner integer display

5. Enhanced Debug Logging:
   - Added emoji icons for easier console scanning
   - Better error messages

Files changed:
- dashboard/chart-surat.tsx: Fixed all chart rendering issues

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 14:55:10 +08:00
c7a986aebc fix: remove hardcoded trend percentages and add debug logging
Chart Surat:
- Added console.log debugging to track API response and data mapping
- Helps identify if data is being received but not rendered

Stat Cards:
- Removed hardcoded trend='0%' and trendValue={0} props
- Cards now display clean without misleading 0% trends
- Trend feature can be re-added later with proper API support

Files changed:
- dashboard/chart-surat.tsx: Added debug logging
- dashboard-content.tsx: Removed hardcoded trend props

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 14:50:34 +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
8da53127c7 feat: add duplicate prevention to seed - skip if data already exists
- Added hasExistingData() function to check for existing seed data
- Checks core entities: users (>1), banjars (>=6), divisions (>=4)
- runSeed() now skips entirely if data exists
- runSpecificSeeder() skips non-auth seeders if data exists
- Provides helpful message with reset instructions
- Prevents accidental duplicate data on re-run

Usage:
- bun run seed - Will skip if data exists
- bun x prisma migrate reset - Reset database before re-seeding

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 14:36:46 +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
34804127c5 Refactor: move AppShell to global layout, add breadcrumbs, and restructure profile routes 2026-03-26 17:10:40 +08:00
0d0dc187a5 chore: fix linting and type safety across the project 2026-03-26 15:51:45 +08:00
ec057ef2e5 feat(dashboard): connect dashboard components to database 2026-03-26 14:28:09 +08:00
0900b8f199 feat(database): implement resident and complaint API and connect DemografiPekerjaan 2026-03-26 14:17:41 +08:00
aeedb17402 fix(header): fix missing Divider, Badge, IconUserShield and navigate 2026-03-26 14:13:59 +08:00
ebc1242bee docs: add task for dev-inspector implementation 2026-03-26 11:50:26 +08:00
0e063cb79e docs: add task for phase 1 core database implementation 2026-03-26 11:14:03 +08:00
3eb84921a1 Fix Konsisten Warna Bg 4 2026-03-25 17:15:07 +08:00
c6415c5aab Fix Konsisten Warna Bg 2 2026-03-25 17:08:39 +08:00
519a14adaa Fix Konsisten Warna Bg 2 2026-03-25 17:02:18 +08:00
366c08fbaa Fix Konsisten Warna Bg 2026-03-25 16:46:59 +08:00
5c09e7a0be Fix Ga Perlu Akses Login Saat Ke Semua Fitur Dashboard 2026-03-25 15:35:20 +08:00
7c8012d277 Fix Lint-1 2026-03-25 15:07:10 +08:00
687ce11a81 Refactor New Ui Semua Pengaturan 2026-03-25 14:38:37 +08:00
1ba4643e23 Refactor New Ui Pengaturan Umum 2026-03-25 11:56:22 +08:00
113dd7ba6f Refactor New Ui Sosial, Keamanan, & Bantuan 2026-03-25 11:10:50 +08:00
71a305cd4b Refactor New Ui Bumdes 02 2026-03-25 10:32:31 +08:00
84b96ca3be Refactor New Ui Bumdes 2026-03-25 00:09:38 +08:00
8159216a2c Refactor ui keuangan 2026-03-24 23:17:23 +08:00
d714c09efc Fix New UI Pengaduan 2026-03-18 00:43:44 +07:00
0a97e31416 Fix New UI Pengaduan 2026-03-18 00:34:53 +07:00
158a2db435 Fix New UI Pengaduan 2026-03-17 21:41:03 +07:00
2d68d4dc06 Fix New UI Kinerja Divisi 2026-03-17 21:19:10 +07:00
97e6caa332 Fix UI Beranda 2026-03-17 21:03:36 +07:00
f0c37272b9 Progress Tampilan UI Dashboard Desa Plus NOC 2026-03-17 20:53:33 +07:00
8c35d58b38 refactor: modularize kinerja-divisi components per PromptDashboard.md
- Create ActivityCard component for program kegiatan cards
- Create DivisionList component for divisi teraktif with arrow icons
- Create DocumentChart component for bar chart (jumlah dokumen)
- Create ProgressChart component for pie chart (progres kegiatan)
- Create DiscussionPanel component for diskusi internal
- Create EventCard component for agenda hari ini
- Create ArchiveCard component for arsip digital perangkat desa
- Refactor main KinerjaDivisi component to use new modular components
- Implement responsive 3-column grid layout
- Add proper dark mode support with specified colors
- Add hover effects and smooth animations

New components structure:
  src/components/kinerja-divisi/
    - activity-card.tsx
    - archive-card.tsx
    - discussion-panel.tsx
    - division-list.tsx
    - document-chart.tsx
    - event-card.tsx
    - progress-chart.tsx
    - index.ts (exports)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 16:47:19 +08:00
952f7ecb16 refactor: modularize dashboard components per PromptDashboard.md
- Create reusable StatCard component for header metrics
- Create ChartSurat component for bar chart (surat statistics)
- Create DivisionProgress component for divisi teraktif
- Create ChartAPBDes component for APBDes horizontal bar chart
- Create ActivityList component for calendar events
- Create SatisfactionChart component for donut chart
- Create SDGSCard component for SDGs metrics
- Refactor DashboardContent to use new modular components
- Add proper dark mode support with specified colors
- Implement responsive grid layout (12/6/1 columns)
- Add custom SDGs icons (Energy, Peace, Health, Poverty, Ocean)

New components structure:
  src/components/dashboard/
    - stat-card.tsx
    - chart-surat.tsx
    - chart-apbdes.tsx
    - division-progress.tsx
    - activity-list.tsx
    - satisfaction-chart.tsx
    - sdgs-card.tsx
    - index.ts (exports)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 15:36:31 +08:00
a74e0c02e5 fix: resolve merge conflict in pengaturan/route.tsx
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 14:41:22 +08:00
17ecd3feca fix: make dashboard public and remove admin-only restriction from main pages
- Make homepage (/) accessible without authentication
- Allow all authenticated users (user & admin) to access main pages:
  - /kinerja-divisi, /pengaduan, /jenna, /demografi
  - /keuangan, /bumdes, /sosial, /keamanan
  - /bantuan, /pengaturan
- Reserve admin-only access for /admin/* routes
- Update auth middleware to handle public routes properly

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 14:21:30 +08:00
d88cf2b100 Merge pull request #5 from bipprojectbali/nico/26-feb-26/fix-seed-2
Fix Gambar
2026-03-12 15:21:17 +08:00
e0955ed2c4 Merge branch 'stg' into nico/26-feb-26/fix-seed-2 2026-03-12 15:21:05 +08:00