import { z } from "zod";

// CAST member (actor)
export const Casting = z.object({
	id: z.string().optional(),
	name: z.string(),
	character: z.string(),
	order: z.number().optional(), // Billing order
	profileUrl: z.string().optional(),
});

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

// CREW member (director, writer, producer, etc.)
export const Crew = z.object({
	id: z.string().optional(),
	name: z.string(),
	job: z.string(), // e.g., "Director", "Producer", "Writer"
	department: z.string().optional(), // e.g., "Directing", "Production", "Writing"
	profileUrl: z.string().optional(),
});

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

// Combined credits
export const Credits = z.object({
	cast: Casting.array(),
	crew: Crew.array(),
});

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