mangaRepository->findById($command->mangaId->getValue()); if ($manga === null) { throw new \RuntimeException('Manga not found'); } // Synchronisation + récupération des nouveaux IDs $newChapterIds = $this->chapterSynchronizationService->synchronizeChapters($manga); // Mise à jour de la date de monitoring $manga->updateLastMonitoringCheck(new DateTimeImmutable()); $this->mangaRepository->save($manga); // Événement de scraping pour chaque nouveau chapitre foreach ($newChapterIds as $chapterId) { $this->eventBus->dispatch( new ChapterReadyForScraping(new ChapterId($chapterId)) ); } } }