"""
Appointment scheduling models
"""

from pydantic import BaseModel, Field
from typing import Optional, List, Dict, Any
from datetime import datetime


class AppointmentRequest(BaseModel):
    """Request model for scheduling an appointment"""
    name: str = Field(..., description="Full name of the person requesting the appointment")
    email: str = Field(..., description="Email address for contact")
    phone: str = Field(..., description="Phone number for contact")
    company: Optional[str] = Field(None, description="Company name if applicable")
    topic: str = Field(..., description="Topic or reason for the appointment")
    preferred_date: Optional[str] = Field(None, description="Preferred date for the appointment (YYYY-MM-DD)")
    preferred_time: Optional[str] = Field(None, description="Preferred time for the appointment (HH:MM)")
    additional_notes: Optional[str] = Field(None, description="Any additional information or requirements")
    conversation_id: str = Field(..., description="ID of the conversation where the appointment was requested")


class AppointmentResponse(BaseModel):
    """Response model for appointment scheduling"""
    appointment_id: str = Field(..., description="Unique identifier for the appointment")
    status: str = Field(..., description="Status of the appointment request (pending, confirmed, etc.)")
    message: str = Field(..., description="Message about the appointment status")
    scheduled_date: Optional[str] = Field(None, description="Scheduled date if confirmed")
    scheduled_time: Optional[str] = Field(None, description="Scheduled time if confirmed")
    contact_person: Optional[str] = Field(None, description="Name of the contact person for the appointment")


class MeetingIntentDetectionResponse(BaseModel):
    """Response model for meeting intent detection"""
    is_meeting_request: bool = Field(..., description="Whether the message is a meeting request")
    confidence: float = Field(..., description="Confidence score for the detection (0-1)")
    suggested_topic: Optional[str] = Field(None, description="Suggested topic for the meeting if detected")
    missing_fields: List[str] = Field([], description="List of fields that need to be collected from the user")
    extracted_info: Dict[str, Any] = Field(default_factory=dict, description="Information extracted from the message")
