diff --git a/src/libs/convert/incomeRange.js b/src/libs/convert/incomeRange.js index fee5189b4a4100e42940108ce3f173e655ef13ee..a38446aa56ac3012edbe034bf1037772085004f8 100644 --- a/src/libs/convert/incomeRange.js +++ b/src/libs/convert/incomeRange.js @@ -36,5 +36,7 @@ module.exports = function incomeRange(id) { return 'Mais de 5 salários mÃnimos'; case 9: return 'Não informado ou ignorado'; + case 10: + return "Ignorado" } }; diff --git a/src/libs/routes_v1/basicEducationConclusion.js b/src/libs/routes_v1/basicEducationConclusion.js index c45cb6e552a505be1072f1ba262835017c0f5361..fb7452990b4a1be888247802cea0e9e424af606c 100644 --- a/src/libs/routes_v1/basicEducationConclusion.js +++ b/src/libs/routes_v1/basicEducationConclusion.js @@ -159,7 +159,7 @@ basicEducationConclusion.get('/income_range', (req, res, next) => { id: i, name: id2str.incomeRange(i) }); } - req.result.push({id: 9, name: id2str.incomeRange(9)}); + req.result.push({id: 10, name: id2str.incomeRange(10)}); next(); }, response('income_range')); @@ -426,12 +426,12 @@ rqf.addField({ }).addValue({ name: 'income_range', table: 'pnad_novo', - tableField: 'faixa_rendimento_aux', + tableField: 'faixa_rendimento_aux_tx', resultField: 'income_range_id', where: { relation: '=', type: 'integer', - field: 'faixa_rendimento_aux' + field: 'faixa_rendimento_aux_tx' } }).addValue({ name: 'gender', @@ -599,8 +599,14 @@ basicEducationConclusion.get('/', rqf.parse(), rqf.build(), (req, res, next) => .group("ano_ref") .order("ano_ref"); + if (req.query.dims && req.query.dims.includes("income_range")) { + totalPopMaior19.where("faixa_rendimento_aux_tx is not null"); + totalPopEdBasMaior19.where("faixa_rendimento_aux_tx is not null"); + } + req.querySet.push(totalPopEdBasMaior19); req.querySet.push(totalPopMaior19); + next(); }, multiQuery, (req, res, next) => { // The multiple requests are made. Then we need to calculate the percetange. So the function