wip: snapshot V2 cascade onglet 2 (sauvegarde avant chirurgie git-hygiene)

This commit is contained in:
Jules Neny
2026-05-06 15:37:13 +02:00
parent 5878c56888
commit e63d02a351
101 changed files with 188900 additions and 3959 deletions

View File

@@ -1,69 +0,0 @@
/**
* Interface canonique Pratique — AEP Pratiques Régénératives
* Source unique : types/pratique.ts
* Importée dans pages/pratiques-regeneratives.vue, pages/pratique/[id].vue
*/
export interface Pratique {
id: number
nom: string
pays: string // ISO-2 — Europe (FR/BE/...) ou DOM-TOM (GP/MQ/GF/RE/YT/PF/NC/...)
ville: string
type: 'agence' | 'cooperative' | 'collectif' | 'reseau' | 'asso' | 'recherche' | 'mouvement' | 'plateforme' | 'inconnu'
url: string
lat: number | null
lng: number | null
description: string
criteres: number[] // 1-8
score: number
tags: string[]
source: string
passe: 1 | 2 | 3
}
export const CRITERES = [
{ id: 1, label: 'Matériaux' },
{ id: 2, label: 'Filières' },
{ id: 3, label: 'Posture' },
{ id: 4, label: 'Process' },
{ id: 5, label: 'Politique' },
{ id: 6, label: 'Modèle éco' },
{ id: 7, label: 'Vivant' },
{ id: 8, label: 'Transmission' },
] as const
export const TYPES_ENTITE = [
'agence',
'cooperative',
'collectif',
'reseau',
'asso',
'recherche',
'mouvement',
'plateforme',
'inconnu',
] as const
export const TYPES_ENTITE_LABELS: Record<string, string> = {
agence: 'Agence',
cooperative: 'Coopérative',
collectif: 'Collectif',
reseau: 'Réseau',
asso: 'Association',
recherche: 'Recherche',
mouvement: 'Mouvement',
plateforme: 'Plateforme',
inconnu: 'Autre',
}
export const EUROPE_CODES = ['FR', 'BE', 'UK', 'DE', 'ES', 'NL', 'CH', 'IT', 'PT', 'SE', 'DK', 'FI', 'NO', 'PL', 'CZ', 'AT'] as const
export const OUTREMER_CODES = ['GP', 'MQ', 'GF', 'RE', 'YT', 'PF', 'NC', 'BL', 'MF', 'PM', 'WF'] as const
export const PAYS_LABELS: Record<string, string> = {
FR: 'France', BE: 'Belgique', UK: 'Royaume-Uni', DE: 'Allemagne',
ES: 'Espagne', NL: 'Pays-Bas', CH: 'Suisse', IT: 'Italie',
PT: 'Portugal', SE: 'Suède', DK: 'Danemark', FI: 'Finlande',
NO: 'Norvège', PL: 'Pologne', CZ: 'Tchéquie', AT: 'Autriche',
GP: 'Guadeloupe', MQ: 'Martinique', GF: 'Guyane', RE: 'La Réunion',
YT: 'Mayotte', PF: 'Polynésie française', NC: 'Nouvelle-Calédonie',
BL: 'Saint-Barthélemy', MF: 'Saint-Martin', PM: 'Saint-Pierre-et-Miquelon', WF: 'Wallis-et-Futuna',
}

91
types/structure-v2.ts Normal file
View File

@@ -0,0 +1,91 @@
/**
* Types V2 - Carte des réseaux de bifurcation
* Source : public/data/reseaux-bifurcation.json
*/
export interface StructureV2 {
id: string
nom: string
url: string
pays: string
ville: string
famille_principale: 1 | 2 | 3 | 4 | 5
familles_secondaires?: number[]
hashtags: string[]
type_principal: string
badges: {
centre_ressources: boolean
mouvement_manifeste: boolean
contre_pouvoir_spatial: boolean
f6_recherche_politique: boolean
}
description_courte: string
description_longue: string
pensees: { id: string; label: string; confiance: string }[]
sources: { type: string; titre: string; url: string }[]
already_in_v1: boolean
eligible_v2: boolean
// Geocoords (ajoutés par géocodage - peut être null)
latitude?: number | null
longitude?: number | null
}
export interface ReseauxBifurcationData {
version: string
meta: {
total_structures: number
total_projets_emblematiques: number
total_edges_graphe: number
familles: { id: number; label: string; color: string }[]
hashtags_officiels: string[]
}
structures: StructureV2[]
projets: ProjetEmblematique[]
graphe: { edges: GrapheEdge[] }
}
export interface ProjetEmblematique {
id: string
nom: string
structure_parent: string
annee?: number
lieu?: string
geocoords?: { lat: number; lng: number } | null
description: string
url?: string | null
tags: string[]
}
export interface GrapheEdge {
source: string
target: string
types: string[]
score: number
evidence: string
}
// Mapping StructureV2 vers le format attendu par NavMap (interface Org)
// NavMap attend { Id, latitude, longitude, nom, ... }
export function structureToMapOrg(s: StructureV2, index: number): {
Id: number
nom: string
latitude?: number | null
longitude?: number | null
prioritaire?: boolean
famille_principale?: number
hashtags?: string[]
type_principal?: string
description_courte?: string
} {
return {
Id: index,
nom: s.nom,
latitude: s.latitude,
longitude: s.longitude,
prioritaire: s.badges?.centre_ressources || s.badges?.mouvement_manifeste || s.badges?.contre_pouvoir_spatial,
famille_principale: s.famille_principale,
hashtags: s.hashtags,
type_principal: s.type_principal,
description_courte: s.description_courte,
}
}