<?php

namespace App\Http\Controllers\Tests;

use App\Http\Controllers\Controller;
use App\Jobs\ShopeeSellerTopProductScraperJob;
use App\Jobs\Tasks\GenerateShopeeAIArticleTask;
use App\Models\Category;
use App\Models\ShopeeSellerScrape;
use Illuminate\Http\Request;

class ScraperTestController extends Controller
{
    public function scrape(Request $request)
    {
        $category = Category::find(2);

        $task = ShopeeSellerTopProductScraperJob::dispatch($request->input('seller'), 'MY', $category)
            ->onQueue('default')
            ->onConnection('default');
    }

    public function gen(Request $request)
    {
        $shopee_seller_scrape = ShopeeSellerScrape::find(6);

        $task = GenerateShopeeAIArticleTask::handle($shopee_seller_scrape);

        dd($task);
    }
}
