<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WalletDocument extends Model
{
    protected $fillable = [
        'registration_id', 'event_id', 'user_id', 'category', 'name',
        'file_path', 'file_type', 'file_size', 'uploaded_by',
        'uploaded_by_admin_id', 'is_offline_available', 'status', 'admin_notes',
    ];

    protected function casts(): array
    {
        return [
            'is_offline_available' => 'boolean',
            'file_size'            => 'integer',
        ];
    }

    public function registration()
    {
        return $this->belongsTo(EventRegistration::class);
    }

    public function event()
    {
        return $this->belongsTo(Event::class);
    }

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