<?php

namespace App\Models;

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

final class VehicleMaintenance extends Model
{
    use HasPublicId;

    protected $table = 'vehicle_maintenance';

    protected $fillable = [
        'public_id',
        'company_id',
        'branch_id',
        'vehicle_id',
        'vendor_id',
        'maintenance_number',
        'maintenance_type',
        'odometer',
        'start_date',
        'completion_date',
        'next_service_date',
        'next_service_odometer',
        'parts_amount',
        'labour_amount',
        'vat_amount',
        'total_amount',
        'status',
        'description',
    ];

    protected function casts(): array
    {
        return ['odometer'=>'decimal:2', 'start_date'=>'date', 'completion_date'=>'date', 'next_service_date'=>'date', 'next_service_odometer'=>'decimal:2', 'parts_amount'=>'decimal:4', 'labour_amount'=>'decimal:4', 'vat_amount'=>'decimal:4', 'total_amount'=>'decimal:4'];
    }
}
