feat: analyse import + all tests fixed

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-10-15 16:14:15 +02:00
parent fbe9619224
commit 3170a7c60e
74 changed files with 4318 additions and 183 deletions

View File

@@ -5,6 +5,8 @@ namespace App\Domain\Manga\Application\CommandHandler;
use App\Domain\Manga\Application\Command\FetchMangaChapters;
use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface;
use App\Domain\Manga\Domain\Contract\Service\ChapterSynchronizationServiceInterface;
use App\Domain\Manga\Domain\Exception\MangadexApiException;
use App\Domain\Manga\Domain\Exception\MangaNotFoundException;
readonly class FetchMangaChaptersHandler
{
@@ -18,7 +20,11 @@ readonly class FetchMangaChaptersHandler
$manga = $this->mangaRepository->findById($command->mangaId->getValue());
if ($manga === null) {
throw new \RuntimeException('Manga not found');
throw new MangaNotFoundException();
}
if($manga->getExternalId() === null){
throw new MangadexApiException("Manga has no external_id");
}
// Synchronisation initiale (pas d'événements)