refactor(manga): merge ChapterRepositoryInterface into MangaRepositoryInterface + pagesDirectory

- Supprime ChapterRepositoryInterface du domaine Manga (et ses implémentations
  LegacyChapterRepository et InMemoryChapterRepository)
- Déplace toutes les méthodes chapter vers MangaRepositoryInterface avec nommage
  explicite (findChapterById, findVisibleChapterById, updateChapter, deleteChapter, etc.)
- Remplace cbzPath par pagesDirectory + pageCount dans le modèle Chapter
  (transition : toChapterDomain conserve un fallback cbzPath pour les données existantes,
  updateChapter synchronise les deux colonnes jusqu'à la Phase 4)
- Ajoute la migration Doctrine (pages_directory, page_count sur la table chapter)
- Met à jour tous les handlers, listeners, query handlers et state providers du domaine
  Manga pour injecter uniquement MangaRepositoryInterface
- Adapte les tests unitaires et InMemoryMangaRepository avec les nouvelles méthodes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-03-09 17:54:35 +01:00
parent dae215dd3d
commit c50f1638ee
27 changed files with 410 additions and 419 deletions

View File

@@ -73,6 +73,7 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
isset($chapterData['attributes']['volume']) ? (int) $chapterData['attributes']['volume'] : null,
true,
null,
0,
new \DateTimeImmutable()
);
$chapterLanguages[(string) $chapterNumber] = $language;
@@ -142,7 +143,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
$currentChapter->getTitle(),
null, // volume = null
$currentChapter->isVisible(),
$currentChapter->getCbzPath(),
$currentChapter->getPagesDirectory(),
$currentChapter->getPageCount(),
$currentChapter->getCreatedAt()
);
}
@@ -155,7 +157,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
$currentChapter->getTitle(),
$prevVolume, // prend le volume des adjacents
$currentChapter->isVisible(),
$currentChapter->getCbzPath(),
$currentChapter->getPagesDirectory(),
$currentChapter->getPageCount(),
$currentChapter->getCreatedAt()
);
}
@@ -209,7 +212,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
$currentChapter->getTitle(),
$prevVolume,
$currentChapter->isVisible(),
$currentChapter->getCbzPath(),
$currentChapter->getPagesDirectory(),
$currentChapter->getPageCount(),
$currentChapter->getCreatedAt()
);
}
@@ -222,7 +226,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
$currentChapter->getTitle(),
$nextVolume,
$currentChapter->isVisible(),
$currentChapter->getCbzPath(),
$currentChapter->getPagesDirectory(),
$currentChapter->getPageCount(),
$currentChapter->getCreatedAt()
);
}