phase 4
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?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
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user