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:
parent
346fede878
commit
6ea24deacf
@@ -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
|
||||
|
||||
@@ -10,6 +10,7 @@ readonly class ChapterResponse
|
||||
public ?string $title,
|
||||
public ?int $volume,
|
||||
public bool $isVisible,
|
||||
public bool $isAvailable,
|
||||
public \DateTimeImmutable $createdAt
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user