Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : Vrai-Prix8 * File : src/app/estimation/manuelle/page.tsx9 * Module : app10 * Repository : https://git.spboucher.ai/vrai-prix11 * Created : 2026-08-0912 * Last Modified : 2026-08-1313 *14 * Author : Simon-Pierre Boucher15 * Position : Professor of Finance16 * Institution : Université du Québec en Outaouais (UQO)17 * Organization : SP Boucher18 * Website : https://spboucher.ai19 * Git : https://git.spboucher.ai20 *21 * Preferred Contact: contact@spboucher.ai22 * Development : dev@spboucher.ai23 * Support : support@spboucher.ai24 * Security/Admin : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142import type { Metadata } from "next";43import { notFound } from "next/navigation";44import { estimateManual } from "@/lib/estimator";45import ResultView from "@/components/ResultView";4647export const dynamic = "force-dynamic";4849// Page paramétrique (querystring libre) : exclue de l'index pour éviter50// un espace d'URL infini ; les fiches /estimation/[id] restent indexables.51export const metadata: Metadata = {52 title: "Estimation manuelle",53 robots: { index: false, follow: true },54};5556export default async function ManualEstimationPage({57 searchParams,58}: {59 searchParams: Promise<Record<string, string | string[] | undefined>>;60}) {61 const sp = await searchParams;62 const one = (k: string) => {63 const v = sp[k];64 return Array.isArray(v) ? v[0] : v;65 };66 const municipality = one("municipality");67 const typeProp = one("typeProp");68 if (!municipality || !typeProp) notFound();69 const num = (k: string) => {70 const v = one(k);71 const n = v ? Number(v) : NaN;72 return Number.isFinite(n) ? n : undefined;73 };74 const data = estimateManual({75 municipality,76 typeProp,77 floorArea: num("floorArea"),78 yearBuilt: num("yearBuilt"),79 landArea: num("landArea"),80 });81 if (!data) notFound();82 return <ResultView data={data} />;83}84