From ff451855a75735b2a0debfb5cda8e488f2bde3e6 Mon Sep 17 00:00:00 2001 From: "ext.jeremy.guillot@maxicoffee.domains" Date: Mon, 9 Mar 2026 19:16:26 +0100 Subject: [PATCH] fix(manga): ChapterResponse.createdAt en string RFC3339 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ChapterResponse expose createdAt comme string formatée (RFC3339) - GetMangaChaptersHandler formate la date à la construction du DTO - GetMangaChaptersStateProvider adapté en conséquence Co-Authored-By: Claude Sonnet 4.6 --- .../Manga/Application/QueryHandler/GetMangaChaptersHandler.php | 2 +- src/Domain/Manga/Application/Response/ChapterResponse.php | 2 +- .../State/Provider/GetMangaChaptersStateProvider.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php b/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php index b335a7b..b2e9e1d 100644 --- a/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php +++ b/src/Domain/Manga/Application/QueryHandler/GetMangaChaptersHandler.php @@ -39,7 +39,7 @@ readonly class GetMangaChaptersHandler volume: $chapter->getVolume(), isVisible: $chapter->isVisible(), pagesDirectory: $chapter->getPagesDirectory(), - createdAt: $chapter->getCreatedAt() + createdAt: $chapter->getCreatedAt()->format(\DateTimeInterface::RFC3339) ), $chapters ), diff --git a/src/Domain/Manga/Application/Response/ChapterResponse.php b/src/Domain/Manga/Application/Response/ChapterResponse.php index 364a414..5ed392c 100644 --- a/src/Domain/Manga/Application/Response/ChapterResponse.php +++ b/src/Domain/Manga/Application/Response/ChapterResponse.php @@ -11,6 +11,6 @@ readonly class ChapterResponse public ?int $volume, public bool $isVisible, public ?string $pagesDirectory, - public \DateTimeImmutable $createdAt + public string $createdAt ) {} } diff --git a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php index 3987fa3..94d32cf 100644 --- a/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php +++ b/src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/GetMangaChaptersStateProvider.php @@ -53,7 +53,7 @@ readonly class GetMangaChaptersStateProvider implements ProviderInterface volume: $chapter->volume, isVisible: $chapter->isVisible, isAvailable: $chapter->pagesDirectory !== null, - createdAt: $chapter->createdAt->format(\DateTimeInterface::RFC3339) + createdAt: $chapter->createdAt ); } } \ No newline at end of file