<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class WalletRecharge extends Model
{
    protected $fillable = [
        'api_client_id',
        'amount',
        'previous_balance',
        'new_balance',
        'status',
        'payment_id',
    ];

    protected $casts = [
        'amount' => 'float',
        'previous_balance' => 'float',
        'new_balance' => 'float',
    ];

    /**
     * Get the API client associated with this transaction.
     */
    public function apiClient(): BelongsTo
    {
        return $this->belongsTo(ApiClient::class, 'api_client_id');
    }
}
