Skip to content
Snippets Groups Projects
Commit da4a8a31 authored by tgcl21's avatar tgcl21
Browse files

fixed instruction level filters

parent 00b7dbc2
No related branches found
No related tags found
3 merge requests!449Homologa,!444dev -> hom,!442fixed instruction level filters
......@@ -61,6 +61,64 @@ NivelInstrucao.get('/instruction_level', (req, res, next) => {
next();
}, response('instruction_level'));
NivelInstrucao.get('/age_range_all', (req, res, next) => {
req.result = []
for (let i = 1; i < 9; i++) {
req.result.push({
id: i, name: id2str.ageRangeAll(i)
});
}
req.result.push({id: 99, name: id2str.ageRangeAll(99)});
next();
}, response('age_range_all'));
NivelInstrucao.get('/gender', (req, res, next) => {
req.result = []
for (let i = 1; i < 3; i++) {
req.result.push({
id: i, name: id2str.gender(i)
});
}
next();
}, response('gender'));
NivelInstrucao.get('/bolsa_familia', (req, res, next) => {
req.result = []
for (let i = 1; i < 3; i++) {
req.result.push({
id: i, name: id2str.attendsSchool(i)
});
}
req.result.push({id: 9, name: id2str.attendsSchool(9)});
next();
}, response('bolsa_familia'));
NivelInstrucao.get('/location', (req, res, next) => {
req.result = []
for (let i = 1; i <= 2; i++) {
req.result.push({
id: i, name: id2str.location(i)
});
}
next();
}, response('location'));
NivelInstrucao.get('/ethnic_group', (req, res, next) => {
req.result = [];
for(let i = 0; i <=5; ++i) {
req.result.push({
id: i,
name: id2str.ethnicGroup(i)
});
}
next();
}, response('ethnic_group'));
rqf.addField({
name: 'filter',
field: false,
......@@ -78,16 +136,6 @@ rqf.addField({
type: 'integer',
field: 'id'
}
}).addValue({
name: 'location',
table: 'pnad_novo',
tableField: 'tipo_de_area',
resultField: 'location_id',
where: {
relation: '=',
type: 'integer',
field: 'id'
}
}).addValue({
name: 'bolsa_familia',
table: 'pnad_novo',
......@@ -223,6 +271,16 @@ rqf.addField({
type: 'integer',
field: 'recebeu_rendimentos_de_programa_bolsa_familia'
}
}).addValue({
name: 'location',
table: 'pnad_novo',
tableField: 'situacao_domicilio',
resultField: 'location_id',
where: {
relation: '=',
type: 'integer',
field: 'situacao_domicilio'
}
})
NivelInstrucao.get('/', rqf.parse(), rqf.build(), (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