2026-04-03 00:39:57 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
|
|
|
|
use App\Services\JobEnrichmentService;
|
|
|
|
|
use Illuminate\Console\Attributes\Description;
|
|
|
|
|
use Illuminate\Console\Attributes\Signature;
|
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
|
|
|
|
|
#[Signature('jobs:enrich {--batch=100}')]
|
|
|
|
|
#[Description('Enrich job listings with additional data (categories, experience levels, etc.)')]
|
|
|
|
|
class EnrichJobs extends Command
|
|
|
|
|
{
|
2026-05-01 23:33:15 +03:00
|
|
|
protected $signature = 'jobs:enrich {--batch=100}';
|
|
|
|
|
protected $description = 'Enrich job listings with additional data';
|
|
|
|
|
|
2026-04-03 00:39:57 +03:00
|
|
|
public function __construct(
|
|
|
|
|
private JobEnrichmentService $enrichmentService
|
|
|
|
|
) {
|
|
|
|
|
parent::__construct();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Execute the console command.
|
|
|
|
|
*/
|
|
|
|
|
public function handle(): int
|
|
|
|
|
{
|
|
|
|
|
$batchSize = (int) $this->option('batch');
|
|
|
|
|
|
|
|
|
|
$this->info('Enriching job listings...');
|
|
|
|
|
$this->newLine();
|
|
|
|
|
|
|
|
|
|
$enrichedCount = $this->enrichmentService->enrichJobs($batchSize);
|
|
|
|
|
|
|
|
|
|
$this->newLine();
|
|
|
|
|
$this->info("Enriched {$enrichedCount} jobs successfully!");
|
|
|
|
|
|
|
|
|
|
return self::SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
}
|