<?php

namespace App\Models;

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

final class FuelEntry extends Model
{
    use HasPublicId;

    protected $table = 'fuel_entries';

    protected $fillable = [
        'public_id',
        'company_id',
        'branch_id',
        'vehicle_id',
        'driver_id',
        'vendor_id',
        'trip_id',
        'entry_date',
        'odometer',
        'litres',
        'price_per_litre',
        'amount_before_vat',
        'vat_amount',
        'total_amount',
        'payment_method',
        'receipt_reference',
    ];

    protected function casts(): array
    {
        return ['entry_date'=>'date', 'odometer'=>'decimal:2', 'litres'=>'decimal:4', 'price_per_litre'=>'decimal:4', 'amount_before_vat'=>'decimal:4', 'vat_amount'=>'decimal:4', 'total_amount'=>'decimal:4'];
    }
}
