/**
 * Project Schema - Zod validation for project forms
 */

import { z } from 'zod';

export const projectSchema = z.object({
  name: z.string().min(1, 'Name is required').max(255, 'Name too long'),
  slug: z
    .string()
    .max(255, 'Slug too long')
    .regex(
      /^[a-z0-9_-]*$/i,
      'Slug can only contain letters, numbers, dashes, underscores',
    )
    .optional()
    .or(z.literal('')),
  description: z
    .string()
    .max(5000, 'Description too long')
    .optional()
    .or(z.literal('')),
});

export type ProjectFormData = z.infer<typeof projectSchema>;

export const projectInitialValues: ProjectFormData = {
  name: '',
  slug: '',
  description: '',
};
