feat(qma): add start time and remove breakdown hours from support timesheet form

This commit is contained in:
Ray1111-aa
2026-10-22 08:34:15 +07:00
parent 61f2a85e3e
commit d1711ee292
3 changed files with 108 additions and 128 deletions
@@ -120,6 +120,7 @@ class QmaSupportTimesheetTest extends TestCase
'vehicle_code' => 'EX01', // Diketik langsung
'operator_id' => $this->operator->id,
'date' => Carbon::today()->toDateString(),
'start_time' => '08:15',
'shift' => 'Shift Siang',
'meter_type' => 'HM',
'start_meter' => 1265.50, // Odometer awal saja
@@ -147,6 +148,10 @@ class QmaSupportTimesheetTest extends TestCase
'status' => 'Operation',
]);
$saved = UnitSupportTimesheet::where('vehicle_id', $this->supportUnit->id)->first();
$this->assertNotNull($saved);
$this->assertStringStartsWith('08:15', (string) $saved->start_time);
// Verifikasi odometer kendaraan terupdate ke start_meter terbaru
$this->supportUnit->refresh();
$this->assertEquals(1265.50, (float) $this->supportUnit->current_km);
@@ -275,6 +280,7 @@ class QmaSupportTimesheetTest extends TestCase
'vehicle_id' => $this->supportUnit->id,
'operator_id' => $this->operator->id,
'date' => Carbon::today()->toDateString(),
'start_time' => '07:45',
'shift' => 'Shift 2 (Malam)',
'meter_type' => 'HM',
'start_meter' => 1250.00,
@@ -293,6 +299,7 @@ class QmaSupportTimesheetTest extends TestCase
$timesheet->refresh();
$this->assertEquals(9.50, (float) $timesheet->operating_hours);
$this->assertEquals('Shift 2 (Malam)', $timesheet->shift);
$this->assertStringStartsWith('07:45', (string) $timesheet->start_time);
$this->assertEquals('Vertical Shaft', $timesheet->location);
$this->assertEquals('Standby', $timesheet->status);
}