[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>
This commit is contained in:
2026-03-27 12:14:19 +08:00
parent 34804127c5
commit 44b6b158ef
17 changed files with 1616 additions and 416 deletions

View File

@@ -3041,6 +3041,363 @@
"operationId": "getApiEventToday",
"summary": "Get events for today"
}
},
"/api/dashboard/budget": {
"get": {
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"category",
"amount",
"percentage",
"color"
],
"properties": {
"category": {
"type": "string"
},
"amount": {
"type": "number"
},
"percentage": {
"type": "number"
},
"color": {
"type": "string"
}
}
}
}
},
"required": [
"data"
]
}
},
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"category",
"amount",
"percentage",
"color"
],
"properties": {
"category": {
"type": "string"
},
"amount": {
"type": "number"
},
"percentage": {
"type": "number"
},
"color": {
"type": "string"
}
}
}
}
},
"required": [
"data"
]
}
},
"text/plain": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"category",
"amount",
"percentage",
"color"
],
"properties": {
"category": {
"type": "string"
},
"amount": {
"type": "number"
},
"percentage": {
"type": "number"
},
"color": {
"type": "string"
}
}
}
}
},
"required": [
"data"
]
}
}
}
}
},
"operationId": "getApiDashboardBudget"
}
},
"/api/dashboard/sdgs": {
"get": {
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"title",
"score",
"image"
],
"properties": {
"title": {
"type": "string"
},
"score": {
"type": "number"
},
"image": {
"nullable": true,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
}
}
},
"required": [
"data"
]
}
},
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"title",
"score",
"image"
],
"properties": {
"title": {
"type": "string"
},
"score": {
"type": "number"
},
"image": {
"nullable": true,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
}
}
},
"required": [
"data"
]
}
},
"text/plain": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"title",
"score",
"image"
],
"properties": {
"title": {
"type": "string"
},
"score": {
"type": "number"
},
"image": {
"nullable": true,
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
}
}
},
"required": [
"data"
]
}
}
}
}
},
"operationId": "getApiDashboardSdgs"
}
},
"/api/dashboard/satisfaction": {
"get": {
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"category",
"value",
"color"
],
"properties": {
"category": {
"type": "string"
},
"value": {
"type": "number"
},
"color": {
"type": "string"
}
}
}
}
},
"required": [
"data"
]
}
},
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"category",
"value",
"color"
],
"properties": {
"category": {
"type": "string"
},
"value": {
"type": "number"
},
"color": {
"type": "string"
}
}
}
}
},
"required": [
"data"
]
}
},
"text/plain": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"category",
"value",
"color"
],
"properties": {
"category": {
"type": "string"
},
"value": {
"type": "number"
},
"color": {
"type": "string"
}
}
}
}
},
"required": [
"data"
]
}
}
}
}
},
"operationId": "getApiDashboardSatisfaction"
}
}
},
"components": {