# app/models/response.py
from pydantic import BaseModel
from typing import List, Dict, Any, Optional
from app.models.green_space import GreenSpace, Coordinates, Amenity, PersonalityScore, LocationScore

class GreenSpaceResponse(BaseModel):
    """Response model for green space search."""
    green_spaces: List[GreenSpace]
    total_found: int
    search_params: Dict[str, Any]
    personality: str
    search_location: Optional[Coordinates] = None
    
class DetailedAnalysis(BaseModel):
    """Detailed analysis of a green space."""
    green_space: GreenSpace
    personality_breakdown: Dict[str, PersonalityScore]
    best_locations_within: List[LocationScore]  # Best spots within this space
    seasonal_recommendations: Dict[str, str]  # Spring, Summer, Fall, Winter
    optimal_visit_times: List[str]
    similar_spaces: List[str]  # IDs of similar green spaces

class NearbyAmenitiesResponse(BaseModel):
    """Response for amenity search."""
    location: Coordinates
    radius: int
    amenities: Dict[str, List[Amenity]]  # Grouped by type
    summary: Dict[str, int]  # Count by type
    
class DiscoveryResult(BaseModel):
    """Result for green space discovery."""
    green_space: GreenSpace
    distance_meters: int
    travel_time_walking: int  # minutes
    travel_time_cycling: int  # minutes
    why_recommended: str
    best_route_description: str
