Skip to content
Snippets Groups Projects
Commit 95509c09 authored by ns17's avatar ns17
Browse files

creating quotas acessibility page

parent d3f43a77
No related branches found
No related tags found
2 merge requests!48Development,!35creating quotas acessibility page
/*
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;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment