Skip to content
Snippets Groups Projects
Commit 4a3a7f04 authored by Victor Picussa's avatar Victor Picussa
Browse files

[v1.11.16]Added UT modifications

parent 8d12f2a3
No related branches found
No related tags found
1 merge request!237[v1.11.16]Added UT modifications
Pipeline #21724 failed
...@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ...@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## 1..11.16 - 2019-10-30
## Changed
- University Teacher updated
## 1.11.15 - 2019-10-16 ## 1.11.15 - 2019-10-16
## Changed ## Changed
- Fix addMissing for classCount route - Fix addMissing for classCount route
......
...@@ -46,8 +46,7 @@ let rqf = new ReqQueryFields(); ...@@ -46,8 +46,7 @@ let rqf = new ReqQueryFields();
teacherEnrollmentApp.get('/years', (req, res, next) => { teacherEnrollmentApp.get('/years', (req, res, next) => {
req.sql.from('docente_ens_superior') req.sql.from('docente_ens_superior')
.field('DISTINCT docente_ens_superior.ano_censo', 'year') .field('DISTINCT docente_ens_superior.ano_censo', 'year');
.where('docente_ens_superior.ano_censo = 2017');
next(); next();
}, query, response('years')); }, query, response('years'));
...@@ -303,13 +302,13 @@ rqf.addField({ ...@@ -303,13 +302,13 @@ rqf.addField({
}).addValue({ }).addValue({
name: 'upper_adm_dependency', name: 'upper_adm_dependency',
table: 'docente_ens_superior', table: 'docente_ens_superior',
tableField: 'cod_categoria_administrativa', tableField: 'par_categoria_administrativa',
resultField: 'upper_adm_dependency_id', resultField: 'upper_adm_dependency_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
table: 'docente_ens_superior', table: 'docente_ens_superior',
field: 'cod_categoria_administrativa' field: 'par_categoria_administrativa'
} }
}).addValue({ }).addValue({
name: 'academic_organization', name: 'academic_organization',
...@@ -345,12 +344,12 @@ rqf.addField({ ...@@ -345,12 +344,12 @@ rqf.addField({
}).addValue({ }).addValue({
name:'teacher_situation', name:'teacher_situation',
table: 'docente_ens_superior', table: 'docente_ens_superior',
tableField: 'cod_situacao_docente', tableField: 'par_situacao_docente',
resultField: 'teacher_situation_id', resultField: 'teacher_situation_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
field: 'cod_situacao_docente' field: 'par_situacao_docente'
} }
}).addValue({ }).addValue({
name:'work_regime', name:'work_regime',
...@@ -455,22 +454,35 @@ rqf.addField({ ...@@ -455,22 +454,35 @@ rqf.addField({
}).addValue({ }).addValue({
name:'deficiency', name:'deficiency',
table: 'docente_ens_superior', table: 'docente_ens_superior',
tableField: 'docente_deficiencia', tableField: 'par_docente_deficiencia',
resultField: 'deficiency_id', resultField: 'deficiency_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
field: 'docente_deficiencia' field: 'par_docente_deficiencia'
} }
}); });
teacherEnrollmentApp.get('/', rqf.parse(), (req, res, next) => { teacherEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
req.sql.field('COUNT(*)', 'total')
.field("'Brasil'", 'name') if ("university" in req.dims) {
.field('docente_ens_superior.ano_censo', 'year') req.sql.field('COUNT(*)', 'total')
.from('docente_ens_superior') .field("'Brasil'", 'name')
.group('docente_ens_superior.ano_censo') .field('docente_ens_superior.ano_censo', 'year')
.order('docente_ens_superior.ano_censo') .from('docente_ens_superior')
.group('docente_ens_superior.cod_ies')
.group('docente_ens_superior.ano_censo')
.order('docente_ens_superior.cod_ies')
.order('docente_ens_superior.ano_censo')
}
else {
req.sql.field('COUNT(*)', 'total')
.field("'Brasil'", 'name')
.field('docente_ens_superior.ano_censo', 'year')
.from('docente_ens_superior')
.group('docente_ens_superior.ano_censo')
.order('docente_ens_superior.ano_censo')
}
next(); next();
}, rqf.build(), query, addMissing(rqf), id2str.transform(false), response('teacherEnrollment')); }, rqf.build(), query, addMissing(rqf), id2str.transform(false), response('teacherEnrollment'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment