import { z } from 'zod';

const fallbackRuleSchema = z.object({
  trigger: z.string(),
  action: z.string(),
  priority: z.enum(['low', 'medium', 'high']).optional(),
});

export const updateAiConfigSchema = z.object({
  voice_enabled: z.boolean().optional(),
  chat_enabled: z.boolean().optional(),
  model: z.string().optional(),
  voice_model: z.string().optional(),
  response_style: z.enum(['friendly', 'professional', 'concise']).optional(),
  system_prompt: z.string().optional(),
  greeting_script: z.string().optional(),
  closing_script: z.string().optional(),
  fallback_rules: z.array(fallbackRuleSchema).optional(),
  capabilities: z.record(z.string(), z.any()).optional(),
  twilio_phone_number: z.string().optional(),
  inbound_routing: z.string().optional(),
  outbound_enabled: z.boolean().optional(),
  call_greeting: z.string().optional(),
  call_recording_enabled: z.boolean().optional(),
  call_transcription_enabled: z.boolean().optional(),
});

export type UpdateAiConfigInput = z.infer<typeof updateAiConfigSchema>;
