<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class TaxRule extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'cc_min',
        'cc_max',
        'fuel_type',
        'is_hybrid',
        'customs_duty_rate',
        'regulatory_duty_rate',
        'supplementary_duty_rate',
        'vat_rate',
        'advance_income_tax_rate',
        'advance_tax_rate',
        'description',
        'is_active',
    ];

    protected function casts(): array
    {
        return [
            'is_hybrid' => 'boolean',
            'is_active' => 'boolean',
            'customs_duty_rate' => 'decimal:2',
            'regulatory_duty_rate' => 'decimal:2',
            'supplementary_duty_rate' => 'decimal:2',
            'vat_rate' => 'decimal:2',
            'advance_income_tax_rate' => 'decimal:2',
            'advance_tax_rate' => 'decimal:2',
            'cc_min' => 'integer',
            'cc_max' => 'integer',
        ];
    }
}
