This commit is contained in:
2026-03-21 13:47:09 +01:00
parent bd20abb745
commit da383237f6
8 changed files with 650 additions and 520 deletions
+71 -69
View File
@@ -1,95 +1,97 @@
export function createFormation(raw) {
// Créer un objet formation à partir des données brutes de l'API
export function creerFormation(brut) {
var taux = 0
var latitude = null
var longitude = null
if (raw.voe_tot && raw.voe_tot > 0) {
taux = Math.round((raw.acc_tot / raw.voe_tot) * 100)
if (brut.voe_tot && brut.voe_tot > 0) {
taux = Math.round((brut.acc_tot / brut.voe_tot) * 100)
}
if (raw.g_olocalisation_des_formations) {
latitude = raw.g_olocalisation_des_formations.lat
longitude = raw.g_olocalisation_des_formations.lon
if (brut.g_olocalisation_des_formations) {
latitude = brut.g_olocalisation_des_formations.lat
longitude = brut.g_olocalisation_des_formations.lon
}
return {
id: raw.cod_uai + "-" + raw.lib_for_voe_ins,
id: brut.cod_uai + "-" + brut.lib_for_voe_ins,
nom: raw.lib_for_voe_ins,
etablissement: raw.g_ea_lib_vx,
ville: raw.ville_etab,
departement: raw.dep,
departementLib: raw.dep_lib,
region: raw.region_etab_aff,
academie: raw.acad_mies,
contrat: raw.contrat_etab,
nom: brut.lib_for_voe_ins,
etablissement: brut.g_ea_lib_vx,
ville: brut.ville_etab,
departement: brut.dep,
departementLib: brut.dep_lib,
region: brut.region_etab_aff,
academie: brut.acad_mies,
contrat: brut.contrat_etab,
filiere: raw.fili,
selectivite: raw.select_form,
filiere: brut.fili,
selectivite: brut.select_form,
capacite: raw.capa_fin,
candidats: raw.voe_tot,
admis: raw.acc_tot,
tauxAcces: taux,
capacite: brut.capa_fin,
candidats: brut.voe_tot,
admis: brut.acc_tot,
tauxAcces: taux,
latitude: latitude,
longitude: longitude,
latitude: latitude,
longitude: longitude,
pctFemmes: raw.pct_f,
pctBoursiers: raw.pct_bours,
pctNeoBac: raw.pct_neobac,
pctFemmes: brut.pct_f,
pctBoursiers: brut.pct_bours,
pctNeoBac: brut.pct_neobac,
pctGeneral: raw.pct_bg,
pctTechno: raw.pct_bt,
pctPro: raw.pct_bp,
pctGeneral: brut.pct_bg,
pctTechno: brut.pct_bt,
pctPro: brut.pct_bp,
pctSansMention: raw.pct_sansmention,
pctAB: raw.pct_ab,
pctB: raw.pct_b,
pctTB: raw.pct_tb,
pctTBF: raw.pct_tbf,
pctSansMention: brut.pct_sansmention,
pctAB: brut.pct_ab,
pctB: brut.pct_b,
pctTB: brut.pct_tb,
pctTBF: brut.pct_tbf,
pctDebutPhase: raw.pct_acc_debutpp,
pctDateBac: raw.pct_acc_datebac,
pctFinPhase: raw.pct_acc_finpp,
pctDebutPhase: brut.pct_acc_debutpp,
pctDateBac: brut.pct_acc_datebac,
pctFinPhase: brut.pct_acc_finpp,
admisDebutPhase: raw.acc_debutpp,
admisDateBac: raw.acc_datebac,
admisFinPhase: raw.acc_finpp,
admisDebutPhase: brut.acc_debutpp,
admisDateBac: brut.acc_datebac,
admisFinPhase: brut.acc_finpp,
// phase principale
voePPGeneral: raw.nb_voe_pp_bg,
voePPTechno: raw.nb_voe_pp_bt,
voePPPro: raw.nb_voe_pp_bp,
voePPAutres: raw.nb_voe_pp_at,
voePPTotal: raw.nb_voe_pp,
// Phase principale
voePPGeneral: brut.nb_voe_pp_bg,
voePPTechno: brut.nb_voe_pp_bt,
voePPPro: brut.nb_voe_pp_bp,
voePPAutres: brut.nb_voe_pp_at,
voePPTotal: brut.nb_voe_pp,
classesPPGeneral: raw.nb_cla_pp_bg,
classesPPTechno: raw.nb_cla_pp_bt,
classesPPPro: raw.nb_cla_pp_bp,
classesPPAutres: raw.nb_cla_pp_at,
classesPPTotal: raw.nb_cla_pp,
classesPPGeneral: brut.nb_cla_pp_bg,
classesPPTechno: brut.nb_cla_pp_bt,
classesPPPro: brut.nb_cla_pp_bp,
classesPPAutres: brut.nb_cla_pp_at,
classesPPTotal: brut.nb_cla_pp,
propositionsPPGeneral: raw.prop_tot_bg,
propositionsPPTechno: raw.prop_tot_bt,
propositionsPPPro: raw.prop_tot_bp,
propositionsPPAutres: raw.prop_tot_at,
propositionsPPTotal: raw.prop_tot,
propositionsPPGeneral: brut.prop_tot_bg,
propositionsPPTechno: brut.prop_tot_bt,
propositionsPPPro: brut.prop_tot_bp,
propositionsPPAutres: brut.prop_tot_at,
propositionsPPTotal: brut.prop_tot,
acceptesPPGeneral: raw.acc_bg,
acceptesPPTechno: raw.acc_bt,
acceptesPPPro: raw.acc_bp,
acceptesPPAutres: raw.acc_at,
acceptesPPTotal: raw.acc_pp,
acceptesPPGeneral: brut.acc_bg,
acceptesPPTechno: brut.acc_bt,
acceptesPPPro: brut.acc_bp,
acceptesPPAutres: brut.acc_at,
acceptesPPTotal: brut.acc_pp,
// phase complémentaire
voePCGeneral: raw.nb_voe_pc_bg,
voePCTechno: raw.nb_voe_pc_bt,
voePCPro: raw.nb_voe_pc_bp,
voePCAutres: raw.nb_voe_pc_at,
voePCTotal: raw.nb_voe_pc,
// Phase complémentaire
voePCGeneral: brut.nb_voe_pc_bg,
voePCTechno: brut.nb_voe_pc_bt,
voePCPro: brut.nb_voe_pc_bp,
voePCAutres: brut.nb_voe_pc_at,
voePCTotal: brut.nb_voe_pc,
classesPCTotal: raw.nb_cla_pc,
acceptesPCTotal: raw.acc_pc
classesPCTotal: brut.nb_cla_pc,
acceptesPCTotal: brut.acc_pc
}
}