<?php

namespace App\Models;

use App\Models\Concerns\HasPublicId;
use Illuminate\Database\Eloquent\Model;

final class Vehicle extends Model
{
    use HasPublicId;

    protected $table = 'vehicles';

    protected $fillable = [
        'public_id',
        'company_id',
        'branch_id',
        'owner_party_id',
        'assigned_driver_id',
        'vehicle_number',
        'plate_number',
        'emirate',
        'vehicle_type',
        'make',
        'model',
        'year',
        'chassis_number',
        'engine_number',
        'ownership_type',
        'purchase_cost',
        'purchase_date',
        'current_odometer',
        'fuel_type',
        'fuel_tank_capacity',
        'payload_capacity',
        'registration_expiry',
        'insurance_expiry',
        'permit_expiry',
        'inspection_expiry',
        'lease_expiry',
        'is_active',
        'notes',
    ];

    protected function casts(): array
    {
        return ['purchase_cost'=>'decimal:4', 'purchase_date'=>'date', 'current_odometer'=>'decimal:2', 'registration_expiry'=>'date', 'insurance_expiry'=>'date', 'permit_expiry'=>'date', 'inspection_expiry'=>'date', 'lease_expiry'=>'date', 'is_active'=>'boolean'];
    }
}
