<?php

namespace App\Console\Commands;

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

class IkeaPrice extends Command
{
  /**
  * The name and signature of the console command.
  *
  * @var string
  */
  protected $signature = 'ikea:price {country} {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');
    $country = $this->argument('country');

    $responses = $countryCompareController->makeRequest($article,$country);
    $prices = $countryCompareController->processResponse($responses,$article);
    //dd($prices);
    return 0;
  }
}

