[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

@@ -358,6 +358,54 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/dashboard/budget": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get: operations["getApiDashboardBudget"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/dashboard/sdgs": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get: operations["getApiDashboardSdgs"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/dashboard/satisfaction": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get: operations["getApiDashboardSatisfaction"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
export type webhooks = Record<string, never>;
export interface components {
@@ -1551,4 +1599,124 @@ export interface operations {
};
};
};
getApiDashboardBudget: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
data: {
category: string;
amount: number;
percentage: number;
color: string;
}[];
};
"multipart/form-data": {
data: {
category: string;
amount: number;
percentage: number;
color: string;
}[];
};
"text/plain": {
data: {
category: string;
amount: number;
percentage: number;
color: string;
}[];
};
};
};
};
};
getApiDashboardSdgs: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
data: {
title: string;
score: number;
image: (string | null) | null;
}[];
};
"multipart/form-data": {
data: {
title: string;
score: number;
image: (string | null) | null;
}[];
};
"text/plain": {
data: {
title: string;
score: number;
image: (string | null) | null;
}[];
};
};
};
};
};
getApiDashboardSatisfaction: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
data: {
category: string;
value: number;
color: string;
}[];
};
"multipart/form-data": {
data: {
category: string;
value: number;
color: string;
}[];
};
"text/plain": {
data: {
category: string;
value: number;
color: string;
}[];
};
};
};
};
};
}

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": {