import { z } from 'zod/v4';

export const bookSchema = z.object({
  id: z.coerce.number(),
  title: z.string(),
  author: z.string(),
  isbn: z.string(),
  rating: z.number().int().min(1).max(5),
});

export const booksSchema = z.array(bookSchema);

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