<?php

namespace App\Console\Commands;
 
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\ShopifyStore;
use App\Helpers\AppHelper;
use Artisan;
use App\Http\Controllers\ListingController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class ProcessPendingProductPublish extends Command{
	protected $signature = 'processpendingproductpublish:run';
	protected $description = 'Process Pending Product Publish';
	
	public function __construct(){
		parent::__construct();
	}

	public function handle(){
		$cronJob = AppHelper::getCronJob("publish_products");
		if(!$cronJob || $cronJob->flag == 1 || $cronJob->do_stop == 1) die();

		$listingController = new ListingController();
		$listingController->processPendingProductPublish();
	}
}