Compare commits

..

4 Commits

22 changed files with 1408 additions and 99 deletions
+2
View File
@@ -93,3 +93,5 @@ GOOGLE_DRIVE_FOLDER_ID=0AJQK-NMrB4b_Uk9PVA
# 1 = Login biasa (NIP/Password + Google OAuth)
# 2 = Login SSO Portal Untan (khusus domain *.untan.ac.id)
LOGIN_MODE=2
DOCS_TOKEN=3863b2e41c487d57f6a14d8a068eb817f244374bed7a9e3d
+3
View File
@@ -93,3 +93,6 @@ GOOGLE_DRIVE_FOLDER_ID=
# 1 = Login Biasa (NIP/Password + Google OAuth)
# 2 = Login SSO Portal Untan (khusus domain *.untan.ac.id)
LOGIN_MODE=2
# Token akses halaman dokumentasi API (/docs)
DOCS_TOKEN=
+3 -1
View File
@@ -28,7 +28,7 @@ class KeseluruhanExport implements FromArray, ShouldAutoSize, WithColumnFormatti
/**
* Kolom setelah blok bulanan P1 (tidak ikut di-expand per bulan).
*/
private const TRAILING_COLUMNS = ['Jumlah P2', 'Jumlah THR', 'Jumlah R13', 'Jumlah Publikasi', 'Total'];
private const TRAILING_COLUMNS = ['Jumlah P2', 'Jumlah THR', 'Jumlah R13', 'Jumlah Publikasi', 'Total', 'Total Pajak', 'Total Netto'];
private const BULAN_NAMES = [
1 => 'Januari', 2 => 'Februari', 3 => 'Maret', 4 => 'April', 5 => 'Mei', 6 => 'Juni',
@@ -79,6 +79,8 @@ class KeseluruhanExport implements FromArray, ShouldAutoSize, WithColumnFormatti
$row['jumlah_r13'],
$row['jumlah_publikasi'],
$row['total'],
$row['total_pajak'] ?? 0,
$row['total_netto'] ?? 0,
]);
}
+1 -1
View File
@@ -456,7 +456,7 @@ class RasioP2Export
protected function getDataForUnit($unit)
{
// Query dengan optimalisasi
$pegawaisQuery = Pegawai::select('nip', 'nip_siakad', 'nama', 'jenis_pegawai', 'unit_kerja_nama', 'jabatan_fungsional_id', 'jabatan_dtt_id', 'npwp', 'nomor_rekening')
$pegawaisQuery = Pegawai::withoutGlobalScope('aktif')->select('nip', 'nip_siakad', 'nama', 'jenis_pegawai', 'unit_kerja_nama', 'jabatan_fungsional_id', 'jabatan_dtt_id', 'npwp', 'nomor_rekening')
->whereHas('jabatan', function ($query) use ($unit) {
$query
->where('periode', $this->periode)
@@ -22,9 +22,9 @@ class MengajarController extends Controller
$exceptions = [196312201988101001, 196106051986022001];
$start = Carbon::parse('2024-05-20 00:00:00');
$end = Carbon::parse('2024-06-15 23:59:59');
$user = Pegawai::select('id', 'nip', 'nama', 'jenis_pegawai')->where('nip', $request->nip)->orWhere('nip_siakad', $request->nip)->firstOrFail();
$user = Pegawai::select('id', 'nip', 'nama', 'jenis_pegawai')->where('nip', $request->nip)->orWhere('nip_siakad', $request->nip)->first();
if (!in_array($user->nip, $exceptions)) {
if (!in_array($user?->nip, $exceptions)) {
if (!now()->isBetween($start, $end)) {
return response()->json([
'code' => 400,
@@ -33,6 +33,7 @@ class MengajarController extends Controller
], 400);
}
}
abort_if(!$user, 404, 'Pegawai tidak ditemukan');
try {
if ($user->jenis_pegawai === 'dosen') {
$token = $request->bearerToken();
@@ -37,12 +37,14 @@ class PengajuanAbsenController extends Controller
$bulan--;
}
$pegawais = Honorer::with('unit:id,nama')
$filterAbsen = function ($query) use ($periode, $bulan) {
$query->where('periode', $periode)
->whereMonth('tanggal_mulai', $bulan);
};
$honorers = Honorer::with('unit:id,nama')
->select('nip', 'nama', 'unit_id')
->with(['absen' => function ($query) use ($periode, $bulan) {
$query->where('periode', $periode)
->whereMonth('tanggal_mulai', $bulan);
}])
->with(['absen' => $filterAbsen])
->get()
->map(function ($pegawai) {
$absen = $pegawai->absen;
@@ -52,13 +54,30 @@ class PengajuanAbsenController extends Controller
});
return $pegawai;
})
});
$tendiks = Tendik::select('nip', 'nama', 'unit_kerja_id', 'unit_kerja_nama')
->whereHas('absen', $filterAbsen)
->with(['absen' => $filterAbsen])
->get()
->map(function ($pegawai) {
$absen = $pegawai->absen;
$unit = ['id' => $pegawai->unit_kerja_id, 'nama' => $pegawai->unit_kerja_nama];
unset($pegawai->absen, $pegawai->unit_kerja_id, $pegawai->unit_kerja_nama);
$pegawai->unit = $unit;
$pegawai->absen = $absen->countBy(function ($absen) {
return $absen->status;
});
return $pegawai;
});
return $honorers
->concat($tendiks)
->filter(function ($pegawai) {
return $pegawai->absen->count();
})
->flatten(1);
return $pegawais;
->values();
}
public function show(Request $request, string $nip)
@@ -488,7 +507,7 @@ class PengajuanAbsenController extends Controller
}
return response()->json([
'code' => 400,
'code' => 200,
'status' => false,
'message' => 'Pengajuan absen tidak ditemukan',
]);
@@ -157,7 +157,7 @@ class RasioP2Controller extends Controller
$unitPembayaranNama = UnitKerjaVerifikator::find($unit)?->nama ?? '-';
// Query dengan optimalisasi
$pegawaisQuery = Pegawai::select('id', 'nip', 'nip_siakad', 'nama', 'jenis_pegawai', 'unit_kerja_nama', 'jabatan_fungsional_id', 'jabatan_dtt_id')
$pegawaisQuery = Pegawai::withoutGlobalScope('aktif')->select('id', 'nip', 'nip_siakad', 'nama', 'jenis_pegawai', 'unit_kerja_nama', 'jabatan_fungsional_id', 'jabatan_dtt_id')
->whereHas('jabatan', function ($query) use ($unit, $periode) {
$query
->where('periode', $periode)
@@ -374,7 +374,7 @@ class RasioP2Controller extends Controller
$isAdmin = $team && $team->nama === 'Admin';
$unit = $request->boolean('gabung') ? null : ($request->unit ?? $team->unit_kerja_id ?? null);
$pegawai = Pegawai::where(function ($query) use ($nip) {
$pegawai = Pegawai::withoutGlobalScope('aktif')->where(function ($query) use ($nip) {
$query->where('nip', $nip)->orWhere('nip_siakad', $nip);
})->first();
@@ -415,7 +415,7 @@ class RasioP2Controller extends Controller
$team = Team::find(session('team_id'));
$unit = $request->boolean('gabung') ? null : ($request->unit ?? $team->unit_kerja_id ?? null);
$pegawai = Pegawai::where(function ($query) use ($nip) {
$pegawai = Pegawai::withoutGlobalScope('aktif')->where(function ($query) use ($nip) {
$query->where('nip', $nip)->orWhere('nip_siakad', $nip);
})->first();
@@ -895,7 +895,7 @@ class RasioP2Controller extends Controller
$team = Team::find(session('team_id'));
$unit = $request->unit ?? $team->unit_kerja_id ?? null;
$pegawai = Pegawai::where(function ($query) use ($nip) {
$pegawai = Pegawai::withoutGlobalScope('aktif')->where(function ($query) use ($nip) {
$query->where('nip', $nip)
->orWhere('nip_siakad', $nip);
})->first();
@@ -978,7 +978,7 @@ class RasioP2Controller extends Controller
if (! empty($request->filter_nominal)) {
// Jika nominal diisi, hitung total P2 normal terlebih dahulu
$pegawaisQuery = Pegawai::select('id', 'nip', 'nip_siakad', 'nama', 'jenis_pegawai', 'unit_kerja_nama', 'jabatan_fungsional_id', 'jabatan_dtt_id')
$pegawaisQuery = Pegawai::withoutGlobalScope('aktif')->select('id', 'nip', 'nip_siakad', 'nama', 'jenis_pegawai', 'unit_kerja_nama', 'jabatan_fungsional_id', 'jabatan_dtt_id')
->whereHas('jabatan', function ($query) use ($unitKerjaId, $periode) {
$query
->where('periode', $periode)
@@ -62,6 +62,35 @@ class KeseluruhanController extends Controller
->make();
}
/**
* Hapus cache rekap Keseluruhan (termasuk cache THR/R13 dari API Dawai) untuk tahun terpilih lalu
* bangun ulang. Hanya membaca dari DB/API dan menyimpan cache — tidak menulis ke tabel remunerasi.
*/
public function refresh(Request $request): JsonResponse
{
$this->authorizeAccess();
set_time_limit(300);
$tahun = (int) ($request->tahun ?: now()->year);
$start = microtime(true);
foreach ([null, 'dosen', 'tendik', 'Dosen', 'Tendik'] as $jenis) {
Cache::forget('remunerasi_keseluruhan_v8_'.$tahun.'_'.($jenis ?: 'semua'));
Cache::forget("keseluruhan_thr_{$jenis}_{$tahun}");
Cache::forget("keseluruhan_r13_{$jenis}_{$tahun}");
}
$rows = $this->buildRekap($tahun, null);
return response()->json([
'success' => true,
'tahun' => $tahun,
'rows' => $rows->count(),
'seconds' => round(microtime(true) - $start, 1),
]);
}
public function export(Request $request): BinaryFileResponse
{
$this->authorizeAccess();
@@ -120,7 +149,7 @@ class KeseluruhanController extends Controller
private function buildRekap(int $tahun, ?string $jenisPegawai): Collection
{
$cacheKey = 'remunerasi_keseluruhan_v5_'.$tahun.'_'.($jenisPegawai ?: 'semua');
$cacheKey = 'remunerasi_keseluruhan_v8_'.$tahun.'_'.($jenisPegawai ?: 'semua');
return collect(Cache::remember($cacheKey, now()->addHours(6), fn () => $this->computeRekap($tahun, $jenisPegawai)));
}
@@ -135,6 +164,21 @@ class KeseluruhanController extends Controller
return $tahun === (int) now()->year ? (int) now()->month : 12;
}
/**
* Snapshot P2 (JSON, hasil perhitungan read-only) untuk pegawai yang P2-nya belum tersimpan di DB.
* Format: {"<nip>": {"p2_bruto": 0.0}}; file per tahun/periode di resources/data/{tahun}/kekurangan_p2_{periode}.json.
*/
private function loadP2Snapshot(int $tahun, int|string $periode): array
{
$path = resource_path("data/{$tahun}/kekurangan_p2_{$periode}.json");
if (! is_file($path)) {
return [];
}
return json_decode((string) file_get_contents($path), true) ?: [];
}
private function computeRekap(int $tahun, ?string $jenisPegawai): array
{
$normalize = fn ($nip) => preg_replace("/['.\-]/", '', (string) $nip);
@@ -150,6 +194,8 @@ class KeseluruhanController extends Controller
->groupBy(fn ($row) => $normalize($row->nip));
$p1 = $p1Rows->map(fn ($rows) => (float) $rows->sum('gaji_yang_dibayarkan'));
$p1Pajak = $p1Rows->map(fn ($rows) => (float) $rows->sum('pph21'));
$p1Netto = $p1Rows->map(fn ($rows) => (float) $rows->sum('gaji_bersih'));
// Rincian per bulan (dipakai untuk breakdown kolom bulanan di export Excel).
$p1Bulanan = $p1Rows->map(fn ($rows) => $rows->groupBy('bulan')->map(fn ($bulanRows) => (float) $bulanRows->sum('gaji_yang_dibayarkan')));
@@ -158,13 +204,18 @@ class KeseluruhanController extends Controller
$periodeSemester1 = Periode::where('nama', 'LIKE', "%{$tahun} Semester 1%")->value('id_periode');
$p2 = collect();
$p2Pajak = collect();
$p2Netto = collect();
$p2DariJson = [];
if ($periodeSemester1) {
$p2 = Pegawai::withoutGlobalScopes()
$p2Rows = Pegawai::withoutGlobalScopes()
->join('verifikator.jabatan_pegawais as jp', 'verifikator.pegawais.nip', '=', 'jp.nip')
->join('verifikator.jabatan_pegawai_details as jpd', 'jp.id', '=', 'jpd.jabatan_pegawai_id')
->join('verifikator.remunerasi_per_bulans as rpb', 'jpd.id', '=', 'rpb.jabatan_pegawai_detail_id')
->select('verifikator.pegawais.nip')
->selectRaw('SUM(rpb.p2_bruto) as total')
->selectRaw('SUM(rpb.p2_tax) as total_pajak')
->selectRaw('SUM(rpb.p2_netto) as total_netto')
->whereNull('rpb.deleted_at')
->where('jp.periode', $periodeSemester1)
->where('jp.active', true)
@@ -172,8 +223,23 @@ class KeseluruhanController extends Controller
->groupBy('verifikator.pegawais.nip')
->havingRaw('SUM(rpb.p2_bruto) > 0')
->get()
->keyBy(fn ($row) => $normalize($row->nip))
->map(fn ($row) => (float) $row->total);
->keyBy(fn ($row) => $normalize($row->nip));
$p2 = $p2Rows->map(fn ($row) => (float) $row->total);
$p2Pajak = $p2Rows->map(fn ($row) => (float) $row->total_pajak);
$p2Netto = $p2Rows->map(fn ($row) => (float) $row->total_netto);
// Fallback untuk pegawai (CPNS) yang P2-nya belum tersimpan di remunerasi_per_bulans:
// ambil dari snapshot JSON hasil perhitungan (read-only), tanpa menulis ke DB.
foreach ($this->loadP2Snapshot($tahun, $periodeSemester1) as $nip => $nilai) {
$key = $normalize($nip);
if (! $p2->has($key) && ($nilai['p2_bruto'] ?? 0) > 0) {
$p2->put($key, (float) $nilai['p2_bruto']);
$p2Pajak->put($key, (float) ($nilai['p2_pajak'] ?? 0));
$p2Netto->put($key, (float) ($nilai['p2_netto'] ?? 0));
$p2DariJson[$key] = true;
}
}
}
// 3. THR & 4. R13 = data eksternal (API Dawai), untuk seluruh unit sekaligus lalu di-cache
@@ -186,6 +252,7 @@ class KeseluruhanController extends Controller
fn () => (new DawaiService)->getDataThr($jenisPegawaiParam, $tahun, null, false)
);
$thr = collect($thrData)->keyBy(fn ($row) => $normalize($row['nip'] ?? ''))->map(fn ($row) => (float) ($row['total_thr'] ?? 0));
$thrNetto = collect($thrData)->keyBy(fn ($row) => $normalize($row['nip'] ?? ''))->map(fn ($row) => (float) ($row['total_thr_setelah_pajak'] ?? 0));
$r13Data = Cache::remember(
"keseluruhan_r13_{$jenisPegawaiParam}_{$tahun}",
@@ -193,6 +260,7 @@ class KeseluruhanController extends Controller
fn () => (new DawaiService)->getDataR13($jenisPegawaiParam, $tahun, null, false)
);
$r13 = collect($r13Data)->keyBy(fn ($row) => $normalize($row['nip'] ?? ''))->map(fn ($row) => (float) ($row['total_r13'] ?? 0));
$r13Netto = collect($r13Data)->keyBy(fn ($row) => $normalize($row['nip'] ?? ''))->map(fn ($row) => (float) ($row['total_r13_setelah_pajak'] ?? 0));
// 5. Publikasi = seluruh periode yang namanya memuat tahun terpilih (mis. "2026 Semester 1"
// maupun "2025/2026 Ganjil"), karena publikasi tidak terikat pada satu format periode tertentu.
@@ -202,7 +270,9 @@ class KeseluruhanController extends Controller
->whereIn('periode', $periodeIds)
->where('poin_total', '>', 0)
->select('nip')
->selectRaw('SUM(biaya_remunerasi) as total');
->selectRaw('SUM(biaya_remunerasi) as total')
->selectRaw('SUM(COALESCE(pajak, 0)) as total_pajak')
->selectRaw('SUM(GREATEST(biaya_remunerasi - COALESCE(pajak, 0), 0)) as total_netto');
if ($jenisPegawai) {
$publikasiQuery->whereHas('pegawai', function ($q) use ($jenisPegawai) {
@@ -210,9 +280,12 @@ class KeseluruhanController extends Controller
});
}
$publikasi = $publikasiQuery->groupBy('nip')->get()
->keyBy(fn ($row) => $normalize($row->nip))
->map(fn ($row) => (float) $row->total);
$publikasiRows = $publikasiQuery->groupBy('nip')->get()
->keyBy(fn ($row) => $normalize($row->nip));
$publikasi = $publikasiRows->map(fn ($row) => (float) $row->total);
$publikasiPajak = $publikasiRows->map(fn ($row) => (float) $row->total_pajak);
$publikasiNetto = $publikasiRows->map(fn ($row) => (float) $row->total_netto);
$allNips = $p1->keys()
->merge($p2->keys())
@@ -238,7 +311,7 @@ class KeseluruhanController extends Controller
->get()
->keyBy(fn ($row) => $normalize($row->nip));
return $allNips->map(function ($nip) use ($pegawaiInfo, $p1, $p1Bulanan, $bulanTerakhir, $p2, $thr, $r13, $publikasi, $jenisPegawai) {
return $allNips->map(function ($nip) use ($pegawaiInfo, $p1, $p1Pajak, $p1Netto, $p1Bulanan, $bulanTerakhir, $p2, $p2Pajak, $p2Netto, $p2DariJson, $thr, $thrNetto, $r13, $r13Netto, $publikasi, $publikasiPajak, $publikasiNetto, $jenisPegawai) {
$info = $pegawaiInfo->get($nip);
if (! $info) {
@@ -256,6 +329,17 @@ class KeseluruhanController extends Controller
$jumlahPublikasi = $publikasi->get($nip, 0.0);
$total = $jumlahP1 + $jumlahP2 + $jumlahThr + $jumlahR13 + $jumlahPublikasi;
$nettoP1 = $p1Netto->get($nip, 0.0);
$nettoP2 = $p2Netto->get($nip, 0.0);
$nettoThr = $thrNetto->get($nip, 0.0);
$nettoR13 = $r13Netto->get($nip, 0.0);
$nettoPublikasi = $publikasiNetto->get($nip, 0.0);
$pajakP1 = $p1Pajak->get($nip, 0.0);
$pajakP2 = $p2Pajak->get($nip, 0.0);
$pajakThr = max($jumlahThr - $nettoThr, 0.0);
$pajakR13 = max($jumlahR13 - $nettoR13, 0.0);
$pajakPublikasi = $publikasiPajak->get($nip, 0.0);
if ($total <= 0) {
return null;
}
@@ -275,10 +359,23 @@ class KeseluruhanController extends Controller
'jumlah_p1' => $jumlahP1,
'jumlah_p1_bulanan' => $jumlahP1Bulanan,
'jumlah_p2' => $jumlahP2,
'p2_sumber' => isset($p2DariJson[$nip]) ? 'json' : 'db',
'jumlah_thr' => $jumlahThr,
'jumlah_r13' => $jumlahR13,
'jumlah_publikasi' => $jumlahPublikasi,
'total' => $total,
'pajak_p1' => $pajakP1,
'netto_p1' => $nettoP1,
'pajak_p2' => $pajakP2,
'netto_p2' => $nettoP2,
'pajak_thr' => $pajakThr,
'netto_thr' => $nettoThr,
'pajak_r13' => $pajakR13,
'netto_r13' => $nettoR13,
'pajak_publikasi' => $pajakPublikasi,
'netto_publikasi' => $nettoPublikasi,
'total_pajak' => $pajakP1 + $pajakP2 + $pajakThr + $pajakR13 + $pajakPublikasi,
'total_netto' => $nettoP1 + $nettoP2 + $nettoThr + $nettoR13 + $nettoPublikasi,
];
})->filter()->values()->all();
}
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Amankan halaman dokumentasi API (/docs) dengan token statis dari DOCS_TOKEN.
*
* Token diterima lewat header "Authorization: Bearer <token>", header "X-Docs-Token",
* atau query "?token=<token>". Setelah valid lewat query, dibuat cookie (berisi hash token)
* supaya request lanjutan dari halaman (mis. /docs/api.json) tetap lolos.
*/
class DocsToken
{
private const COOKIE = 'docs_access';
public function handle(Request $request, Closure $next): Response
{
$expected = (string) config('scramble.docs_token');
if ($expected === '') {
return $this->deny('DOCS_TOKEN belum dikonfigurasi.', 403);
}
$provided = $request->bearerToken()
?: $request->header('X-Docs-Token')
?: $request->query('token');
if (is_string($provided) && $provided !== '' && hash_equals($expected, $provided)) {
$response = $next($request);
return $response->withCookie(cookie(
self::COOKIE, hash('sha256', $expected), 60 * 8, '/docs', null, $request->isSecure(), true, false, 'lax'
));
}
// Token yang dikirim tapi salah selalu ditolak, walau cookie lama masih valid.
if (is_string($provided) && $provided !== '') {
return $this->deny('Token dokumentasi tidak valid.', 401)
->withCookie(cookie()->forget(self::COOKIE, '/docs'));
}
$cookie = $request->cookies->get(self::COOKIE);
if (is_string($cookie) && hash_equals(hash('sha256', $expected), $cookie)) {
return $next($request);
}
return $this->deny('Token dokumentasi tidak valid atau belum disertakan.', 401);
}
private function deny(string $message, int $status): Response
{
return response()->view('errors.docs-unauthorized', ['message' => $message], $status);
}
}
+2 -1
View File
@@ -4,10 +4,11 @@ namespace App\Models\Rekapitulasi;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class P1 extends Model
{
use HasFactory;
use HasFactory, SoftDeletes;
protected $table = 'rekapitulasi.p1';
+21
View File
@@ -2,8 +2,13 @@
namespace App\Providers;
use App\Support\ApiDocsSummaries;
use Dedoc\Scramble\Scramble;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Routing\Route;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
class AppServiceProvider extends ServiceProvider
{
@@ -20,6 +25,22 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
Scramble::configure()->expose(
ui: fn (Router $router, $action) => $router->get('docs', $action)->name('scramble.docs.ui'),
document: fn (Router $router, $action) => $router->get('docs/api.json', $action)->name('scramble.docs.document'),
);
Scramble::afterOpenApiGenerated(new ApiDocsSummaries);
// Batasi endpoint yang tampil di /docs lewat config('scramble.visible_routes').
$defaultRoutes = Scramble::configure()->routes();
Scramble::routes(function (Route $route) use ($defaultRoutes) {
$visible = config('scramble.visible_routes', []);
return $defaultRoutes($route)
&& ($visible === [] || Str::is($visible, $route->uri()));
});
Relation::morphMap([
'App\Models\Syarat' => 'App\Models\DokSiremun\Syarat',
'App\Models\Mengajar' => 'App\Models\DokSiremun\Mengajar',
+2 -2
View File
@@ -98,9 +98,9 @@ class PoinService
}
if ($periode === 383) {
$rawQuery = '(poin_total / sks) as poin_per_sks';
$rawQuery = '(poin_total / CASE WHEN sks = 0 THEN 1 ELSE sks END) as poin_per_sks';
} else {
$rawQuery = '(poin_total / beban_mengajar) as poin_per_sks';
$rawQuery = '(poin_total / CASE WHEN beban_mengajar = 0 THEN 1 ELSE beban_mengajar END) as poin_per_sks';
}
$mengajars = $this->triDharmaService->mengajarSiakad($nip, $periode, 6, 8, $column, $rawQuery, $jenjang, $tipeMk)->sortByDesc('poin_per_sks');
+73
View File
@@ -0,0 +1,73 @@
<?php
namespace App\Support;
use Dedoc\Scramble\Support\Generator\OpenApi;
/**
* Nama endpoint yang tampil di halaman /docs (sidebar & judul operasi).
*
* Kunci: "<method> <path>" sesuai route. Endpoint yang docblock-nya sudah punya
* summary tidak ditimpa; tambahkan endpoint baru di sini agar punya nama yang rapi.
*/
class ApiDocsSummaries
{
private const SUMMARIES = [
'get /v1/rubrik' => 'Daftar Rubrik',
'get /v1/rubrik/{id}' => 'Detail Rubrik',
'get /v1/jabatan/{nip}' => 'Jabatan Pegawai',
'get /v1/jabatan/fungsional' => 'Daftar Jabatan Fungsional',
'get /v1/jabatan/tugas-tambahan' => 'Daftar Jabatan Tugas Tambahan',
'get /v1/pengajuan-absen' => 'Daftar Pengajuan Absen',
'get /v1/pengajuan-absen/{nip}' => 'Pengajuan Absen Pegawai',
'post /v1/pengajuan-absen' => 'Buat Pengajuan Absen',
'post /v1/pengajuan-absen/exists' => 'Duplikasi Pengajuan Absen',
'delete /v1/pengajuan-absen/delete/{id}' => 'Hapus Pengajuan Absen',
'patch /v1/pengajuan-absen/batalkan/{id}' => 'Batalkan Pengajuan Absen',
'get /v1/poin/{nip}' => 'Poin Pegawai',
'get /v1/pegawai' => 'Daftar Pegawai',
'get /v1/pegawai/{nip}' => 'Detail Pegawai',
'get /v1/laporan-kegiatan/kompetisi' => 'Laporan Kegiatan Kompetisi',
'get /v1/laporan-kegiatan/mbkm' => 'Laporan Kegiatan MBKM',
'get /v1/pengajuan/sanggahan/{nip}' => 'Daftar Sanggahan',
'post /v1/pengajuan/sanggahan' => 'Kirim Sanggahan',
'get /v1/pengajuan/tri-dharma/mengajar' => 'Pengajuan Mengajar',
'get /v1/pengajuan/tri-dharma/menguji' => 'Pengajuan Menguji',
'get /v1/pengajuan/tri-dharma/membimbing' => 'Pengajuan Membimbing',
'get /v1/pengajuan/mbkm' => 'Pengajuan MBKM',
'get /v1/pengajuan/modul' => 'Pengajuan Modul',
'get /v1/verifikator/presensi/honorer/{unit}' => 'Presensi Honorer per Unit',
'get /v1/verifikator/presensi/{unit}' => 'Presensi per Unit',
'get /v1/verifikator/presensi/{unit}/{nip}' => 'Detail Presensi Pegawai',
'get /v1/verifikator/presensi/{nip}/{nip}' => 'Detail Presensi Pegawai',
'get /v1/remunerasi/{nip}' => 'Remunerasi Pegawai',
'get /v1/remunerasi/poin' => 'Poin Remunerasi',
'get /v1/remunerasi/skp' => 'Data SKP',
'post /v1/verifikasi-absen/link' => 'Buat Link Verifikasi',
'get /v1/verifikasi-absen/{id}' => 'Detail Verifikasi Absen',
'post /v1/verifikasi-absen/{id}/setujui' => 'Setujui Pengajuan Absen',
'post /v1/verifikasi-absen/{id}/tolak' => 'Tolak Pengajuan Absen',
];
public function __invoke(OpenApi $openApi): void
{
foreach ($openApi->paths as $path) {
foreach ($path->operations as $operation) {
$key = strtolower($operation->method).' /'.ltrim($path->path, '/');
if ($operation->summary === '' && isset(self::SUMMARIES[$key])) {
$operation->summary(self::SUMMARIES[$key]);
}
}
}
}
}
+1
View File
@@ -10,6 +10,7 @@
"license": "MIT",
"require": {
"php": "^8.2",
"dedoc/scramble": "^0.13.45",
"google/apiclient": "^2.19",
"laravel/framework": "^12.0",
"laravel/socialite": "^5.23",
Generated
+250 -61
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ff4de989ae1021516a8c7e527a1faed3",
"content-hash": "10d90e96a4aad7de117b9533d45d6150",
"packages": [
{
"name": "brick/math",
@@ -291,6 +291,87 @@
],
"time": "2025-08-20T19:15:30+00:00"
},
{
"name": "dedoc/scramble",
"version": "v0.13.45",
"source": {
"type": "git",
"url": "https://github.com/dedoc/scramble.git",
"reference": "4f096c49d555c580d7ce7a978896bb3d8b28dc4d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dedoc/scramble/zipball/4f096c49d555c580d7ce7a978896bb3d8b28dc4d",
"reference": "4f096c49d555c580d7ce7a978896bb3d8b28dc4d",
"shasum": ""
},
"require": {
"illuminate/contracts": "^10.0|^11.0|^12.0|^13.0",
"myclabs/deep-copy": "^1.12",
"nikic/php-parser": "^5.0",
"php": "^8.1",
"phpstan/phpdoc-parser": "^1.0|^2.0",
"spatie/laravel-package-tools": "^1.9.2"
},
"require-dev": {
"larastan/larastan": "^3.3",
"laravel/pint": "^v1.1.0",
"laravel/scout": "^10.0|^11.0",
"nunomaduro/collision": "^7.0|^8.0",
"orchestra/testbench": "^8.0|^9.0|^10.0|^11.0",
"pestphp/pest": "^2.34|^3.7|^4.4",
"pestphp/pest-plugin-laravel": "^2.3|^3.1|^4.1",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^10.5|^11.5.3|^12.5.12",
"spatie/laravel-permission": "^6.10|^7.2",
"spatie/pest-plugin-snapshots": "^2.1"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Dedoc\\Scramble\\ScrambleServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Dedoc\\Scramble\\": "src",
"Dedoc\\Scramble\\Database\\Factories\\": "database/factories"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Lytvynenko",
"email": "litvinenko95@gmail.com",
"role": "Developer"
}
],
"description": "Automatic generation of API documentation for Laravel applications.",
"homepage": "https://github.com/dedoc/scramble",
"keywords": [
"documentation",
"laravel",
"openapi"
],
"support": {
"issues": "https://github.com/dedoc/scramble/issues",
"source": "https://github.com/dedoc/scramble/tree/v0.13.45"
},
"funding": [
{
"url": "https://github.com/romalytvynenko",
"type": "github"
}
],
"time": "2026-09-18T15:47:56+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
@@ -3221,6 +3302,66 @@
],
"time": "2026-01-02T08:56:05+00:00"
},
{
"name": "myclabs/deep-copy",
"version": "1.13.4",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a",
"reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/collections": "<1.6.8",
"doctrine/common": "<2.13.3 || >=3 <3.2.2"
},
"require-dev": {
"doctrine/collections": "^1.6.8",
"doctrine/common": "^2.13.3 || ^3.2.2",
"phpspec/prophecy": "^1.10",
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"type": "library",
"autoload": {
"files": [
"src/DeepCopy/deep_copy.php"
],
"psr-4": {
"DeepCopy\\": "src/DeepCopy/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Create deep copies (clones) of your objects",
"keywords": [
"clone",
"copy",
"duplicate",
"object",
"object graph"
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.4"
},
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
"type": "tidelift"
}
],
"time": "2025-08-01T08:46:24+00:00"
},
{
"name": "nesbot/carbon",
"version": "3.11.4",
@@ -4041,6 +4182,53 @@
],
"time": "2026-04-10T01:33:53+00:00"
},
{
"name": "phpstan/phpdoc-parser",
"version": "2.3.6",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "1427af4647235b4a73b13940b1f1258d3584f36e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1427af4647235b4a73b13940b1f1258d3584f36e",
"reference": "1427af4647235b4a73b13940b1f1258d3584f36e",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0"
},
"require-dev": {
"doctrine/annotations": "^2.0",
"nikic/php-parser": "^5.3.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6",
"symfony/process": "^5.2"
},
"type": "library",
"autoload": {
"psr-4": {
"PHPStan\\PhpDocParser\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.6"
},
"time": "2026-09-27T20:07:45+00:00"
},
{
"name": "psr/cache",
"version": "3.0.0",
@@ -4779,6 +4967,67 @@
},
"time": "2025-12-14T04:43:48+00:00"
},
{
"name": "spatie/laravel-package-tools",
"version": "1.93.3",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-package-tools.git",
"reference": "7aeef26bd8d4909bec744dbf47aee7d1395588c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/7aeef26bd8d4909bec744dbf47aee7d1395588c1",
"reference": "7aeef26bd8d4909bec744dbf47aee7d1395588c1",
"shasum": ""
},
"require": {
"illuminate/contracts": "^10.0|^11.0|^12.0|^13.0",
"php": "^8.1"
},
"require-dev": {
"mockery/mockery": "^1.5",
"orchestra/testbench": "^8.0|^9.2|^10.0|^11.0",
"pestphp/pest": "^2.1|^3.1|^4.0",
"phpunit/php-code-coverage": "^10.0|^11.0|^12.0",
"phpunit/phpunit": "^10.5|^11.5|^12.5",
"spatie/pest-plugin-test-time": "^2.2|^3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\LaravelPackageTools\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"role": "Developer"
}
],
"description": "Tools for creating Laravel packages",
"homepage": "https://github.com/spatie/laravel-package-tools",
"keywords": [
"laravel-package-tools",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/laravel-package-tools/issues",
"source": "https://github.com/spatie/laravel-package-tools/tree/1.93.3"
},
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2026-09-28T07:16:50+00:00"
},
{
"name": "spatie/laravel-permission",
"version": "6.25.0",
@@ -8338,66 +8587,6 @@
},
"time": "2024-05-16T03:13:13+00:00"
},
{
"name": "myclabs/deep-copy",
"version": "1.13.4",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a",
"reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/collections": "<1.6.8",
"doctrine/common": "<2.13.3 || >=3 <3.2.2"
},
"require-dev": {
"doctrine/collections": "^1.6.8",
"doctrine/common": "^2.13.3 || ^3.2.2",
"phpspec/prophecy": "^1.10",
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"type": "library",
"autoload": {
"files": [
"src/DeepCopy/deep_copy.php"
],
"psr-4": {
"DeepCopy\\": "src/DeepCopy/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Create deep copies (clones) of your objects",
"keywords": [
"clone",
"copy",
"duplicate",
"object",
"object graph"
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.4"
},
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
"type": "tidelift"
}
],
"time": "2025-08-01T08:46:24+00:00"
},
{
"name": "nunomaduro/collision",
"version": "v8.9.4",
+191
View File
@@ -0,0 +1,191 @@
<?php
use App\Http\Middleware\DocsToken;
return [
/*
* Which routes to document. String or array form; use Scramble::routes() for custom selection.
*
* 'api_path' => [
* 'include' => 'api',
* 'exclude' => ['api/internal'],
* ],
*
* Without *, patterns match path segments (api matches api and api/users, not apiary).
* With *, Str::is is used (e.g. api/v*).
*
* One static include → default server is /{include} and paths are stripped (/users).
* Multiple includes or wildcards → server defaults to / and paths stay full (/api/users).
* Override with `servers`, or use Scramble::registerApi() for separate bases.
*/
'api_path' => 'api',
/*
* Your API domain. By default, app domain is used. This is also a part of the default API routes
* matcher, so when implementing your own, make sure you use this config if needed.
*/
'api_domain' => null,
/*
* The path where your OpenAPI specification will be exported.
*/
'export_path' => 'api.json',
/*
* Cache configuration for the generated OpenAPI document.
*
* Use `scramble:cache` to warm the cache and `scramble:clear` to invalidate it.
*/
'cache' => [
'key' => 'scramble.openapi',
'store' => 'file',
],
'info' => [
/*
* API version.
*/
'version' => env('API_VERSION', '0.0.1'),
/*
* Description rendered on the home page of the API documentation (`/docs/api`).
*/
'description' => 'Dokumentasi API Verifikator UNTAN.',
],
'ui' => [
'title' => null,
],
/*
* Load Scramble's development tools on documentation pages. An explicit
* SCRAMBLE_DEV_TOOLS value takes precedence over APP_DEBUG.
*/
'dev_tools' => [
'enabled' => env('SCRAMBLE_DEV_TOOLS', env('APP_DEBUG', false)),
],
'renderer' => 'elements',
'renderers' => [
/*
* Stoplight Elements config options: https://docs.stoplight.io/docs/elements/b074dc47b2826-elements-configuration-options
*/
'elements' => [
'view' => 'scramble::docs',
'theme' => 'light',
'hideTryIt' => false,
'hideSchemas' => true,
'logo' => '',
'tryItCredentialsPolicy' => 'include',
'layout' => 'responsive',
'router' => 'hash',
],
/*
* Scalar API reference config options: https://scalar.com/products/api-references/configuration
*/
'scalar' => [
'view' => 'scramble::scalar',
'cdn' => 'https://cdn.jsdelivr.net/npm/@scalar/api-reference',
'theme' => 'laravel',
'proxyUrl' => 'https://proxy.scalar.com',
'darkMode' => false,
'showDeveloperTools' => 'never',
'agent' => ['disabled' => true],
'credentials' => 'include',
],
],
/*
* The list of servers of the API. By default, when `null`, server URL will be created from
* `scramble.api_path` and `scramble.api_domain` config variables. When providing an array, you
* will need to specify the local server URL manually (if needed).
*
* Example of non-default config (final URLs are generated using Laravel `url` helper):
*
* ```php
* 'servers' => [
* 'Live' => 'api',
* 'Prod' => 'https://scramble.dedoc.co/api',
* ],
* ```
*/
'servers' => null,
/**
* Determines how Scramble stores the descriptions of enum cases.
* Available options:
* - 'description' – Case descriptions are stored as the enum schema's description using table formatting.
* - 'extension' – Case descriptions are stored in the `x-enumDescriptions` enum schema extension.
*
* @see https://redocly.com/docs-legacy/api-reference-docs/specification-extensions/x-enum-descriptions
* - false - Case descriptions are ignored.
*/
'enum_cases_description_strategy' => 'description',
/**
* Determines how Scramble stores the names of enum cases.
* Available options:
* - 'names' – Case names are stored in the `x-enumNames` enum schema extension.
* - 'varnames' - Case names are stored in the `x-enum-varnames` enum schema extension.
* - false - Case names are not stored.
*/
'enum_cases_names_strategy' => false,
/**
* When Scramble encounters deep objects in query parameters, it flattens the parameters so the generated
* OpenAPI document correctly describes the API. Flattening deep query parameters is relevant until
* OpenAPI 3.2 is released and query string structure can be described properly.
*
* For example, this nested validation rule describes the object with `bar` property:
* `['foo.bar' => ['required', 'int']]`.
*
* When `flatten_deep_query_parameters` is `true`, Scramble will document the parameter like so:
* `{"name":"foo[bar]", "schema":{"type":"int"}, "required":true}`.
*
* When `flatten_deep_query_parameters` is `false`, Scramble will document the parameter like so:
* `{"name":"foo", "schema": {"type":"object", "properties":{"bar":{"type": "int"}}, "required": ["bar"]}, "required":true}`.
*/
'flatten_deep_query_parameters' => true,
// Token akses halaman /docs diambil dari DOCS_TOKEN (lihat App\Http\Middleware\DocsToken).
'docs_token' => env('DOCS_TOKEN'),
/*
* Endpoint yang ditampilkan di /docs, berupa pola URI route (mendukung wildcard `*`).
* Kosongkan ([]) untuk menampilkan semua endpoint. Contoh:
* 'visible_routes' => [],
*/
'visible_routes' => ['api/v1/pengajuan-absen*'],
'middleware' => [
DocsToken::class,
],
'extensions' => [],
/*
* Automatically document API security (OpenAPI `security` / `securitySchemes`) based on route
* middleware.
*
* Disabled by default. Uncomment the line below to enable `MiddlewareAuthSecurityStrategy`.
* When at least one documented route uses middleware matching the configured patterns (by default
* `auth` and `auth:*`), bearer auth is applied globally. Routes without matching middleware are
* marked as public (`security: []`).
*
* Set to `null` explicitly to disable. If you already configure security manually via
* `afterOpenApiGenerated` / `extendOpenApi`, keep this disabled to avoid duplicate schemes.
*
* Customize with a class-string or [class, options]:
*
* 'security_strategy' => [
* \Dedoc\Scramble\SecurityDocumentation\MiddlewareAuthSecurityStrategy::class,
* [
* 'middleware' => ['auth', 'auth:*'],
* 'scheme' => \Dedoc\Scramble\Support\Generator\SecurityScheme::http('bearer'),
* ],
* ],
*/
// 'security_strategy' => \Dedoc\Scramble\SecurityDocumentation\MiddlewareAuthSecurityStrategy::class,
'security_strategy' => null,
];
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
if (Schema::connection('rekapitulasi')->hasColumn('p1', 'deleted_at')) {
return;
}
Schema::connection('rekapitulasi')->table('p1', function (Blueprint $table) {
$table->softDeletes();
});
}
public function down(): void
{
if (! Schema::connection('rekapitulasi')->hasColumn('p1', 'deleted_at')) {
return;
}
Schema::connection('rekapitulasi')->table('p1', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
};
+287
View File
@@ -0,0 +1,287 @@
{
"199002132025062005": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199003202025061004": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199112282025061003": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199207202025061002": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199212142025061004": {
"p2_bruto": 11786313.6,
"p2_pajak": 0,
"p2_netto": 11786313.6
},
"199301212025062001": {
"p2_bruto": 13598877.6,
"p2_pajak": 0,
"p2_netto": 13598877.6
},
"199303222025061005": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199312112025061004": {
"p2_bruto": 13013280,
"p2_pajak": 0,
"p2_netto": 13013280
},
"199312202025061004": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199312312025062006": {
"p2_bruto": 18944832,
"p2_pajak": 947241.6,
"p2_netto": 17997590.4
},
"199403142025061006": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199403212025061001": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199411272025061004": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199412092025062006": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199501192025061004": {
"p2_bruto": 13431564,
"p2_pajak": 0,
"p2_netto": 13431564
},
"199502272025061007": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199503042025062007": {
"p2_bruto": 12204597.6,
"p2_pajak": 0,
"p2_netto": 12204597.6
},
"199503282025061008": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199504082025061005": {
"p2_bruto": 18405264,
"p2_pajak": 920263.2,
"p2_netto": 17485000.8
},
"199505052025061004": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199506072025061004": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199506222025062004": {
"p2_bruto": 18405264,
"p2_pajak": 920263.2,
"p2_netto": 17485000.8
},
"199510262025061003": {
"p2_bruto": 19484400,
"p2_pajak": 974220,
"p2_netto": 18510180
},
"199512162025062009": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199512312025062006": {
"p2_bruto": 16786560,
"p2_pajak": 839328,
"p2_netto": 15947232
},
"199603192025061007": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199604082025061006": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199605232025062010": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199608092025061005": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199609092025062010": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199610022025061003": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199611192025061007": {
"p2_bruto": 18189436.8,
"p2_pajak": 909471.84,
"p2_netto": 17279964.96
},
"199711112025062011": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199712042025061009": {
"p2_bruto": 18333321.6,
"p2_pajak": 916666.08,
"p2_netto": 17416655.52
},
"199804032025061004": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199804152025062009": {
"p2_bruto": 17326128,
"p2_pajak": 866306.4,
"p2_netto": 16459821.6
},
"199805242025061008": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199806232025062007": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199808172025062009": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199809292025061010": {
"p2_bruto": 17614404,
"p2_pajak": 0,
"p2_netto": 17614404
},
"199901152025062009": {
"p2_bruto": 16570732.8,
"p2_pajak": 828536.64,
"p2_netto": 15742196.16
},
"199909162025062013": {
"p2_bruto": 18944832,
"p2_pajak": 947241.6,
"p2_netto": 17997590.4
},
"199910092025062015": {
"p2_bruto": 16498790.4,
"p2_pajak": 824939.52,
"p2_netto": 15673850.88
},
"199911282025062010": {
"p2_bruto": 0,
"p2_pajak": 0,
"p2_netto": 0
},
"199912282025062007": {
"p2_bruto": 14268132,
"p2_pajak": 0,
"p2_netto": 14268132
},
"200002092025062008": {
"p2_bruto": 18405264,
"p2_pajak": 920263.2,
"p2_netto": 17485000.8
},
"200003222025061006": {
"p2_bruto": 14268132,
"p2_pajak": 0,
"p2_netto": 14268132
},
"200006172025061004": {
"p2_bruto": 18153465.6,
"p2_pajak": 907673.28,
"p2_netto": 17245792.32
},
"200008082025062017": {
"p2_bruto": 16786560,
"p2_pajak": 839328,
"p2_netto": 15947232
},
"200008242025062012": {
"p2_bruto": 16786560,
"p2_pajak": 839328,
"p2_netto": 15947232
},
"200010292025061005": {
"p2_bruto": 18405264,
"p2_pajak": 920263.2,
"p2_netto": 17485000.8
},
"200105232025061010": {
"p2_bruto": 13738305.6,
"p2_pajak": 0,
"p2_netto": 13738305.6
},
"200107272025062014": {
"p2_bruto": 19214616,
"p2_pajak": 960730.8,
"p2_netto": 18253885.2
},
"200109152025062009": {
"p2_bruto": 15491596.8,
"p2_pajak": 774579.84,
"p2_netto": 14717016.96
},
"200205012025062004": {
"p2_bruto": 13431564,
"p2_pajak": 0,
"p2_netto": 13431564
},
"200205052025061010": {
"p2_bruto": 9388152,
"p2_pajak": 0,
"p2_netto": 9388152
},
"200207162025061003": {
"p2_bruto": 12678652.8,
"p2_pajak": 0,
"p2_netto": 12678652.8
}
}
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="id">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Akses Ditolak | {{ config('app.name') }}</title>
<link rel="shortcut icon" href="{{ asset('assets/images/logo-untan.png') }}">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
<style>
body { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #fafbfe; font-family: "Inter", sans-serif; color: #000; }
.box { max-width: 420px; padding: 40px 32px; text-align: center; background: #fff; border: 1px solid #e3e6ec; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
img { height: 56px; }
h1 { font-size: 20px; margin: 16px 0 8px; }
p { margin: 0; font-size: 14px; color: #6c757d; line-height: 1.6; }
</style>
</head>
<body>
<div class="box">
<img src="{{ asset('assets/images/logo-untan.png') }}" alt="UNTAN">
<h1>Akses Ditolak</h1>
<p>{{ $message }}</p>
</div>
</body>
</html>
@@ -56,6 +56,9 @@
$actionButtons = '<button type="button" class="btn btn-sm btn-outline-success me-2" id="btn-export">
<i class="uil-file-download-alt"></i> Export
</button>
<button type="button" class="btn btn-sm btn-outline-primary me-2" id="btnPerbaruiData">
<i class="mdi mdi-database-refresh-outline"></i> Perbarui Data
</button>
<button type="button" class="btn btn-sm btn-outline-secondary" id="btnRefresh">
<i class="uil-refresh"></i>
Refresh
@@ -137,6 +140,24 @@
</div>
</div>
</div>
<div class="modal fade" id="warmCacheModal" tabindex="-1" aria-hidden="true" data-bs-backdrop="static"
data-bs-keyboard="false">
<div class="modal-dialog modal-sm modal-dialog-centered">
<div class="modal-content">
<div class="modal-body text-center p-4">
<h6 class="mb-1">Memperbarui Data Keseluruhan</h6>
<p class="text-muted small mb-3">Menyusun ulang rekap P1, P2, THR, R13, dan Publikasi…</p>
<div class="progress" style="height: 14px;">
<div id="warm-cache-bar"
class="progress-bar progress-bar-striped progress-bar-animated bg-primary" role="progressbar"
style="width: 0%"></div>
</div>
<div id="warm-cache-pct" class="fw-semibold mt-2">0%</div>
</div>
</div>
</div>
</div>
@endsection
@section('js')
@@ -164,6 +185,14 @@
'"></i> ' + jenis.toUpperCase() + '</small>';
}
// Penanda pegawai yang P2-nya diambil dari snapshot JSON (CPNS), warna tosca.
function renderCpnsTag(sumber) {
if (sumber !== 'json') {
return '';
}
return ' <small class="d-inline-block fw-bold" title="P2 dari snapshot JSON (belum tersimpan di DB)" style="padding: 1px 18px 1px 6px; color: #0fb5a5; background: linear-gradient(to right, rgba(20, 184, 166, 0.25), rgba(20, 184, 166, 0)); clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%);"><i class="uil-file-check-alt"></i> CPNS</small>';
}
var table = $('#keseluruhan-table').DataTable({
processing: true,
serverSide: true,
@@ -191,17 +220,17 @@
return '<div>' +
'<div class="fw-semibold">' + nama + '</div>' +
'<div class="text-muted small font-monospace">' + nip + '</div>' +
'<div class="mt-1">' + renderJenisPegawaiTag(row.jenis_pegawai) + '</div>' +
'<div class="mt-1">' + renderJenisPegawaiTag(row.jenis_pegawai) + renderCpnsTag(row.p2_sumber) + '</div>' +
'</div>';
}
},
{ data: 'nama_unit', name: 'nama_unit' },
{ data: 'jumlah_p1', name: 'jumlah_p1', className: 'text-end font-monospace', orderable: false },
{ data: 'jumlah_p2', name: 'jumlah_p2', className: 'text-end font-monospace', orderable: false },
{ data: 'jumlah_thr', name: 'jumlah_thr', className: 'text-end font-monospace', orderable: false },
{ data: 'jumlah_r13', name: 'jumlah_r13', className: 'text-end font-monospace', orderable: false },
{ data: 'jumlah_publikasi', name: 'jumlah_publikasi', className: 'text-end font-monospace', orderable: false },
{ data: 'total', name: 'total', className: 'text-end font-monospace fw-bold', orderable: false }
{ data: 'jumlah_p1', name: 'jumlah_p1', className: 'text-end font-monospace' },
{ data: 'jumlah_p2', name: 'jumlah_p2', className: 'text-end font-monospace' },
{ data: 'jumlah_thr', name: 'jumlah_thr', className: 'text-end font-monospace' },
{ data: 'jumlah_r13', name: 'jumlah_r13', className: 'text-end font-monospace' },
{ data: 'jumlah_publikasi', name: 'jumlah_publikasi', className: 'text-end font-monospace' },
{ data: 'total', name: 'total', className: 'text-end font-monospace fw-bold' }
],
order: [],
language: {
@@ -237,6 +266,51 @@
}, false);
});
$('#btnPerbaruiData').on('click', function() {
var button = $(this);
var modal = bootstrap.Modal.getOrCreateInstance(document.getElementById('warmCacheModal'));
var $bar = $('#warm-cache-bar');
var $pct = $('#warm-cache-pct');
var pct = 0;
function setPct(v) {
pct = v;
$bar.css('width', v + '%');
$pct.text(v + '%');
}
setPct(0);
button.prop('disabled', true);
modal.show();
// Progres merangkak sampai ~90% selama menunggu server.
var timer = setInterval(function() {
if (pct < 90) {
setPct(Math.min(90, pct + Math.max(1, Math.round((90 - pct) / 12))));
}
}, 350);
$.ajax({
url: "{{ route('remunerasi.keseluruhan.refresh') }}",
method: 'POST',
data: { tahun: $('#filter-tahun').val() }
}).done(function(res) {
clearInterval(timer);
setPct(100);
setTimeout(function() {
modal.hide();
table.ajax.reload(null, false);
showSuccess('Berhasil!', 'Data keseluruhan diperbarui - ' + (res.rows || 0) + ' pegawai (' + (res.seconds || 0) + ' detik).');
}, 450);
}).fail(function(xhr) {
clearInterval(timer);
modal.hide();
showError('Gagal', (xhr.responseJSON && xhr.responseJSON.message) || 'Terjadi kesalahan saat memperbarui data.');
}).always(function() {
button.prop('disabled', false);
});
});
$('#btn-export').on('click', function() {
var button = $(this);
var originalHtml = button.html();
+234
View File
@@ -0,0 +1,234 @@
<!doctype html>
<html lang="en" data-theme="{{ $config->renderer()->get('theme', 'light') }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="color-scheme" content="{{ $config->renderer()->get('theme', 'light') }}">
<title>{{ $config->get('ui.title') ?? config('app.name') . ' - API Docs' }}</title>
<script src="https://unpkg.com/@stoplight/elements@8.4.2/web-components.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@stoplight/elements@8.4.2/styles.min.css">
<link rel="shortcut icon" href="{{ asset('assets/images/logo-untan.png') }}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
@include('scramble::dev-tools', ['renderer' => 'elements'])
<script>
const originalFetch = window.fetch;
// intercept TryIt requests and add the XSRF-TOKEN header,
// which is necessary for Sanctum cookie-based authentication to work correctly
window.fetch = (url, options) => {
const CSRF_TOKEN_COOKIE_KEY = "XSRF-TOKEN";
const CSRF_TOKEN_HEADER_KEY = "X-XSRF-TOKEN";
const getCookieValue = (key) => {
const cookie = document.cookie.split(';').find((cookie) => cookie.trim().startsWith(key));
return cookie?.split("=")[1];
};
const updateFetchHeaders = (
headers,
headerKey,
headerValue,
) => {
if (headers instanceof Headers) {
headers.set(headerKey, headerValue);
} else if (Array.isArray(headers)) {
headers.push([headerKey, headerValue]);
} else if (headers) {
headers[headerKey] = headerValue;
}
};
const csrfToken = getCookieValue(CSRF_TOKEN_COOKIE_KEY);
if (csrfToken) {
const { headers = new Headers() } = options || {};
updateFetchHeaders(headers, CSRF_TOKEN_HEADER_KEY, decodeURIComponent(csrfToken));
return originalFetch(url, {
...options,
headers,
});
}
return originalFetch(url, options);
};
</script>
<style>
:root { --verif-primary: #0166d2; --verif-bg: #fafbfe; --verif-topbar: 70px; }
html, body { margin:0; height:100%; font-family: "Inter", sans-serif; }
elements-api { display: block; height: 100%; }
elements-api, elements-api * { font-family: "Inter", sans-serif; }
elements-api { --color-primary: var(--verif-primary); --color-primary-light: #3d8ce0; --color-primary-dark: #014f9f; --color-primary-darker: #013a75; }
.verif-topbar { height: var(--verif-topbar); box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: #fff; border-bottom: 1px solid #e3e6ec; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.verif-topbar img { height: 36px; }
.verif-topbar span { font-size: 20px; font-weight: 600; color: #000; }
.verif-topbar small { font-size: 13px; color: #6c757d; margin-left: 6px; }
.verif-content { height: calc(100vh - var(--verif-topbar)); overflow-y: auto; }
body { background-color: var(--verif-bg); }
/* Layout mengikuti aplikasi Verifikator: sidebar kiri + topbar */
:root { --verif-side: 260px; }
.verif-side { position: fixed; top: 0; bottom: 0; left: 0; width: var(--verif-side); background: #fff; border-right: 1px solid #e3e6ec; display: flex; flex-direction: column; z-index: 10; }
.verif-logo { height: var(--verif-topbar); display: flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; text-decoration: none; }
.verif-logo img { height: 36px; margin-bottom: 5px; }
.verif-logo span { font-size: 20px; color: #000; }
.verif-nav { flex: 1; overflow-y: auto; padding: 0 0 24px; }
.verif-nav-title { padding: 12px 20px 6px; font-size: 12px; letter-spacing: .05rem; text-transform: uppercase; font-weight: 700; color: #000; }
.verif-nav a { display: flex; align-items: center; gap: 8px; margin: 2px 8px; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: #000; text-decoration: none; }
.verif-nav a:hover { color: var(--verif-primary); }
.verif-nav a.active { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1d4ed8 100%); color: #fff; }
.verif-nav a .m { flex-shrink: 0; min-width: 34px; text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; border-radius: 4px; padding: 1px 4px; background: #e8f1fb; color: var(--verif-primary); }
.verif-nav a.active .m { background: rgba(255,255,255,.2); color: #fff; }
.verif-nav a .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Warna metode HTTP */
.verif-nav a .m { --mc: #0166d2; background: color-mix(in srgb, var(--mc) 14%, #fff); color: var(--mc); }
.verif-nav a .m-get { --mc: #0acf97; }
.verif-nav a .m-post { --mc: #0166d2; }
.verif-nav a .m-put { --mc: #e6a700; }
.verif-nav a .m-patch { --mc: #fd7e14; }
.verif-nav a .m-delete { --mc: #fa5c7c; }
.verif-nav a.active .m { background: rgba(255,255,255,.22); color: #fff; }
/* Scrollbar tipis seperti simplebar di aplikasi */
* { scrollbar-width: thin; scrollbar-color: rgba(115, 124, 138, .45) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(115, 124, 138, .45); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(115, 124, 138, .7); }
.verif-nav { padding-right: 2px; }
.verif-main { margin-left: var(--verif-side); height: 100vh; display: flex; flex-direction: column; }
/* Area konten: lebar penuh, rapi */
.sl-elements-api > div.sl-overflow-y-auto { padding-left: 32px !important; padding-right: 32px !important; background: var(--verif-bg) !important; }
.sl-elements-api > div.sl-overflow-y-auto > div { max-width: none !important; width: 100%; padding-top: 32px !important; padding-bottom: 48px !important; }
[data-testid="two-column-right"] { width: 52% !important; margin-left: 40px !important; }
[data-testid="two-column-right"] > * { border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-testid="two-column-left"] { min-width: 0; }
.sl-elements-api h1 { font-size: 30px !important; font-weight: 600 !important; }
.sl-elements-api h2 { font-size: 22px !important; font-weight: 600 !important; }
.sl-elements-api h3 { font-size: 17px !important; font-weight: 600 !important; }
/* Contoh respons/request: lebar penuh, tanpa terpotong */
[data-testid="two-column-right"] pre, [data-testid="two-column-right"] code { font-size: 13px; }
[data-testid="two-column-right"] .sl-code-viewer, [data-testid="two-column-right"] .sl-panel__content { max-height: none !important; }
.verif-topbar { justify-content: flex-start; flex-shrink: 0; }
.verif-content { flex: 1; min-height: 0; height: auto !important; }
/* Sembunyikan sidebar bawaan Elements pada layar lebar (diganti sidebar di atas) */
.sl-elements-api > div:first-child:has([style*="min-width: 300px"]) { display: none !important; }
@media (max-width: 991px) {
.verif-side { display: none; }
.verif-main { margin-left: 0; }
}
/* issues about the dark theme of stoplight/mosaic-code-viewer using web component:
* https://github.com/stoplightio/elements/issues/2188#issuecomment-1485461965
*/
[data-theme="dark"] .token.property {
color: rgb(128, 203, 196) !important;
}
[data-theme="dark"] .token.operator {
color: rgb(255, 123, 114) !important;
}
[data-theme="dark"] .token.number {
color: rgb(247, 140, 108) !important;
}
[data-theme="dark"] .token.string {
color: rgb(165, 214, 255) !important;
}
[data-theme="dark"] .token.boolean {
color: rgb(121, 192, 255) !important;
}
[data-theme="dark"] .token.punctuation {
color: #dbdbdb !important;
}
</style>
</head>
<body style="height: 100vh; overflow-y: hidden">
@php
$verifMethods = ['get', 'post', 'put', 'patch', 'delete'];
$verifGroups = [];
foreach (($spec['paths'] ?? []) as $verifPath => $verifItem) {
foreach ($verifItem as $verifMethod => $verifOp) {
if (! in_array($verifMethod, $verifMethods, true) || empty($verifOp['operationId'])) {
continue;
}
$verifGroups[$verifOp['tags'][0] ?? 'Lainnya'][] = [
'id' => $verifOp['operationId'],
'method' => $verifMethod,
'label' => $verifOp['summary'] ?? $verifPath,
'path' => $verifPath,
];
}
}
@endphp
<aside class="verif-side">
<a class="verif-logo" href="#/">
<img src="{{ asset('assets/images/logo-untan.png') }}" alt="UNTAN">
<span>{{ config('app.name') }}</span>
</a>
<nav class="verif-nav" id="verif-nav">
<div class="verif-nav-title">Dashboard</div>
<a href="#/" data-hash="#/"><span class="t">Overview</span></a>
@foreach($verifGroups as $verifTag => $verifOps)
<div class="verif-nav-title">{{ preg_replace('/(?<=[a-z])(?=[A-Z])/', ' ', $verifTag) }}</div>
@foreach($verifOps as $verifOp)
<a href="#/operations/{{ rawurlencode($verifOp['id']) }}" data-hash="#/operations/{{ rawurlencode($verifOp['id']) }}" title="{{ $verifOp['path'] }}">
<span class="m m-{{ $verifOp['method'] }}">{{ $verifOp['method'] }}</span>
<span class="t">{{ $verifOp['label'] }}</span>
</a>
@endforeach
@endforeach
</nav>
</aside>
<div class="verif-main">
<header class="verif-topbar">
<span>API Documentation</span>
</header>
<div class="verif-content">
<elements-api
id="docs"
@foreach($config->renderer()->all(except: ['theme']) as $key => $value)
@continue(! $value)
{{ $key }}="{{ $value === true ? 'true' : ($value === false ? 'false' : $value) }}"
@endforeach
/>
<script>
(async () => {
const docs = document.getElementById('docs');
docs.apiDescriptionDocument = @json($spec);
})();
// Tandai item sidebar yang aktif sesuai hash (router Elements memakai hash).
(() => {
const links = document.querySelectorAll('#verif-nav a');
const sync = () => {
const hash = location.hash || '#/';
links.forEach((a) => {
const on = a.dataset.hash === hash;
a.classList.toggle('active', on);
if (on) a.scrollIntoView({ block: 'nearest' });
});
};
addEventListener('hashchange', sync);
sync();
})();
</script>
@if($config->renderer()->get('theme', 'light') === 'system')
<script>
var mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
function updateTheme(e) {
if (e.matches) {
window.document.documentElement.setAttribute('data-theme', 'dark');
window.document.getElementsByName('color-scheme')[0].setAttribute('content', 'dark');
} else {
window.document.documentElement.setAttribute('data-theme', 'light');
window.document.getElementsByName('color-scheme')[0].setAttribute('content', 'light');
}
}
mediaQuery.addEventListener('change', updateTheme);
updateTheme(mediaQuery);
</script>
@endif
</div>
</div>
</body>
</html>
+1
View File
@@ -76,5 +76,6 @@ Route::middleware('permission:Baca Pembayaran')->prefix('/remunerasi')->name('re
Route::get('/', [KeseluruhanController::class, 'index'])->name('index');
Route::get('/data', [KeseluruhanController::class, 'data'])->name('data');
Route::get('/export', [KeseluruhanController::class, 'export'])->name('export');
Route::post('/refresh', [KeseluruhanController::class, 'refresh'])->name('refresh');
});
});