jobRepository->findById(Uuid::fromString($message->jobId)); if (null === $job) { return; } $job->incrementAttempt(); $job->markProcessing(); $this->jobRepository->save($job); $result = $this->visionAgent->analyze($message->storedPhotoPath); $job->recordStep('vision', [ 'manufacturer' => $result['manufacturer'], 'modelName' => $result['modelName'], 'modelNumber' => $result['modelNumber'], 'serial' => $result['serial'], ]); $this->jobRepository->save($job); $hasAnyInfo = '' !== $result['manufacturer'] || '' !== $result['modelName'] || '' !== $result['modelNumber']; if (!$hasAnyInfo) { $job->markNeedsReview('OllamaVisionAgent: nothing readable on nameplate'); $this->jobRepository->save($job); return; } $this->bus->dispatch(new SpecsResearchMessage( jobId: $message->jobId, articleTypeId: $message->articleTypeId, modelNumber: $result['modelNumber'], modelName: $result['modelName'], serialNumber: $result['serial'], manufacturer: $result['manufacturer'], )); } }