"""Generative Design — geometry placement.

Stage 1a: Shapely-based polygon parsing + normative offsets (buffer).
Stage 1b: greedy filling of rectangular MKD with 3 strategies. STRtree for collisions.
Performance target: <=10s per variant; fallback acceptance 15s.
"""

from typing import Any

from app.schemas.concept import TEAP, ConceptInput, ConceptVariant, FinancialModel


def generate_stub(payload: ConceptInput) -> list[ConceptVariant]:
    """Placeholder returning 3 empty variants. Replaced in Stage 1b."""
    empty_buildings: dict[str, Any] = {"type": "FeatureCollection", "features": []}
    empty_teap = TEAP(
        built_area_sqm=0.0,
        total_floor_area_sqm=0.0,
        residential_area_sqm=0.0,
        apartments_count=0,
        density=0.0,
        parking_spaces=0,
    )
    empty_financial = FinancialModel(revenue_rub=0.0, cost_rub=0.0, gross_margin_rub=0.0, irr=0.0)
    strategies: list[ConceptVariant] = []
    for strategy in ("max_area", "max_insolation", "balanced"):
        strategies.append(
            ConceptVariant(
                strategy=strategy,
                buildings_geojson=empty_buildings,
                teap=empty_teap,
                financial=empty_financial,
            )
        )
    return strategies
