
/**
 * @fileoverview Generated Zod schemas from RDF ontology
 * DO NOT EDIT - auto-generated by ggen sync
 * @module generated/schemas
 */

import { z } from "zod";
/**
 * Comment schema - Comment on a post

 */
export const commentSchema = z.object({
  authorId: z.string().min(1),
  content: z.string().min(1),
  id: z.string().min(1),
});

/**
 * @typedef {z.infer<typeof commentSchema>} Comment
 */


/**
 * Post schema - Published blog post

 */
export const postSchema = z.object({
  authorId: z.string().min(1),
  comments: z.lazy(() => z.array(commentSchema)).default([]).optional().nullable(),
  content: z.string().min(1),
  id: z.string().min(1),
  published_at: z.string().datetime("Must be ISO 8601 datetime"),
  tags: z.lazy(() => z.array(tagSchema)).default([]).optional().nullable(),
  title: z.string().min(1),
});

/**
 * @typedef {z.infer<typeof postSchema>} Post
 */


/**
 * Tag schema - Post tag/category

 */
export const tagSchema = z.object({
  id: z.string().min(1),
  name: z.string().min(1),
});

/**
 * @typedef {z.infer<typeof tagSchema>} Tag
 */


/**
 * User schema - Blog user account

 */
export const userSchema = z.object({
  bio: z.string().max(500).optional().nullable(),
  email: z.string().email("Must be a valid email address"),
  id: z.string().min(1),
  posts: z.lazy(() => z.array(postSchema)).default([]).optional().nullable(),
  username: z.string().min(1).max(255),
});

/**
 * @typedef {z.infer<typeof userSchema>} User
 */
