import { z } from "zod";

export const PersonDetailsSchema = z.object({
	birthday: z.string().nullable(),
	knownForDepartment: z.string(),
	deathday: z.string().nullable(),
	id: z.number(),
	name: z.string(),
	alsoKnownAs: z.array(z.string()),
	gender: z.number(),
	biography: z.string(),
	popularity: z.number(),
	placeOfBirth: z.string().nullable(),
	profilePath: z.string().nullable(),
	adult: z.boolean(),
	imdbId: z.string().nullable(),
	homepage: z.string().nullable(),
});

export type PersonDetails = z.infer<typeof PersonDetailsSchema>;

export const PersonInfoSchema = z.object({
	personId: z.number(),
});

export type PersonInfo = z.infer<typeof PersonInfoSchema>;

export const ResolvedPersonSchema = z.object({
	id: z.number(),
	name: z.string(),
	biography: z.string(),
	birthday: z.string().nullable(),
	deathday: z.string().nullable(),
	placeOfBirth: z.string().nullable(),
	profilePath: z.string().nullable(),
	knownForDepartment: z.string(),
	popularity: z.number(),
	imdbId: z.string().nullable(),
	homepage: z.string().nullable(),
});

export type ResolvedPerson = z.infer<typeof ResolvedPersonSchema>;
export type ResolvedPersonResult = ResolvedPerson | null;
