fix: nouvelle valeurs de StatutFamille

wip-related-pages
Sébastien Arod 2024-11-27 10:09:09 +01:00
parent 539e1a9e38
commit e906093d1d
4 changed files with 10 additions and 10 deletions

View File

@ -27,7 +27,7 @@ export function periodOfResistance(
family: Famille, family: Famille,
atDate: Date = new Date(Date.now()) atDate: Date = new Date(Date.now())
): Period | null { ): Period | null {
if (family.Statut !== "Résistant.e" && family.Statut !== "Ex résistant·e·s") { if (family.Statut !== "Résistant·e" && family.Statut !== "Ex résistant·e") {
return null; return null;
} }
if (!family.Integration || family.Integration > atDate) { if (!family.Integration || family.Integration > atDate) {

View File

@ -8,8 +8,8 @@ export const statutsPreIntegration = ["en réflexion"] as const;
export const statutsIntegrationEnEchec = ["Abandon", "Incompatible"] as const; export const statutsIntegrationEnEchec = ["Abandon", "Incompatible"] as const;
export const statutsFamille = [ export const statutsFamille = [
...statutsPreIntegration, ...statutsPreIntegration,
"Résistant.e", "Résistant·e",
"Ex résistant·e·s", "Ex résistant·e",
...statutsIntegrationEnCours, ...statutsIntegrationEnCours,
...statutsIntegrationEnEchec, ...statutsIntegrationEnEchec,
] as const; ] as const;

View File

@ -22,30 +22,30 @@ function checkFamilyDataConsistency(family: Famille): ConsistencyReport {
const consistencyErrors: ConsistencyIssue[] = []; const consistencyErrors: ConsistencyIssue[] = [];
const consistencyWarnings: ConsistencyIssue[] = []; const consistencyWarnings: ConsistencyIssue[] = [];
if (family.Statut === "Résistant.e") { if (family.Statut === "Résistant·e") {
if (family.Integration === null) { if (family.Integration === null) {
consistencyErrors.push({ consistencyErrors.push({
familyId: family.Titre, familyId: family.Titre,
issueType: "Résistant.e sans date d'Intégration", issueType: "Résistant·e sans date d'Intégration",
}); });
} }
if (family.Sortie !== null) { if (family.Sortie !== null) {
consistencyErrors.push({ consistencyErrors.push({
familyId: family.Titre, familyId: family.Titre,
issueType: "Résistant.e avec Date de Sortie", issueType: "Résistant·e avec Date de Sortie",
}); });
} }
} else if (family.Statut === "Ex résistant·e·s") { } else if (family.Statut === "Ex résistant·e") {
if (family.Integration === null) { if (family.Integration === null) {
consistencyErrors.push({ consistencyErrors.push({
familyId: family.Titre, familyId: family.Titre,
issueType: "Ex résistant.e.s sans date Intégration", issueType: "Ex résistant·e sans date Intégration",
}); });
} }
if (family.Sortie === null) { if (family.Sortie === null) {
consistencyErrors.push({ consistencyErrors.push({
familyId: family.Titre, familyId: family.Titre,
issueType: "Ex résistant.e.s sans date Sortie", issueType: "Ex résistant·e sans date Sortie",
}); });
} }
if ( if (

View File

@ -32,7 +32,7 @@ export const computeFamillesWithEventsConditionInEarlyPeriod = (
Object.entries(durations).map(([name, months]) => { Object.entries(durations).map(([name, months]) => {
const famillesWithAtLeastDurationOfDc = familles const famillesWithAtLeastDurationOfDc = familles
.filter( .filter(
(f) => f.Statut === "Résistant.e" || f.Statut === "Ex résistant·e·s" (f) => f.Statut === "Résistant·e" || f.Statut === "Ex résistant·e"
) )
.filter( .filter(
(f) => (f) =>