Skip to content

Vector cadastre map + MAF mission-type selection#94

Merged
zinkh merged 4 commits into
mainfrom
claude/parcelles-tech-analysis-6nwo5q
Jul 19, 2026
Merged

Vector cadastre map + MAF mission-type selection#94
zinkh merged 4 commits into
mainfrom
claude/parcelles-tech-analysis-6nwo5q

Conversation

@zinkh

@zinkh zinkh commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

Interactive vector cadastre map (matching the gorenove.fr-style UX requested)

  • MapLibreCadastre.tsx now renders cadastral parcels as a clickable vector layer (fill/line with hover + selection states) instead of a static raster WMTS overlay, with an onParcelSelect callback threaded through GeoportailMap.
  • /api/cadastre/parcel accepts a bbox (in addition to the existing point mode) and now returns parcel geometry, so the map can fetch and render all parcels in view. Also fixes the contenance (surface) field, which was computed client-side but never actually populated by the server.

MAF mission-type selection, per the 2025 activity circular

  • Devis and projets can now pick the mission type (maf_intercalaire: jaune/vert/ami/violet/orange clair.../etc.) and, for maîtrise d'œuvre missions, the taux T (30/60/100/110%) — new fields on Proposal/Project, new migration migrate_add_maf_mission_type.sql.
  • The choice carries over automatically when an accepted proposal creates its project.
  • The MAF declaration plugin (MafDeclaration.tsx) now warns when a linked project's declared mission type doesn't match the active intercalaire tab.
  • The existing (previously unused) useMafCost/MafCostBadge are now wired into both pages, showing a live estimated MAF cost next to the mission-type selector. The hook's intercalaire guess now defers to the explicit choice instead of only heuristics, and honoraires HT are passed through for the fee-based intercalaires.

Test plan

  • npm run lint (tsc --noEmit) passes
  • vite build succeeds
  • Manual verification in a browser with real Supabase credentials (not available in this sandbox — no outbound network to apicarto.ign.fr, no Supabase env vars)
  • Apply supabase/migrate_add_maf_mission_type.sql on the target Supabase project before/after merge

Generated by Claude Code

claude added 4 commits July 19, 2026 21:10
…WMTS

Replace the raster CADASTRALPARCELS.PARCELS WMTS overlay in MapLibreCadastre
with a clickable GeoJSON vector layer, matching the vector-tile UX seen on
gorenove.fr. /api/cadastre/parcel now accepts a bbox (in addition to the
existing lon/lat point mode) and returns parcel geometry, so the map can
fetch and render all parcels in view and let users click one to select it
(onParcelSelect callback, threaded through GeoportailMap).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmfoTz7co9CshaNAFf6QD3
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmfoTz7co9CshaNAFf6QD3
Devis and projets can now pick the mission type from the MAF activity
circular (intercalaire jaune/vert/ami/... and, for maîtrise d'œuvre, the
taux T 30/60/100/110%). The choice carries over from an accepted proposal
to its project, and the MAF declaration plugin now warns when a linked
project's declared mission type doesn't match the selected intercalaire
tab. Shared MAF_INTERCALAIRE_OPTIONS/TAUX_MISSION_OPTIONS constants moved
to mafUtils.ts to avoid duplicating them per page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmfoTz7co9CshaNAFf6QD3
useMafCost/MafCostBadge existed but were never wired into the UI, and the
hook only guessed the intercalaire heuristically from categorie_projet —
ignoring the explicit maf_intercalaire choice just added to proposals and
projects. Make the explicit choice take priority over the heuristic, pass
honoraires HT through for the non-maîtrise-d'œuvre intercalaires (which
price on fees rather than M×T×P), and surface the badge live next to the
mission-type selectors on both the devis and the project page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmfoTz7co9CshaNAFf6QD3
@zinkh
zinkh merged commit d5b8f6c into main Jul 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants