23 lines
739 B
JavaScript
23 lines
739 B
JavaScript
|
|
export function createFormation(raw) {
|
||
|
|
let taux = 0
|
||
|
|
|
||
|
|
if (raw.voe_tot && raw.voe_tot > 0) {
|
||
|
|
taux = Math.round((raw.acc_tot / raw.voe_tot) * 100)
|
||
|
|
}
|
||
|
|
|
||
|
|
return {
|
||
|
|
id: raw.cod_uai + "-" + raw.lib_for_voe_ins,
|
||
|
|
nom: raw.lib_for_voe_ins,
|
||
|
|
etablissement: raw.g_ea_lib_vx,
|
||
|
|
ville: raw.ville_etab,
|
||
|
|
departement: raw.dep,
|
||
|
|
filiere: raw.fili,
|
||
|
|
selectivite: raw.select_form,
|
||
|
|
capacite: raw.capa_fin,
|
||
|
|
candidats: raw.voe_tot,
|
||
|
|
admis: raw.acc_tot,
|
||
|
|
tauxAcces: taux,
|
||
|
|
latitude: raw.g_olocalisation_des_formations ? raw.g_olocalisation_des_formations.lat : null,
|
||
|
|
longitude: raw.g_olocalisation_des_formations ? raw.g_olocalisation_des_formations.lon : null
|
||
|
|
}
|
||
|
|
}
|