<?php

namespace App\Domain\Scraping\Domain\Model;

class Manga
{
    /**
     * @param string[] $preferredSources
     * @param string[] $alternativeSlugs
     */
    public function __construct(
        private readonly string $id,
        private readonly string $title,
        private readonly string $slug,
        private readonly string $description,
        private readonly string $author,
        private readonly string $publicationYear,
        private readonly bool $monitored = false,
        private readonly array $preferredSources = [],
        private readonly array $alternativeSlugs = [],
    ) {
    }

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

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

    public function getSlug(): string
    {
        return $this->slug;
    }

    public function getDescription(): string
    {
        return $this->description;
    }

    public function getAuthor(): string
    {
        return $this->author;
    }

    public function getPublicationYear(): string
    {
        return $this->publicationYear;
    }

    /**
     * @return string[]
     */
    public function getPreferredSources(): array
    {
        return $this->preferredSources;
    }

    /**
     * @return bool
     */
    public function hasPreferredSources(): bool
    {
        return !empty($this->preferredSources);
    }

    /**
     * @return string[]
     */
    public function getAlternativeSlugs(): array
    {
        return $this->alternativeSlugs;
    }

    public function isMonitored(): bool
    {
        return $this->monitored;
    }
}
