mcp pengaduan

Deskripsi:
- database pengaduan
- seeder pengaduan

No Issues
This commit is contained in:
2025-10-27 15:14:51 +08:00
parent 4d1e78468f
commit addd41389a
5 changed files with 126 additions and 55 deletions

View File

@@ -1,24 +1,51 @@
import { prisma } from "@/server/lib/prisma";
const role = [
{
id: "developer",
name: "developer"
},
{
id: "admin",
name: "admin"
},
{
id: "pelaksana",
name: "pelaksana"
}
]
const user = [
{
name: "Bip",
email: "bip@bip.com",
password: "bip",
roleId: "developer"
}
];
; (async () => {
(async () => {
for (const u of user) {
await prisma.user.upsert({
where: { email: u.email },
create: u,
update: u,
update: u
})
console.log(`✅ User ${u.email} seeded successfully`)
}
for (const r of role) {
console.log(`Seeding role ${r.name}`)
await prisma.role.upsert({
where: { id: r.id },
create: r,
update: r
})
console.log(`✅ Role ${r.name} seeded successfully`)
}
})().catch((e) => {
console.error(e)