feat: stats admin adhoc et vice de procédure

This commit is contained in:
Sébastien Arod 2025-05-26 19:08:40 +02:00
parent 4381f594c0
commit 9b724d3789
3 changed files with 35 additions and 3 deletions

View file

@ -20,13 +20,21 @@ export const typesEvenementsPenal = [
"Stage parentalité", "Stage parentalité",
"Réquisition judiciaire", "Réquisition judiciaire",
// Tribunal // Tribunal correctionnel
"Tribunal correctionnel", "Tribunal correctionnel",
"Appel jugement Tribunal Correctionnel", "Appel jugement Tribunal Correctionnel",
"Appel du 2ème jugement TC", // placeholder "Appel du 2ème jugement TC", // placeholder
"Tribunal de police judiciaire",
"Administrateur AD'HOC", "Administrateur AD'HOC",
"Relaxe Tribunal correctionnel", "Relaxe Tribunal correctionnel",
"Vice de procédure tribunal correctionnel",
"Procès appel TC",
"Appel du parquet",
// Tribunal de police
"Tribunal de police judiciaire",
"Procès appel TP",
"Relaxe Tribunal de police",
"Appel Tribunal Police opposition ordonnance pénale"
// [,,,"Amendes",,,,"Classement sous condition","Information non médico-sociale"]
] as const; ] as const;
export function isEvtTypeProcedurePenale(evtType: TypeEvenement): boolean { export function isEvtTypeProcedurePenale(evtType: TypeEvenement): boolean {

View file

@ -7,6 +7,12 @@ export const statsTribunalDesc = {
nbFamillesPassees: { nbFamillesPassees: {
label: "Nb familles passées au tribunal", label: "Nb familles passées au tribunal",
}, },
nbFamillesViceDeProcedure: {
label: "Nb familles pour lesquels il y a eu un vice de procédure",
},
nbFamillesAdministrateurAdhoc: {
label: "Nb familles pour lesquelles un Administrateur ad'hoc à été nommé",
},
nbFamillesAppelDuJugement: { nbFamillesAppelDuJugement: {
label: "Nb familles ayant fait appel du jugement", label: "Nb familles ayant fait appel du jugement",
}, },

View file

@ -15,7 +15,6 @@ import { filterFamillesWithOneOfEvenements } from "../filterFamillesWithOneOfEve
import { filterFamillesWithOneOfEvenementsOfType } from "../filterFamillesWithOneOfEvenementsOfType"; import { filterFamillesWithOneOfEvenementsOfType } from "../filterFamillesWithOneOfEvenementsOfType";
import { StatsPenales } from "./StatsPenales"; import { StatsPenales } from "./StatsPenales";
import { nbFamillesAvecPagesLiees } from "./nbFamillesAvecPagesLiees"; import { nbFamillesAvecPagesLiees } from "./nbFamillesAvecPagesLiees";
import { info } from "console";
type FamilleAvecInfoTribunaux = Famille & { type FamilleAvecInfoTribunaux = Famille & {
infoTribunaux: InfoTribunalCorrectionnel[]; infoTribunaux: InfoTribunalCorrectionnel[];
@ -25,6 +24,7 @@ type InfoTribunalCorrectionnel = {
evtTribunal: EvenementFamille; evtTribunal: EvenementFamille;
evtRelaxe?: EvenementFamille; evtRelaxe?: EvenementFamille;
evtAdminAdhoc?: EvenementFamille; evtAdminAdhoc?: EvenementFamille;
evtViceDeProcedure?: EvenementFamille;
evtAppel?: EvenementFamille; evtAppel?: EvenementFamille;
}; };
@ -216,6 +216,17 @@ function computeTribunalCorrectionnel(
f.infoTribunaux.length > indexTribunal && f.infoTribunaux.length > indexTribunal &&
f.infoTribunaux[indexTribunal].evtAppel f.infoTribunaux[indexTribunal].evtAppel
); );
const famillesAdministrateurAdhoc = famillesPassees.filter(
(f) =>
f.infoTribunaux.length > indexTribunal &&
f.infoTribunaux[indexTribunal].evtAdminAdhoc
);
const famillesViceDeProcedure = famillesPassees.filter(
(f) =>
f.infoTribunaux.length > indexTribunal &&
f.infoTribunaux[indexTribunal].evtViceDeProcedure
);
return { return {
nbFamillesPassees: nbFamillesAvecPagesLiees(famillesPassees), nbFamillesPassees: nbFamillesAvecPagesLiees(famillesPassees),
@ -224,6 +235,9 @@ function computeTribunalCorrectionnel(
nbFamillesAppelDuJugement: nbFamillesAvecPagesLiees( nbFamillesAppelDuJugement: nbFamillesAvecPagesLiees(
famillesAppelDuJugement famillesAppelDuJugement
), ),
nbFamillesAdministrateurAdhoc: nbFamillesAvecPagesLiees(famillesAdministrateurAdhoc),
nbFamillesViceDeProcedure: nbFamillesAvecPagesLiees(famillesViceDeProcedure),
}; };
} }
@ -312,9 +326,13 @@ function buildInfoTribunaux(f: Famille): InfoTribunalCorrectionnel[] {
(index === 0 && e.Type === "Appel jugement Tribunal Correctionnel") || (index === 0 && e.Type === "Appel jugement Tribunal Correctionnel") ||
(index === 1 && e.Type == "Appel du 2ème jugement TC") (index === 1 && e.Type == "Appel du 2ème jugement TC")
), ),
evtViceDeProcedure: eventsBetweenTribAndNextTrib.find(
(e) => e.Type === "Vice de procédure tribunal correctionnel"
),
evtRelaxe: eventsBetweenTribAndNextTrib.find( evtRelaxe: eventsBetweenTribAndNextTrib.find(
(e) => e.Type === "Relaxe Tribunal correctionnel" (e) => e.Type === "Relaxe Tribunal correctionnel"
), ),
}; };
}); });
} }