diff --git a/src/libs/routes/enrollment.js b/src/libs/routes/enrollment.js index 58ebb200c70709c4862f51a0bbb87ed720eb04d2..926b6ce62a219b98f1442d9584e235fe822ed189 100644 --- a/src/libs/routes/enrollment.js +++ b/src/libs/routes/enrollment.js @@ -35,7 +35,7 @@ enrollmentApp.get('/location', (req, res, next) => { next(); }, query, response('location')); -// Returns all educational levels avaible +// Returns all school years available enrollmentApp.get('/school_year', (req, res, next) => { req.sql.from('serie_ano') .field('id') @@ -43,6 +43,22 @@ enrollmentApp.get('/school_year', (req, res, next) => { next(); }, query, response('school_year')); +// Returns all school years available +enrollmentApp.get('/education_level', (req, res, next) => { + req.sql.from('etapa_ensino') + .field('id') + .field('desc_etapa', 'name'); + next(); +}, query, response('education_level')); + +// Returns all school years available +enrollmentApp.get('/education_level_mod', (req, res, next) => { + req.sql.from('etapa_ensino') + .field('id') + .field('nome', 'name'); + next(); +}, query, response('education_level_mod')); + // Returns all adm dependencies enrollmentApp.get('/adm_dependency', (req, res, next) => { req.sql.from('dependencia_adm') @@ -118,6 +134,24 @@ rqf.addField({ relation: '=', type: 'integer' } +}).addValue({ + name: 'education_level', + table: 'matricula', + tableField: 'etapa_ensino_id', + resultField: 'education_level_id', + where: { + relation: '=', + type: 'integer' + } +}).addValue({ + name: 'education_level_mod', + table: 'matricula', + tableField: 'etapas_mod_ensino_segmento_id', + resultField: 'education_level_mod_id', + where: { + relation: '=', + type: 'integer' + } }).addValue({ name: 'region', table: 'regiao',