<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class IshareTopup extends Model
{
    protected $fillable = [
        'user_id',
        'ishare_id',
        'capacity',
        'price',
        'current_capacity',
        'new_capacity',
        'narration',
        'payment_mode',
        'payment_status',
        'transaction_id',
        'type',
        'status'
    ];

    protected $table = 'ishare_topups';

    /**
     * Get the user that owns the topup
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }

    /**
     * Get the ishare order this topup belongs to
     */
    public function ishareWallet()
    {
        return $this->belongsTo(IshareWallet::class, 'ishare_id');
    }
}
