mirror of
https://framagit.org/enfance-libre/statistiques
synced 2025-12-07 13:53:45 +00:00
feat: ajoute stats Composition pénale Acceptée/refusée
This commit is contained in:
parent
39f46a596c
commit
4cbc2c15a7
3 changed files with 73 additions and 0 deletions
|
|
@ -63,6 +63,29 @@ const statPropsPublishOptions: {
|
|||
notionPropName: "% procédure pénale avec composition pénale",
|
||||
unit: "%",
|
||||
},
|
||||
nbFamillesCompositionPenaleAcceptee: {
|
||||
notionPropName: "Nb familles avec composition pénale acceptée",
|
||||
},
|
||||
pourcentageCompositionPenaleAcceptee: {
|
||||
notionPropName: "% des composition pénale qui sont acceptée",
|
||||
unit: "%",
|
||||
},
|
||||
pourcentageFamillesCompositionPenaleAcceptee: {
|
||||
notionPropName: "% familles avec composition pénale acceptée",
|
||||
unit: "%",
|
||||
},
|
||||
nbFamillesCompositionPenaleRefusee: {
|
||||
notionPropName: "Nb familles avec composition pénale refusée",
|
||||
},
|
||||
pourcentageCompositionPenaleRefusee: {
|
||||
notionPropName: "% des composition pénale qui sont refusée",
|
||||
unit: "%",
|
||||
},
|
||||
pourcentageFamillesCompositionPenaleRefusee: {
|
||||
notionPropName: "% familles avec composition pénale refusée",
|
||||
unit: "%",
|
||||
},
|
||||
|
||||
nbFamillesCRPC: {
|
||||
notionPropName: "Nb familles avec CRPC",
|
||||
},
|
||||
|
|
@ -96,6 +119,7 @@ const statPropsPublishOptions: {
|
|||
notionPropName: "% familles avec CRPC refusée",
|
||||
unit: "%",
|
||||
},
|
||||
|
||||
nbFamillesProcedureCivile: {
|
||||
notionPropName: "Nb familles avec procédure civile",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,9 +18,17 @@ export type ELStatsAtDate<V> = {
|
|||
pourcentageFamillesMisesEnDemeure: V;
|
||||
nbFamillesProcedurePenale: V;
|
||||
pourcentageFamillesProcedurePenale: V;
|
||||
|
||||
// Pénale > Composition Pénale
|
||||
nbFamillesCompositionPenale: V;
|
||||
pourcentageFamillesCompositionPenale: V;
|
||||
pourcentageProcedurePenaleAvecCompositionPenale: V;
|
||||
nbFamillesCompositionPenaleAcceptee: V;
|
||||
pourcentageCompositionPenaleAcceptee: V;
|
||||
pourcentageFamillesCompositionPenaleAcceptee: V;
|
||||
nbFamillesCompositionPenaleRefusee: V;
|
||||
pourcentageCompositionPenaleRefusee: V;
|
||||
pourcentageFamillesCompositionPenaleRefusee: V;
|
||||
|
||||
// Pénale > CRPC
|
||||
nbFamillesCRPC: V;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,26 @@ export function computeELStatsAtDate(
|
|||
(evt) => isCompositionPenale(evt) && isEvenementBefore(evt, asOfDate)
|
||||
)
|
||||
);
|
||||
|
||||
const famillesAvecCompositionPenaleAcceptee = familleResistantesOrEx.filter(
|
||||
(famille) =>
|
||||
famille.Evenements.find(
|
||||
(evt) =>
|
||||
isCompositionPenale(evt) &&
|
||||
evt.Type === "Composition pénale acceptée" &&
|
||||
isEvenementBefore(evt, asOfDate)
|
||||
)
|
||||
);
|
||||
const famillesAvecCompositionPenaleRefusee = familleResistantesOrEx.filter(
|
||||
(famille) =>
|
||||
famille.Evenements.find(
|
||||
(evt) =>
|
||||
isCompositionPenale(evt) &&
|
||||
evt.Type === "Composition pénale refusée" &&
|
||||
isEvenementBefore(evt, asOfDate)
|
||||
)
|
||||
);
|
||||
|
||||
const famillesAvecCRPC = familleResistantesOrEx.filter((famille) =>
|
||||
famille.Evenements.find(
|
||||
(evt) => isCRPC(evt) && isEvenementBefore(evt, asOfDate)
|
||||
|
|
@ -103,6 +123,27 @@ export function computeELStatsAtDate(
|
|||
famillesAvecCompositionPenale.length,
|
||||
famillesAvecProcedurePenale.length
|
||||
),
|
||||
nbFamillesCompositionPenaleAcceptee:
|
||||
famillesAvecCompositionPenaleAcceptee.length,
|
||||
pourcentageCompositionPenaleAcceptee: percent(
|
||||
famillesAvecCompositionPenaleAcceptee.length,
|
||||
famillesAvecCompositionPenale.length
|
||||
),
|
||||
pourcentageFamillesCompositionPenaleAcceptee: percent(
|
||||
famillesAvecCompositionPenaleAcceptee.length,
|
||||
familleResistantesOrEx.length
|
||||
),
|
||||
nbFamillesCompositionPenaleRefusee:
|
||||
famillesAvecCompositionPenaleRefusee.length,
|
||||
pourcentageCompositionPenaleRefusee: percent(
|
||||
famillesAvecCompositionPenaleRefusee.length,
|
||||
famillesAvecCompositionPenale.length
|
||||
),
|
||||
pourcentageFamillesCompositionPenaleRefusee: percent(
|
||||
famillesAvecCompositionPenaleRefusee.length,
|
||||
familleResistantesOrEx.length
|
||||
),
|
||||
|
||||
nbFamillesCRPC: famillesAvecCRPC.length,
|
||||
pourcentageFamillesCRPC: percent(
|
||||
famillesAvecCRPC.length,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue