<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class RequestRating extends Model
{
    protected $fillable = [
        'request_id',
        'rated_user_id',
        'rated_by',
        'rating',
        'comment',
    ];

    public function request(): BelongsTo
    {
        return $this->belongsTo(InstallRequest::class);
    }

    public function ratedUser(): BelongsTo
    {
        return $this->belongsTo(User::class, 'rated_user_id');
    }

    public function ratedBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'rated_by');
    }
}
