<?php

namespace App\Models;

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

class ResourceRate extends Model
{
    use HasFactory;
    use SoftDeletes;

    protected $fillable = [
        'resource_id',
        'rate_group_id',
        'rate_type_id',
        'company_rate_id',
        'cost',
        'price',
        'enabled',
    ];

    public function resource()
    {
        return $this->belongsTo(\App\Models\Resource::class);
    }

    public function rate_group()
    {
        return $this->belongsTo(\App\Models\RateGroup::class);
    }

    public function rate_type()
    {
        return $this->belongsTo(\App\Models\RateType::class);
    }

    public function company_rate()
    {
        return $this->belongsTo(\App\Models\CompanyRate::class);
    }

}
