Skip to content
Snippets Groups Projects
Commit 7f22fd5e authored by Henrique Varella Ehrenfried's avatar Henrique Varella Ehrenfried :speech_balloon:
Browse files

Merge branch 'quotas_acessibility' into 'development'

creating quotas acessibility page

See merge request !35
parents d3f43a77 3cad9e2c
Branches
No related tags found
2 merge requests!48Development,!35creating quotas acessibility page
Pipeline #23625 failed
/*
Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-Node.
SMPPIR-Node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-Node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-Node. If not, see <https://www.gnu.org/licenses/>.
*/
const express = require('express');
const educationApp = express.Router();
const libs = `${process.cwd()}/libs`;
const squel = require('squel');
const query = require(`${libs}/middlewares/query`).query;
const response = require(`${libs}/middlewares/response`);
const ReqQueryFields = require(`${libs}/middlewares/reqQueryFields`);
const rqf = new ReqQueryFields();
rqf.addField({
name: 'filter',
field: false,
where: true,
}).addField({
name: 'dims',
field: true,
where: false,
})
.addValue({
name: 'ethnic',
table: 'education_ag',
tableField: 'cor_raca_aluno',
resultField: 'ds_cor_raca_aluno',
where: {
relation: '=',
type: 'string',
field: 'cor_raca_aluno',
},
}).addValue({
name: 'year',
table: 'education_ag',
tableField: 'ano_censo',
resultField: 'year',
where: {
relation: '=',
type: 'integer',
field: 'ano_censo',
},
}).addValue({
name: 'min_year',
table: 'education_ag',
tableField: 'ano_censo',
resultField: 'year',
where: {
relation: '>=',
type: 'integer',
field: 'ano_censo',
},
}).addValue({
name: 'max_year',
table: 'v_ag',
tableField: 'ano_censo',
resultField: 'year',
where: {
relation: '<=',
type: 'integer',
field: 'ano_censo',
},
}).addValue({
name: 'region',
table: 'education_ag',
tableField: 'nome_regiao_ies',
resultField: 'region',
where: {
relation: '=',
type: 'string',
field: 'nome_regiao_ies',
},
}).addValue({
name: 'uf',
table: 'education_ag',
tableField: 'sigla_uf_ies',
resultField: 'uf',
where: {
relation: '=',
type: 'string',
field: 'sigla_uf_ies',
},
}).addValue({
name: 'quotas',
table: 'education_ag',
tableField: 'reserva_vagas',
resultField: 'cod_reserva_vagas',
where: {
relation: '=',
type: 'string',
field: 'reserva_vagas',
},
}).addValue({
name: 'admission',
table: 'education_ag',
tableField: 'ingressante',
resultField: 'cod_ingressantes',
where: {
relation: '=',
type: 'string',
field: 'ingressante',
},
});
educationApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.sql.field('education_ag.ano_censo as no_ano_pesquisa')
.field('SUM(total) AS total')
.from('education_ag')
.group('education_ag.ano_censo')
.order('education_ag.ano_censo');
next();
}, query, response('education'));
module.exports = educationApp;
...@@ -100,6 +100,8 @@ const youth_education = require(`${libs}/routes/SMPPIR/youth_education`) ...@@ -100,6 +100,8 @@ const youth_education = require(`${libs}/routes/SMPPIR/youth_education`)
const sim = require(`${libs}/routes/SMPPIR/sim`) const sim = require(`${libs}/routes/SMPPIR/sim`)
const education = require(`${libs}/routes/SMPPIR/education`)
const taxa_homicidios = require(`${libs}/routes/SMPPIR/taxa_homicidios`) const taxa_homicidios = require(`${libs}/routes/SMPPIR/taxa_homicidios`)
const traditional_families = require(`${libs}/routes/SMPPIR/traditional_families`) const traditional_families = require(`${libs}/routes/SMPPIR/traditional_families`)
...@@ -156,6 +158,7 @@ api.use('/ciganos_sustentability', ciganos_sustentability); ...@@ -156,6 +158,7 @@ api.use('/ciganos_sustentability', ciganos_sustentability);
api.use('/youth_jobs', youth_jobs) api.use('/youth_jobs', youth_jobs)
api.use('/youth_education', youth_education) api.use('/youth_education', youth_education)
api.use('/sim', sim) api.use('/sim', sim)
api.use('/education', education)
api.use('/taxa_homicidios', taxa_homicidios) api.use('/taxa_homicidios', taxa_homicidios)
api.use('/traditional_families', traditional_families) api.use('/traditional_families', traditional_families)
api.use('/traditional_families_people', traditional_families_people) api.use('/traditional_families_people', traditional_families_people)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment