creditos especificos#

This commit is contained in:
Lemuel Marquez
2021-08-04 10:20:12 -05:00
parent 50d0758f65
commit b4373c770f
3 changed files with 1377 additions and 839 deletions
+33 -1
View File
@@ -3,12 +3,38 @@ const validar = require('../../helper/validar');
const axios = require('axios');
const Usuario = require('../../db/tablas/Usuario');
const Carrera = require('../../db/tablas/Carrera');
const creditosCarreras = [
{ carrera: 'LIC. EN ACTUARIA', creditos: 70 },
{ carrera: 'LIC. EN ARQUITECTURA', creditos: 70 },
{ carrera: 'LIC. EN CIENCIAS POLITICAS Y ADMON PUB', creditos: 70 },
{ carrera: 'LIC. EN CIENCIAS POLITICAS Y ADMON.PUBL.', creditos: 70 },
{ carrera: 'LIC. EN COMUNICACION', creditos: 67.28 },
{ carrera: 'LIC. EN DERECHO', creditos: 70 },
{ carrera: 'LIC. EN DERECHO (SUA)', creditos: 70 },
{ carrera: 'LIC. EN DISEÑO GRAFICO', creditos: 70 },
{ carrera: 'LIC. EN ECONOMIA', creditos: 70 },
{ carrera: 'LIC. EN ENSEÑANZA DE INGLES', creditos: 70 },
{ carrera: 'LIC. EN FILOSOFIA', creditos: 70 },
{ carrera: 'LIC. EN HISTORIA', creditos: 70 },
{ carrera: 'LIC. EN INGENIERIA CIVIL', creditos: 70 },
{ carrera: 'LIC. EN LENGUA Y LITERATURA HISPANICAS', creditos: 70 },
{ carrera: 'LIC. EN MAT. APLICADAS Y COMPUTACION', creditos: 68.89 },
{ carrera: 'LIC. EN MATEMATICAS APLICADAS Y COMP.', creditos: 68.89 },
{ carrera: 'LIC. EN PEDAGOGÍA', creditos: 70 },
{ carrera: 'LIC. EN PERIODISMO Y COMUNICACION COL.', creditos: 70 },
{ carrera: 'LIC. EN RELACIONES INTERNACIONALES', creditos: 70 },
{ carrera: 'LIC. EN RELACIONES INTERNACIONALES (SUA)', creditos: 70 },
{ carrera: 'LIC. EN SOCIOLOGIA', creditos: 70 },
{ carrera: 'LIC. ENSEÑANZA DE ALEMÁN (LENG. EXTRANJS', creditos: 70 },
{ carrera: 'LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ)', creditos: 70 },
{ carrera: 'LIC. ENSEÑANZA DE INGLÉS(LENG. EXTRANJE)', creditos: 70 },
{ carrera: 'LIC. ENSEÑANZA DE ITALIANO(LENG. EXTRANJ', creditos: 70 },
];
const escolares = async (body) => {
const numeroCuenta = validar.validarNumeroCuenta(body.numeroCuenta);
let alumno;
//return sybase(numeroCuenta)
return axios({
method: 'post',
url: `${process.env.ESCOLARES}${numeroCuenta}`,
@@ -24,6 +50,12 @@ const escolares = async (body) => {
creditos: res.data.avance,
carrera: res.data.carrconst.trim(),
};
for (let i = 0; i < creditosCarreras.length; i++)
if (
alumno.carrera === creditosCarreras[i].carrera &&
Number(alumno.creditos) < creditosCarreras[i].creditos
)
throw new Error('Este alumno no cuenta con los créditos necesarios.');
while (
alumno.nombre.search('‘') != -1 &&
alumno.nombre.search('Ã') != -1