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

[FIX] Some fixes based on 'LDE fix' file

parent 98e69025
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!390dev -> homologa,!389new_pnad -> dev
...@@ -20,6 +20,8 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>. ...@@ -20,6 +20,8 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
module.exports = function capitalCode(id) { module.exports = function capitalCode(id) {
switch (id) { switch (id) {
case null:
return 'Não é capital';
case 11: case 11:
return 'Porto Velho'; return 'Porto Velho';
case 12: case 12:
...@@ -75,7 +77,7 @@ module.exports = function capitalCode(id) { ...@@ -75,7 +77,7 @@ module.exports = function capitalCode(id) {
case 53: case 53:
return 'Brasília'; return 'Brasília';
default: default:
return 'Não é capital'; return 'Não informado';
} }
}; };
...@@ -31,6 +31,6 @@ module.exports = function ethnicGroupNewPnad(id) { ...@@ -31,6 +31,6 @@ module.exports = function ethnicGroupNewPnad(id) {
case 5: case 5:
return 'Indígena'; return 'Indígena';
case 9: case 9:
return 'Sem declaração'; return 'Não declarado';
} }
}; };
...@@ -20,6 +20,8 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>. ...@@ -20,6 +20,8 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
module.exports = function metroCode(id) { module.exports = function metroCode(id) {
switch (id) { switch (id) {
case null:
return 'Não é região metropolitana ou região administrativa integrada';
case 13: case 13:
return 'Região Metropolitana de Manaus'; return 'Região Metropolitana de Manaus';
case 15: case 15:
...@@ -63,6 +65,6 @@ module.exports = function metroCode(id) { ...@@ -63,6 +65,6 @@ module.exports = function metroCode(id) {
case 52: case 52:
return 'Região Metropolitana de Goiânia'; return 'Região Metropolitana de Goiânia';
default: default:
return 'Não é região metropolitana ou região administrativa integrada'; return 'Não informado';
} }
}; };
...@@ -77,12 +77,12 @@ PnadNovoApp.get('/years_of_study', (req, res, next) => { ...@@ -77,12 +77,12 @@ PnadNovoApp.get('/years_of_study', (req, res, next) => {
PnadNovoApp.get('/instruction_level', (req, res, next) => { PnadNovoApp.get('/instruction_level', (req, res, next) => {
req.result = [] req.result = []
for (let i = 1; i < 9; i++) { for (let i = 1; i < 8; i++) {
req.result.push({ req.result.push({
id: i, name: id2str.instructionLevel(i) id: i, name: id2str.instructionLevel(i)
}); });
} }
req.result.push({id: 99, name: id2str.instructionLevel(99)});
next(); next();
}, response('instruction_level')); }, response('instruction_level'));
...@@ -111,10 +111,13 @@ PnadNovoApp.get('/region', (req, res, next) => { ...@@ -111,10 +111,13 @@ PnadNovoApp.get('/region', (req, res, next) => {
PnadNovoApp.get('/cap_code', (req, res, next) => { PnadNovoApp.get('/cap_code', (req, res, next) => {
req.result = [] req.result = []
for (let i = 11; i < 54; i++) { for (let i = 11; i < 54; i++) {
if (id2str.capitalCode(i) !== 'Não informado') {
req.result.push({ req.result.push({
id: i, name: id2str.capitalCode(i) id: i, name: id2str.capitalCode(i)
}); });
}
} }
req.result.push({id: null, name: id2str.capitalCode(null)});
next(); next();
}, response('cap_code')); }, response('cap_code'));
...@@ -122,17 +125,20 @@ PnadNovoApp.get('/cap_code', (req, res, next) => { ...@@ -122,17 +125,20 @@ PnadNovoApp.get('/cap_code', (req, res, next) => {
PnadNovoApp.get('/metro_code', (req, res, next) => { PnadNovoApp.get('/metro_code', (req, res, next) => {
req.result = [] req.result = []
for (let i = 13; i < 53; i++) { for (let i = 13; i < 53; i++) {
if (id2str.metroCode(i) !== 'Não informado') {
req.result.push({ req.result.push({
id: i, name: id2str.metroCode(i) id: i, name: id2str.metroCode(i)
}); });
}
} }
req.result.push({id: null, name: id2str.metroCode(null)});
next(); next();
}, response('metro_code')); }, response('metro_code'));
PnadNovoApp.get('/attended_modality', (req, res, next) => { PnadNovoApp.get('/attended_modality', (req, res, next) => {
req.result = [] req.result = []
for (let i = 1; i < 15; i++) { for (let i = 1; i < 16; i++) {
req.result.push({ req.result.push({
id: i, name: id2str.attendedModality(i) id: i, name: id2str.attendedModality(i)
}); });
...@@ -143,12 +149,12 @@ PnadNovoApp.get('/attended_modality', (req, res, next) => { ...@@ -143,12 +149,12 @@ PnadNovoApp.get('/attended_modality', (req, res, next) => {
PnadNovoApp.get('/income_range', (req, res, next) => { PnadNovoApp.get('/income_range', (req, res, next) => {
req.result = [] req.result = []
for (let i = 1; i < 15; i++) { for (let i = 1; i < 8; i++) {
req.result.push({ req.result.push({
id: i, name: id2str.attendedModality(i) id: i, name: id2str.incomeRange(i)
}); });
} }
req.result.push({id: 99, name: id2str.attendedModality(99)}); req.result.push({id: 9, name: id2str.incomeRange(9)});
next(); next();
}, response('income_range')); }, response('income_range'));
...@@ -159,7 +165,6 @@ PnadNovoApp.get('/attends_school', (req, res, next) => { ...@@ -159,7 +165,6 @@ PnadNovoApp.get('/attends_school', (req, res, next) => {
id: i, name: id2str.attendsSchool(i) id: i, name: id2str.attendsSchool(i)
}); });
} }
req.result.push({id: 9, name: id2str.attendsSchool(9)});
next(); next();
}, response('attends_school')); }, response('attends_school'));
......
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