import { z } from 'zod';

export const registerSchema = z.object({
  name: z.string().min(2),
  email: z.string().email(),
  password: z.string().min(6),
  role: z.enum(['user', 'provider']).default('user'),
  phone: z.string().optional()
});

export const loginSchema = z.object({
  email: z.string().email(),
  password: z.string()
});

export const serviceSchemaValidation = z.object({
  title: z.string().min(3),
  description: z.string().optional(),
  category: z.string(),
  subcategory: z.string().optional(),
  price: z.number().positive(),
  priceType: z.enum(['fixed', 'hourly']).default('fixed'),
  duration: z.number().optional()
});

export const bookingSchemaValidation = z.object({
  serviceId: z.string().uuid(),
  scheduledAt: z.string().datetime(),
  address: z.string(),
  duration: z.number().optional(),
  notes: z.string().optional()
});

export const reviewSchemaValidation = z.object({
  bookingId: z.string().uuid(),
  rating: z.number().min(1).max(5),
  comment: z.string().optional()
});

export const messageSchemaValidation = z.object({
  bookingId: z.string().uuid(),
  content: z.string().min(1),
  type: z.enum(['text', 'image', 'location']).default('text')
});