<?php

namespace App\Models;

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

class TripRating extends Model
{
    use HasFactory;

    protected $fillable = [
        'booking_id',
        'passenger_rating',
        'driver_rating',
        'passenger_feedback',
        'driver_feedback',
        'passenger_rated_at',
        'driver_rated_at',
    ];

    protected $casts = [
        'passenger_rating' => 'integer',
        'driver_rating' => 'integer',
        'passenger_rated_at' => 'datetime',
        'driver_rated_at' => 'datetime',
    ];

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