upd: configurasi desa
Deskripsi: - update table database - seeder configurasi desa NO Issues
This commit is contained in:
@@ -193,7 +193,7 @@ model SuratPelayanan {
|
|||||||
|
|
||||||
model Configuration {
|
model Configuration {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
category String
|
name String
|
||||||
value String
|
value String
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { categoryPelayananSurat } from "@/lib/categoryPelayananSurat";
|
import { categoryPelayananSurat } from "@/lib/categoryPelayananSurat";
|
||||||
|
import { confDesa } from "@/lib/configurationDesa";
|
||||||
import { prisma } from "@/server/lib/prisma";
|
import { prisma } from "@/server/lib/prisma";
|
||||||
|
|
||||||
const category = [
|
const category = [
|
||||||
@@ -51,7 +52,6 @@ const user = [
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
for (const r of role) {
|
for (const r of role) {
|
||||||
console.log(`Seeding role ${r.name}`)
|
|
||||||
await prisma.role.upsert({
|
await prisma.role.upsert({
|
||||||
where: { id: r.id },
|
where: { id: r.id },
|
||||||
create: r,
|
create: r,
|
||||||
@@ -91,6 +91,15 @@ const user = [
|
|||||||
console.log(`✅ Category Pelayanan ${cp.name} seeded successfully`)
|
console.log(`✅ Category Pelayanan ${cp.name} seeded successfully`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const c of confDesa) {
|
||||||
|
await prisma.configuration.upsert({
|
||||||
|
where: { id: c.id },
|
||||||
|
create: c,
|
||||||
|
update: c
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(`✅ Configuration ${c.name} seeded successfully`)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
57
src/lib/configurationDesa.ts
Normal file
57
src/lib/configurationDesa.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
export const confDesa = [
|
||||||
|
{
|
||||||
|
id: "desaNama",
|
||||||
|
name: "Nama Desa",
|
||||||
|
value: "Darmasaba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "desaKabupaten",
|
||||||
|
name: "Kabupaten",
|
||||||
|
value: "Badung"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "desaKecamatan",
|
||||||
|
name: "Kecamatan",
|
||||||
|
value: "Abiansemal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "desaAlamat",
|
||||||
|
name: "Alamat Kantor Desa",
|
||||||
|
value: "Jl. Raya Darmasaba No.22, Darmasaba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "desaPos",
|
||||||
|
name: "Kode Pos",
|
||||||
|
value: "80352"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "desaTelepon",
|
||||||
|
name: "Telepon",
|
||||||
|
value: "081239580000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "desaEmail",
|
||||||
|
name: "Email",
|
||||||
|
value: "desadarmasaba@badungkab.go.id"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "perbekelNama",
|
||||||
|
name: "Nama Perbekel",
|
||||||
|
value: "Ida Bagus Surya Prabhawa Manuaba, S.H., M.H., N.L.P."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "perbekelJabatan",
|
||||||
|
name: "Jabatan",
|
||||||
|
value: "Perbekel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "perbekelNIP",
|
||||||
|
name: "NIP",
|
||||||
|
value: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "perbekelTTD",
|
||||||
|
name: "TTD",
|
||||||
|
value: ""
|
||||||
|
},
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user