feat: ajout de la gestion de la disponibilité des chapitres dans les réponses et les modèles, avec mise à jour des classes concernées

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-03-27 11:15:36 +01:00
parent 346fede878
commit 6ea24deacf
6 changed files with 20 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ use App\Domain\Manga\Application\Response\ChapterListResponse;
use App\Domain\Manga\Application\Response\ChapterResponse;
use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface;
use App\Domain\Manga\Domain\Exception\MangaNotFoundException;
use App\Domain\Manga\Domain\Model\Chapter;
readonly class GetMangaChaptersHandler
{
public function __construct(
@@ -32,12 +32,13 @@ readonly class GetMangaChaptersHandler
return new ChapterListResponse(
chapters: array_map(
fn ($chapter) => new ChapterResponse(
fn (Chapter $chapter) => new ChapterResponse(
id: $chapter->getId(),
number: $chapter->getNumber(),
title: $chapter->getTitle(),
volume: $chapter->getVolume(),
isVisible: $chapter->isVisible(),
isAvailable: $chapter->isAvailable(),
createdAt: $chapter->getCreatedAt()
),
$chapters

View File

@@ -10,6 +10,7 @@ readonly class ChapterResponse
public ?string $title,
public ?int $volume,
public bool $isVisible,
public bool $isAvailable,
public \DateTimeImmutable $createdAt
) {}
}