API & UI Menu Ekonomi, Submenu Jumlah Pengangguran
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
[
|
||||
{
|
||||
"year": 2025,
|
||||
"totalUnemployment": 140,
|
||||
"educatedUnemployment": 80,
|
||||
"percentageEducatedOfTotal": 57.1,
|
||||
"productiveAgePopulation": 125,
|
||||
"percentageProductiveOfTotal": 89.3,
|
||||
"percentageChangeFromPreviousYear": -12.5
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
[
|
||||
{
|
||||
"recordedDate": "2025-06-30",
|
||||
"count": 95,
|
||||
"percentageOfTotal": 67.9
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "DetailDataPengangguran" (
|
||||
"id" UUID NOT NULL,
|
||||
"month" VARCHAR(20) NOT NULL,
|
||||
"year" INTEGER NOT NULL,
|
||||
"totalUnemployment" INTEGER NOT NULL,
|
||||
"educatedUnemployment" INTEGER NOT NULL,
|
||||
"uneducatedUnemployment" INTEGER NOT NULL,
|
||||
"percentageChange" DOUBLE PRECISION,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
"deletedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"isActive" BOOLEAN NOT NULL DEFAULT true,
|
||||
|
||||
CONSTRAINT "DetailDataPengangguran_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "DetailDataPengangguran_month_year_key" ON "DetailDataPengangguran"("month", "year");
|
||||
@@ -1279,30 +1279,3 @@ model DetailDataPengangguran {
|
||||
|
||||
@@unique([month, year])
|
||||
}
|
||||
|
||||
model RingkasanDataPengangguran {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
year Int @unique
|
||||
totalUnemployment Int
|
||||
educatedUnemployment Int
|
||||
percentageEducatedOfTotal Float?
|
||||
productiveAgePopulation Int?
|
||||
percentageProductiveOfTotal Float?
|
||||
percentageChangeFromPreviousYear Float?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
deletedAt DateTime @default(now())
|
||||
isActive Boolean @default(true)
|
||||
}
|
||||
|
||||
model SedangMencariKerja {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
count Int
|
||||
percentageOfTotal Float?
|
||||
recordedDate DateTime @unique @db.Date
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
deletedAt DateTime @default(now())
|
||||
isActive Boolean @default(true)
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ import hubunganOrganisasi from "./data/ekonomi/struktur-organisasi/hubungan-orga
|
||||
import posisiOrganisasi from "./data/ekonomi/struktur-organisasi/posisi-organisasi.json";
|
||||
import pegawai from "./data/ekonomi/struktur-organisasi/pegawai.json";
|
||||
import detailDataPengangguran from './data/ekonomi/jumlah-pengangguran/detail-data-pengangguran.json';
|
||||
import ringkasanDataPengangguran from './data/ekonomi/jumlah-pengangguran/ringkasan-data-pengangguran.json';
|
||||
import sedangMencariKerja from './data/ekonomi/jumlah-pengangguran/sedang-mencari-kerja.json';
|
||||
|
||||
(async () => {
|
||||
for (const l of layanan) {
|
||||
@@ -457,52 +455,6 @@ import sedangMencariKerja from './data/ekonomi/jumlah-pengangguran/sedang-mencar
|
||||
});
|
||||
}
|
||||
console.log("📊 detailDataPengangguran success ...");
|
||||
|
||||
// RingkasanDataPengangguran
|
||||
for (const r of ringkasanDataPengangguran) {
|
||||
await prisma.ringkasanDataPengangguran.upsert({
|
||||
where: {
|
||||
year: r.year,
|
||||
},
|
||||
update: {
|
||||
totalUnemployment: r.totalUnemployment,
|
||||
educatedUnemployment: r.educatedUnemployment,
|
||||
percentageEducatedOfTotal: r.percentageEducatedOfTotal,
|
||||
productiveAgePopulation: r.productiveAgePopulation,
|
||||
percentageProductiveOfTotal: r.percentageProductiveOfTotal,
|
||||
percentageChangeFromPreviousYear: r.percentageChangeFromPreviousYear,
|
||||
},
|
||||
create: {
|
||||
year: r.year,
|
||||
totalUnemployment: r.totalUnemployment,
|
||||
educatedUnemployment: r.educatedUnemployment,
|
||||
percentageEducatedOfTotal: r.percentageEducatedOfTotal,
|
||||
productiveAgePopulation: r.productiveAgePopulation,
|
||||
percentageProductiveOfTotal: r.percentageProductiveOfTotal,
|
||||
percentageChangeFromPreviousYear: r.percentageChangeFromPreviousYear,
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("📈 ringkasanDataPengangguran success ...");
|
||||
|
||||
// SedangMencariKerja
|
||||
for (const s of sedangMencariKerja) {
|
||||
await prisma.sedangMencariKerja.upsert({
|
||||
where: {
|
||||
recordedDate: new Date(s.recordedDate),
|
||||
},
|
||||
update: {
|
||||
count: s.count,
|
||||
percentageOfTotal: s.percentageOfTotal,
|
||||
},
|
||||
create: {
|
||||
recordedDate: new Date(s.recordedDate),
|
||||
count: s.count,
|
||||
percentageOfTotal: s.percentageOfTotal,
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("💼 sedangMencariKerja success ...");
|
||||
})()
|
||||
.then(() => prisma.$disconnect())
|
||||
.catch((e) => {
|
||||
|
||||
Reference in New Issue
Block a user