2023-01-18 00:11:10 +01:00
|
|
|
|
2023-01-17 21:51:49 +01:00
|
|
|
const RARETE_COMMUNE = { code: 'Commune', label: 'Commune', frequence: 54, min: 27, max: 108 };
|
|
|
|
const RARETE_FREQUENTE = { code: 'Frequente', label: 'Fréquente', frequence: 18, min: 9, max: 36 };
|
|
|
|
const RARETE_RARE = { code: 'Rare', label: 'Rare', frequence: 6, min: 3, max: 12 };
|
|
|
|
const RARETE_RARISSIME = { code: 'Rarissime', label: 'Rarissime', frequence: 2, min: 1, max: 4 };
|
|
|
|
const RARETE_INEXISTANT = { code: 'Inexistant', label: 'Inexistant', frequence: 0, min: 0, max: 0 };
|
2023-01-20 03:25:40 +01:00
|
|
|
const RARETE_EGALE = { code: 'eqal', label: 'Egal', frequence: 1, min: 1, max: 1 };
|
2023-01-13 04:54:29 +01:00
|
|
|
|
|
|
|
const RARETES = [
|
2023-01-17 21:51:49 +01:00
|
|
|
RARETE_COMMUNE,
|
|
|
|
RARETE_FREQUENTE,
|
|
|
|
RARETE_RARE,
|
|
|
|
RARETE_RARISSIME,
|
|
|
|
RARETE_INEXISTANT,
|
|
|
|
]
|
2023-01-13 04:54:29 +01:00
|
|
|
|
|
|
|
export class RdDRaretes {
|
|
|
|
|
2023-01-20 03:25:40 +01:00
|
|
|
static rareteFrequente() { return RARETE_FREQUENTE; }
|
|
|
|
static rareteEgale() { return RARETE_EGALE; }
|
|
|
|
static raretes() { return RARETES; }
|
|
|
|
|
|
|
|
static byCode(code = undefined) {
|
2023-01-17 21:51:49 +01:00
|
|
|
return RARETES.find(it => it.code == code) ?? RARETE_FREQUENTE;
|
2023-01-13 04:54:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static getChamp(rarete, field = undefined) {
|
2023-01-20 03:25:40 +01:00
|
|
|
return RdDRaretes.byCode(rarete)[field ?? 'frequence'];
|
2023-01-17 21:51:49 +01:00
|
|
|
}
|
2023-01-18 00:11:10 +01:00
|
|
|
|
2023-01-13 04:54:29 +01:00
|
|
|
}
|