import { z } from "zod";
import { Comment } from "./Comment";
import { User } from "./User";

export interface Post {
  id: number;
  userId: number;
  title: string;
  content: string;
  isAttendantOnly: boolean;
  createdAt: Date;
  updatedAt: Date;
  author?: User;
  comments?: Comment[];
}

// Create post form schema
export const createPostSchema = z.object({
  title: z.string().min(3, "Title must be at least 3 characters"),
  content: z.string().min(10, "Content must be at least 10 characters"),
  isAttendantOnly: z.boolean().default(false),
});

export type CreatePostFormValues = z.infer<typeof createPostSchema>;
