<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WhitelistApplication extends Model
{
    protected $fillable = ['user_id', 'answers', 'status', 'reviewed_by', 'reviewed_at'];

    protected function casts(): array
    {
        return [
            'answers' => 'array',
            'reviewed_at' => 'datetime',
        ];
    }

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

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