Skip to content
Snippets Groups Projects
Commit e0ebfbe9 authored by jpp18's avatar jpp18
Browse files

Adds licentiate degree route

parent a6253bcd
No related branches found
No related tags found
1 merge request!309Merge new updates into master
Pipeline #23994 passed
/*
Copyright (C) 2016 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 licentiateDegree(id) {
switch (id) {
case 1:
return 'Sem ensino superior';
case 2:
return 'Superior com bacharelado ou tecnólogo';
case 3:
return 'Superior com licenciatura ou complementação pedagógica';
}
};
......@@ -88,6 +88,7 @@ const discipline = require(`${libs}/convert/discipline`);
const finishUniversity = require(`${libs}/convert/finishUniversity`);
const initialTraining = require(`${libs}/convert/initialTraining`);
const posTraining = require(`${libs}/convert/posTraining`);
const licentiateDegree = require(`${libs}/convert/licentiateDegree`);
const ids = {
gender_id: gender,
......@@ -167,7 +168,8 @@ const ids = {
discipline: discipline,
finish_id: finishUniversity,
initial_training_id: initialTraining,
pos_training_id: posTraining
pos_training_id: posTraining,
licentiate_degree_id: licentiateDegree
};
function transform(removeId=false) {
......
......@@ -204,6 +204,17 @@ teacherApp.get('/pos_training', (req, res, next) => {
next();
}, response('pos_training'));
teacherApp.get('/licentiate_degree', (req, res, next) => {
req.result = [];
for(let i = 1; i <= 3; ++i) {
req.result.push({
id: i,
name: id2str.licentiateDegree(i)
});
}
next();
}, response('licentiate_degree'));
rqf.addField({
name: 'filter',
field: false,
......@@ -474,6 +485,16 @@ rqf.addField({
type: 'integer',
field: 'formacao_pos_docente'
}
}).addValue({
name: 'licentiate_degree',
table: 'docente',
tableField: 'formacao_licenciatura_docente',
resultField: 'licentiate_degree_id',
where: {
relation: '=',
type: 'integer',
field: 'formacao_licenciatura_docente'
}
});
teacherApp.get('/', rqf.parse(), (req, res, next) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment