mirror of
https://framagit.org/enfance-libre/statistiques
synced 2025-12-07 07:23:44 +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 { TypeEvenement } from "./TypeEvenement";
|
||||
|
||||
export type EvenementFamille = {
|
||||
export type EvenementFamille = Readonly<{
|
||||
notionId: string;
|
||||
notionIdFamille: string;
|
||||
Évènement: string;
|
||||
Date: Date | null;
|
||||
Type: TypeEvenement;
|
||||
"Enfants concernés": string;
|
||||
};
|
||||
}>;
|
||||
|
||||
export function isProcedurePenale(evenement: EvenementFamille): boolean {
|
||||
return categorieEvenement[evenement.Type] === "Procédure Pénale";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { ContexteEntreeDC } from "./ContexteEntreeDC";
|
|||
import { EvenementFamille } from "./EvenementFamille";
|
||||
import { StatutFamille } from "./StatutFamille";
|
||||
|
||||
export type Famille = {
|
||||
export type Famille = Readonly<{
|
||||
notionId: string;
|
||||
Titre: string;
|
||||
Statut: StatutFamille;
|
||||
|
|
@ -15,7 +15,7 @@ export type Famille = {
|
|||
Sortie: Date | null;
|
||||
// sorted by date asc
|
||||
Evenements: EvenementFamille[];
|
||||
};
|
||||
}>;
|
||||
|
||||
export function periodOfResistance(
|
||||
family: Famille,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ function checkFamilyDataConsistency(family: Famille): ConsistencyReport {
|
|||
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({
|
||||
familyId: family.Titre,
|
||||
issueType: "Date Intégration > date Sortie ",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue