diff --git a/src/libs/convert/teacherAdequacy.js b/src/libs/convert/teacherAdequacy.js new file mode 100644 index 0000000000000000000000000000000000000000..7cd21cbb2299508fa38ce32b05f7f63cfe90dda2 --- /dev/null +++ b/src/libs/convert/teacherAdequacy.js @@ -0,0 +1,28 @@ +/* +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 teacherAdequacy(id) { + switch (id) { + case 0: + return 'Formação não adequada'; + case 1: + return 'Formação adequada'; + } +}; diff --git a/src/libs/middlewares/id2str.js b/src/libs/middlewares/id2str.js index b86232cac7a547430b6cddd4c588e304194ce5a4..af4995e9745093e2c98c3e383cdf6207f1d7b208 100644 --- a/src/libs/middlewares/id2str.js +++ b/src/libs/middlewares/id2str.js @@ -89,6 +89,7 @@ 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 teacherAdequacy = require(`${libs}/convert/teacherAdequacy`); const ids = { gender_id: gender, @@ -169,7 +170,8 @@ const ids = { finish_id: finishUniversity, initial_training_id: initialTraining, pos_training_id: posTraining, - licentiate_degree_id: licentiateDegree + licentiate_degree_id: licentiateDegree, + teacher_adequacy_id: teacherAdequacy }; function transform(removeId=false) { @@ -277,5 +279,6 @@ module.exports = { finishUniversity, initialTraining, posTraining, - licentiateDegree + licentiateDegree, + teacherAdequacy }; diff --git a/src/libs/routes/disciplines.js b/src/libs/routes/disciplines.js index 09584a429b277350d61d964e4c21be9c658299d3..43b7dd6ea54f95e4703395b7d41d524168d73018 100644 --- a/src/libs/routes/disciplines.js +++ b/src/libs/routes/disciplines.js @@ -193,6 +193,17 @@ disciplinesApp.get('/discipline', (req, res, next) => { next(); }, response('discipline')) +disciplinesApp.get('/discipline', (req, res, next) => { + req.result = []; + for (let i = 0; i <= 1; i++) { + req.result.push({ + id: i, + name: id2str.teacherAdequacy(i) + }) + } + next(); +}, response('discipline')) + rqf.addField({ name: 'filter', field: false,