Compare commits

...

22 Commits

Author SHA1 Message Date
acb82388db upd: migrasi 2026-03-27 16:10:36 +08:00
f2a66beeb3 upd: url wa 2026-03-27 15:33:27 +08:00
724484b875 Merge pull request 'upd: api noc' (#118) from amalia/25-mar-26 into main
Reviewed-on: #118
2026-03-25 17:03:56 +08:00
1eb708ae59 upd: api noc 2026-03-25 17:01:50 +08:00
e4406fbcf0 Merge pull request 'upd: api noc' (#117) from amalia/17-mar-26 into main
Reviewed-on: #117
2026-03-17 15:39:55 +08:00
0c8b9d1667 upd: api noc 2026-03-17 15:38:44 +08:00
a8aa0f8d63 Merge pull request 'upd : api noc dashboard' (#116) from amalia/16-mar-26 into main
Reviewed-on: #116
2026-03-16 16:13:12 +08:00
39cb8d8391 upd : api noc dashboard 2026-03-16 16:06:08 +08:00
d6abc163fb Merge pull request 'upd: tambah satuan' (#115) from amalia/06-feb-26 into main
Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/115
2026-02-06 17:46:25 +08:00
9c08980bf1 upd: tambah satuan
Deskripsi:
- satuan luas tempat usaha
- satuan pendapatan perbulan
- pada tambah, edit, detail surat

No Issues
2026-02-06 14:39:58 +08:00
a2af3fbe36 Merge pull request 'upd: form tambah surat' (#114) from amalia/21-jan-26 into main
Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/114
2026-01-21 11:55:14 +08:00
ec8722ffba upd: form tambah surat
Deskripsi:
- fix select jenis surat pada saat selesai input

No Issue
2026-01-21 09:02:25 +08:00
b0752dac8d Merge pull request 'amalia/20-jan-26' (#113) from amalia/20-jan-26 into main
Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/113
2026-01-20 17:28:34 +08:00
a8d3a3a9ff fix: pelayanan surat
Deskripsi:
- mandatory pada form tambah pelayanan surat
- mandatory pada form update pelayanan surat

No Issues
2026-01-20 17:15:16 +08:00
f86703e7d1 rev: button cancel
Deskripsi:
- tambah button clear pada form file tambah pengajuan surat
- tambah button clear pada form file update data pengajuan surat

NO Issues
2026-01-20 10:48:37 +08:00
d8bb33cc93 Merge pull request 'amalia/15-jan-26' (#112) from amalia/15-jan-26 into main
Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/112
2026-01-15 14:33:16 +08:00
5807e98069 fix: tambah pengajuan surat pengantar skck
Deskripsi:
- link nya

No Issues
2026-01-15 14:32:28 +08:00
59b4f1d73f fix: surat keterangan kelahiran
Deskripsi:
- update value tanggal_lahir_ayah

No Issues
2026-01-15 14:19:05 +08:00
8bd552ac22 fix: pelayanan surat
Deskripsi:
- link surat

NO Issues
2026-01-15 14:09:32 +08:00
5d48d06513 Merge pull request 'fix : error surat' (#111) from amalia/15-jan-26 into main
Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/111
2026-01-15 11:54:25 +08:00
3da163ea1d fix : error surat 2026-01-15 11:53:10 +08:00
57e4f34eb6 Merge pull request 'amalia/14-jan-26' (#110) from amalia/14-jan-26 into main
Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/110
2026-01-14 17:43:11 +08:00
13 changed files with 1009 additions and 347 deletions

View File

@@ -0,0 +1,271 @@
-- CreateEnum
CREATE TYPE "StatusPengaduan" AS ENUM ('diterima', 'antrian', 'dikerjakan', 'ditolak', 'selesai');
-- CreateTable
CREATE TABLE "Role" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"permissions" JSONB,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Role_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"roleId" TEXT,
"name" TEXT,
"email" TEXT,
"password" TEXT,
"phone" TEXT,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "ApiKey" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"key" TEXT NOT NULL,
"description" TEXT,
"expiredAt" TIMESTAMP(3),
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "ApiKey_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Credential" (
"id" TEXT NOT NULL,
"name" TEXT,
"value" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Credential_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "CategoryPengaduan" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "CategoryPengaduan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Pengaduan" (
"id" TEXT NOT NULL,
"idCategory" TEXT NOT NULL,
"idWarga" TEXT NOT NULL,
"noPengaduan" TEXT NOT NULL,
"title" TEXT,
"detail" TEXT,
"location" TEXT,
"image" TEXT,
"keterangan" TEXT,
"status" "StatusPengaduan" NOT NULL DEFAULT 'antrian',
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Pengaduan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "HistoryPengaduan" (
"id" TEXT NOT NULL,
"idPengaduan" TEXT NOT NULL,
"idUser" TEXT,
"deskripsi" TEXT,
"status" "StatusPengaduan" NOT NULL DEFAULT 'antrian',
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "HistoryPengaduan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Warga" (
"id" TEXT NOT NULL,
"name" TEXT,
"phone" TEXT,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Warga_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "CategoryPelayanan" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"syaratDokumen" JSONB[],
"dataText" TEXT[] DEFAULT ARRAY[]::TEXT[],
"dataPelengkap" JSONB[] DEFAULT ARRAY[]::JSONB[],
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "CategoryPelayanan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "PelayananAjuan" (
"id" TEXT NOT NULL,
"idWarga" TEXT NOT NULL,
"idCategory" TEXT NOT NULL,
"noPengajuan" TEXT NOT NULL,
"status" "StatusPengaduan" NOT NULL DEFAULT 'antrian',
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "PelayananAjuan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "HistoryPelayanan" (
"id" TEXT NOT NULL,
"idPengajuanLayanan" TEXT NOT NULL,
"idUser" TEXT,
"deskripsi" TEXT,
"keteranganAlasan" TEXT,
"status" "StatusPengaduan" NOT NULL DEFAULT 'antrian',
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "HistoryPelayanan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "SyaratDokumenPelayanan" (
"id" TEXT NOT NULL,
"idPengajuanLayanan" TEXT NOT NULL,
"idCategory" TEXT NOT NULL,
"jenis" TEXT NOT NULL,
"value" TEXT NOT NULL,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "SyaratDokumenPelayanan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "DataTextPelayanan" (
"id" TEXT NOT NULL,
"idPengajuanLayanan" TEXT NOT NULL,
"idCategory" TEXT NOT NULL,
"jenis" TEXT NOT NULL,
"value" TEXT NOT NULL,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "DataTextPelayanan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "SuratPelayanan" (
"id" TEXT NOT NULL,
"idPengajuanLayanan" TEXT NOT NULL,
"idCategory" TEXT NOT NULL,
"idWarga" TEXT NOT NULL,
"noSurat" TEXT NOT NULL,
"file" TEXT,
"dateExpired" DATE,
"status" INTEGER NOT NULL DEFAULT 0,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "SuratPelayanan_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Configuration" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"value" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Configuration_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
-- CreateIndex
CREATE UNIQUE INDEX "User_phone_key" ON "User"("phone");
-- CreateIndex
CREATE UNIQUE INDEX "ApiKey_key_key" ON "ApiKey"("key");
-- CreateIndex
CREATE UNIQUE INDEX "Warga_phone_key" ON "Warga"("phone");
-- AddForeignKey
ALTER TABLE "User" ADD CONSTRAINT "User_roleId_fkey" FOREIGN KEY ("roleId") REFERENCES "Role"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "ApiKey" ADD CONSTRAINT "ApiKey_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Pengaduan" ADD CONSTRAINT "Pengaduan_idCategory_fkey" FOREIGN KEY ("idCategory") REFERENCES "CategoryPengaduan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Pengaduan" ADD CONSTRAINT "Pengaduan_idWarga_fkey" FOREIGN KEY ("idWarga") REFERENCES "Warga"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "HistoryPengaduan" ADD CONSTRAINT "HistoryPengaduan_idPengaduan_fkey" FOREIGN KEY ("idPengaduan") REFERENCES "Pengaduan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "HistoryPengaduan" ADD CONSTRAINT "HistoryPengaduan_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "PelayananAjuan" ADD CONSTRAINT "PelayananAjuan_idWarga_fkey" FOREIGN KEY ("idWarga") REFERENCES "Warga"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "PelayananAjuan" ADD CONSTRAINT "PelayananAjuan_idCategory_fkey" FOREIGN KEY ("idCategory") REFERENCES "CategoryPelayanan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "HistoryPelayanan" ADD CONSTRAINT "HistoryPelayanan_idPengajuanLayanan_fkey" FOREIGN KEY ("idPengajuanLayanan") REFERENCES "PelayananAjuan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "HistoryPelayanan" ADD CONSTRAINT "HistoryPelayanan_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "SyaratDokumenPelayanan" ADD CONSTRAINT "SyaratDokumenPelayanan_idPengajuanLayanan_fkey" FOREIGN KEY ("idPengajuanLayanan") REFERENCES "PelayananAjuan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "SyaratDokumenPelayanan" ADD CONSTRAINT "SyaratDokumenPelayanan_idCategory_fkey" FOREIGN KEY ("idCategory") REFERENCES "CategoryPelayanan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DataTextPelayanan" ADD CONSTRAINT "DataTextPelayanan_idPengajuanLayanan_fkey" FOREIGN KEY ("idPengajuanLayanan") REFERENCES "PelayananAjuan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DataTextPelayanan" ADD CONSTRAINT "DataTextPelayanan_idCategory_fkey" FOREIGN KEY ("idCategory") REFERENCES "CategoryPelayanan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "SuratPelayanan" ADD CONSTRAINT "SuratPelayanan_idPengajuanLayanan_fkey" FOREIGN KEY ("idPengajuanLayanan") REFERENCES "PelayananAjuan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "SuratPelayanan" ADD CONSTRAINT "SuratPelayanan_idCategory_fkey" FOREIGN KEY ("idCategory") REFERENCES "CategoryPelayanan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "SuratPelayanan" ADD CONSTRAINT "SuratPelayanan_idWarga_fkey" FOREIGN KEY ("idWarga") REFERENCES "Warga"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"

View File

@@ -23,7 +23,7 @@ export default function ModalSurat({
surat,
}: {
open: boolean;
onClose: (val: any) => void;
onClose: (val: { success: boolean, data: string }) => void;
surat: string;
}) {
const A4Style = {
@@ -35,7 +35,7 @@ export default function ModalSurat({
fontSize: "14px",
fontFamily: "Times New Roman",
};
const [uploading, setUploading] = useState<{ text: "Menyiapkan" | "Mengupload" | "Selesai", value: number }>({ text: "Menyiapkan", value: 10 })
const [uploading, setUploading] = useState<{ text: "Menyiapkan" | "Mengupload" | "Selesai" | "Gagal", value: number }>({ text: "Menyiapkan", value: 10 })
const hiddenRef = useRef<any>(null);
const { data, mutate, isLoading } = useSWR("surat", () =>
apiFetch.api.surat.detail.get({
@@ -45,6 +45,7 @@ export default function ModalSurat({
}),
);
useShallowEffect(() => {
mutate();
}, []);
@@ -95,9 +96,21 @@ export default function ModalSurat({
filename: resImg.data?.filename!,
});
setUploading({ text: "Selesai", value: 100 });
if (resUpdate?.data?.success) {
setUploading({ text: "Selesai", value: 100 });
setTimeout(() => {
onClose({ success: true, data: resUpdate.data?.link });
}, 1000)
} else {
setUploading({ text: "Gagal", value: 100 });
setTimeout(() => {
onClose({ success: false, data: "" });
}, 1000)
}
} else {
setUploading({ text: "Gagal", value: 100 });
setTimeout(() => {
onClose(resUpdate.data?.link);
onClose({ success: false, data: "" });
}, 1000)
}
@@ -110,7 +123,7 @@ export default function ModalSurat({
if (open) {
setTimeout(() => {
uploadPdf();
}, 5000);
}, 3000);
}
}, [surat, open]);

View File

@@ -7,7 +7,7 @@ export default function SKKelahiran({ data }: { data: any }) {
const getValue = (jenis: string) =>
_.upperFirst(
data.surat.dataText.find((item: any) => item.jenis === jenis)?.value ||
"",
"",
);
const loadImage = async () => {
@@ -161,7 +161,7 @@ export default function SKKelahiran({ data }: { data: any }) {
<tr>
<td>Tempat & Tanggal Lahir</td>
<td>:</td>
<td>{`${getValue("tempat_lahir_ayah")}, ${"tanggal_lahir_ayah"}`}</td>
<td>{`${getValue("tempat_lahir_ayah")}, ${getValue("tanggal_lahir_ayah")}`}</td>
</tr>
<tr>
<td>Pekerjaan</td>

View File

@@ -90,7 +90,7 @@ export default function SKTempatUsaha({ data }: { data: any }) {
<Row label="Bidang Usaha" value={getValue("bidang_usaha")} />
<Row label="Alamat Usaha" value={getValue("alamat_usaha")} />
<Row label="Status Tempat Usaha" value={getValue("status_tempat")} />
<Row label="Luas Tempat Usaha" value={getValue("luas_usaha")} />
<Row label="Luas Tempat Usaha" value={getValue("luas_usaha") + " m2"} />
<Row label="Jumlah Karyawan" value={getValue("jumlah_karyawan")} />
</div>

View File

@@ -20,6 +20,7 @@ import SuratRoute from "./server/routes/surat_route";
import TestPengaduanRoute from "./server/routes/test_pengaduan";
import UserRoute from "./server/routes/user_route";
import WargaRoute from "./server/routes/warga_route";
import NocRoute from "./server/routes/noc_route";
const Docs = new Elysia({
tags: ["docs"],
@@ -47,7 +48,8 @@ const Api = new Elysia({
.use(UserRoute)
.use(LayananRoute)
.use(AduanRoute)
.use(SendWaRoute);
.use(SendWaRoute)
.use(NocRoute);
const app = new Elysia()
.use(Api)

View File

@@ -8,472 +8,377 @@ export const categoryPelayananSurat = [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas di Wilayah Masing-masing"
desc: "Surat Pengantar Kelian Banjar Dinas di Wilayah Masing-masing",
required: true, satuan: null
},
{
key: "ktp_kk",
name: "KTP / KK",
desc: "Fotokopi KTP atau Kartu Keluarga"
desc: "Fotokopi KTP atau Kartu Keluarga",
required: true, satuan: null
},
{
key: "dokumen_beda",
name: "Dokumen Pendukung",
desc: "Fotokopi dokumen yang terdapat perbedaan biodata (ijazah, sertifikat, dll)"
desc: "Fotokopi dokumen yang terdapat perbedaan biodata (ijazah, sertifikat, dll)",
required: true, satuan: null
}
],
dataText: [],
dataPelengkap: [
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number" },
{ key: "nama", name: "Nama Lengkap", desc: "Nama sesuai KTP", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir pemohon", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir pemohon", type: "date" },
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number", required: true, satuan: null },
{ key: "nama", name: "Nama Lengkap", desc: "Nama sesuai KTP", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir pemohon", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir pemohon", type: "date", required: true, satuan: null },
{
key: "jenis_kelamin",
name: "Jenis Kelamin",
desc: "Jenis kelamin pemohon",
type: "enum",
options: enumJenisKelamin
options: enumJenisKelamin,
required: true, satuan: null
},
{ key: "alamat", name: "Alamat", desc: "Alamat lengkap tempat tinggal", type: "text" },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemohon", type: "text" },
{ key: "alamat", name: "Alamat", desc: "Alamat lengkap tempat tinggal", type: "text", required: true, satuan: null },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemohon", type: "text", required: true, satuan: null },
{
key: "dokumen",
name: "Nama Dokumen",
desc: "Jenis dokumen yang mengalami perbedaan biodata (cth : ijazah, sertifikat, dll)",
type: "text"
desc: "Jenis dokumen yang mengalami perbedaan biodata",
type: "text",
required: true, satuan: null
},
{
key: "data_dokumen",
name: "Data Dokumen",
desc: "Data dokumen yg berbeda (cth : nama, tempat lahir, tanggal lahir, jenis kelamin, alamat, pekerjaan)",
type: "text"
desc: "Data dokumen yg berbeda",
type: "text",
required: true, satuan: null
},
{
key: "dokumen_a",
name: "Data pada Dokumen A",
desc: "Data biodata yang tertulis pada dokumen pertama",
type: "text"
},
{
key: "dokumen_b",
name: "Data pada Dokumen B",
desc: "Data biodata yang tertulis pada dokumen kedua",
type: "text"
}
{ key: "dokumen_a", name: "Data pada Dokumen A", desc: "Data biodata pada dokumen pertama", type: "text", required: true, satuan: null },
{ key: "dokumen_b", name: "Data pada Dokumen B", desc: "Data biodata pada dokumen kedua", type: "text", required: true, satuan: null }
]
},
{
id: "skbelumkawin",
name: "Surat Keterangan Belum Kawin",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_kk",
name: "KTP / KK",
desc: "Fotokopi KTP atau Kartu Keluarga"
},
{
key: "akta_cerai",
name: "Akta Cerai",
desc: "Fotokopi akta cerai (jika berstatus janda/duda)"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_kk", name: "KTP / KK", desc: "Fotokopi KTP atau Kartu Keluarga", required: true, satuan: null },
{ key: "akta_cerai", name: "Akta Cerai", desc: "Fotokopi akta cerai (jika berstatus janda/duda)", required: false, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number" },
{ key: "nama", name: "Nama Lengkap", desc: "Nama sesuai KTP", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir pemohon", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir pemohon", type: "date" },
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number", required: true, satuan: null },
{ key: "nama", name: "Nama Lengkap", desc: "Nama sesuai KTP", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir pemohon", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir pemohon", type: "date", required: true, satuan: null },
{
key: "jenis_kelamin",
name: "Jenis Kelamin",
desc: "Jenis kelamin pemohon",
type: "enum",
options: enumJenisKelamin
options: enumJenisKelamin,
required: true, satuan: null
},
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text" },
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text", required: true, satuan: null },
{
key: "agama",
name: "Agama",
desc: "Agama pemohon",
type: "enum",
options: enumAgama
options: enumAgama,
required: true, satuan: null
},
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemohon", type: "text" }
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemohon", type: "text", required: true, satuan: null }
]
},
{
id: "skdomisiliorganisasi",
name: "Surat Keterangan Domisili Organisasi",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "skt_organisasi",
name: "SKT Organisasi",
desc: "Fotokopi SKT Organisasi atau pengukuhan kelompok"
},
{
key: "susunan_pengurus",
name: "Susunan Pengurus",
desc: "Susunan pengurus lengkap dengan kop organisasi"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "skt_organisasi", name: "SKT Organisasi", desc: "Fotokopi SKT Organisasi", required: true, satuan: null },
{ key: "susunan_pengurus", name: "Susunan Pengurus", desc: "Susunan pengurus organisasi", required: true, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nama_organisasi", name: "Nama Organisasi", desc: "Nama resmi organisasi", type: "text" },
{ key: "jenis_organisasi", name: "Jenis Organisasi", desc: "Jenis atau bentuk organisasi", type: "text" },
{ key: "alamat_organisasi", name: "Alamat Organisasi", desc: "Alamat sekretariat organisasi", type: "text" },
{ key: "no_telepon", name: "Nomor Telepon", desc: "Nomor telepon organisasi", type: "text" },
{ key: "nama_pimpinan", name: "Nama Pimpinan", desc: "Nama pimpinan organisasi", type: "text" },
{ key: "keperluan", name: "Keperluan", desc: "Keperluan pembuatan surat", type: "text" }
{ key: "nama_organisasi", name: "Nama Organisasi", desc: "Nama resmi organisasi", type: "text", required: true, satuan: null },
{ key: "jenis_organisasi", name: "Jenis Organisasi", desc: "Jenis organisasi", type: "text", required: true, satuan: null },
{ key: "alamat_organisasi", name: "Alamat Organisasi", desc: "Alamat sekretariat", type: "text", required: true, satuan: null },
{ key: "no_telepon", name: "Nomor Telepon", desc: "Nomor telepon organisasi", type: "text", required: true, satuan: null },
{ key: "nama_pimpinan", name: "Nama Pimpinan", desc: "Nama pimpinan", type: "text", required: true, satuan: null },
{ key: "keperluan", name: "Keperluan", desc: "Keperluan pembuatan surat", type: "text", required: true, satuan: null }
]
},
{
id: "skkelahiran",
name: "Surat Keterangan Kelahiran",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "surat_lahir",
name: "Surat Keterangan Lahir",
desc: "Surat keterangan lahir dari bidan/dokter (jika ada)"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "surat_lahir", name: "Surat Keterangan Lahir", desc: "Surat keterangan lahir dari bidan/dokter (jika ada)", required: false, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nama_anak", name: "Nama Anak", desc: "Nama bayi/anak", type: "text" },
{ key: "tanggal_lahir_anak", name: "Tanggal Lahir Anak", desc: "Tanggal lahir anak", type: "date" },
{ key: "pukul_lahir", name: "Pukul Lahir", desc: "Waktu kelahiran anak", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat kelahiran anak", type: "text" },
{ key: "nama_anak", name: "Nama Anak", desc: "Nama bayi/anak", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir_anak", name: "Tanggal Lahir Anak", desc: "Tanggal lahir anak", type: "date", required: true, satuan: null },
{ key: "pukul_lahir", name: "Pukul Lahir", desc: "Waktu kelahiran", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat kelahiran", type: "text", required: true, satuan: null },
{
key: "jenis_kelamin",
name: "Jenis Kelamin Anak",
desc: "Jenis kelamin anak",
type: "enum",
options: enumJenisKelamin
options: enumJenisKelamin,
required: true, satuan: null
},
{ key: "anak_ke", name: "Anak Ke-", desc: "Urutan kelahiran anak", type: "number" },
{ key: "nik_ibu", name: "NIK Ibu", desc: "NIK ibu kandung", type: "number" },
{ key: "nama_ibu", name: "Nama Ibu", desc: "Nama lengkap ibu", type: "text" },
{ key: "tempat_lahir_ibu", name: "Tempat Lahir Ibu", desc: "Tempat lahir ibu kandung", type: "text" },
{ key: "tanggal_lahir_ibu", name: "Tanggal Lahir Ibu", desc: "Tanggal lahir ibu kandung", type: "date" },
{ key: "pekerjaan_ibu", name: "Pekerjaan Ibu", desc: "Pekerjaan ibu kandung", type: "text" },
{ key: "alamat_ibu", name: "Alamat Ibu", desc: "Alamat ibu kandung", type: "text" },
{ key: "nama_ayah", name: "Nama Ayah", desc: "Nama lengkap ayah", type: "text" },
{ key: "nik_ayah", name: "NIK Ayah", desc: "NIK ayah kandung", type: "number" },
{ key: "tempat_lahir_ayah", name: "Tempat Lahir Ayah", desc: "Tempat lahir ayah kandung", type: "text" },
{ key: "tanggal_lahir_ayah", name: "Tanggal Lahir Ayah", desc: "Tanggal lahir ayah kandung", type: "date" },
{ key: "pekerjaan_ayah", name: "Pekerjaan Ayah", desc: "Pekerjaan ayah kandung", type: "text" },
{ key: "alamat_ayah", name: "Alamat Ayah", desc: "Alamat ayah kandung", type: "text" },
{ key: "nama_pelapor", name: "Nama Pelapor", desc: "Nama pihak yang melaporkan", type: "text" },
{ key: "hubungan_pelapor", name: "Hubungan Pelapor", desc: "Hubungan pelapor dengan anak", type: "text" },
{ key: "alamat_pelapor", name: "Alamat Pelapor", desc: "Alamat pelapor", type: "text" }
{ key: "anak_ke", name: "Anak Ke-", desc: "Urutan kelahiran", type: "number", required: true, satuan: null },
{ key: "nik_ibu", name: "NIK Ibu", desc: "NIK ibu kandung", type: "number", required: true, satuan: null },
{ key: "nama_ibu", name: "Nama Ibu", desc: "Nama ibu kandung", type: "text", required: true, satuan: null },
{ key: "tempat_lahir_ibu", name: "Tempat Lahir Ibu", desc: "Tempat lahir ibu", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir_ibu", name: "Tanggal Lahir Ibu", desc: "Tanggal lahir ibu", type: "date", required: true, satuan: null },
{ key: "pekerjaan_ibu", name: "Pekerjaan Ibu", desc: "Pekerjaan ibu", type: "text", required: true, satuan: null },
{ key: "alamat_ibu", name: "Alamat Ibu", desc: "Alamat ibu", type: "text", required: true, satuan: null },
{ key: "nama_ayah", name: "Nama Ayah", desc: "Nama ayah kandung", type: "text", required: true, satuan: null },
{ key: "nik_ayah", name: "NIK Ayah", desc: "NIK ayah kandung", type: "number", required: true, satuan: null },
{ key: "tempat_lahir_ayah", name: "Tempat Lahir Ayah", desc: "Tempat lahir ayah", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir_ayah", name: "Tanggal Lahir Ayah", desc: "Tanggal lahir ayah", type: "date", required: true, satuan: null },
{ key: "pekerjaan_ayah", name: "Pekerjaan Ayah", desc: "Pekerjaan ayah", type: "text", required: true, satuan: null },
{ key: "alamat_ayah", name: "Alamat Ayah", desc: "Alamat ayah", type: "text", required: true, satuan: null },
{ key: "nama_pelapor", name: "Nama Pelapor", desc: "Nama pelapor", type: "text", required: true, satuan: null },
{ key: "hubungan_pelapor", name: "Hubungan Pelapor", desc: "Hubungan dengan anak", type: "text", required: true, satuan: null },
{ key: "alamat_pelapor", name: "Alamat Pelapor", desc: "Alamat pelapor", type: "text", required: true, satuan: null }
]
},
{
id: "skkelakuanbaik",
name: "Surat Keterangan Kelakuan Baik (Pengantar SKCK)",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_kk",
name: "KTP / KK",
desc: "Fotokopi KTP atau Kartu Keluarga"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_kk", name: "KTP / KK", desc: "Fotokopi KTP atau KK", required: true, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number" },
{ key: "nama", name: "Nama Lengkap", desc: "Nama sesuai KTP", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date" },
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number", required: true, satuan: null },
{ key: "nama", name: "Nama Lengkap", desc: "Nama sesuai KTP", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date", required: true, satuan: null },
{
key: "jenis_kelamin",
name: "Jenis Kelamin",
desc: "Jenis kelamin pemohon",
desc: "Jenis kelamin",
type: "enum",
options: enumJenisKelamin
options: enumJenisKelamin,
required: true, satuan: null
},
{
key: "agama",
name: "Agama",
desc: "Agama pemohon",
desc: "Agama",
type: "enum",
options: enumAgama
options: enumAgama,
required: true, satuan: null
},
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text" },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemohon", type: "text" },
{ key: "polsek", name: "Polsek Tujuan", desc: "Polsek tujuan pembuatan SKCK", type: "text" }
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text", required: true, satuan: null },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan", type: "text", required: true, satuan: null },
{ key: "polsek", name: "Polsek Tujuan", desc: "Polsek tujuan", type: "text", required: true, satuan: null }
]
},
{
id: "skkematian",
name: "Surat Keterangan Kematian",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_kk",
name: "KTP / KK",
desc: "Fotokopi KTP atau Kartu Keluarga"
},
{
key: "surat_kematian",
name: "Surat Keterangan Kematian",
desc: "Surat keterangan kematian dari rumah sakit/dokter (jika ada)"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_kk", name: "KTP / KK", desc: "Fotokopi KTP atau KK", required: true, satuan: null },
{ key: "surat_kematian", name: "Surat Keterangan Kematian", desc: "Surat keterangan kematian dari rumah sakit/dokter (jika ada)", required: false, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nik_pelapor", name: "NIK Pelapor", desc: "Nomor Induk Kependudukan pelapor", type: "number" },
{ key: "nama_pelapor", name: "Nama Pelapor", desc: "Nama lengkap pelapor", type: "text" },
{ key: "pekerjaan_pelapor", name: "Pekerjaan Pelapor", desc: "Pekerjaan pelapor", type: "text" },
{ key: "alamat_pelapor", name: "Alamat Pelapor", desc: "Alamat tempat tinggal pelapor", type: "text" },
{ key: "hubungan_pelapor", name: "Hubungan dengan Almarhum", desc: "Hubungan pelapor dengan almarhum", type: "text" },
{ key: "nama_almarhum", name: "Nama Almarhum", desc: "Nama lengkap almarhum", type: "text" },
{ key: "nik_almarhum", name: "NIK Almarhum", desc: "Nomor Induk Kependudukan almarhum", type: "number" },
{ key: "tempat_lahir_almarhum", name: "Tempat Lahir Almarhum", desc: "Tempat lahir almarhum", type: "text" },
{ key: "tanggal_lahir_almarhum", name: "Tanggal Lahir Almarhum", desc: "Tanggal lahir almarhum", type: "date" },
{ key: "alamat_almarhum", name: "Alamat Almarhum", desc: "Alamat terakhir almarhum", type: "text" },
{ key: "nik_pelapor", name: "NIK Pelapor", desc: "NIK pelapor", type: "number", required: true, satuan: null },
{ key: "nama_pelapor", name: "Nama Pelapor", desc: "Nama pelapor", type: "text", required: true, satuan: null },
{ key: "pekerjaan_pelapor", name: "Pekerjaan Pelapor", desc: "Pekerjaan pelapor", type: "text", required: true, satuan: null },
{ key: "alamat_pelapor", name: "Alamat Pelapor", desc: "Alamat pelapor", type: "text", required: true, satuan: null },
{ key: "hubungan_pelapor", name: "Hubungan Pelapor", desc: "Hubungan dengan almarhum", type: "text", required: true, satuan: null },
{ key: "nama_almarhum", name: "Nama Almarhum", desc: "Nama almarhum", type: "text", required: true, satuan: null },
{ key: "nik_almarhum", name: "NIK Almarhum", desc: "NIK almarhum", type: "number", required: true, satuan: null },
{ key: "tempat_lahir_almarhum", name: "Tempat Lahir", desc: "Tempat lahir almarhum", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir_almarhum", name: "Tanggal Lahir", desc: "Tanggal lahir almarhum", type: "date", required: true, satuan: null },
{ key: "alamat_almarhum", name: "Alamat", desc: "Alamat terakhir", type: "text", required: true, satuan: null },
{
key: "agama_almarhum",
name: "Agama Almarhum",
desc: "Agama almarhum",
type: "enum",
options: enumAgama
options: enumAgama,
required: true, satuan: null
},
{ key: "tanggal_kematian", name: "Tanggal Kematian", desc: "Tanggal meninggal dunia", type: "date" },
{ key: "waktu_kematian", name: "Waktu Kematian", desc: "Waktu meninggal dunia", type: "text" },
{ key: "tempat_kematian", name: "Tempat Kematian", desc: "Tempat meninggal dunia", type: "text" },
{ key: "penyebab_kematian", name: "Penyebab Kematian", desc: "Penyebab meninggal dunia", type: "text" }
{ key: "tanggal_kematian", name: "Tanggal Kematian", desc: "Tanggal meninggal dunia", type: "date", required: true, satuan: null },
{ key: "waktu_kematian", name: "Waktu Kematian", desc: "Waktu meninggal dunia", type: "text", required: true, satuan: null },
{ key: "tempat_kematian", name: "Tempat Kematian", desc: "Tempat meninggal dunia", type: "text", required: true, satuan: null },
{ key: "penyebab_kematian", name: "Penyebab Kematian", desc: "Penyebab meninggal dunia", type: "text", required: true, satuan: null }
]
},
{
id: "skpenghasilan",
name: "Surat Keterangan Penghasilan",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_ortu_kk",
name: "KTP Orang Tua / KK",
desc: "Fotokopi KTP orang tua atau Kartu Keluarga"
},
{
key: "surat_pernyataan",
name: "Surat Pernyataan",
desc: "Surat pernyataan penghasilan bermaterai"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_ortu_kk", name: "KTP Orang Tua / KK", desc: "Fotokopi KTP orang tua/KK", required: true, satuan: null },
{ key: "surat_pernyataan", name: "Surat Pernyataan Penghasilan", desc: "Surat pernyataan penghasilan bermaterai", required: true, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nama", name: "Nama Lengkap", desc: "Nama pemohon", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date" },
{ key: "nama", name: "Nama Lengkap", desc: "Nama pemohon", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date", required: true, satuan: null },
{
key: "jenis_kelamin",
name: "Jenis Kelamin",
desc: "Jenis kelamin pemohon",
desc: "Jenis kelamin",
type: "enum",
options: enumJenisKelamin
options: enumJenisKelamin,
required: true, satuan: null
},
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text" },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemohon/orang tua", type: "text" },
{ key: "penghasilan", name: "Penghasilan", desc: "Jumlah penghasilan per bulan", type: "number" },
{ key: "alasan", name: "Alasan Permohonan", desc: "Alasan pengajuan surat penghasilan", type: "text" }
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text", required: true, satuan: null },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemohon", type: "text", required: true, satuan: null },
{ key: "penghasilan", name: "Penghasilan", desc: "Jumlah penghasilan per bulan", type: "number", required: true, satuan: "/Bulan" },
{ key: "alasan", name: "Alasan Permohonan", desc: "Alasan pengajuan surat penghasilan", type: "text", required: true, satuan: null }
]
},
{
id: "sktempatusaha",
name: "Surat Keterangan Tempat Usaha",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_kk",
name: "KTP / KK",
desc: "Fotokopi KTP atau Kartu Keluarga"
},
{
key: "foto_lokasi",
name: "Foto Lokasi Usaha",
desc: "Foto lokasi usaha dicetak dan distempel oleh Kelian"
},
{
key: "dokumen_lahan",
name: "Dokumen Lahan",
desc: "SPPT, Sertifikat, atau surat sewa tempat usaha"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_kk", name: "KTP / KK", desc: "Fotokopi KTP/KK", required: true, satuan: null },
{ key: "foto_lokasi", name: "Foto Lokasi Usaha", desc: "Foto lokasi usaha", required: true, satuan: null },
{ key: "dokumen_lahan", name: "Dokumen Lahan", desc: "SPPT/Sertifikat/surat sewa tempat usaha", required: true, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number" },
{ key: "nama_pemilik", name: "Nama Pemilik", desc: "Nama pemilik usaha", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date" },
{ key: "alamat_pemilik", name: "Alamat Pemilik", desc: "Alamat pemilik usaha", type: "text" },
{ key: "nama_usaha", name: "Nama Usaha", desc: "Nama usaha", type: "text" },
{ key: "bidang_usaha", name: "Bidang Usaha", desc: "Bidang atau jenis usaha", type: "text" },
{ key: "alamat_usaha", name: "Alamat Usaha", desc: "Alamat lokasi usaha", type: "text" },
{ key: "status_tempat", name: "Status Tempat Usaha", desc: "Status kepemilikan tempat usaha", type: "enum", options: enumStatusTempatUsaha },
{ key: "luas_usaha", name: "Luas Tempat Usaha", desc: "Luas tempat usaha (m²)", type: "number" },
{ key: "jumlah_karyawan", name: "Jumlah Karyawan", desc: "Jumlah tenaga kerja", type: "number" },
{ key: "tujuan", name: "Tujuan Pembuatan Surat", desc: "Tujuan pembuatan surat keterangan", type: "text" }
{ key: "nik", name: "NIK", desc: "NIK pemilik", type: "number", required: true, satuan: null },
{ key: "nama_pemilik", name: "Nama Pemilik", desc: "Nama pemilik usaha", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date", required: true, satuan: null },
{ key: "alamat_pemilik", name: "Alamat Pemilik", desc: "Alamat pemilik", type: "text", required: true, satuan: null },
{ key: "nama_usaha", name: "Nama Usaha", desc: "Nama usaha", type: "text", required: true, satuan: null },
{ key: "bidang_usaha", name: "Bidang Usaha", desc: "Bidang usaha", type: "text", required: true, satuan: null },
{ key: "alamat_usaha", name: "Alamat Usaha", desc: "Alamat usaha", type: "text", required: true, satuan: null },
{
key: "status_tempat",
name: "Status Tempat Usaha",
desc: "Status kepemilikan tempat usaha",
type: "enum",
options: enumStatusTempatUsaha,
required: true, satuan: null
},
{ key: "luas_usaha", name: "Luas Tempat Usaha", desc: "Luas tempat usaha (m²)", type: "number", required: true, satuan: "m²" },
{ key: "jumlah_karyawan", name: "Jumlah Karyawan", desc: "Jumlah karyawan", type: "number", required: true, satuan: null },
{ key: "tujuan", name: "Tujuan Pembuatan Surat", desc: "Tujuan pembuatan surat keterangan", type: "text", required: true, satuan: null }
]
},
{
id: "sktidakmampu",
name: "Surat Keterangan Tidak Mampu",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_kia_kk",
name: "KTP / KIA / KK",
desc: "Fotokopi KTP, KIA, atau Kartu Keluarga"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_kia_kk", name: "KTP / KIA / KK", desc: "Fotokopi KTP/KIA/KK", required: true, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan pemohon", type: "number" },
{ key: "nama", name: "Nama Lengkap", desc: "Nama lengkap pemohon", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir pemohon", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir pemohon", type: "date" },
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal pemohon", type: "text" },
{ key: "alasan", name: "Alasan Permohonan", desc: "Alasan pengajuan Surat Keterangan Tidak Mampu", type: "text" }
{ key: "nik", name: "NIK", desc: "NIK pemohon", type: "number", required: true, satuan: null },
{ key: "nama Lengkap", name: "Nama", desc: "Nama pemohon", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date", required: true, satuan: null },
{ key: "alamat", name: "Alamat", desc: "Alamat pemohon", type: "text", required: true, satuan: null },
{ key: "alasan", name: "Alasan Permohonan", desc: "Alasan permohonan", type: "text", required: true, satuan: null }
]
},
{
id: "skusaha",
name: "Surat Keterangan Usaha",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_kk",
name: "KTP / KK",
desc: "Fotokopi KTP atau Kartu Keluarga"
},
{
key: "foto_lokasi",
name: "Foto Lokasi Usaha",
desc: "Foto lokasi usaha dicetak dan distempel oleh Kelian"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_kk", name: "KTP / KK", desc: "Fotokopi KTP/KK", required: true, satuan: null },
{ key: "foto_lokasi", name: "Foto Lokasi Usaha", desc: "Foto lokasi usaha", required: true, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nama", name: "Nama Lengkap", desc: "Nama pemilik usaha", type: "text" },
{ key: "nama", name: "Nama Lengkap", desc: "Nama pemilik usaha", type: "text", required: true, satuan: null },
{
key: "jenis_kelamin",
name: "Jenis Kelamin",
desc: "Jenis kelamin pemilik usaha",
type: "enum",
options: enumJenisKelamin
options: enumJenisKelamin,
required: true, satuan: null
},
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date" },
{ key: "negara", name: "Kewarganegaraan", desc: "Kewarganegaraan pemilik usaha", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date", required: true, satuan: null },
{ key: "negara", name: "Kewarganegaraan", desc: "Kewarganegaraan", type: "text", required: true, satuan: null },
{
key: "agama",
name: "Agama",
desc: "Agama pemilik usaha",
desc: "Agama",
type: "enum",
options: enumAgama
options: enumAgama,
required: true, satuan: null
},
{
key: "status_perkawinan",
name: "Status Perkawinan",
desc: "Status perkawinan",
type: "enum",
options: enumStatusPerkawinan
options: enumStatusPerkawinan,
required: true, satuan: null
},
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text" },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan pemilik usaha", type: "text" },
{ key: "jenis_usaha", name: "Jenis Usaha", desc: "Jenis usaha yang dijalankan", type: "text" },
{ key: "alamat_usaha", name: "Alamat Usaha", desc: "Alamat lokasi usaha", type: "text" }
{ key: "alamat", name: "Alamat", desc: "Alamat", type: "text", required: true, satuan: null },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan", type: "text", required: true, satuan: null },
{ key: "jenis_usaha", name: "Jenis Usaha", desc: "Jenis usaha", type: "text", required: true, satuan: null },
{ key: "alamat_usaha", name: "Alamat Usaha", desc: "Alamat usaha", type: "text", required: true, satuan: null }
]
},
{
id: "skyatimpiatu",
name: "Surat Keterangan Yatim / Piatu / Yatim Piatu",
syaratDokumen: [
{
key: "pengantar_kelian",
name: "Pengantar Kelian",
desc: "Surat Pengantar Kelian Banjar Dinas"
},
{
key: "ktp_kia_kk",
name: "KTP / KIA / KK",
desc: "Fotokopi KTP, KIA, atau Kartu Keluarga"
}
{ key: "pengantar_kelian", name: "Pengantar Kelian", desc: "Surat Pengantar Kelian Banjar Dinas", required: true, satuan: null },
{ key: "ktp_kia_kk", name: "KTP / KIA / KK", desc: "Fotokopi KTP/KIA/KK", required: true, satuan: null }
],
dataText: [],
dataPelengkap: [
{ key: "nik", name: "NIK", desc: "Nomor Induk Kependudukan", type: "number" },
{ key: "nama", name: "Nama Lengkap", desc: "Nama anak", type: "text" },
{ key: "tempat_lahir", name: "Tempat Lahir Anak", desc: "Tempat lahir anak", type: "text" },
{ key: "tanggal_lahir", name: "Tanggal Lahir Anak", desc: "Tanggal lahir anak", type: "date" },
{ key: "nik", name: "NIK", desc: "NIK anak", type: "number", required: true, satuan: null },
{ key: "nama", name: "Nama", desc: "Nama anak", type: "text", required: true, satuan: null },
{ key: "tempat_lahir", name: "Tempat Lahir", desc: "Tempat lahir", type: "text", required: true, satuan: null },
{ key: "tanggal_lahir", name: "Tanggal Lahir", desc: "Tanggal lahir", type: "date", required: true, satuan: null },
{
key: "jenis_kelamin",
name: "Jenis Kelamin",
desc: "Jenis kelamin anak",
type: "enum",
options: enumJenisKelamin
options: enumJenisKelamin,
required: true, satuan: null
},
{ key: "alamat", name: "Alamat", desc: "Alamat tempat tinggal", type: "text" },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan (jika ada)", type: "text" },
{ key: "nama_ayah", name: "Nama Ayah", desc: "Nama ayah kandung", type: "text" },
{ key: "alamat", name: "Alamat", desc: "Alamat", type: "text", required: true, satuan: null },
{ key: "pekerjaan", name: "Pekerjaan", desc: "Pekerjaan (jika ada)", type: "text", required: false, satuan: null },
{ key: "nama_ayah", name: "Nama Ayah", desc: "Nama ayah", type: "text", required: true, satuan: null },
{
key: "status_ayah",
name: "Status Ayah",
desc: "Status ayah (hidup / meninggal)",
desc: "Status ayah",
type: "enum",
options: enumStatusHidup
options: enumStatusHidup,
required: true, satuan: null
},
{ key: "nama_ibu", name: "Nama Ibu", desc: "Nama ibu kandung", type: "text" },
{ key: "nama_ibu", name: "Nama Ibu", desc: "Nama ibu", type: "text", required: true, satuan: null },
{
key: "status_ibu",
name: "Status Ibu",
desc: "Status ibu (hidup / meninggal)",
desc: "Status ibu",
type: "enum",
options: enumStatusHidup
options: enumStatusHidup,
required: true, satuan: null
}
]
}
];

View File

@@ -31,7 +31,7 @@ import {
IconInfoCircle,
IconNotes,
IconPhone,
IconUpload,
IconUpload
} from "@tabler/icons-react";
import dayjs from "dayjs";
import "dayjs/locale/id";
@@ -42,6 +42,7 @@ import useSWR from "swr";
type DataItem = {
key: string;
value: string;
required: boolean;
};
type FormSurat = {
@@ -96,7 +97,7 @@ export default function FormSurat() {
setJenisSuratFix({ name: "", id: "" });
} else {
const namaJenis = fromSlug(jenisSurat);
const data = listCategory.find((item: any) => item.name == namaJenis);
const data = listCategory.find((item: any) => item.name.toUpperCase() == namaJenis.toUpperCase());
if (!data) return;
setJenisSuratFix(data);
}
@@ -119,15 +120,17 @@ export default function FormSurat() {
nama: "",
phone: "",
dataPelengkap: (get.data?.dataPelengkap || []).map(
(item: { key: string }) => ({
(item: { key: string, required: boolean }) => ({
key: item.key,
value: "",
required: item.required
}),
),
syaratDokumen: (get.data?.syaratDokumen || []).map(
(item: { key: string }) => ({
(item: { key: string, required: boolean }) => ({
key: item.key,
value: "",
required: item.required
}),
),
});
@@ -167,7 +170,7 @@ export default function FormSurat() {
if (Array.isArray(value)) {
return value.some(
(item) =>
typeof item.value === "string" && item.value.trim() === "",
(typeof item.value === "string" && item.value.trim() === "" && item.required) || (typeof item.value === "object" && item.value === null && item.required),
);
}
return typeof value === "string" && value.trim() === "";
@@ -276,13 +279,14 @@ export default function FormSurat() {
value: any;
}) {
if (key === "dataPelengkap" || key === "syaratDokumen") {
const errorMsg = validateField(value.key, value.value);
setErrors((prev) => ({
...prev,
[value.key]: errorMsg,
}));
if (value.required == true) {
const errorMsg = validateField(value.key, value.value);
setErrors((prev) => ({
...prev,
[value.key]: errorMsg,
}));
}
setFormSurat((prev) => ({
...prev,
[key]: updateArrayByKey(prev[key], value.key, value.value),
@@ -381,7 +385,7 @@ export default function FormSurat() {
value: item.name,
label: item.name,
}))}
value={jenisSuratFix.name}
value={jenisSuratFix.name == "" ? null : jenisSuratFix.name}
onChange={(value) => {
const slug = toSlug(String(value));
navigate("/darmasaba/surat?jenis=" + slug);
@@ -400,7 +404,7 @@ export default function FormSurat() {
<Grid>
<Grid.Col span={6}>
<TextInput
label={<FieldLabel label="Nama" hint="Nama kontak" />}
label={<FieldLabel label="Nama" hint="Nama kontak" required />}
placeholder="Budi Setiawan"
value={formSurat.nama}
error={errors.nama_kontak}
@@ -414,6 +418,7 @@ export default function FormSurat() {
<TextInput
label={
<FieldLabel
required
label="Nomor Telephone"
hint="Nomor telephone yang dapat dihubungi / terhubung dengan whatsapp"
/>
@@ -450,6 +455,7 @@ export default function FormSurat() {
<FieldLabel
label={item.name}
hint={item.desc}
required={item.required}
/>
}
data={item.options ?? []}
@@ -457,7 +463,7 @@ export default function FormSurat() {
onChange={(e) => {
validationForm({
key: "dataPelengkap",
value: { key: item.key, value: e },
value: { key: item.key, value: e, required: item.required },
});
}}
value={
@@ -474,6 +480,7 @@ export default function FormSurat() {
<FieldLabel
label={item.name}
hint={item.desc}
required={item.required}
/>
}
placeholder={item.name}
@@ -488,6 +495,7 @@ export default function FormSurat() {
value: {
key: item.key,
value: formatted,
required: item.required,
},
});
}}
@@ -500,6 +508,7 @@ export default function FormSurat() {
<FieldLabel
label={item.name}
hint={item.desc}
required={item.required}
/>
}
placeholder={item.name}
@@ -509,6 +518,7 @@ export default function FormSurat() {
value: {
key: item.key,
value: e.target.value,
required: item.required,
},
})
}
@@ -517,6 +527,10 @@ export default function FormSurat() {
(n: any) => n.key == item.key,
)?.value
}
rightSection={
item.satuan != null &&
<Text mr={"lg"}>{item.satuan}</Text>
}
/>
)}
</Grid.Col>
@@ -545,6 +559,7 @@ export default function FormSurat() {
})
}
name={item.name}
required={item.required}
/>
</Grid.Col>
),
@@ -569,10 +584,20 @@ export default function FormSurat() {
);
}
function FieldLabel({ label, hint }: { label: string; hint?: string }) {
function FieldLabel({ label, hint, required = false, }: { label: string; hint?: string; required?: boolean; }) {
return (
<Group justify="apart" gap="xs" align="center">
<Text fw={600}>{label}</Text>
<Group gap={4} align="center">
<Text fw={600}>
{label}
{required && (
<Text span c="red" ml={4}>
*
</Text>
)}
</Text>
</Group>
{hint && (
<Tooltip label={hint} withArrow>
<ActionIcon size={24} variant="subtle">
@@ -584,6 +609,7 @@ function FieldLabel({ label, hint }: { label: string; hint?: string }) {
);
}
function FormSection({
title,
icon,
@@ -619,6 +645,7 @@ function FileInputWrapper({
preview,
name,
description,
required = false,
}: {
label: string;
placeholder?: string;
@@ -627,12 +654,20 @@ function FileInputWrapper({
preview?: string | null;
name: string;
description?: string;
required?: boolean;
}) {
return (
<Stack gap="xs">
<Flex direction={"column"}>
<Group justify="apart" align="center">
<Text fw={500}>{label}</Text>
<Text fw={500}>
{label}
{required && (
<Text span c="red" ml={4}>
*
</Text>
)}
</Text>
</Group>
{description && (
<Text size="sm" c="dimmed" mt={4} style={{ lineHeight: 1.2 }}>
@@ -648,6 +683,7 @@ function FileInputWrapper({
leftSection={<IconUpload />}
aria-label={label}
name={name}
clearable={true}
/>
{preview ? (

View File

@@ -50,6 +50,7 @@ type UpdateDataItem = {
id: string;
key: string;
value: any;
required: boolean;
};
type FormSurat = {
@@ -125,10 +126,20 @@ export default function UpdateDataSurat() {
);
}
function FieldLabel({ label, hint }: { label: string; hint?: string }) {
function FieldLabel({ label, hint, required = false, }: { label: string; hint?: string; required?: boolean; }) {
return (
<Group justify="apart" gap="xs" align="center">
<Text fw={600}>{label}</Text>
<Group gap={4} align="center">
<Text fw={600}>
{label}
{required && (
<Text span c="red" ml={4}>
*
</Text>
)}
</Text>
</Group>
{hint && (
<Tooltip label={hint} withArrow>
<ActionIcon size={24} variant="subtle">
@@ -139,7 +150,6 @@ function FieldLabel({ label, hint }: { label: string; hint?: string }) {
</Group>
);
}
function FormSection({
title,
icon,
@@ -185,6 +195,8 @@ function FileInputWrapper({
description,
linkView,
disabled,
required = false,
}: {
label: string;
placeholder?: string;
@@ -195,6 +207,7 @@ function FileInputWrapper({
name: string;
description?: string;
disabled?: boolean;
required?: boolean;
}) {
const [viewImg, setViewImg] = useState("");
const [openedPreviewFile, setOpenedPreviewFile] = useState(false);
@@ -219,7 +232,14 @@ function FileInputWrapper({
<Stack gap="xs">
<Flex direction={"column"}>
<Group justify="apart" align="center">
<Text fw={500}>{label}</Text>
<Text fw={500}>
{label}
{required && (
<Text span c="red" ml={4}>
*
</Text>
)}
</Text>
</Group>
{description && (
<Text size="sm" c="dimmed" mt={4} style={{ lineHeight: 1.2 }}>
@@ -241,6 +261,7 @@ function FileInputWrapper({
aria-label={label}
name={name}
disabled={disabled}
clearable={true}
/>
{preview ? (
@@ -477,21 +498,33 @@ function DataUpdate({
kategori: "dataPelengkap" | "syaratDokumen";
value: UpdateDataItem;
}) {
const errorMsg = validateField(value.key, value.value);
if (kategori == "syaratDokumen" && value.value == null) {
setFormSurat((prev) => ({
...prev,
syaratDokumen: prev.syaratDokumen.filter(
(item) => item.id !== value.id
),
}));
} else {
if (value.required == true) {
const errorMsg = validateField(value.key, value.value);
setErrors((prev) => ({
...prev,
[value.id]: errorMsg,
}));
}
setErrors((prev) => ({
...prev,
[value.id]: errorMsg,
}));
setFormSurat((prev) => ({
...prev,
[kategori]: upsertById(prev[kategori], {
id: value.id,
key: value.key,
value: value.value,
}),
}));
setFormSurat((prev) => ({
...prev,
[kategori]: upsertById(prev[kategori], {
id: value.id,
key: value.key,
value: value.value,
required: value.required,
}),
}));
}
}
@@ -528,7 +561,7 @@ function DataUpdate({
if (Array.isArray(value)) {
return value.some(
(item) =>
typeof item.value === "string" && item.value.trim() === "",
(typeof item.value === "string" && item.value.trim() === "" && item.required) || (typeof item.value === "object" && item.value === null && item.required),
);
}
@@ -676,13 +709,13 @@ function DataUpdate({
<Select
disabled={status != "ditolak" && status != "antrian"}
allowDeselect={false}
label={<FieldLabel label={item.name} hint={item.desc} />}
label={<FieldLabel label={item.name} hint={item.desc} required={item.required} />}
data={item.options ?? []}
placeholder={item.name}
onChange={(e) => {
validationForm({
kategori: "dataPelengkap",
value: { id: item.id, key: item.key, value: e },
value: { id: item.id, key: item.key, value: e, required: item.required },
});
}}
value={
@@ -697,7 +730,7 @@ function DataUpdate({
disabled={status != "ditolak" && status != "antrian"}
locale="id"
valueFormat="DD MMMM YYYY"
label={<FieldLabel label={item.name} hint={item.desc} />}
label={<FieldLabel label={item.name} hint={item.desc} required={item.required} />}
placeholder={item.name}
onChange={(e) => {
const formatted = e
@@ -709,6 +742,7 @@ function DataUpdate({
id: item.id,
key: item.key,
value: formatted,
required: item.required
},
});
}}
@@ -727,7 +761,7 @@ function DataUpdate({
) : (
<TextInput
error={errors[item.id]}
label={<FieldLabel label={item.name} hint={item.desc} />}
label={<FieldLabel label={item.name} hint={item.desc} required={item.required} />}
placeholder={item.name}
type={item.type}
onChange={(e) =>
@@ -737,6 +771,7 @@ function DataUpdate({
id: item.id,
key: item.key,
value: e.target.value,
required: item.required,
},
})
}
@@ -746,6 +781,10 @@ function DataUpdate({
dataPelengkap.find((n: any) => n.key == item.key)?.value
}
disabled={status != "ditolak" && status != "antrian"}
rightSection={
item.satuan != null &&
<Text mr={"lg"}>{item.satuan}</Text>
}
/>
)}
</Grid.Col>
@@ -754,7 +793,7 @@ function DataUpdate({
</FormSection>
<FormSection
title="Syarat Dokumen"
title="Syarat Dokumen hjh"
description="Syarat dokumen yang diperlukan"
icon={<IconFiles size={16} />}
>
@@ -762,6 +801,7 @@ function DataUpdate({
{dataSyaratDokumen.map((item: any, index: number) => (
<Grid.Col span={6} key={index}>
<FileInputWrapper
required={item.required}
label={item.desc}
placeholder={"Upload file terbaru untuk mengupdate"}
accept="image/*,application/pdf"
@@ -769,7 +809,7 @@ function DataUpdate({
onChange={(file) =>
validationForm({
kategori: "syaratDokumen",
value: { id: item.id, key: item.key, value: file },
value: { id: item.id, key: item.key, value: file, required: item.required },
})
}
name={item.name}

View File

@@ -123,7 +123,7 @@ function DetailDataPengajuan({
const [permissions, setPermissions] = useState<JsonValue[]>([]);
const [viewImg, setViewImg] = useState({ file: "", folder: "" });
const [uploading, setUploading] = useState({ ok: false, file: "" });
const [editValue, setEditValue] = useState({ id: "", jenis: "", val: "", option: null as any, type: "", key: "" })
const [editValue, setEditValue] = useState({ id: "", jenis: "", val: "", satuan: null as string | null, option: null as any, type: "", key: "" })
const [openEdit, setOpenEdit] = useState(false)
const [loadingUpdate, setLoadingUpdate] = useState(false)
const [loadingFS, setLoadingFS] = useState({ value: false, text: "" })
@@ -163,6 +163,11 @@ function DetailDataPengajuan({
message: "Success send message to warga",
type: "success",
});
if (status == "selesai") {
onAction()
}
} else {
notification({
title: "Failed",
@@ -363,6 +368,10 @@ function DetailDataPengajuan({
type={editValue.type}
onChange={(e) => { setEditValue({ ...editValue, val: e.target.value }) }}
value={editValue.val}
rightSection={
editValue.satuan != null &&
<Text mr={"lg"}>{editValue.satuan}</Text>
}
/>
)}
<Group justify="center" grow>
@@ -460,12 +469,14 @@ function DetailDataPengajuan({
)}
</Stack>
</Modal>
{/* MODAL PREVIEW SURAT */}
{data?.status == "selesai" && !data?.fileSurat && (
<ModalSurat
open={openedPreview}
onClose={(val) => {
setOpenedPreview(false)
setUploading({ ok: true, file: val })
setUploading({ ok: val.success, file: val.data })
}}
surat={data?.idSurat}
/>
@@ -568,13 +579,13 @@ function DetailDataPengajuan({
direction="row"
>
<Text>
{_.upperFirst(item.value)}
{_.upperFirst(item.value)} {item.satuan}
</Text>
<ActionIcon
variant="subtle"
aria-label="Edit"
onClick={() => {
setEditValue({ id: item.id, val: item.value, type: item.type, option: item.options, jenis: item.jenis, key: item.key })
setEditValue({ id: item.id, val: item.value, type: item.type, satuan: item.satuan, option: item.options, jenis: item.jenis, key: item.key })
setOpenEdit(true)
}}>
<IconEdit size={16} />
@@ -637,18 +648,31 @@ function DetailDataPengajuan({
Setujui
</Button>
</Group>
) : data?.status === "selesai" ? (
<Group justify="center" grow>
<Button
variant="light"
onClick={() => { setViewImg({ file: data?.fileSurat, folder: "surat" }) }}
>
Surat
</Button>
</Group>
) : (
<></>
)}
) : data?.status === "selesai" ?
!data?.fileSurat ?
(
<Group justify="center" grow>
<Button
variant="light"
onClick={() => { setOpenedPreview(true) }}
>
Kirim Ulang Surat
</Button>
</Group>
)
:
(
<Group justify="center" grow>
<Button
variant="light"
onClick={() => { setViewImg({ file: data?.fileSurat, folder: "surat" }) }}
>
Surat
</Button>
</Group>
) : (
<></>
)}
</Grid.Col>
</Grid>
</Stack>

View File

@@ -0,0 +1,359 @@
import Elysia from "elysia";
import { prisma } from "../lib/prisma";
const NocRoute = new Elysia({
prefix: "noc",
tags: ["noc"],
})
.get("/surat-perminggu", async () => {
const now = new Date();
const startOfThisWeek = new Date(now);
const day = now.getDay();
const diff = (day === 0 ? 6 : day - 1); // Adjust for Monday as start (Sunday=0 becomes 6, Monday=1 becomes 0)
startOfThisWeek.setDate(now.getDate() - diff);
startOfThisWeek.setHours(0, 0, 0, 0);
const endOfThisWeek = new Date(startOfThisWeek);
endOfThisWeek.setDate(startOfThisWeek.getDate() + 7);
const startOfLastWeek = new Date(startOfThisWeek);
startOfLastWeek.setDate(startOfThisWeek.getDate() - 7);
const endOfLastWeek = new Date(startOfThisWeek);
const [thisWeekCount, lastWeekCount] = await Promise.all([
prisma.suratPelayanan.count({
where: {
isActive: true,
createdAt: {
gte: startOfThisWeek,
lt: endOfThisWeek,
}
}
}),
prisma.suratPelayanan.count({
where: {
isActive: true,
createdAt: {
gte: startOfLastWeek,
lt: endOfLastWeek,
}
}
})
]);
let percentageIncrease = 0;
if (lastWeekCount > 0) {
percentageIncrease = ((thisWeekCount - lastWeekCount) / lastWeekCount) * 100;
} else if (thisWeekCount > 0) {
percentageIncrease = 100;
}
return {
jumlah: thisWeekCount, // jumlah surat minggu ini
persentase_kenaikan: Number(percentageIncrease.toFixed(2)) // persentase kenaikan dari minggu lalu
};
}, {
detail: {
summary: "Jumlah surat minggu ini",
description: `Menu beranda - tool untuk mendapatkan jumlah surat minggu ini dan persentase kenaikan dibandingkan minggu lalu`,
}
})
.get("/pengaduan-count", async () => {
const [antrian, diterima, dikerjakan, ditolak, selesai] = await Promise.all([
prisma.pengaduan.count({
where: {
isActive: true,
status: "antrian",
}
}),
prisma.pengaduan.count({
where: {
isActive: true,
status: "dikerjakan",
}
}),
prisma.pengaduan.count({
where: {
isActive: true,
status: "diterima",
}
}),
prisma.pengaduan.count({
where: {
isActive: true,
status: "ditolak",
}
}),
prisma.pengaduan.count({
where: {
isActive: true,
status: "selesai",
}
})
]);
return {
antrian,
diterima,
dikerjakan,
ditolak,
selesai,
aktif: antrian + diterima + dikerjakan,
total: antrian + diterima + dikerjakan + ditolak + selesai
};
}, {
detail: {
summary: "Jumlah pengaduan berdasarkan status",
description: `Menu beranda dan pengaduan layanan publik - Menghitung jumlah pengaduan yang sedang aktif (antrian, diterima, dikerjakan), dan total (termasuk ditolak dan selesai)`,
}
})
.get("/pelayanan-count", async () => {
const now = new Date();
// Bulan ini
const startOfThisMonth = new Date(now.getFullYear(), now.getMonth(), 1);
const endOfThisMonth = new Date(now.getFullYear(), now.getMonth() + 1, 1);
// Bulan lalu
const startOfLastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
const endOfLastMonth = new Date(now.getFullYear(), now.getMonth(), 1);
const [thisMonthCount, lastMonthCount] = await Promise.all([
prisma.pelayananAjuan.count({
where: {
isActive: true,
status: "selesai",
createdAt: {
gte: startOfThisMonth,
lt: endOfThisMonth,
}
}
}),
prisma.pelayananAjuan.count({
where: {
isActive: true,
status: "selesai",
createdAt: {
gte: startOfLastMonth,
lt: endOfLastMonth,
}
}
})
]);
let percentageIncrease = 0;
if (lastMonthCount > 0) {
percentageIncrease = ((thisMonthCount - lastMonthCount) / lastMonthCount) * 100;
} else if (thisMonthCount > 0) {
percentageIncrease = 100;
}
return {
total_bulan_ini: thisMonthCount,
persentase_kenaikan: Number(percentageIncrease.toFixed(2))
};
}, {
detail: {
summary: "Total pelayanan selesai bulan ini dan kenaikan dari bulan lalu",
description: `Menu beranda - Menampilkan total pelayanan yang telah berstatus selesai bulan ini dan persentase kenaikan dari bulan lalu`,
}
})
.get("/pengajuan-history", async ({ query }) => {
const { period = "6months" } = query as { period?: string };
const now = new Date();
const results: { label: string; total: number }[] = [];
if (period === "6weeks") {
// Get the most recent Monday
const currentDay = now.getDay();
const diffToMonday = (currentDay === 0 ? 6 : currentDay - 1);
const startOfCurrentWeek = new Date(now);
startOfCurrentWeek.setDate(now.getDate() - diffToMonday);
startOfCurrentWeek.setHours(0, 0, 0, 0);
for (let i = 5; i >= 0; i--) {
const startOfWeek = new Date(startOfCurrentWeek);
startOfWeek.setDate(startOfCurrentWeek.getDate() - (i * 7));
const endOfWeek = new Date(startOfWeek);
endOfWeek.setDate(startOfWeek.getDate() + 7);
const count = await prisma.pelayananAjuan.count({
where: {
isActive: true,
createdAt: {
gte: startOfWeek,
lt: endOfWeek,
}
}
});
const label = `Minggu ${6 - i}`;
results.push({ label, total: count });
}
} else {
// Default 6 months
for (let i = 5; i >= 0; i--) {
const startOfMonth = new Date(now.getFullYear(), now.getMonth() - i, 1);
const endOfMonth = new Date(now.getFullYear(), now.getMonth() - i + 1, 1);
const count = await prisma.pelayananAjuan.count({
where: {
isActive: true,
createdAt: {
gte: startOfMonth,
lt: endOfMonth,
}
}
});
const monthName = startOfMonth.toLocaleString('id-ID', { month: 'long' });
results.push({ label: monthName, total: count });
}
}
return results;
}, {
detail: {
summary: "Statistik pengajuan surat 6 bulan / 6 minggu",
description: `Menu beranda - Menampilkan statistik pengajuan surat selama 6 bulan terakhir atau 6 minggu terakhir`,
}
})
.get("/pengaduan-history", async ({ query }) => {
const { period = "6months" } = query as { period?: string };
const now = new Date();
const results: { label: string; total: number }[] = [];
if (period === "7days") {
for (let i = 6; i >= 0; i--) {
const startOfDay = new Date(now);
startOfDay.setDate(now.getDate() - i);
startOfDay.setHours(0, 0, 0, 0);
const endOfDay = new Date(startOfDay);
endOfDay.setDate(startOfDay.getDate() + 1);
const count = await prisma.pengaduan.count({
where: {
isActive: true,
createdAt: {
gte: startOfDay,
lt: endOfDay,
}
}
});
const label = startOfDay.toLocaleDateString('id-ID', { weekday: 'long' });
results.push({ label, total: count });
}
} else {
// Default 6 months
for (let i = 5; i >= 0; i--) {
const startOfMonth = new Date(now.getFullYear(), now.getMonth() - i, 1);
const endOfMonth = new Date(now.getFullYear(), now.getMonth() - i + 1, 1);
const count = await prisma.pengaduan.count({
where: {
isActive: true,
createdAt: {
gte: startOfMonth,
lt: endOfMonth,
}
}
});
const monthName = startOfMonth.toLocaleString('id-ID', { month: 'long' });
results.push({ label: monthName, total: count });
}
}
return results;
}, {
detail: {
summary: "Statistik total pengaduan 6 bulan / 7 hari",
description: `Menu pengaduan layanan publik - Menampilkan statistik total pengaduan selama 6 bulan terakhir atau 7 hari terakhir`,
}
})
.get("/pelayanan-perjenis", async () => {
const categories = await prisma.categoryPelayanan.findMany({
where: {
isActive: true
},
select: {
name: true,
_count: {
select: {
SuratPelayanan: {
where: {
isActive: true
}
}
}
}
}
});
return categories
.map(cat => ({
jenis: cat.name,
jumlah: cat._count.SuratPelayanan
}))
.sort((a, b) => b.jumlah - a.jumlah);
}, {
detail: {
summary: "Jumlah surat terbanyak berdasarkan jenis surat",
description: `Menu pengaduan layanan publik - Menampilkan jumlah surat berdasarkan jenis/kategori pelayanan`,
}
})
.get("/pengajuan-terbaru", async () => {
const applications = await prisma.pelayananAjuan.findMany({
where: {
isActive: true
},
take: 5,
orderBy: {
createdAt: "desc"
},
include: {
Warga: true,
CategoryPelayanan: true
}
});
const formatDuration = (date: Date) => {
const diff = Math.floor((new Date().getTime() - date.getTime()) / 1000);
if (diff < 60) return `${diff} detik yang lalu`;
if (diff < 3600) return `${Math.floor(diff / 60)} menit yang lalu`;
if (diff < 86400) return `${Math.floor(diff / 3600)} jam yang lalu`;
if (diff < 604800) return `${Math.floor(diff / 86400)} hari yang lalu`;
return date.toLocaleDateString("id-ID", {
day: "numeric",
month: "long",
year: "numeric"
});
};
return applications.map(app => ({
jenis: app.CategoryPelayanan.name,
status: app.status,
namaWarga: app.Warga.name,
durasi: formatDuration(app.createdAt)
}));
}, {
detail: {
summary: "5 data pengajuan surat terbaru",
description: `Menu pengaduan layanan publik - Menampilkan 5 data pengajuan surat terbaru beserta status, nama warga, dan durasi pengajuan`,
}
})
export default NocRoute

View File

@@ -315,6 +315,7 @@ const PelayananRoute = new Elysia({
}[]; name: string;
desc: string;
key: string;
satuan?: string;
}[];
const refMap = new Map(
@@ -336,6 +337,7 @@ const PelayananRoute = new Elysia({
type: ref?.type ?? "",
options: ref?.options ?? [],
order: ref?.order ?? Infinity,
satuan: ref?.satuan ?? null
};
})
.sort((a, b) => a.order - b.order)
@@ -685,17 +687,20 @@ const PelayananRoute = new Elysia({
name: string;
desc: string;
key: string;
required: boolean;
}[];
const dataSyaratFix = dataSyarat.map((item) => {
const desc = syaratDokumen.find((v) => v.key == item.jenis)?.desc
const name = syaratDokumen.find((v) => v.key == item.jenis)?.name
const required = syaratDokumen.find((v) => v.key == item.jenis)?.required
return {
id: item.id,
key: item.jenis,
value: item.value,
name: name ?? '',
desc: desc ?? ''
desc: desc ?? '',
required: required ?? true
}
})
@@ -708,6 +713,8 @@ const PelayananRoute = new Elysia({
name: string;
desc: string;
key: string;
required: boolean;
satuan?: string;
}[];
const refMap = new Map(
@@ -730,6 +737,8 @@ const PelayananRoute = new Elysia({
type: ref?.type ?? "",
options: ref?.options ?? [],
order: ref?.order ?? Infinity,
required: ref?.required ?? true,
satuan: ref?.satuan ?? null
};
})
.sort((a, b) => a.order - b.order)

View File

@@ -49,7 +49,7 @@ Terima kasih atas partisipasi dan kepercayaan Bapak/Ibu.`
const textFix = encodeURIComponent(text)
const res = await fetch(
`https://cld-dkr-prod-wajs-server.wibudev.com/api/wa/code?nom=${tlp}&text=${textFix}`,
`${process.env.WA_SERVER_URL}/api/wa/code?nom=${tlp}&text=${textFix}`,
{
cache: "no-cache",
headers: {
@@ -119,7 +119,7 @@ Terima kasih atas kepercayaan Bapak/Ibu.`
const res = await fetch(
`https://cld-dkr-prod-wajs-server.wibudev.com/api/wa/code?nom=${tlp}&text=${textFix}`,
`${process.env.WA_SERVER_URL}/api/wa/code?nom=${tlp}&text=${textFix}`,
{
cache: "no-cache",
headers: {