Skip to content
Snippets Groups Projects
Commit 9e8a187c authored by Pietro Cavassin's avatar Pietro Cavassin
Browse files

add subroutes

parent ac780e08
No related branches found
No related tags found
3 merge requests!309Merge new updates into master,!279Homologa,!278Enrollment situation tmp
/*
Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function enrollmentSituation(id) {
switch (id) {
case 1:
return 'Ingressante';
case 2:
return 'Cursando';
case 3:
return 'Concluintes';
default:
return 'Não definido';
}
};
/*
Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function enterSituation(id) {
switch (id) {
case 1:
return 'Cursando';
case 2:
return 'Concluinte';
case 3:
return 'Evadido';
case 4:
return 'Trancado';
default:
return 'Não definido';
}
};
......@@ -90,6 +90,8 @@ const initialTraining = require(`${libs}/convert/initialTraining`);
const posTraining = require(`${libs}/convert/posTraining`);
const licentiateDegree = require(`${libs}/convert/licentiateDegree`);
const enrolledVacanciesFreshmen = require(`${libs}/convert/enrolledVacanciesFreshmen`);
const enterSituation = require(`${libs}/convert/enterSituation`);
const enrollmentSituation = require(`${libs}/convert/enrollmentSituation`);
const ids = {
gender_id: gender,
......@@ -171,7 +173,9 @@ const ids = {
initial_training_id: initialTraining,
pos_training_id: posTraining,
licentiate_degree_id: licentiateDegree,
enrolled_vacancies_freshmen: enrolledVacanciesFreshmen
enrolled_vacancies_freshmen: enrolledVacanciesFreshmen,
enter_situation: enterSituation,
enrollment_situation: enrollmentSituation
};
function transform(removeId=false) {
......@@ -280,5 +284,7 @@ module.exports = {
initialTraining,
posTraining,
licentiateDegree,
enrolledVacanciesFreshmen
enrolledVacanciesFreshmen,
enterSituation,
enrollmentSituation
};
......@@ -286,6 +286,30 @@ universityEnrollmentApp.get('/age_student_code', function (req, res, next) {
next();
}, response('age_student_code'));
universityEnrollmentApp.get('/student_enter_situation', function (req, res, next) {
req.result = [];
for (var i = 1; i <= 4; ++i) {
req.result.push({
id: i,
name: id2str.enterSituation(i)
});
};
next();
}, response('student_enter_situation'));
universityEnrollmentApp.get('/student_enrollment_situation', function (req, res, next) {
req.result = [];
for (var i = 1; i <= 3; ++i) {
req.result.push({
id: i,
name: id2str.enrollmentSituation(i)
});
};
next();
}, response('student_enrollment_situation'));
universityEnrollmentApp.get('/university', (req, res, next) => {
req.sql.from('aluno_ens_superior')
.field('DISTINCT aluno_ens_superior.nome_ies', 'nome')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment