fix: nouvelle valeurs de StatutFamille
parent
539e1a9e38
commit
e906093d1d
|
@ -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) {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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) =>
|
||||||
|
|
Loading…
Reference in New Issue