<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Http\Controllers\CountryCompareController;

class IkeaPrices extends Command
{
  /**
  * The name and signature of the console command.
  *
  * @var string
  */
  protected $signature = 'ikea:prices {article}';

  /**
  * The console command description.
  *
  * @var string
  */
  protected $description = 'Get Ikea Prices';

  /**
  * Execute the console command.
  *
  * @return int
  */
  public function handle(CountryCompareController $countryCompareController)
  {
    $article = $this->argument('article');
    $responses = $countryCompareController->makeRequests($article);
    $products = $countryCompareController->processResponse($responses,$article);

    dd($products);
  }
}

