From e65f165c3b563db6c1b2701b1320730a716db4de Mon Sep 17 00:00:00 2001
From: Fernando Erd <fce15@inf.ufpr.br>
Date: Wed, 19 Apr 2017 10:16:08 -0300
Subject: [PATCH] Add filter related with education_level

---
 src/libs/routes/school.js | 60 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/src/libs/routes/school.js b/src/libs/routes/school.js
index 5ebf7473..f2940245 100644
--- a/src/libs/routes/school.js
+++ b/src/libs/routes/school.js
@@ -248,6 +248,66 @@ rqfCount.addField({
         type: 'boolean',
         field: 'quadra_esportes_coberta'
     }
+}).addValue({
+    name: 'education_eja',
+    table: 'escola',
+    tableField: 'ensino_eja',
+    resultField: 'education_eja_name',
+    where: {
+        relation: '=',
+        type: 'boolean',
+        field: 'ensino_eja'
+    }
+}).addValue({
+    name: 'education_professional',
+    table: 'escola',
+    tableField: 'educacao_profissional',
+    resultField: 'education_professional_name',
+    where: {
+        relation: '=',
+        type: 'boolean',
+        field: 'educacao_profissional'
+    }
+}).addValue({
+    name: 'education_middle_school',
+    table: 'escola',
+    tableField: 'reg_medio_medio',
+    resultField: 'education_middle_school_name',
+    where: {
+        relation: '=',
+        type: 'boolean',
+        field: 'reg_medio_medio'
+    }
+}).addValue({
+    name: 'education_end_elementary_school',
+    table: 'escola',
+    tableField: 'reg_fund_af',
+    resultField: 'education_end_elementary_school_name',
+    where: {
+        relation: '=',
+        type: 'boolean',
+        field: 'reg_fund_af'
+    }
+}).addValue({
+    name: 'education_begin_elementary_school',
+    table: 'escola',
+    tableField: 'reg_fund_ai',
+    resultField: 'education_begin_elementary_school_name',
+    where: {
+        relation: '=',
+        type: 'boolean',
+        field: 'reg_fund_ai'
+    }
+}).addValue({
+    name: 'education_preschool_child',
+    table: 'escola',
+    tableField: 'reg_infantil_preescola',
+    resultField: 'education_preschool_child_name',
+    where: {
+        relation: '=',
+        type: 'boolean',
+        field: 'reg_infantil_preescola'
+    }
 });
 
 schoolApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
-- 
GitLab