import { t } from "elysia";
import { Image } from "../utils/image";

export const EntryContent = t.UnionEnum(["story", "recap", "filler", "ova"]);

export const BaseEntry = () =>
	t.Object({
		airDate: t.Nullable(t.String({ format: "date" })),
		runtime: t.Nullable(
			t.Number({
				minimum: 0,
				description: "Runtime of the episode in minutes",
			}),
		),
		thumbnail: t.Nullable(Image),
		content: EntryContent,
	});

export const EntryTranslation = () =>
	t.Object({
		name: t.Nullable(t.String()),
		description: t.Nullable(t.String()),
	});
