Skip to content
Snippets Groups Projects

fixed instruction level filters

Merged tgcl21 requested to merge tgcl21-fixing-instructionlevel into development
1 file
+ 68
10
Compare changes
  • Side-by-side
  • Inline
@@ -61,6 +61,64 @@ NivelInstrucao.get('/instruction_level', (req, res, next) => {
@@ -61,6 +61,64 @@ NivelInstrucao.get('/instruction_level', (req, res, next) => {
next();
next();
}, response('instruction_level'));
}, 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({
rqf.addField({
name: 'filter',
name: 'filter',
field: false,
field: false,
@@ -78,16 +136,6 @@ rqf.addField({
@@ -78,16 +136,6 @@ rqf.addField({
type: 'integer',
type: 'integer',
field: 'id'
field: 'id'
}
}
}).addValue({
name: 'location',
table: 'pnad_novo',
tableField: 'tipo_de_area',
resultField: 'location_id',
where: {
relation: '=',
type: 'integer',
field: 'id'
}
}).addValue({
}).addValue({
name: 'bolsa_familia',
name: 'bolsa_familia',
table: 'pnad_novo',
table: 'pnad_novo',
@@ -223,6 +271,16 @@ rqf.addField({
@@ -223,6 +271,16 @@ rqf.addField({
type: 'integer',
type: 'integer',
field: 'recebeu_rendimentos_de_programa_bolsa_familia'
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) => {
NivelInstrucao.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
Loading