<?php

namespace App\Models;

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

class TransNotice extends Model
{
    use SoftDeletes;

    protected $table = 'trans_notice';
    protected $primaryKey = 'Notice_Id';

    protected $fillable = [
        'Prop_Id',
        'Owner_ID',
        'Dmd_Id',
        'Notice_Type',
        'Notice_No',
        'Notice_Date',
        'Channel',
        'Remark',
        'Generated_By',
        'Approved_By',
        'Status',
        'R_Status',
        'Status_Remark'
    ];

    public function property()
    {
        return $this->belongsTo(PropertyMaster::class,'Prop_Id','Prop_Id');
    }

    public function owner()
    {
        return $this->belongsTo(OwnerMaster::class,'Owner_ID','Owner_ID');
    }

    public function demand()
    {
        return $this->belongsTo(TransDemand::class,'Dmd_Id','Dmd_Id');
    }

    public function status()
    {
        return $this->belongsTo(ActionMaster::class,'Status','Act_Id');
    }

    public function rstatus()
    {
        return $this->belongsTo(ActionMaster::class,'R_Status','Act_Id');
    }

        public function generatedBy()
    {
        return $this->belongsTo(UserMaster::class,'Generated_By','Usr_Id');
    }

      public function approvedBy()
    {
        return $this->belongsTo(UserMaster::class,'Approved_By','Usr_Id');
    }

}
