<?php

namespace App\Tmdb;

use App\Base\Enum\MediaType;
use App\Tmdb\Dto\CastMemberDto;
use App\Tmdb\Dto\CrewMemberDto;
use App\Tmdb\Dto\GenreDto;
use App\Tmdb\Dto\TmdbEpisodeDto;
use App\Tmdb\Dto\WatchProviderDto;
use Symfony\Component\Serializer\Attribute\Context;
use Symfony\Component\Serializer\Attribute\SerializedPath;

class TmdbResult
{
    /**
     * @param string|null $imdbId
     * @param int|null $tmdbId
     * @param string|null $title
     * @param string|null $description
     * @param string|null $poster
     * @param \DateTimeInterface|null $premiereDate
     * @param string|null $year
     * @param string|null $mediaType
     * @param array<TmdbEpisodeDto[]>|null $episodes
     * @param string|null $episodeAirDate
     * @param GenreDto[]|null $genres
     * @param CastMemberDto[]|null $stars
     * @param CrewMemberDto[]|null $directors
     * @param CrewMemberDto[]|null $creators
     * @param CrewMemberDto[]|null $producers
     * @param int|null $runtime
     * @param int|null $numberSeasons
     */
    public function __construct(
        #[SerializedPath('[external_ids][imdb_id]')]
        public ?string $imdbId = "",
        #[SerializedPath('[id]')]
        public ?int $tmdbId = null,
        public ?string $title = "",
        #[SerializedPath('[overview]')]
        public ?string $description = "",
        public ?string $poster = "",
        public ?\DateTimeInterface $premiereDate = null,
        public ?string $year = null,
        public ?string $mediaType = "",
        #[Context(denormalizationContext: [
            'media_type' => MediaType::TvEpisode->value
        ])]
        #[SerializedPath('[seasons]')]
        public ?array $episodes = null,
        public ?string $episodeAirDate = null,
        public ?array $genres = null,
        public ?array $stars = null,
        public ?array $directors = null,
        public ?array $creators = null,
        public ?array $producers = null,
        public ?int $runtime = null,
        public ?int $numberSeasons = null,
        public ?int $latestSeason = null,
        public ?array $watchProviders = null
    ) {}
}
