<?php

namespace App\Console\Commands;

use App\Models\State;
use App\Http\Helpers\General;

use Illuminate\Console\Command;
use App\Classes\Jobs\FetchContainersStatusUpdateFromVTPortalJob;
use App\Classes\Jobs\FetchDeliveryListFromVTPortalJob;
use App\Classes\Jobs\FetchLoadedContainersFromVTPortalJob;
use App\Classes\Jobs\FetchPackingListFromVTPortalJob;
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;

class CurlVTCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */

    protected $signature = 'command:curlVTCommand';
    // php artisan queue:work

    /**
     * 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 mixed
     */
    public function handle()
    {
        FetchWarehouseReceiveListFromVTPortalJob::withChain([
            new FetchLoadedContainersFromVTPortalJob,
            new FetchPackingListFromVTPortalJob,
            new FetchContainersStatusUpdateFromVTPortalJob,
            new FetchDeliveryListFromVTPortalJob
        ])->dispatch();
    }
}
