import { z } from 'zod'; export const preSubmitMovieSchema = z.object({ title: z.string().min(1).max(255), watched: z.boolean(), rating: z.number().min(0).max(5), notes: z.string().min(0).max(255), }).strict(); export type PreSubmitMovie = z.infer; export const MovieSchema = z.object({ id: z.number(), title: z.string(), watched: z.boolean().default(false), rating: z.number().min(0).max(5).default(0), notes: z.string().default(''), }).strict(); export type Movie = z.infer; export const MoviesSchema = z.array(MovieSchema); export type Movies = z.infer; export const PreSubmitShowSchema = z.object({ title: z.string().min(1).max(255), //watchState unwatched = 0 | watching = 1 | watched = 2 watchState: z.number().min(0).max(2), rating: z.number().min(0).max(5), notes: z.string().min(0).max(255), currentSeason: z.number().min(0).max(1000), currentEpisode: z.number().min(0).max(1000), }).strict(); export type PreSubmitShow = z.infer; export const ShowSchema = z.object({ id: z.number(), title: z.string().min(1).max(255), //watchState unwatched = 0 | watching = 1 | watched = 2 watchState: z.number().min(0).max(2), rating: z.number().min(0).max(5), notes: z.string().min(0).max(255), currentSeason: z.number().min(0).max(1000), currentEpisode: z.number().min(0).max(1000), }).strict(); export type Show = z.infer; export const ShowsSchema = z.array(ShowSchema); export type Shows = z.infer; export const PreSubmitOtherSchema = z.object({ title: z.string().min(1).max(255), notes: z.string().min(0).max(255), completeState: z.number().min(0).max(2).default(0), rating: z.number().min(0).max(5).default(0), currentSeason: z.number().min(0).max(1000).default(0), currentEpisode: z.number().min(0).max(1000).default(0), category: z.number() }).strict(); export type PreSubmitOther = z.infer; export const OtherSchema = z.object({ id: z.number(), title: z.string().min(1).max(255), //conpleteState TBD = 0 | In Progress = 1 | Completed = 2 completeState: z.number().min(0).max(2), rating: z.number().min(0).max(5).default(0), notes: z.string().min(0).max(255), currentSeason: z.number().min(0).max(1000).default(0), currentEpisode: z.number().min(0).max(1000).default(0), category: z.number(), }).strict(); export type Other = z.infer; export const OthersSchema = z.array(OtherSchema); export type Others = z.infer; export const CategorySchema = z.object({ id: z.number(), title: z.string(), showEpisodes: z.boolean().default(false), }).strict(); export type Category = z.infer; export const CategoriesSchema = z.array(CategorySchema); export type Categories = z.infer; export const TestTableShema = z.object({ id: z.number(), test: z.string(), }).strict(); export type TestTable = z.infer; export const SettingSchema = z.object({ id: z.string(), value: z.string().or(z.boolean().or(z.number())) }) export type SettingsTable = z.infer