<?php

namespace App\Models;

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

class Withdrawal extends Model
{
    use HasFactory;

    protected $fillable = [
        'wallet_id',
        'bank_account_id',
        'amount',
        'status',
        'rejection_reason',
        'proof_of_payment',
        'processed_at'
    ];

    protected $casts = [
        'id' => 'integer',
        'wallet_id' => 'integer',
        'bank_account_id' => 'integer',
        'amount' => 'float',
        'processed_at' => 'datetime'
    ];

    public function wallet()
    {
        return $this->belongsTo(Wallet::class);
    }

    public function bankAccount()
    {
        return $this->belongsTo(BankAccount::class);
    }
} 