<?php

namespace App\Jobs;

use App\Jobs\Tasks\GetAIToolScreenshotTask;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class GetAIToolScreenshotJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $url_to_crawl_id;

    protected $ai_tool_id;

    /**
     * Create a new job instance.
     */
    public function __construct($url_to_crawl_id, $ai_tool_id)
    {
        $this->url_to_crawl_id = $url_to_crawl_id;

        $this->ai_tool_id = $ai_tool_id;
    }

    /**
     * Execute the job.
     */
    public function handle(): void
    {
        GetAIToolScreenshotTask::handle($this->url_to_crawl_id, $this->ai_tool_id);
    }
}
