import { z } from "zod";
import { MovieDetails } from "./movie";
import { SeriesDetails } from "./series";

export const GetDetailsInputSchema = z.object({
	id: z
		.number()
		.int("ID must be a whole number")
		.positive("ID must be positive"),
});

export type GetDetailsInput = z.infer<typeof GetDetailsInputSchema>;

export const GetDetailsOutputSchema = z.discriminatedUnion("type", [
	MovieDetails,
	SeriesDetails,
]);

export type GetDetailsOutput = z.infer<typeof GetDetailsOutputSchema>;
