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

started frontend

parent a209ef26
No related branches found
No related tags found
No related merge requests found
......@@ -171,6 +171,8 @@ const adjustedLiquidFrequency = require(`${libs}/routes_v1/adjustedLiquidFrequen
const iliteracyRate = require(`${libs}/routes_v1/iliteracyRate`);
const enrollmentRate = require(`${libs}/routes_v1/enrollmentRate`);
api.get('/', (req, res) => {
res.json({ msg: 'SimCAQ API v1 is running' });
});
......@@ -244,6 +246,7 @@ api.use('/superior_education_conclusion_tax', superiorEducationConclusionTax)
api.use('/basic_education_conclusion', basicEducationConclusion);
api.use('/adjusted_liquid_frequency', adjustedLiquidFrequency);
api.use('/iliteracy_rate', iliteracyRate);
api.use('/enrollment_rate', enrollmentRate);
//Publication
api.use('/publication', publication);
......
......@@ -56,6 +56,61 @@ EnrollmentRateApp.get('/ageRanges', (req, res, next) => {
next();
}, 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({
name: 'filter',
......@@ -173,9 +228,9 @@ function matchQueries(queryPartial, queryTotal) {
match.push({
year: result.year,
age_range: result.age_range,
total: result.total,
total_partial: partial.total_inf_cre,
total_taxa: ((partial.total_inf_cre/result.total) * 100).toFixed(2),
// total: result.total,
// total_partial: partial.total_inf_cre,
total: ((partial.total_inf_cre/result.total) * 100).toFixed(2),
});
found = true;
break;
......@@ -183,9 +238,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({
year: result.year,
age_range: result.age_range,
total: result.total,
total_partial: partial.total_inf_pre,
total_taxa: ((partial.total_inf_pre/result.total) * 100).toFixed(2),
total: ((partial.total_inf_pre/result.total) * 100).toFixed(2),
});
found = true;
break;
......@@ -193,9 +246,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({
year: result.year,
age_range: result.age_range,
total: result.total,
total_partial: partial.total_fund_ai,
total_taxa: ((partial.total_fund_ai/result.total) * 100).toFixed(2),
total: ((partial.total_fund_ai/result.total) * 100).toFixed(2),
});
found = true;
break;
......@@ -203,9 +254,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({
year: result.year,
age_range: result.age_range,
total: result.total,
total_partial: partial.total_fund_af,
total_taxa: ((partial.total_fund_af/result.total) * 100).toFixed(2),
total: ((partial.total_fund_af/result.total) * 100).toFixed(2),
});
found = true;
break;
......@@ -213,9 +262,7 @@ function matchQueries(queryPartial, queryTotal) {
match.push({
year: result.year,
age_range: result.age_range,
total: result.total,
total_partial: partial.total_med,
total_taxa: ((partial.total_med/result.total) * 100).toFixed(2),
total: ((partial.total_med/result.total) * 100).toFixed(2),
});
found = true;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment