Skip to content
Snippets Groups Projects
Commit c2ccc44a authored by lgtg20's avatar lgtg20
Browse files

Fix filters and names

parent 2bf3697a
Branches
No related tags found
3 merge requests!417[ADD] Indicator "Taxa de Atendimento Educacional" updated on production!,!416[ADD] Route almost ready, some tests needed. Comments added and filters that...,!413Fix filters and names
......@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function especialEducation(id) {
module.exports = function specialEducation(id) {
switch (id) {
case 1:
return 'Inclusiva';
......
......@@ -20,13 +20,13 @@ const convert = {
integral_time_agg: 'integralTime',
period_agg: 'period',
modality_integral_time: 'educationLevelBasic',
especial_education: 'especialEducation'
special_education: 'specialEducation'
}
function aggregateData(req, res, next) {
if (req.query.dims) {
const newResult = []
const aggregateFields = ['gender', 'age_range', 'ethnic_group', 'education_level_mod_agg', 'integral_time_agg', 'period_agg', 'modality_integral_time', 'especial_education']
const aggregateFields = ['gender', 'age_range', 'ethnic_group', 'education_level_mod_agg', 'integral_time_agg', 'period_agg', 'modality_integral_time', 'special_education']
let id;
const fields = req.query.dims.split(',');
let currentAggregateField;
......
......@@ -116,7 +116,7 @@ const metroCode = require(`${libs}/convert/metroCode`);
const modalityShift = require(`${libs}/convert/modalityShift`);
const incomeRange = require(`${libs}/convert/incomeRange`);
const ageRangeAggregate = require(`${libs}/convert/ageRangeAggregate`);
const especialEducation = require(`${libs}/convert/especialEducation`);
const specialEducation = require(`${libs}/convert/specialEducation`);
const ids = {
gender_id: gender,
......@@ -226,7 +226,7 @@ const ids = {
metro_code_id: metroCode,
modality_shift_id: modalityShift,
income_range_id: incomeRange,
especial_education: especialEducation
special_education: specialEducation
};
function transform(removeId=false) {
......@@ -358,5 +358,5 @@ module.exports = {
metroCode,
modalityShift,
incomeRange,
especialEducation
specialEducation
};
......@@ -78,7 +78,7 @@ enrollmentAggregateApp.get('/adm_dependency_detailed', (req, res, next) => {
next();
}, response('adm_dependency_detailed'));
enrollmentAggregateApp.get('/education_level_mod', (req, res, next) => {
enrollmentAggregateApp.get('/education_level_mod_agg', (req, res, next) => {
req.result = []
for (let i = 1; i <= 13; i++) {
......@@ -87,9 +87,9 @@ enrollmentAggregateApp.get('/education_level_mod', (req, res, next) => {
});
}
next();
}, response('education_level_mod'));
}, response('education_level_mod_agg'));
enrollmentAggregateApp.get('/integral_time', (req, res, next) => {
enrollmentAggregateApp.get('/integral_time_agg', (req, res, next) => {
req.result = []
for (let i = 0; i <= 3; i++) {
......@@ -98,7 +98,7 @@ enrollmentAggregateApp.get('/integral_time', (req, res, next) => {
});
}
next();
}, response('education_level_mod'));
}, response('integral_time_agg'));
enrollmentAggregateApp.get('/location', (req, res, next) => {
req.result = []
......@@ -212,17 +212,17 @@ enrollmentAggregateApp.get('/state', (req, res, next) => {
next();
}, response('state'));
enrollmentAggregateApp.get('/especial_education', (req, res, next) => {
enrollmentAggregateApp.get('/special_education', (req, res, next) => {
req.result = []
for (let i = 1; i <= 2; i++) {
req.result.push({
id: i, name: id2str.especialEducation(i)
id: i, name: id2str.specialEducation(i)
});
}
next();
}, response('especial_education'));
}, response('special_education'));
rqf.addField({
......@@ -574,7 +574,7 @@ enrollmentAggregateApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
.group('escola.ano_censo')
.order('escola.ano_censo')
}
else if (req.query.dims && req.query.dims.includes('especial_education')) {
else if (req.query.dims && req.query.dims.includes('special_education')) {
req.sql.from('escola')
.field('SUM(escola.qt_mat_esp_cc)', 'total_qt_mat_esp_cc')
.field('SUM(escola.qt_mat_esp_ce)', 'total_qt_mat_esp_ce')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment