<?php

namespace App\Models;

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

class AttnRegularize extends Model
{
    use SoftDeletes;

    protected $table = 'attn_regularize';
    protected $primaryKey = 'ARG_id';

    protected $fillable = [
        'ARG_Code',
        'Emp_Id',
        'ARG_FDt',
        'ARG_TDt',
        'ARG_Rsn',
        'ARG_TIn',
        'ARG_TOu',
        'ARG_Days',
        'PlaceVisit',
        'HlDy_Btwn',
        'ARG_HOD',
        'ARG_HDT',
        'Reason',
        'Status',
        'R_Status',
        'Status_Remark'
    ];

    // ✅ Relations
    public function employee()
    {
        return $this->belongsTo(EmployeeMaster::class, 'Emp_Id', 'Emp_Id');
    }

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

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