<?php

namespace App\Models\Reservation;

use App\Models\Agency\Agency;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ReservationActivity extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'agency_id',
        'reservation_id',
        'performed_by',
        'activity_type',
        'subject',
        'description',
        'metadata',
    ];

    protected $casts = [
        'metadata' => 'array',
    ];

    public function agency()
    {
        return $this->belongsTo(Agency::class);
    }

    public function reservation()
    {
        return $this->belongsTo(Reservation::class);
    }

    public function performer()
    {
        return $this->belongsTo(User::class, 'performed_by');
    }
}
