import { z } from 'zod';

export const createBookingSchema = z.object({
  branch_id: z.string().uuid().optional(),
  customer_id: z.string().uuid().optional(),
  guest_name: z.string().min(1, 'Guest name is required'),
  guest_phone: z.string().optional(),
  guest_email: z.string().email().optional(),
  table_no: z.string().optional(),
  party_size: z.number().int().positive().optional(),
  booking_date: z.string().optional(),
  booking_time: z.string().optional(),
  zone: z.string().optional(),
  channel: z.enum(['chat', 'voice', 'whatsapp', 'email', 'sms']).optional(),
  occasion: z.string().optional(),
  dietary_needs: z.array(z.string()).optional(),
  special_requests: z.string().optional(),
  is_vip: z.boolean().optional(),
  notes: z.string().optional(),
});

export const updateBookingSchema = z.object({
  status: z.enum(['pending','confirmed','seated','completed','cancelled','noshow','escalated','reminder_sent']).optional(),
  table_no: z.string().optional(),
  party_size: z.number().int().positive().optional(),
  booking_date: z.string().optional(),
  booking_time: z.string().optional(),
  zone: z.string().optional(),
  notes: z.string().optional(),
  special_requests: z.string().optional(),
  reminder_sent: z.boolean().optional(),
  is_vip: z.boolean().optional(),
});

export type CreateBookingInput = z.infer<typeof createBookingSchema>;
export type UpdateBookingInput = z.infer<typeof updateBookingSchema>;
