<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\HasOne;

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

/**
 * Class Bank
 * @package App\Models
 *
 * @property \App\Models\Country country_id
 * @property \App\Models\Company company_id
 * @property string bank_name
 * @property string holder_name
 * @property string account_no
 * @property int type
 * @property int default
 * @property int status
 */
class Bank extends AbstractModel
{
    use SoftDeletes;
    
    protected $table = 'banks';

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function country(): HasOne
    {
        return $this->hasOne(Country::class, 'country_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     **/
    public function company(): BelongsTo
    {
        return $this->BelongsTo(Company::class, 'company_id', 'id');
    }
    
    /**
     * @return HasMany
     */
    public function recipientTransactions(): HasMany
    {
        return $this->HasMany(Transaction::class, 'recipient_bank_account_id');
    }
}
