feat: GetMangaList endpoint + tests + test db

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-02-10 19:21:14 +01:00
parent 073439163b
commit e3d380eadd
34 changed files with 932 additions and 23 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Domain\Manga\Application\Response;
readonly class MangaListResponse
{
public function __construct(
public array $mangas,
public int $total,
public int $page,
public int $limit
) {}
public function getTotalPages(): int
{
return (int) ceil($this->total / $this->limit);
}
public function hasNextPage(): bool
{
return $this->page < $this->getTotalPages();
}
public function hasPreviousPage(): bool
{
return $this->page > 1;
}
}