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

[ADD] Adding '/state', '/modality_shift' and '/age_range' subroutes to newPnad

parent 99838469
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!390dev -> homologa,!389new_pnad -> dev
...@@ -217,6 +217,42 @@ PnadNovoApp.get('/modality', (req, res, next) => { ...@@ -217,6 +217,42 @@ PnadNovoApp.get('/modality', (req, res, next) => {
next(); next();
}, response('modality')); }, response('modality'));
PnadNovoApp.get('/modality_shift', (req, res, next) => {
req.result = []
for (let i = 1; i < 8; i++) {
req.result.push({
id: i, name: id2str.modalityShift(i)
});
}
req.result.push({id: 99, name: id2str.modality(99)});
req.result.push({id: null, name: id2str.modality(null)});
next();
}, response('modality_shift'));
PnadNovoApp.get('/state', (req, res, next) => {
req.result = []
for (let i = 11; i < 54; i++) {
req.result.push({
id: i, name: id2str.stateName(i)
});
}
req.result.push({id: 99, name: id2str.stateName(99)});
next();
}, response('state'));
PnadNovoApp.get('/age_range', (req, res, next) => {
req.result = []
for (let i = 1; i < 12; i++) {
req.result.push({
id: i, name: id2str.ageRangeAll(i)
});
}
next();
}, response('state'));
rqf.addField({ rqf.addField({
name: 'filter', name: 'filter',
field: false, field: false,
...@@ -378,12 +414,12 @@ rqf.addField({ ...@@ -378,12 +414,12 @@ rqf.addField({
}).addValue({ }).addValue({
name: 'income_range', name: 'income_range',
table: 'pnad_novo', table: 'pnad_novo',
tableField: 'faixa_rendimento', tableField: 'faixa_rendimento_aux',
resultField: 'income_range_id', resultField: 'income_range_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
field: 'faixa_rendimento' field: 'faixa_rendimento_aux'
} }
}).addValue({ }).addValue({
name: 'gender', name: 'gender',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment