Skip to content
Snippets Groups Projects
Commit 84e7b42d authored by Fernando Gbur dos Santos's avatar Fernando Gbur dos Santos
Browse files

[ADD] Trying to work with filters with id2str (filter newPnadAdmDependency added)

parent a99ea6f2
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!386Merge development -> homologa,!385Merge new_pnad -> development
/*
Copyright (C) 2024 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 newPnadAdmDependency(id) {
switch (id) {
case 1:
return 'Pública';
case 2:
return 'Privada';
case 3:
return 'Não frequenta instituição de ensino';
}
};
...@@ -101,6 +101,7 @@ const supplyDimension = require(`${libs}/convert/supplyDimension`); ...@@ -101,6 +101,7 @@ const supplyDimension = require(`${libs}/convert/supplyDimension`);
const type = require(`${libs}/convert/type`); const type = require(`${libs}/convert/type`);
const level = require(`${libs}/convert/level`); const level = require(`${libs}/convert/level`);
const scholarDependency = require(`${libs}/convert/scholarDependency`); const scholarDependency = require(`${libs}/convert/scholarDependency`);
const newPnadAdmDependency = require(`${libs}/convert/newPnadAdmDependency`);
const ids = { const ids = {
gender_id: gender, gender_id: gender,
...@@ -193,7 +194,8 @@ const ids = { ...@@ -193,7 +194,8 @@ const ids = {
supply_dimension_id: supplyDimension, supply_dimension_id: supplyDimension,
type_id: type, type_id: type,
level_id: level, level_id: level,
scholar_dependency_id: scholarDependency scholar_dependency_id: scholarDependency,
new_pnad_adm_dependency_id: newPnadAdmDependency
}; };
function transform(removeId=false) { function transform(removeId=false) {
...@@ -309,5 +311,6 @@ module.exports = { ...@@ -309,5 +311,6 @@ module.exports = {
peePorCategoria, peePorCategoria,
pee, pee,
shift, shift,
admDependencyPub admDependencyPub,
newPnadAdmDependency
}; };
/* /*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node. This file is part of simcaq-node.
...@@ -86,13 +86,14 @@ PnadNovoApp.get('/instruction_level', (req, res, next) => { ...@@ -86,13 +86,14 @@ PnadNovoApp.get('/instruction_level', (req, res, next) => {
}, response('instruction_level')); }, response('instruction_level'));
PnadNovoApp.get('/adm_dependency', (req, res, next) => { PnadNovoApp.get('/adm_dependency', (req, res, next) => {
req.result = [ req.result = []
{id: 1, name: 'Publica'}, for (let i = 1; i < 4; i++) {
{id: 2, name: 'Privada'}, req.result.push({
{id: 3, name: 'Não frequenta instituição de ensino'}, id: i, name: id2str.newPnadAdmDependency(i)
]; });
}
next(); next();
}, response('years_of_study')); }, response('adm_dependency'));
rqf.addField({ rqf.addField({
name: 'filter', name: 'filter',
...@@ -176,7 +177,7 @@ rqf.addField({ ...@@ -176,7 +177,7 @@ rqf.addField({
name: 'adm_dependency', name: 'adm_dependency',
table: 'pnad_novo', table: 'pnad_novo',
tableField: 'dependencia_adm', tableField: 'dependencia_adm',
resultField: 'adm_dependency_id', resultField: 'new_pnad_adm_dependency_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment