"""Industrial AVM router — rent estimation for industrial parks."""

from fastapi import APIRouter

from app.models.avm_industrial import (
    IndustrialAVMRequest,
    IndustrialAVMResponse,
)
from app.services.avm_industrial_service import industrial_avm_service

router = APIRouter(prefix="/avm/industrial", tags=["AVM Industrial"])


@router.post("/predict", response_model=IndustrialAVMResponse)
def predict_industrial(req: IndustrialAVMRequest) -> IndustrialAVMResponse:
    """Estimate industrial property rent using gradient boosting model.

    Returns estimated monthly rent in USD/m² with confidence interval,
    comparable properties, and feature importance drivers.
    Falls back to heuristic when trained model is not available.
    """
    return industrial_avm_service.predict(req)
