feat: add kependudukan seeders, API routes, year filter, and navbar menu

- Add Prisma models: DataBanjar, DistribusiAgama, DistribusiUmur, MigrasiPenduduk, DinamikaPenduduk
- Create seeders for all kependudukan models with year 2026 data
- Register Kependudukan API routes in route.ts
- Update API findMany endpoints to make tahun parameter optional
- Add YearFilter reusable component for admin pages
- Update 4 kependudukan admin pages with year filter UI
- Fix Mantine color array in AdminThemeProvider (add 10th element)
- Fix invalid Mantine color scale in paguTable.tsx (gray.50 -> gray.1)
- Add Kependudukan menu to navbar-list-menu.ts
- Fix Bun JSON import resolution with loadJsonData helper
- Update 74 seeder files to use dynamic JSON loading

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-04-10 11:54:36 +08:00
parent 5e822f0b05
commit 8b14c6ce44
146 changed files with 3051 additions and 201 deletions

View File

@@ -7,7 +7,7 @@ export default async function migrasiPendudukFindMany(context: Context) {
const limit = Number(context.query.limit) || 10;
const search = (context.query.search as string) || '';
const jenis = (context.query.jenis as string) || '';
const tahun = Number(context.query.tahun) || new Date().getFullYear();
const tahun = context.query.tahun ? Number(context.query.tahun) : undefined;
const skip = (page - 1) * limit;
const where: any = { isActive: true };
@@ -16,6 +16,7 @@ export default async function migrasiPendudukFindMany(context: Context) {
where.jenis = jenis;
}
// Filter by tahun hanya jika dikirim
if (tahun) {
where.tanggal = {
gte: new Date(`${tahun}-01-01`),