[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>
This commit is contained in:
@@ -357,47 +357,88 @@ model SatisfactionRating {
|
||||
// --- STUBS FOR PHASE 2+ (To maintain relations) ---
|
||||
|
||||
model HealthRecord {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
residentId String
|
||||
resident Resident @relation(fields: [residentId], references: [id])
|
||||
recordedBy String
|
||||
recorder User @relation(fields: [recordedBy], references: [id])
|
||||
recorder User @relation(fields: [recordedBy], references: [id])
|
||||
type String // "Pemeriksaan", "Imunisasi", "Ibu Hamil"
|
||||
notes String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model EmploymentRecord {
|
||||
id String @id @default(cuid())
|
||||
residentId String
|
||||
resident Resident @relation(fields: [residentId], references: [id])
|
||||
id String @id @default(cuid())
|
||||
residentId String
|
||||
resident Resident @relation(fields: [residentId], references: [id])
|
||||
companyName String
|
||||
position String
|
||||
startDate DateTime
|
||||
endDate DateTime?
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model PopulationDynamic {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
documentedBy String
|
||||
documentor User @relation(fields: [documentedBy], references: [id])
|
||||
documentor User @relation(fields: [documentedBy], references: [id])
|
||||
type String // "KELAHIRAN", "KEMATIAN", "KEDATANGAN", "KEPERGIAN"
|
||||
residentName String
|
||||
eventDate DateTime
|
||||
description String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model BudgetTransaction {
|
||||
id String @id @default(cuid())
|
||||
createdBy String
|
||||
creator User @relation(fields: [createdBy], references: [id])
|
||||
id String @id @default(cuid())
|
||||
createdBy String
|
||||
creator User @relation(fields: [createdBy], references: [id])
|
||||
transactionNumber String @unique
|
||||
type String // "PENGELUARAN", "PENDAPATAN"
|
||||
category String
|
||||
amount Float
|
||||
description String?
|
||||
date DateTime
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Umkm {
|
||||
id String @id @default(cuid())
|
||||
banjarId String?
|
||||
banjar Banjar? @relation(fields: [banjarId], references: [id])
|
||||
id String @id @default(cuid())
|
||||
banjarId String?
|
||||
banjar Banjar? @relation(fields: [banjarId], references: [id])
|
||||
name String
|
||||
owner String
|
||||
productType String?
|
||||
description String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Posyandu {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
coordinatorId String?
|
||||
coordinator User? @relation(fields: [coordinatorId], references: [id])
|
||||
coordinator User? @relation(fields: [coordinatorId], references: [id])
|
||||
name String
|
||||
location String
|
||||
schedule String
|
||||
type String // "Ibu dan Anak", "Lansia", etc.
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model SecurityReport {
|
||||
id String @id @default(cuid())
|
||||
assignedTo String?
|
||||
assignee User? @relation(fields: [assignedTo], references: [id])
|
||||
id String @id @default(cuid())
|
||||
assignedTo String?
|
||||
assignee User? @relation(fields: [assignedTo], references: [id])
|
||||
reportNumber String @unique
|
||||
title String
|
||||
description String
|
||||
location String?
|
||||
reportedBy String
|
||||
status String @default("BARU") // BARU, DIPROSES, SELESAI
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// --- ENUMS ---
|
||||
|
||||
Reference in New Issue
Block a user