Commit e395acc8 authored by Vytor Calixto's avatar Vytor Calixto 👾

Change age range dimension in out of school indicator

parent b1301d4c
Pipeline #14912 failed with stage
in 9 minutes and 48 seconds
module.exports = function ageRange(id) {
switch (id) {
case 1:
return '0-3';
case 2:
return '4-5';
case 3:
return '6-10';
case 4:
return '11-14';
case 5:
return '15-17';
case 6:
return '18-24';
case 7:
return '25-29';
case 8:
return '30-40';
case 9:
return '41-50';
case 10:
return '51-64';
case 11:
return '64+';
default:
return 'Não declarada';
}
};
......@@ -20,6 +20,7 @@ const stateName = require(`${libs}/convert/stateName`);
const contractType = require(`${libs}/convert/contractType`);
const ethnicGroupPnad = require(`${libs}/convert/ethnicGroupPnad`);
const ageRange = require(`${libs}/convert/ageRange`);
const fullAgeRange = require(`${libs}/convert/fullAgeRange`);
const genderPnad = require(`${libs}/convert/genderPnad`);
const fifthHouseholdIncome = require(`${libs}/convert/fifthHouseholdIncome`);
const extremesHouseholdIncome = require(`${libs}/convert/extremesHouseholdIncome`);
......@@ -57,6 +58,7 @@ const ids = {
contract_type_id: contractType,
ethnic_group_pnad_id: ethnicGroupPnad,
age_range_id: ageRange,
full_age_range_id: fullAgeRange,
gender_pnad_id: genderPnad,
fifth_household_income_id: fifthHouseholdIncome,
extremes_household_income_id: extremesHouseholdIncome
......@@ -122,6 +124,7 @@ module.exports = {
contractType,
ethnicGroupPnad,
ageRange,
fullAgeRange,
genderPnad,
fifthHouseholdIncome,
extremesHouseholdIncome
......
......@@ -39,13 +39,22 @@ outOfSchoolApp.get('/years', (req, res, next) => {
next();
}, query, response('years'));
outOfSchoolApp.get('/age', (req, res, next) => {
req.result = [];
for(let i = 0; i <= 120; ++i) {
req.result.push({id: i, name: i+''});
}
outOfSchoolApp.get('/full_age_range', (req, res, next) => {
req.result = [
{id: 1, name: '0-3'},
{id: 2, name: '4-5'},
{id: 3, name: '6-10'},
{id: 4, name: '11-14'},
{id: 5, name: '15-17'},
{id: 6, name: '18-24'},
{id: 7, name: '25-29'},
{id: 8, name: '30-40'},
{id: 9, name: '41-50'},
{id: 10, name: '51-64'},
{id: 11, name: '64+'}
];
next();
}, response('age'));
}, response('full_age_range'));
outOfSchoolApp.get('/ethnic_group_pnad', (req, res, next) => {
req.result = [
......@@ -165,14 +174,14 @@ rqf.addField({
field: 'ano_censo'
}
}).addValue({
name: 'age',
name: 'full_age_range',
table: 'pnad',
tableField: 'idade_31_03',
resultField: 'age_name',
resultField: 'full_age_range_id',
where: {
relation: '=',
type: 'integer',
field: 'idade_31_03'
field: 'faixa_etaria_31_03'
}
}).addValue({
name: 'gender',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment