import { z } from 'zod';

export const CreateGroupSchema = z.object({
  name: z.string().min(1).max(100).regex(/^[a-z0-9-]+$/, 'Name must be lowercase alphanumeric with hyphens'),
  description: z.string().max(1000).default(''),
  members: z.array(z.string().email()).default([]),
});

export const UpdateGroupSchema = z.object({
  description: z.string().max(1000).optional(),
  members: z.array(z.string().email()).optional(),
});

export type CreateGroupInput = z.infer<typeof CreateGroupSchema>;
export type UpdateGroupInput = z.infer<typeof UpdateGroupSchema>;
