mirror of
https://framagit.org/enfance-libre/statistiques
synced 2025-12-07 23:13: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",
|
notionPropName: "% procédure pénale avec composition pénale",
|
||||||
unit: "%",
|
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: {
|
nbFamillesCRPC: {
|
||||||
notionPropName: "Nb familles avec CRPC",
|
notionPropName: "Nb familles avec CRPC",
|
||||||
},
|
},
|
||||||
|
|
@ -96,6 +119,7 @@ const statPropsPublishOptions: {
|
||||||
notionPropName: "% familles avec CRPC refusée",
|
notionPropName: "% familles avec CRPC refusée",
|
||||||
unit: "%",
|
unit: "%",
|
||||||
},
|
},
|
||||||
|
|
||||||
nbFamillesProcedureCivile: {
|
nbFamillesProcedureCivile: {
|
||||||
notionPropName: "Nb familles avec procédure civile",
|
notionPropName: "Nb familles avec procédure civile",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,17 @@ export type ELStatsAtDate<V> = {
|
||||||
pourcentageFamillesMisesEnDemeure: V;
|
pourcentageFamillesMisesEnDemeure: V;
|
||||||
nbFamillesProcedurePenale: V;
|
nbFamillesProcedurePenale: V;
|
||||||
pourcentageFamillesProcedurePenale: V;
|
pourcentageFamillesProcedurePenale: V;
|
||||||
|
|
||||||
|
// Pénale > Composition Pénale
|
||||||
nbFamillesCompositionPenale: V;
|
nbFamillesCompositionPenale: V;
|
||||||
pourcentageFamillesCompositionPenale: V;
|
pourcentageFamillesCompositionPenale: V;
|
||||||
pourcentageProcedurePenaleAvecCompositionPenale: V;
|
pourcentageProcedurePenaleAvecCompositionPenale: V;
|
||||||
|
nbFamillesCompositionPenaleAcceptee: V;
|
||||||
|
pourcentageCompositionPenaleAcceptee: V;
|
||||||
|
pourcentageFamillesCompositionPenaleAcceptee: V;
|
||||||
|
nbFamillesCompositionPenaleRefusee: V;
|
||||||
|
pourcentageCompositionPenaleRefusee: V;
|
||||||
|
pourcentageFamillesCompositionPenaleRefusee: V;
|
||||||
|
|
||||||
// Pénale > CRPC
|
// Pénale > CRPC
|
||||||
nbFamillesCRPC: V;
|
nbFamillesCRPC: V;
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,26 @@ export function computeELStatsAtDate(
|
||||||
(evt) => isCompositionPenale(evt) && isEvenementBefore(evt, asOfDate)
|
(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) =>
|
const famillesAvecCRPC = familleResistantesOrEx.filter((famille) =>
|
||||||
famille.Evenements.find(
|
famille.Evenements.find(
|
||||||
(evt) => isCRPC(evt) && isEvenementBefore(evt, asOfDate)
|
(evt) => isCRPC(evt) && isEvenementBefore(evt, asOfDate)
|
||||||
|
|
@ -103,6 +123,27 @@ export function computeELStatsAtDate(
|
||||||
famillesAvecCompositionPenale.length,
|
famillesAvecCompositionPenale.length,
|
||||||
famillesAvecProcedurePenale.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,
|
nbFamillesCRPC: famillesAvecCRPC.length,
|
||||||
pourcentageFamillesCRPC: percent(
|
pourcentageFamillesCRPC: percent(
|
||||||
famillesAvecCRPC.length,
|
famillesAvecCRPC.length,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue