from fastapi import APIRouter

from app.models.neighborhood import NeighborhoodScoreRequest, NeighborhoodScoreResponse
from app.services.neighborhood_service import neighborhood_score_service

router = APIRouter(prefix="/neighborhood", tags=["Neighborhood"])


@router.post("/score", response_model=NeighborhoodScoreResponse)
def score(req: NeighborhoodScoreRequest) -> NeighborhoodScoreResponse:
    """Compute weighted 0-100 livability score from per-category POI counts."""
    return neighborhood_score_service.score(req)
