<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WalletTransaction extends Model
{
    protected $table = 'wallet_transactions';

    protected $fillable = [
        'wallet_id',
        'current_bal',
        'amount',
        'new_bal',
        'approved_by',
        'transaction_type',
        'narration',
        'status',
        'user_id',
        'payment_option_id',
        'payment_provider_id',
        'payment_mode',
        'transaction_id'
    ];

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

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

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

    public function paymentProvider()
    {
        return $this->belongsTo(PaymentProvider::class, 'payment_provider_id');
    }

    // public function paymentOption()
    // {
    //     return $this->belongsTo(PaymentOption::class);
    // }
}
