from fastapi import APIRouter, HTTPException
from pydantic import BaseModel
from core.hackathon_scorer import compute_hackathon_score

router = APIRouter()

class HackathonRequest(BaseModel):
    parsed: dict

@router.post("/hackathon")
def hackathon(req: HackathonRequest):
    try:
        return compute_hackathon_score(req.parsed)
    except Exception as e:
        raise HTTPException(status_code=400, detail=str(e))
