Skip to content
Snippets Groups Projects
Commit 9c9b68cd authored by tgcl21's avatar tgcl21
Browse files

started frontend

parent a209ef26
Branches
No related tags found
No related merge requests found
...@@ -171,6 +171,8 @@ const adjustedLiquidFrequency = require(`${libs}/routes_v1/adjustedLiquidFrequen ...@@ -171,6 +171,8 @@ const adjustedLiquidFrequency = require(`${libs}/routes_v1/adjustedLiquidFrequen
const iliteracyRate = require(`${libs}/routes_v1/iliteracyRate`); const iliteracyRate = require(`${libs}/routes_v1/iliteracyRate`);
const enrollmentRate = require(`${libs}/routes_v1/enrollmentRate`);
api.get('/', (req, res) => { api.get('/', (req, res) => {
res.json({ msg: 'SimCAQ API v1 is running' }); res.json({ msg: 'SimCAQ API v1 is running' });
}); });
...@@ -244,6 +246,7 @@ api.use('/superior_education_conclusion_tax', superiorEducationConclusionTax) ...@@ -244,6 +246,7 @@ api.use('/superior_education_conclusion_tax', superiorEducationConclusionTax)
api.use('/basic_education_conclusion', basicEducationConclusion); api.use('/basic_education_conclusion', basicEducationConclusion);
api.use('/adjusted_liquid_frequency', adjustedLiquidFrequency); api.use('/adjusted_liquid_frequency', adjustedLiquidFrequency);
api.use('/iliteracy_rate', iliteracyRate); api.use('/iliteracy_rate', iliteracyRate);
api.use('/enrollment_rate', enrollmentRate);
//Publication //Publication
api.use('/publication', publication); api.use('/publication', publication);
......
...@@ -56,6 +56,61 @@ EnrollmentRateApp.get('/ageRanges', (req, res, next) => { ...@@ -56,6 +56,61 @@ EnrollmentRateApp.get('/ageRanges', (req, res, next) => {
next(); next();
}, query, response('ageRanges')); }, query, response('ageRanges'));
// • Área da Localidade
EnrollmentRateApp.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'));
// • Capital
EnrollmentRateApp.get('/cap_code', (req, res, next) => {
req.result = []
for (let i = 11; i < 54; i++) {
if (id2str.capitalCode(i) !== 'Não informado') {
req.result.push({
id: i, name: id2str.capitalCode(i)
});
}
}
req.result.push({id: 99, name: id2str.capitalCode(99)});
next();
}, response('cap_code'));
// • Região
EnrollmentRateApp.get('/region', (req, res, next) => {
req.result = []
for (let i = 1; i < 6; i++) {
req.result.push({
id: i, name: id2str.regionCode(i)
});
}
next();
}, response('region'));
// • UF
EnrollmentRateApp.get('/state', (req, res, next) => {
req.result = []
for (let i = 11; i < 54; i++) {
if (id2str.stateName(i) !== 'Não declarada') {
req.result.push({
id: i, name: id2str.stateName(i)
});
}
}
req.result.push({id: 99, name: id2str.stateName(99)});
next();
}, response('state'));
rqf.addField({ rqf.addField({
name: 'filter', name: 'filter',
...@@ -173,9 +228,9 @@ function matchQueries(queryPartial, queryTotal) { ...@@ -173,9 +228,9 @@ function matchQueries(queryPartial, queryTotal) {
match.push({ match.push({
year: result.year, year: result.year,
age_range: result.age_range, age_range: result.age_range,
total: result.total, // total: result.total,
total_partial: partial.total_inf_cre, // total_partial: partial.total_inf_cre,
total_taxa: ((partial.total_inf_cre/result.total) * 100).toFixed(2), total: ((partial.total_inf_cre/result.total) * 100).toFixed(2),
}); });
found = true; found = true;
break; break;
...@@ -183,9 +238,7 @@ function matchQueries(queryPartial, queryTotal) { ...@@ -183,9 +238,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({ match.push({
year: result.year, year: result.year,
age_range: result.age_range, age_range: result.age_range,
total: result.total, total: ((partial.total_inf_pre/result.total) * 100).toFixed(2),
total_partial: partial.total_inf_pre,
total_taxa: ((partial.total_inf_pre/result.total) * 100).toFixed(2),
}); });
found = true; found = true;
break; break;
...@@ -193,9 +246,7 @@ function matchQueries(queryPartial, queryTotal) { ...@@ -193,9 +246,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({ match.push({
year: result.year, year: result.year,
age_range: result.age_range, age_range: result.age_range,
total: result.total, total: ((partial.total_fund_ai/result.total) * 100).toFixed(2),
total_partial: partial.total_fund_ai,
total_taxa: ((partial.total_fund_ai/result.total) * 100).toFixed(2),
}); });
found = true; found = true;
break; break;
...@@ -203,9 +254,7 @@ function matchQueries(queryPartial, queryTotal) { ...@@ -203,9 +254,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({ match.push({
year: result.year, year: result.year,
age_range: result.age_range, age_range: result.age_range,
total: result.total, total: ((partial.total_fund_af/result.total) * 100).toFixed(2),
total_partial: partial.total_fund_af,
total_taxa: ((partial.total_fund_af/result.total) * 100).toFixed(2),
}); });
found = true; found = true;
break; break;
...@@ -213,9 +262,7 @@ function matchQueries(queryPartial, queryTotal) { ...@@ -213,9 +262,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({ match.push({
year: result.year, year: result.year,
age_range: result.age_range, age_range: result.age_range,
total: result.total, total: ((partial.total_med/result.total) * 100).toFixed(2),
total_partial: partial.total_med,
total_taxa: ((partial.total_med/result.total) * 100).toFixed(2),
}); });
found = true; found = true;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment