<?php

namespace App\Console\Commands;

use App\Jobs\ProcessPdfJob;
use Illuminate\Console\Command;

class ImportPdfCommand extends Command
{
    protected $signature = 'question:import-pdf {path}';
    protected $description = 'Import pdf questions into pre_question_candidates';

    public function handle(): int
    {
        $path = (string) $this->argument('path');

        ProcessPdfJob::dispatch($path);

        $this->info(sprintf('Queued pdf import for %s', $path));

        return self::SUCCESS;
    }
}
