<?php

declare(strict_types=1);

namespace App\Domain\Reader\Application\Response;

final readonly class ChapterContextResponse
{
    public function __construct(
        private string  $id,
        private string  $mangaId,
        private string  $title,
        private float   $number,
        private int     $totalPages,
        private ?string $previousChapterId,
        private ?string $nextChapterId
    ) {
    }

    public function getId(): string
    {
        return $this->id;
    }

    public function getMangaId(): string
    {
        return $this->mangaId;
    }

    public function getTitle(): string
    {
        return $this->title;
    }

    public function getNumber(): float
    {
        return $this->number;
    }

    public function getTotalPages(): int
    {
        return $this->totalPages;
    }

    public function getPreviousChapterId(): ?string
    {
        return $this->previousChapterId;
    }

    public function getNextChapterId(): ?string
    {
        return $this->nextChapterId;
    }

    public function getNavigation(): array
    {
        $navigation['previousChapter'] = $this->previousChapterId;
        $navigation['nextChapter'] = $this->nextChapterId;

        return $navigation;
    }
}
