import { z } from "zod";
import { CommonDetails } from "./common";

export const SeriesSeasons = z.object({
	number: z.int().positive(),
	name: z.string(),
	poster: z.url(),
	totalEpisodes: z.int().positive(),
});

export type SeriesSeasons = z.infer<typeof SeriesSeasons>;
export const SeriesDetails = CommonDetails.extend({
	type: z.literal("SERIES"),
	seasons: SeriesSeasons.array(),
	nextUpPlay: z
		.object({
			poster: z.url(),
			name: z.string(),
		})
		.nullable()
		.optional(),
});

export type SeriesDetails = z.infer<typeof SeriesDetails>;
