From 728e219878e087f534b664d269dbb453fed32ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Arod?= Date: Tue, 27 May 2025 21:09:55 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Nb=20familles=20ou=20le=20proc=C3=A8s?= =?UTF-8?q?=20d'appel=20est=20planifi=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/statistiques/v2/penales/StatsPenales.ts | 3 +++ .../v2/penales/tc/InfoTribunalCorrectionnel.ts | 2 +- .../penales/tc/buildInfoTribunauxCorrectionnel.ts | 3 +++ .../v2/penales/tc/computeTribunalCorrectionnel.ts | 14 ++++++++++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/statistiques/v2/penales/StatsPenales.ts b/src/statistiques/v2/penales/StatsPenales.ts index 0a00fdf..266d9a0 100644 --- a/src/statistiques/v2/penales/StatsPenales.ts +++ b/src/statistiques/v2/penales/StatsPenales.ts @@ -19,6 +19,9 @@ export const statsTribunalCorrectionnelDesc = { nbFamillesAvecAppelDuParquet: { label: "Nb familles ou le parquet à fait appel", }, + nbFamillesAvecProcesAppelPlanifie: { + label: "Nb familles ou le procès d'appel est planifié", + }, } as const; export const statsPenalesDesc = { diff --git a/src/statistiques/v2/penales/tc/InfoTribunalCorrectionnel.ts b/src/statistiques/v2/penales/tc/InfoTribunalCorrectionnel.ts index bd1def8..7ec4864 100644 --- a/src/statistiques/v2/penales/tc/InfoTribunalCorrectionnel.ts +++ b/src/statistiques/v2/penales/tc/InfoTribunalCorrectionnel.ts @@ -6,5 +6,5 @@ export type InfoTribunalCorrectionnel = { evtViceDeProcedure?: EvenementFamille; evtAppel?: EvenementFamille; evtAppelDuParquet?: EvenementFamille; - procesDAppel?: EvenementFamille; + evtProcesAppel?: EvenementFamille; }; diff --git a/src/statistiques/v2/penales/tc/buildInfoTribunauxCorrectionnel.ts b/src/statistiques/v2/penales/tc/buildInfoTribunauxCorrectionnel.ts index ab942f6..d7cbbda 100644 --- a/src/statistiques/v2/penales/tc/buildInfoTribunauxCorrectionnel.ts +++ b/src/statistiques/v2/penales/tc/buildInfoTribunauxCorrectionnel.ts @@ -36,6 +36,9 @@ export function buildInfoTribunauxCorrectionnel( evtAppelDuParquet: eventsBetweenCurrentTribAndNextTrib.find( (e) => e.Type === "Appel du parquet" ), + evtProcesAppel: eventsBetweenCurrentTribAndNextTrib.find( + (e) => e.Type === "Procès appel TC" + ), }; }); } diff --git a/src/statistiques/v2/penales/tc/computeTribunalCorrectionnel.ts b/src/statistiques/v2/penales/tc/computeTribunalCorrectionnel.ts index 461004a..1fcf55a 100644 --- a/src/statistiques/v2/penales/tc/computeTribunalCorrectionnel.ts +++ b/src/statistiques/v2/penales/tc/computeTribunalCorrectionnel.ts @@ -20,6 +20,12 @@ export function computeTribunalCorrectionnel( !isEvenementBefore(f.infoTribunaux[indexTribunal].evtTribunal, now) ); + const famillesViceDeProcedure = famillesPassees.filter( + (f) => + f.infoTribunaux.length > indexTribunal && + f.infoTribunaux[indexTribunal].evtViceDeProcedure + ); + const famillesRelaxees = famillesPassees.filter( (f) => f.infoTribunaux.length > indexTribunal && @@ -37,10 +43,11 @@ export function computeTribunalCorrectionnel( f.infoTribunaux.length > indexTribunal && f.infoTribunaux[indexTribunal].evtAppelDuParquet ); - const famillesViceDeProcedure = famillesPassees.filter( + + const nbFamillesAvecProcesAppelPlanifie = famillesPassees.filter( (f) => f.infoTribunaux.length > indexTribunal && - f.infoTribunaux[indexTribunal].evtViceDeProcedure + f.infoTribunaux[indexTribunal].evtProcesAppel ); return { @@ -56,5 +63,8 @@ export function computeTribunalCorrectionnel( nbFamillesAvecAppelDuParquet: nbFamillesAvecPagesLiees( famillesAppelDuParquet ), + nbFamillesAvecProcesAppelPlanifie: nbFamillesAvecPagesLiees( + nbFamillesAvecProcesAppelPlanifie + ), }; }