feat(qma): implement unit support timesheet input, vehicle meter & location sync, and exports

This commit is contained in:
Ray1111-aa
2026-10-20 20:46:48 +07:00
parent fb67d7c63d
commit 0cd02a17cd
9 changed files with 2154 additions and 2 deletions
+10
View File
@@ -227,6 +227,16 @@ class Vehicle extends Model
return $this->hasOne(VehicleLocationHistory::class)->latestOfMany('recorded_at');
}
public function supportTimesheets(): HasMany
{
return $this->hasMany(UnitSupportTimesheet::class)->orderByDesc('date')->orderByDesc('id');
}
public function latestSupportTimesheet(): HasOne
{
return $this->hasOne(UnitSupportTimesheet::class)->latestOfMany('date');
}
/**
* Tentukan arah gerbang berikutnya yang sah:
* - 'ANY' jika belum pernah ada riwayat (kendaraan baru)