<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class TaxRate extends Model
{
    use SoftDeletes;

    protected $table = 'tax_rate';
    protected $primaryKey = 'TxRt_Id';

    protected $fillable = [
        'TxTy_ID',
        'FY_Id',
        'UsgTy_Id',
        'Zone_Id',
        'Slab_From',
        'Slab_To',
        'Rate',
        'Rate_Type',
        'Min_Amount'
    ];

    public function taxType()
    {
        return $this->belongsTo(TaxTypeMaster::class, 'TxTy_ID', 'TxTy_ID');
    }

    public function financialYear()
    {
        return $this->belongsTo(FyearMaster::class, 'FY_Id', 'FY_Id');
    }

    public function usageType()
    {
        return $this->belongsTo(PropertyUsageType::class, 'UsgTy_Id', 'UsgTy_Id');
    }

    public function zone()
    {
        return $this->belongsTo(ZoneMaster::class, 'Zone_Id', 'Zon_Id');
    }
}
