<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use App\Service\StrategyService;

class StrategyTaskJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    
    private $paramsArr;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($params)
    {
        $this->paramsArr = $params;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        
        $StrategyService = new StrategyService();
        $startDay = isset($this->paramsArr['startDay']) ? $this->paramsArr['startDay'] : '';
        $StrategyService->createTaskDataJob($this->paramsArr['strategySn'],$startDay);
    }
}
