// Auteur : Simon-Pierre Boucher — contact@spboucher.ai import { NextRequest, NextResponse } from "next/server"; import { estimatePortfolio } from "@/lib/estimator"; export async function POST(req: NextRequest) { const body = (await req.json()) as { ids?: string[] }; const ids = (body.ids ?? []).filter((x) => typeof x === "string").slice(0, 40); if (ids.length === 0) return NextResponse.json({ error: "ids requis" }, { status: 400 }); const r = estimatePortfolio(ids); if (r.items.length === 0) return NextResponse.json({ error: "aucune propriété trouvée" }, { status: 404 }); return NextResponse.json(r); }