import { z } from 'zod/v4';

export const bookSchema = z.object({
  id: z.coerce.number(),
  title: z.string(),
  image: z.string().optional(),
});

export const booksSchema = z.array(bookSchema);

export type Book = z.infer<typeof bookSchema>;

export const inputBookSchema = bookSchema.partial({ id: true });

export type InputBook = z.infer<typeof inputBookSchema>;
