mirror of
https://framagit.org/enfance-libre/statistiques
synced 2025-12-07 13:53:45 +00:00
feat: readonly data
This commit is contained in:
parent
e4af267c4f
commit
24d20a4fe0
3 changed files with 5 additions and 5 deletions
|
|
@ -2,14 +2,14 @@ import { Period } from "../period/Period";
|
||||||
import { isPeriodContaining } from "../period/isPeriodContaining";
|
import { isPeriodContaining } from "../period/isPeriodContaining";
|
||||||
import { TypeEvenement } from "./TypeEvenement";
|
import { TypeEvenement } from "./TypeEvenement";
|
||||||
|
|
||||||
export type EvenementFamille = {
|
export type EvenementFamille = Readonly<{
|
||||||
notionId: string;
|
notionId: string;
|
||||||
notionIdFamille: string;
|
notionIdFamille: string;
|
||||||
Évènement: string;
|
Évènement: string;
|
||||||
Date: Date | null;
|
Date: Date | null;
|
||||||
Type: TypeEvenement;
|
Type: TypeEvenement;
|
||||||
"Enfants concernés": string;
|
"Enfants concernés": string;
|
||||||
};
|
}>;
|
||||||
|
|
||||||
export function isProcedurePenale(evenement: EvenementFamille): boolean {
|
export function isProcedurePenale(evenement: EvenementFamille): boolean {
|
||||||
return categorieEvenement[evenement.Type] === "Procédure Pénale";
|
return categorieEvenement[evenement.Type] === "Procédure Pénale";
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { ContexteEntreeDC } from "./ContexteEntreeDC";
|
||||||
import { EvenementFamille } from "./EvenementFamille";
|
import { EvenementFamille } from "./EvenementFamille";
|
||||||
import { StatutFamille } from "./StatutFamille";
|
import { StatutFamille } from "./StatutFamille";
|
||||||
|
|
||||||
export type Famille = {
|
export type Famille = Readonly<{
|
||||||
notionId: string;
|
notionId: string;
|
||||||
Titre: string;
|
Titre: string;
|
||||||
Statut: StatutFamille;
|
Statut: StatutFamille;
|
||||||
|
|
@ -15,7 +15,7 @@ export type Famille = {
|
||||||
Sortie: Date | null;
|
Sortie: Date | null;
|
||||||
// sorted by date asc
|
// sorted by date asc
|
||||||
Evenements: EvenementFamille[];
|
Evenements: EvenementFamille[];
|
||||||
};
|
}>;
|
||||||
|
|
||||||
export function periodOfResistance(
|
export function periodOfResistance(
|
||||||
family: Famille,
|
family: Famille,
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ function checkFamilyDataConsistency(family: Famille): ConsistencyReport {
|
||||||
issueType: "Ex résistant.e.s sans date Sortie",
|
issueType: "Ex résistant.e.s sans date Sortie",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (family.Integration! > family.Sortie!) {
|
if (family.Integration && family.Sortie && family.Integration > family.Sortie) {
|
||||||
consistencyErrors.push({
|
consistencyErrors.push({
|
||||||
familyId: family.Titre,
|
familyId: family.Titre,
|
||||||
issueType: "Date Intégration > date Sortie ",
|
issueType: "Date Intégration > date Sortie ",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue