<?php
namespace App\Models;

use App\Enums\TaxCategory;
use App\Models\Concerns\HasPublicId;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;

final class TaxCode extends Model
{
    use HasPublicId;


protected $fillable = ['public_id','company_id','code','name','category','rate','recoverable_percentage','output_account_id','input_account_id','reverse_charge_output_account_id','reverse_charge_input_account_id','is_active','requires_trn','requires_evidence'];
protected function casts(): array { return ['category'=>TaxCategory::class,'rate'=>'decimal:4','recoverable_percentage'=>'decimal:4','is_active'=>'boolean','requires_trn'=>'boolean','requires_evidence'=>'boolean']; }
public function company(): BelongsTo { return $this->belongsTo(Company::class); }
}
