<?php

namespace App\Console\Commands\QuickFixes;

use App\Models\Network\Network;
use Illuminate\Console\Command;

class FixNetworkTitlesCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'quick-fix:network-titles';

    protected $candles = [];

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $network = Network::find(NETWORK_ETH);

        if($network) {
            $network->name = "Ethereum (ERC-20)";
            $network->save();
        }

        $network = Network::find(NETWORK_ERC);

        if($network) {
            $network->name = "ERC-20";
            $network->save();
        }

        $network = Network::find(NETWORK_BNB);

        if($network) {
            $network->name = "BNB (BEP-20)";
            $network->save();
        }

        $network = Network::find(NETWORK_BEP);

        if($network) {
            $network->name = "BEP-20";
            $network->save();
        }

        $network = Network::find(NETWORK_TRX);

        if($network) {
            $network->name = "TRX (TRC-20)";
            $network->save();
        }

        $network = Network::find(NETWORK_TRC);

        if($network) {
            $network->name = "TRC-20";
            $network->save();
        }
    }
}
