feat: fail on consistency issues
parent
5bbfd14abf
commit
7f58f45814
|
@ -46,19 +46,6 @@ function checkFamilyDataConsistency(family: Famille) {
|
||||||
issueType: "startResistsant > endResistant ",
|
issueType: "startResistsant > endResistant ",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (family.Integration !== null) {
|
|
||||||
consistencyIssues.push({
|
|
||||||
familyId: family.Titre,
|
|
||||||
issueType: family.Statut + " with startResistant",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (family.Sortie !== null) {
|
|
||||||
consistencyIssues.push({
|
|
||||||
familyId: family.Titre,
|
|
||||||
issueType: family.Statut + " with endResistant",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
consistencyIssues.push(
|
consistencyIssues.push(
|
||||||
...family.Evenements.filter((e) => !isValidEvenementFamille(e.Type)).map(
|
...family.Evenements.filter((e) => !isValidEvenementFamille(e.Type)).map(
|
||||||
|
|
|
@ -25,6 +25,8 @@ import { computeELStats } from "./statistiques/computeELStats";
|
||||||
if (consistencyIssues.length > 0) {
|
if (consistencyIssues.length > 0) {
|
||||||
console.log("Found consistency issues:");
|
console.log("Found consistency issues:");
|
||||||
console.log(consistencyIssues);
|
console.log(consistencyIssues);
|
||||||
|
console.log("Exiting.");
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentDate = new Date(Date.now());
|
const currentDate = new Date(Date.now());
|
||||||
|
|
Loading…
Reference in New Issue