feat: ajout de la description et de la date d'ajout dans le endpoint MangaList

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-02-17 15:15:05 +01:00
parent 140cc14316
commit 7303d63198
4 changed files with 27 additions and 13 deletions

View File

@@ -13,6 +13,7 @@ use Doctrine\ORM\EntityManagerInterface;
use App\Domain\Manga\Domain\Model\Chapter;
use App\Domain\Manga\Domain\Model\ValueObject\ChapterId;
use App\Entity\Chapter as EntityChapter;
use DateTime;
readonly class LegacyMangaRepository implements MangaRepositoryInterface
{
@@ -165,17 +166,18 @@ readonly class LegacyMangaRepository implements MangaRepositoryInterface
private function toDomain(EntityManga $entity): DomainManga
{
return new DomainManga(
new MangaId((string) $entity->getId()),
new MangaTitle($entity->getTitle()),
new MangaSlug($entity->getSlug()),
$entity->getDescription(),
$entity->getAuthor(),
$entity->getPublicationYear(),
$entity->getGenres(),
$entity->getStatus(),
$entity->getExternalId() ? new ExternalId($entity->getExternalId()) : null,
$entity->getImageUrl(),
$entity->getRating()
id: new MangaId((string) $entity->getId()),
title: new MangaTitle($entity->getTitle()),
slug: new MangaSlug($entity->getSlug()),
description: $entity->getDescription(),
author: $entity->getAuthor(),
publicationYear: $entity->getPublicationYear(),
genres: $entity->getGenres(),
status: $entity->getStatus(),
externalId: $entity->getExternalId() ? new ExternalId($entity->getExternalId()) : null,
imageUrl: $entity->getImageUrl(),
rating: $entity->getRating(),
createdAt: $entity->getCreatedAt(),
);
}