<?php

namespace Modules\DealStatus\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Region\Models\Region;
use Modules\Sector\Models\Sector;

class DealStatus extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable =
    [
        'color','rank'
    ];

    /**
     * Get current description of the the Room
     * @return HasOne
     */
    public function currentDescription() :HasOne
    {
        return $this->hasOne(DealStatusDescription::class)->where('language_id', currentLanguage()->id);
    }

    public function sector()
    {
        return $this->belongsTo(Sector::class)->withTrashed();
    }
}
