<?php

namespace App\Models;

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

class AuthorizationRequest extends Model
{
    use HasFactory;

    protected $fillable = [
        'account_id',
        'access_log_id',
        'requested_to_name',
        'status',
        'responded_at',
    ];

    protected $casts = [
        'responded_at' => 'datetime',
    ];

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

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