Vector cadastre map + MAF mission-type selection#94
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Interactive vector cadastre map (matching the gorenove.fr-style UX requested)
MapLibreCadastre.tsxnow renders cadastral parcels as a clickable vector layer (fill/line with hover + selection states) instead of a static raster WMTS overlay, with anonParcelSelectcallback threaded throughGeoportailMap./api/cadastre/parcelaccepts abbox(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 thecontenance(surface) field, which was computed client-side but never actually populated by the server.MAF mission-type selection, per the 2025 activity circular
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 onProposal/Project, new migrationmigrate_add_maf_mission_type.sql.MafDeclaration.tsx) now warns when a linked project's declared mission type doesn't match the active intercalaire tab.useMafCost/MafCostBadgeare 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) passesvite buildsucceedssupabase/migrate_add_maf_mission_type.sqlon the target Supabase project before/after mergeGenerated by Claude Code