Penambahn P1 Dev

This commit is contained in:
Ariyutta
2026-10-20 10:24:22 +07:00
parent 8418a63fc0
commit ee0e6deacc
43 changed files with 5406 additions and 44 deletions
@@ -11,6 +11,7 @@ use App\Models\Verifikator\Periode;
use App\Models\Verifikator\Team;
use App\Models\Verifikator\UnitKerjaPegawai;
use App\Services\DawaiService;
use App\Services\WebPresensiDocumentService;
use App\Services\VerifikatorWebhookService;
use Carbon\Carbon;
use Exception;
@@ -28,6 +29,8 @@ class HonorerController extends Controller
protected $periodeAktif;
private ?string $verificationError = null;
public function __construct(DawaiService $dawaiService)
{
$this->dawaiService = $dawaiService;
@@ -424,7 +427,7 @@ class HonorerController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -452,7 +455,7 @@ class HonorerController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -601,7 +604,7 @@ class HonorerController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -641,7 +644,7 @@ class HonorerController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -680,14 +683,27 @@ class HonorerController extends Controller
'message' => $catatan,
]);
}
// Verifikasi web memakai PDF asli, tanpa proses tanda tangan elektronik.
$linkDrive = $status === 'Diterima'
? app(WebPresensiDocumentService::class)->upload($pengajuan)
: null;
if ($status === 'Diterima' && ! $linkDrive) {
$this->verificationError = 'Gagal mengunggah PDF ke Google Drive. Periksa file pengajuan dan konfigurasi Drive, lalu coba kembali.';
DB::rollBack();
return null;
}
$dawai = $this->dawaiService->verifikasiUsulanPresensi($pengajuan->nip, [$pengajuan->tanggal_mulai], $this->status($status), $pengajuan->getRawOriginal('kategori'));
if (! $dawai) {
Log::error("Presensi DAWAI: $pengajuan->nip ($status)");
throw new Exception('Presensi: DAWAI ERROR');
}
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip)) {
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip, $linkDrive)) {
throw new Exception('Presensi: DAWAI ERROR (siskaPengajuanPresensi)');
}
if ($linkDrive) {
$pengajuan->update(['file' => $linkDrive]);
}
DB::commit();
if ($status !== 'Diajukan') {
@@ -11,6 +11,7 @@ use App\Models\Verifikator\Team;
use App\Models\Verifikator\Tendik;
use App\Models\Verifikator\UnitKerjaPegawai;
use App\Services\DawaiService;
use App\Services\WebPresensiDocumentService;
use App\Services\VerifikatorWebhookService;
use Carbon\Carbon;
use Exception;
@@ -28,6 +29,8 @@ class TendikController extends Controller
protected $periodeAktif;
private ?string $verificationError = null;
public function __construct(DawaiService $dawaiService)
{
$this->dawaiService = $dawaiService;
@@ -401,7 +404,7 @@ class TendikController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -424,7 +427,7 @@ class TendikController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -568,7 +571,7 @@ class TendikController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -603,7 +606,7 @@ class TendikController extends Controller
return response()->json([
'success' => false,
'message' => 'Gagal melakukan verifikasi presensi',
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
]);
}
@@ -645,14 +648,27 @@ class TendikController extends Controller
]);
}
// Verifikasi web memakai PDF asli, tanpa proses tanda tangan elektronik.
$linkDrive = $status === 'Diterima'
? app(WebPresensiDocumentService::class)->upload($pengajuan)
: null;
if ($status === 'Diterima' && ! $linkDrive) {
$this->verificationError = 'Gagal mengunggah PDF ke Google Drive. Periksa file pengajuan dan konfigurasi Drive, lalu coba kembali.';
DB::rollBack();
return null;
}
$dawai = $this->dawaiService->verifikasiUsulanPresensi($pengajuan->nip, [$pengajuan->tanggal_mulai], $this->status($status), $pengajuan->getRawOriginal('kategori'));
if (! $dawai) {
Log::error("Presensi DAWAI: $pengajuan->nip ($status)");
throw new Exception('Presensi: DAWAI ERROR');
}
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip)) {
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip, $linkDrive)) {
throw new Exception('Presensi: DAWAI ERROR (siskaPengajuanPresensi)');
}
if ($linkDrive) {
$pengajuan->update(['file' => $linkDrive]);
}
DB::commit();
if ($status !== 'Diajukan') {