/**
 * Interface of the server (auto-generated code)
 */
import { z as zod } from "zod";

import {ZodLong} from "./long";
import {ZodObjectId} from "./object-id";
import {ZodGenericDataSoftDelete, ZodGenericDataSoftDeleteWrite } from "./generic-data-soft-delete";

export const ZodSeason = ZodGenericDataSoftDelete.extend({
	/**
	 * Name of the media (this represent the title)
	 */
	name: zod.string(),
	/**
	 * Description of the media
	 */
	description: zod.string().optional(),
	/**
	 * series parent ID
	 */
	parentId: ZodLong,
	/**
	 * List of Id of the specific covers
	 */
	covers: zod.array(ZodObjectId).optional(),

});

export type Season = zod.infer<typeof ZodSeason>;

export function isSeason(data: any): data is Season {
	try {
		ZodSeason.parse(data);
		return true;
	} catch (e: any) {
		console.log(`Fail to parse data type='ZodSeason' error=${e}`);
		return false;
	}
}
export const ZodSeasonWrite = ZodGenericDataSoftDeleteWrite.extend({
	/**
	 * Name of the media (this represent the title)
	 */
	name: zod.string().optional(),
	/**
	 * Description of the media
	 */
	description: zod.string().nullable().optional(),
	/**
	 * series parent ID
	 */
	parentId: ZodLong.optional(),
	/**
	 * List of Id of the specific covers
	 */
	covers: zod.array(ZodObjectId).nullable().optional(),

});

export type SeasonWrite = zod.infer<typeof ZodSeasonWrite>;

export function isSeasonWrite(data: any): data is SeasonWrite {
	try {
		ZodSeasonWrite.parse(data);
		return true;
	} catch (e: any) {
		console.log(`Fail to parse data type='ZodSeasonWrite' error=${e}`);
		return false;
	}
}
