fix(user,trash): fix 500 server error when deleting user with operational history and protect audit integrity

This commit is contained in:
Ray1111-aa
2026-11-03 09:14:53 +07:00
parent 5a4969b467
commit ff3ab616e0
9 changed files with 236 additions and 52 deletions
+3 -3
View File
@@ -302,7 +302,7 @@ class QmaUnitManagementTest extends TestCase
$vehicle->refresh();
$this->assertEquals('inside_site', $vehicle->site_status);
$this->assertEquals($this->gate->name, $vehicle->location);
$this->assertEquals($this->guard->name, $vehicle->location_updated_by);
$this->assertEquals($this->gateOfficer->name, $vehicle->location_updated_by);
$this->assertStringContainsString('TRX-IN-001', $vehicle->location_note);
// Verifikasi riwayat tersimpan otomatis bersumber gate_crossing
@@ -312,7 +312,7 @@ class QmaUnitManagementTest extends TestCase
'location' => $this->gate->name,
'source' => 'gate_crossing',
'vehicle_activity_id' => $activity->id,
'user_name' => $this->guard->name,
'user_name' => $this->gateOfficer->name,
]);
}
@@ -362,7 +362,7 @@ class QmaUnitManagementTest extends TestCase
$vehicle->refresh();
$this->assertEquals('outside_site', $vehicle->site_status);
$this->assertEquals('Luar Site - Antar Dokumen ke Kantor Jambi', $vehicle->location);
$this->assertEquals($this->guard->name, $vehicle->location_updated_by);
$this->assertEquals($this->gateOfficer->name, $vehicle->location_updated_by);
// Verifikasi riwayat tersimpan otomatis
$this->assertDatabaseHas('vehicle_location_histories', [