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

Add pos training routes

parent 05e8493e
No related branches found
No related tags found
2 merge requests!272v1.15.7,!271Add pos training routes
Pipeline #23856 failed
/*
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 posTraining(id) {
switch (id) {
case 1:
return 'Sem pós-graduação';
case 2:
return 'Especialização';
case 3:
return 'Mestrado';
case 4:
return 'Doutorado';
}
};
......@@ -87,6 +87,7 @@ const nightTime = require(`${libs}/convert/nightTime`);
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 ids = {
gender_id: gender,
......@@ -165,7 +166,8 @@ const ids = {
arrangement_id: arrangement,
discipline: discipline,
finish_id: finishUniversity,
initial_training_id: initialTraining
initial_training_id: initialTraining,
pos_training_id: posTraining
};
function transform(removeId=false) {
......@@ -271,5 +273,6 @@ module.exports = {
nightTime,
discipline,
finishUniversity,
initialTraining
initialTraining,
posTraining
};
......@@ -182,6 +182,18 @@ teacherApp.get('/ethnic_group', (req, res, next) => {
next();
}, response('ethnic_group'));
teacherApp.get('/pos_training', (req, res, next) => {
req.result = [];
for(let i = 1; i <= 4; ++i) {
req.result.push({
id: i,
name: id2str.posTraining(i)
});
}
next();
}, response('pos_training'));
rqf.addField({
name: 'filter',
field: false,
......@@ -442,6 +454,16 @@ rqf.addField({
type: 'integer',
field: 'formacao_inicial_docente'
}
}).addValue({
name: 'pos_training',
table: 'docente',
tableField: 'formacao_pos_docente',
resultField: 'pos_training_id',
where: {
relation: '=',
type: 'integer',
field: 'formacao_pos_docente'
}
});
teacherApp.get('/', rqf.parse(), (req, res, next) => {
......
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