Validation)'; /** * Execute the console command. */ public function handle(PricelistFileProcessService $service): int { $id = $this->argument('id'); $pricelistFile = PricelistFile::find($id); if (!$pricelistFile) { $this->error("A(z) {$id} ID-vel rendelkező árlista fájl nem található."); return 1; } // A konzolos indítás ugyanúgy a termékadatokat érinti, mint a felületi - a // beszállítói blokkolás itt sem kerülhető meg. $guard = app(\App\Services\PricelistGuard::class); if ($blockingFile = $guard->blockingFileFor($pricelistFile->supplier_id, $pricelistFile->id)) { $this->error($guard->blockingMessage($blockingFile)); return 1; } $this->info("Folyamat elindítása: {$pricelistFile->filename} (ID: {$id})"); $this->info("Workflow állapotok alaphelyzetbe állítása..."); try { $service->resetWorkflow($pricelistFile); $service->dispatchInitialChain($pricelistFile); $this->info("Az árlista feldolgozási lánc (Pre-process -> Validation) sikeresen ütemezve."); return 0; } catch (\Exception $e) { $this->error("Hiba történt a folyamat indításakor: " . $e->getMessage()); return 1; } } }