API & State Jumlah Pengangguran
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
[
|
||||
{
|
||||
"month": "Jan",
|
||||
"year": 2025,
|
||||
"totalUnemployment": 160,
|
||||
"educatedUnemployment": 95,
|
||||
"uneducatedUnemployment": 65,
|
||||
"percentageChange": null
|
||||
},
|
||||
{
|
||||
"month": "Feb",
|
||||
"year": 2025,
|
||||
"totalUnemployment": 155,
|
||||
"educatedUnemployment": 90,
|
||||
"uneducatedUnemployment": 65,
|
||||
"percentageChange": -3.1
|
||||
},
|
||||
{
|
||||
"month": "Mar",
|
||||
"year": 2025,
|
||||
"totalUnemployment": 150,
|
||||
"educatedUnemployment": 88,
|
||||
"uneducatedUnemployment": 62,
|
||||
"percentageChange": -3.2
|
||||
},
|
||||
{
|
||||
"month": "Apr",
|
||||
"year": 2025,
|
||||
"totalUnemployment": 148,
|
||||
"educatedUnemployment": 85,
|
||||
"uneducatedUnemployment": 63,
|
||||
"percentageChange": -1.3
|
||||
},
|
||||
{
|
||||
"month": "Mei",
|
||||
"year": 2025,
|
||||
"totalUnemployment": 145,
|
||||
"educatedUnemployment": 82,
|
||||
"uneducatedUnemployment": 63,
|
||||
"percentageChange": -2.0
|
||||
},
|
||||
{
|
||||
"month": "Jun",
|
||||
"year": 2025,
|
||||
"totalUnemployment": 140,
|
||||
"educatedUnemployment": 80,
|
||||
"uneducatedUnemployment": 60,
|
||||
"percentageChange": -3.4
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"year": 2025,
|
||||
"totalUnemployment": 140,
|
||||
"educatedUnemployment": 80,
|
||||
"percentageEducatedOfTotal": 57.1,
|
||||
"productiveAgePopulation": 125,
|
||||
"percentageProductiveOfTotal": 89.3,
|
||||
"percentageChangeFromPreviousYear": -12.5
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"recordedDate": "2025-06-30",
|
||||
"count": 95,
|
||||
"percentageOfTotal": 67.9
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1262,3 +1262,46 @@ model DataDemografiPekerjaan {
|
||||
deletedAt DateTime @default(now())
|
||||
isActive Boolean @default(true)
|
||||
}
|
||||
|
||||
// ========================================= JUMLAH PENGANGGURAN ========================================= //
|
||||
model DetailDataPengangguran {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
month String @db.VarChar(20)
|
||||
year Int
|
||||
totalUnemployment Int
|
||||
educatedUnemployment Int
|
||||
uneducatedUnemployment Int
|
||||
percentageChange Float?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
deletedAt DateTime @default(now())
|
||||
isActive Boolean @default(true)
|
||||
|
||||
@@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)
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,9 @@ import kategoriProduk from "./data/ekonomi/pasar-desa/kategori-produk.json";
|
||||
import hubunganOrganisasi from "./data/ekonomi/struktur-organisasi/hubungan-organisasi.json";
|
||||
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) {
|
||||
@@ -431,6 +434,75 @@ import pegawai from "./data/ekonomi/struktur-organisasi/pegawai.json";
|
||||
});
|
||||
}
|
||||
console.log("hubungan organisasi success ...");
|
||||
|
||||
for (const d of detailDataPengangguran) {
|
||||
await prisma.detailDataPengangguran.upsert({
|
||||
where: {
|
||||
month_year: { month: d.month, year: d.year },
|
||||
},
|
||||
update: {
|
||||
totalUnemployment: d.totalUnemployment,
|
||||
educatedUnemployment: d.educatedUnemployment,
|
||||
uneducatedUnemployment: d.uneducatedUnemployment,
|
||||
percentageChange: d.percentageChange,
|
||||
},
|
||||
create: {
|
||||
month: d.month,
|
||||
year: d.year,
|
||||
totalUnemployment: d.totalUnemployment,
|
||||
educatedUnemployment: d.educatedUnemployment,
|
||||
uneducatedUnemployment: d.uneducatedUnemployment,
|
||||
percentageChange: d.percentageChange,
|
||||
},
|
||||
});
|
||||
}
|
||||
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