security(core): patch driver IDOR, protect employee core role, harden XLSX parser, and fix timesheet concurrency race condition

This commit is contained in:
Ray1111-aa
2026-10-28 15:37:01 +07:00
parent 48678df82b
commit 1e1286e3e2
9 changed files with 155 additions and 32 deletions
@@ -284,21 +284,23 @@ class SupportTimesheetController extends Controller
: null;
$operatingHours = $endMeter !== null ? max(0, $endMeter - $startMeter) : null;
$shift = $validated['shift'] ?: 'Shift Siang';
$timesheetNo = UnitSupportTimesheet::generateTimesheetNo(Carbon::parse($validated['date']));
$updaterName = auth()->user()?->name ?? 'Admin QMA';
$timesheetNo = null;
DB::transaction(function () use (
$validated,
$vehicle,
$operator,
$timesheetNo,
$startMeter,
$endMeter,
$operatingHours,
$shift,
$updaterName
$updaterName,
&$timesheetNo
) {
// Generate nomor timesheet unik di dalam transaksi untuk meminimalkan bentrokan
$timesheetNo = UnitSupportTimesheet::generateTimesheetNo(Carbon::parse($validated['date']));
// 1. Simpan Data Timesheet Heavy Equipment
$timesheet = UnitSupportTimesheet::create([
'timesheet_no' => $timesheetNo,