<?php

namespace App\Models;

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

class AgentReview extends Model
{
    use HasFactory;

    protected $fillable = [
        'agent_id',
        'user_id',
        'rating',
        'comment',
        'transaction_id',
    ];

    protected $casts = [
        'rating' => 'integer',
    ];

    public function agent()
    {
        return $this->belongsTo(Agent::class);
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function transaction()
    {
        return $this->belongsTo(AgentTransaction::class);
    }
}
