<?php

namespace App\Domain\Manga\Application\Response;

readonly class SearchLocalMangaResponse
{
    /**
     * @param MangaSearchItem[] $items
     */
    public function __construct(
        public array $items,
        public int $total,
        public int $page,
        public int $limit
    ) {
    }

    public function hasNextPage(): bool
    {
        return $this->total > ($this->page * $this->limit);
    }

    public function hasPreviousPage(): bool
    {
        return $this->page > 1;
    }
}
