<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class EmployeeTaxAssignment extends Model
{
    protected $fillable = [
        'employee_id',
        'tax_id',
        'fixed_amount',
        'effective_from',
        'status',
    ];

    protected function casts(): array
    {
        return [
            'effective_from' => 'date',
        ];
    }

    public function employee()
    {
        return $this->belongsTo(User::class, 'employee_id');
    }

    public function tax()
    {
        return $this->belongsTo(Tax::class);
    }
}
