<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Tax extends Model
{
    protected $fillable = [
        'name',
        'type',
        'fixed_amount',
        'fixed_amount_type',
        'status',
        'created_by',
    ];

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

    public function slabs()
    {
        return $this->hasMany(TaxSlab::class);
    }

    public function assignments()
    {
        return $this->hasMany(EmployeeTaxAssignment::class);
    }
}
