<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class GtsWalletTransaction extends Model
{
    protected $fillable = ['gts_wallet_id', 'payment_method_id', 'type', 'amount', 'reference', 'sender_account', 'proof_path', 'note', 'status', 'applied_at'];

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

    public function wallet()
    {
        return $this->belongsTo(GtsWallet::class, 'gts_wallet_id');
    }

    public function paymentMethod()
    {
        return $this->belongsTo(PaymentMethod::class);
    }
}
