diff --git a/src/libs/routes_v1/superiorEnrollmentAggregate.js b/src/libs/routes_v1/superiorEnrollmentAggregate.js index e37d4cb5f55d37c1d9654497e26f86ab11f76777..e9a287882a902faea0969633568a15087e1260d3 100644 --- a/src/libs/routes_v1/superiorEnrollmentAggregate.js +++ b/src/libs/routes_v1/superiorEnrollmentAggregate.js @@ -65,7 +65,32 @@ superiorEnrollmentAggregateApp.get('/qtd_graduates', (req, res, next) => { .where('curso_superior_agregado.ano_censo >= 2020') next(); -}) +}, query, response('qtd_graduates')); + +superiorEnrollmentAggregateApp.get('/ies_name', (req, res, next) => { + req.sql.from('curso_superior_agregado') + .field('DISTINCT curso_superior_agregado.cod_ies', 'ies_cod') + .field('curso_superior_agregado.nome_ies', 'ies_name') + .where('curso_superior_agregado.ano_censo >= 2020') + next(); +}, query, response('ies_name')); + +superiorEnrollmentAggregateApp.get('/uf_agg', (req, res, next) => { + req.sql.from('curso_superior_agregado') + .field('DISTINCT curso_superior_agregado.cod_uf', 'uf_cod') + .field('curso_superior_agregado.nome_uf', 'uf_name') + .where('curso_superior_agregado.ano_censo >= 2020') + next(); +}, query, response('uf_agg')); + +superiorEnrollmentAggregateApp.get('/city_agg', (req, res, next) => { + req.sql.from('curso_superior_agregado') + .field('DISTINCT curso_superior_agregado.cod_mun', 'city_cod') + .field('curso_superior_agregado.nome_mun', 'city_name') + .where('curso_superior_agregado.ano_censo >= 2020') + .order('curso_superior_agregado.cod_mun') + next(); +}, query, response('city_agg')); superiorEnrollmentAggregateApp.get('/tp_categ_adm', (req, res, next) => { req.result = [] @@ -127,6 +152,58 @@ superiorEnrollmentAggregateApp.get('/cine_detailed', (req, res, next) => { next(); }, response('cine_detailed')); +superiorEnrollmentAggregateApp.get('/academic_level', (req, res, next) => { + req.result = []; + const defaultCase = null; + for (let i = 0; i <= 3; ++i) { + let obj = { + id: i, + name: id2str.academicLevel(i) + }; + if (obj.name !== id2str.academicLevel(defaultCase)){ + req.result.push(obj); + } + } + req.result.push({ + id: defaultCase, + name: id2str.academicLevel(defaultCase) + }); + next(); +}, response('academic_level')); + +superiorEnrollmentAggregateApp.get('/modality', (req, res, next) => { + req.result = []; + for (let i = 1; i <= 2; ++i) { + req.result.push({ + id: i, + name: id2str.modalityShiftSuperior(i) + }) + } + next(); +}, response('modality')); + +superiorEnrollmentAggregateApp.get('/academic_organization', (req, res, next) => { + req.result = []; + for (let i = 1; i <= 5; ++i) { + req.result.push({ + id: i, + name: id2str.academicOrganization(i) + }) + } + next(); +}, response('academic_organization')); + +superiorEnrollmentAggregateApp.get('/region_agg', (req, res, next) => { + req.result = []; + for (let i = 1; i <= 5; ++i) { + req.result.push({ + id: i, + name: id2str.regionCode(i) + }) + } + next(); +}, response('region_agg')); + rqf.addField({ name: 'filter', field: false, @@ -281,10 +358,10 @@ rqf.addField({ field: 'cod_uf' } }).addValue({ - name: 'mun_agg', + name: 'city_agg', table: 'curso_superior_agregado', tableField: 'nome_mun', - resultField: 'mun_name', + resultField: 'city_name', where: { relation: '=', type: 'integer',