From 1ada478ba9bdeaae5556bb27d3b8b1fc8af0746d Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
Date: Mon, 6 Jul 2020 11:14:24 -0300
Subject: [PATCH 01/39] Fix bug with sustentability indicators

Signed-off-by: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
---
 src/libs/routes/SMPPIR/african_sustentability.js | 2 +-
 src/libs/routes/SMPPIR/ciganos_sustentability.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libs/routes/SMPPIR/african_sustentability.js b/src/libs/routes/SMPPIR/african_sustentability.js
index 6ea5f7be..0110786e 100644
--- a/src/libs/routes/SMPPIR/african_sustentability.js
+++ b/src/libs/routes/SMPPIR/african_sustentability.js
@@ -109,7 +109,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total')
+    req.sql.field('COUNT(total) AS Total')
         .from('african_sustentability_ag');
     next();
 }, query, response('cad_unico'));
diff --git a/src/libs/routes/SMPPIR/ciganos_sustentability.js b/src/libs/routes/SMPPIR/ciganos_sustentability.js
index 89b28cf7..9de39e43 100644
--- a/src/libs/routes/SMPPIR/ciganos_sustentability.js
+++ b/src/libs/routes/SMPPIR/ciganos_sustentability.js
@@ -109,7 +109,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total')
+    req.sql.field('COUNT(total) AS Total')
         .from('ciganos_sustentability_ag');
     next();
 }, query, response('cad_unico'));
-- 
GitLab


From 99d0d94a12ffe97cb5b7c9b34fad5847a2c99ef6 Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
Date: Wed, 8 Jul 2020 08:43:58 -0300
Subject: [PATCH 02/39] Change SUM for COUNT to get Cadunico Families

Signed-off-by: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
---
 src/libs/routes/SMPPIR/african_culture.js        | 3 ++-
 src/libs/routes/SMPPIR/african_sustentability.js | 1 +
 src/libs/routes/SMPPIR/ciganos_culture.js        | 3 ++-
 src/libs/routes/SMPPIR/ciganos_sustentability.js | 1 +
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/libs/routes/SMPPIR/african_culture.js b/src/libs/routes/SMPPIR/african_culture.js
index 749971d9..f9d03364 100644
--- a/src/libs/routes/SMPPIR/african_culture.js
+++ b/src/libs/routes/SMPPIR/african_culture.js
@@ -133,7 +133,8 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total')
+    // Use COUNT to get Family and SUM to get people, as the indicator needs families, COUNT is being used.
+    req.sql.field('COUNT(total) AS Total')
         .from('african_culture_ag');
     next();
 }, query, response('cad_unico'));
diff --git a/src/libs/routes/SMPPIR/african_sustentability.js b/src/libs/routes/SMPPIR/african_sustentability.js
index 0110786e..36137559 100644
--- a/src/libs/routes/SMPPIR/african_sustentability.js
+++ b/src/libs/routes/SMPPIR/african_sustentability.js
@@ -109,6 +109,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
+    // Use COUNT to get Family and SUM to get people, as the indicator needs families, COUNT is being used.
     req.sql.field('COUNT(total) AS Total')
         .from('african_sustentability_ag');
     next();
diff --git a/src/libs/routes/SMPPIR/ciganos_culture.js b/src/libs/routes/SMPPIR/ciganos_culture.js
index f368aa0f..e346b996 100644
--- a/src/libs/routes/SMPPIR/ciganos_culture.js
+++ b/src/libs/routes/SMPPIR/ciganos_culture.js
@@ -133,7 +133,8 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total')
+    // Use COUNT to get Family and SUM to get people, as the indicator needs families, COUNT is being used.
+    req.sql.field('COUNT(total) AS Total')
         .from('ciganos_culture_ag');
     next();
 }, query, response('cad_unico'));
diff --git a/src/libs/routes/SMPPIR/ciganos_sustentability.js b/src/libs/routes/SMPPIR/ciganos_sustentability.js
index 9de39e43..3b14ffac 100644
--- a/src/libs/routes/SMPPIR/ciganos_sustentability.js
+++ b/src/libs/routes/SMPPIR/ciganos_sustentability.js
@@ -109,6 +109,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
+    // Use COUNT to get Family and SUM to get people, as the indicator needs families, COUNT is being used.
     req.sql.field('COUNT(total) AS Total')
         .from('ciganos_sustentability_ag');
     next();
-- 
GitLab


From 8cdc16131844f678ac6e56a48bff4f3915580202 Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
Date: Wed, 5 Aug 2020 09:14:40 -0300
Subject: [PATCH 03/39] Add routes for traditional families and their people

Signed-off-by: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
---
  SMPPIR-API Specification.yaml                | 2973 -----------------
 .../routes/SMPPIR/traditional_families.js     |  130 +
 .../SMPPIR/traditional_families_people.js     |  106 +
 src/libs/routes/api.js                        |    6 +
 4 files changed, 242 insertions(+), 2973 deletions(-)
 delete mode 100644  SMPPIR-API Specification.yaml 
 create mode 100644 src/libs/routes/SMPPIR/traditional_families.js
 create mode 100644 src/libs/routes/SMPPIR/traditional_families_people.js

diff --git a/ SMPPIR-API Specification.yaml  b/ SMPPIR-API Specification.yaml 
deleted file mode 100644
index a79e6491..00000000
--- a/ SMPPIR-API Specification.yaml 	
+++ /dev/null
@@ -1,2973 +0,0 @@
-# Specification of SMPPIR API using OpenAPI 3.0
-# For the specification of OpenAPI 3.0, please refer to: https://swagger.io/docs/specification/about/
-openapi: "3.0.0"
-info:
-  version: 1.0.0
-  title: SMPPIR - API
-  description: 'This API provides access to quotas data based in [INEP - Census of higher education](http://portal.inep.gov.br/web/guest/microdados), [PNAD - People information](http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40), [FIES](http://www.fnde.gov.br/dadosabertos/dataset/fundo-de-financiamento-estudantil-fies), [PROUNI](http://dadosabertos.mec.gov.br/prouni)'
- 
-servers:
-  - url: http://seppirdev.c3sl.ufpr.br:4000/api/v1
-
-tags:
-  - name: INEP
-    description: "Contains queries made with data from the INEP database listed above. This section's concern is the undergraduation students"
-    externalDocs:
-      url: http://portal.inep.gov.br/web/guest/microdados
-  - name: FIES
-    description: "Contains queries made with data from the FIES database listed above. This section's concern is the loan for undergraduation students"
-    externalDocs:
-      url: http://www.fnde.gov.br/dadosabertos/dataset/fundo-de-financiamento-estudantil-fies
-  - name: PNAD
-    description: "Contains queries made with data from the PNAD database listed above. This section's concern is the educational level of the population between 18 and 24 years old"
-    externalDocs:
-      url: http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40
-  - name: PROUNI
-    description: "Contains queries made with data from the PROUNI database listed above. This section's concern is the federal scholarship"
-    externalDocs:
-      url: http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40
-#  - name: IBGE - Census
-#    description: "Contains queries made with data from IBGE Census"
-#    externalDocs:
-#url:  https://ww2.ibge.gov.br/home/estatistica/populacao/censo2010/resultados_gerais_amostra/resultados_gerais_amostra_tab_uf_microdados.shtm
-  - name: CadÚnico
-    description: "Contains queries made with data from CadÚnico"
-    externalDocs:
-      url: https://aplicacoes.mds.gov.br/sagi/portal/index.php?grupo=212 
-  - name: EXTRA
-    description: "Contains data from auxiliary extra routes"
-    externalDocs:
-      url:  https://ww2.ibge.gov.br/home/estatistica/populacao/censo2010/resultados_gerais_amostra/resultados_gerais_amostra_tab_uf_microdados.shtm
-
-paths:
-  /admission:
-    get:
-      summary: Return the number of quotasholder that entered in a federal institution. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturn'
-        '404':
-          description: no data found
-  /evader:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and drop out. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-                - region
-                - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturnWithLocationInfo'
-        '404':
-          description: no data found  
-  /extracurricular_activities:
-    get:
-      summary: Return the number of quotasholder that studie in a federal institution and do any type of extracurricular activity (Intership, Teacher's Assistant, etc.). This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturn'
-        '404':
-          description: no data found  
-  /fies:
-    get:
-      summary: Return the number of students that got a loan from FIES. This route uses the FIES database listed above
-      tags:
-        - FIES
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - offer_location
-                - loan
-                - loan_type
-                - uf
-                - region
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: gender:"Feminino",ethnic:["Branco","Pardo"]
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                gender:
-                  type: array
-                  items:
-                    type: string
-                    enum: ['Masculino', 'Feminino']
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                    enum: ['Amarelo', 'Branco', 'Negro', 'Pardo', 'Índio']
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_cod:
-                  type: array
-                  items:
-                    type: integer
-                offer_location:
-                  type: array
-                  items:
-                    type: string
-                loan:
-                  type: array
-                  items:
-                    type: integer
-                    enum: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ]
-                loan_type:
-                  type: array
-                  items:
-                    type: string
-                    enum: ["F", "N", "S"]
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                region:
-                  type: array
-                  items:
-                    type: string
-                    enum: [ 'Norte', 'Nordeste', 'Centro-Oeste', 'Sul', 'Sudeste' ]
-                uf:
-                  type: array
-                  items:
-                    type: string
-                    enum: [ 'AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SP', 'SE', 'TO' ]
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/FiesReturn'
-        '404':
-          description: no data found  
-  /graduate:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and finished their studies
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-                - region
-                - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturnWithLocationInfo'
-        '404':
-          description: no data found
-  
-  /course:
-    get:
-      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-               - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015", uf:"PR"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-                uf:
-                  type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/course'
-        '404':
-          description: no data found  
- 
-  /courseFIES:
-    get:
-      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the FIES database listed above
-      tags:
-        - FIES
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/coursePROUNI'
-        '404':
-          description: no data found  
-
-  /coursePROUNI:
-    get:
-      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the PROUNI database listed above
-      tags:
-        - PROUNI
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/courseFIES'
-        '404':
-          description: no data found  
-          
-  /institution:
-    get:
-      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-               - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015", uf:"PR"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-                uf:
-                  type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institution'
-        '404':
-          description: no data found  
-          
-  /institutionFIES:
-    get:
-      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the FIES database listed above
-      tags:
-        - FIES
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institutionFIES'
-        '404':
-          description: no data found            
-          
-  /institutionPROUNI:
-    get:
-      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the PROUNI database listed above
-      tags:
-        - PROUNI
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institutionPROUNI'
-        '404':
-          description: no data found            
-  
-  /ibge_code:
-    get:
-      summary: Return the name and code of a city as well as the code for the state the city is in. This route uses the IBGE database listed above.
-      tags:
-        - EXTRA
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - city_name
-               - city_code
-               - state
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: city_name:"Curitiba", state:"17"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                city_name:
-                  type: string
-                city_code:
-                  type: number
-                state:
-                  type: number
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/ibge_code'
-        '404':
-          description: no data found  
-          
-  /institutionPrivate:
-    get:
-      summary: Return the existing IFES(Instituto Federal de Educação Superior) that are private. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institutionPrivate'
-        '404':
-          description: no data found   
-     
-  /vacancy:
-    get:
-      summary: Return the number of quotasholder spots that are open to students in a federal institution
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - region
-                - uf
-                - cod_ies
-                - campus
-                - course
-                - shift
-                - name_ies
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/vacancy'
-        '404':
-          description: no data found
-          
-  /pnad:
-    get:
-      summary: Return the number of people obtained by IBGE in the PNAD research. This route uses the PNAD database listed above
-      tags:
-        - PNAD
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: level_of_education,type_of_school
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - ethnic
-                - type_of_school
-                - type_of_public_school
-                - level_of_education
-                - uf
-                - region
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: level_of_education:["2","6"],type_of_school:"4"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                ethnic:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['0', '2', '4', '6', '8', '9']
-                type_of_school:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['2', '4']
-                type_of_public_school:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['2','4','6']
-                level_of_education:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['1','2','3','4','5','6','10','11']
-                uf:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-                region:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-                year:
-                    type: "array"
-                    items: 
-                        type: "integer"
-                min_year:
-                    type: "integer"
-                max_year:
-                    type: "integer"
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/PnadReturn'
-        '404':
-          description: no data found
-  /prouni:
-    get:
-      summary: Return the number of people that received a scholarship from PROUNI. This route uses the PROUNI database listed above
-      tags:
-        - PROUNI
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - scholarship
-                - uf
-                - region
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Curso a distância"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: "string"
-                  enum: ["Curso a distância", "Integral", "Matutino", "Noturno", "Vespertino"]
-                gender:
-                  type: "string"
-                  enum: ["Masculino", "Feminino"]
-                ethnic:
-                  type: "string"
-                  enum: ["Amarela", "Branca", "Indígena", "Não Informada", "Parda", "Preta"]
-                course:
-                  type: "string"
-                institution:
-                  type: "string"
-                scholarship:
-                  type: "string"
-                  enum: ["BOLSA INTEGRAL", "BOLSA PARCIAL 50%"]
-                uf:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-                region:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-                year:
-                    type: "array"
-                    items: 
-                        type: "integer"
-                min_year:
-                    type: "integer"
-                max_year:
-                    type: "integer"
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/ProuniReturn'
-        '404':
-          description: no data found
-  /social_support:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and had some sort of social support
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - food_support
-                - support
-                - work_support
-                - courseware_support
-                - housing_support
-                - transport_support
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                food_support:
-                  type: array
-                  items:
-                    type: string
-                support:
-                  type: array
-                  items:
-                    type: string
-                work_support:
-                  type: array
-                  items:
-                    type: string
-                courseware_support:
-                  type: array
-                  items:
-                    type: string
-                housing_support:
-                  type: array
-                  items:
-                    type: string
-                transport_support:
-                  type: array
-                  items:
-                    type: string
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/SocialSupportReturn'
-        '404':
-          description: no data found
-  /student_loans:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and contracted some sort of loan
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - cod_offer_location
-                - name_offer_location
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - refund_fies
-                - refund_state
-                - refund_city
-                - refund_edu_inst
-                - refund_org
-                - refund_others
-                - no_refund_prouni_integral
-                - no_refund_prouni_partial
-                - no_refund_state
-                - no_refund_city
-                - no_refund_edu_inst
-                - no_refund_org
-                - no_refund_others
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                refund_fies:
-                  type: array
-                  items:
-                      type: string
-                refund_state:
-                  type: array
-                  items:
-                      type: string
-                refund_city:
-                  type: array
-                  items:
-                      type: string
-                refund_edu_inst:
-                  type: array
-                  items:
-                      type: string
-                refund_org:
-                  type: array
-                  items:
-                      type: string
-                refund_others:
-                  type: array
-                  items:
-                      type: string
-                no_refund_prouni_integral:
-                  type: array
-                  items:
-                      type: string
-                no_refund_prouni_partial:
-                  type: array
-                  items:
-                      type: string
-                no_refund_state:
-                  type: array
-                  items:
-                      type: string
-                no_refund_city:
-                  type: array
-                  items:
-                      type: string
-                no_refund_edu_inst:
-                  type: array
-                  items:
-                      type: string
-                no_refund_org:
-                  type: array
-                  items:
-                      type: string
-                no_refund_others:
-                  type: array
-                  items:
-                      type: string
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/InepLoanReturn'
-        '404':
-          description: no data found
-  
-#  /ibge_census:
-#    get:
-#      summary: Return the number of people obtained by IBGE in the last census. This route uses the IBGE data listed above
-#      tags:
-#        - IBGE - Census
-#      parameters:
-#        - name: dims
-#          in: query
-#          description: Group data using a metric parameter
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: ethnic,gender
-#          schema:
-#            type: array
-#            items:
-#              type: string
-#              enum:
-#                - ethnic
-#                - gender
-#                - religion
-#                - income_range
-#                - age
-#                - age_greater_than
-#                - age_lesser_than
-#                - highest_education
-#                - school_daycare
-#                - work_status
-#                - education_level
-#                - ocupation_position_and_category
-#                - home_status
-#                - work_condition
-#                - mensal_home_income_range
-#                - relation_homeowner
-#        - name: filter
-#          in: query
-#          description: Filter data
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: ethnic:["2","6"],gender:"1"
-#          schema:
-#            type: array
-#            items:
-#              type: object
-#              properties:
-#                ethnic:
-#                  type: "array"
-#                  items: 
-#                      type: "string"
-#                      enum: ['1', '2', '3', '4', '5', '9']
-#                gender:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2']
-#                religion:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['0', '1', '2', '110', '111', '112', '120', '130', '140', '149', '199', '210', '219', '220', '221', '222', '223', '224', '225', '229', '230', '231', '232', '239', '240', '241', '242', '243', '244', '245', '249', '250', '251', '259', '260', '261', '262', '269', '270', '279', '280', '289', '300', '310', '311', '312', '319', '320', '329', '330', '339', '340', '349', '350', '359', '360', '369', '370', '379', '380', '389', '390', '399', '400', '401', '409', '420', '429', '430', '439', '440', '449', '450', '451', '452', '453', '454', '455', '460', '469', '470', '479', '480', '489', '490', '492', '499', '510', '519', '520', '529', '530', '590', '599', '610', '619', '620', '629', '630', '639', '640', '641', '649', '710', '711', '719', '740', '741', '749', '750', '751', '752', '753', '754', '755', '759', '760', '761', '762', '763', '764', '765', '766', '790', '791', '792', '793', '799', '810', '811', '819', '820', '821', '829', '830', '831', '832', '834', '839', '850', '890', '891', '892', '893', '894', '895', '896', '990', '999', ]
-#                income_range:
-#                    type: "array"
-#                    items: 
-#                        type: "number"
-#                age:
-#                    type: "array"
-#                    items: 
-#                        type: "integer"
-#                age_greater_than:
-#                    type: "array"
-#                    items: 
-#                        type: "integer"
-#                age_lesser_than:
-#                    type: "array"
-#                    items: 
-#                        type: "integer"
-#                highest_education:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: [null, '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14']    
-#                school_daycare:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2','3', '4']
-#                work_status:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: [null, '1', '2']
-#                education_level:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2', '3', '4', '5']
-#                ocupation_position_and_category:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2']    
-#                home_status: 
-#                    type: "array"
-#                    items:
-#                        type: "string"
-#                        enum: ['1', '2']    
-#                work_condition: 
-#                    type: "array"
-#                    items:
-#                        type: "string"
-#                        enum: [null, '1', '2']   
-#                mensal_home_income_range: 
-#                    type: "array"
-#                    items:
-#                        type: "number"  
-#                relation_homeowner: 
-#                    type: "array"
-#                    items:
-#                        type: "string" 
-#                        enum: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']
-#
-#      responses:
-#        '200':
-#          description: successful operation
-#          content:
-#            application/json:
-#              schema:
-#                $ref: '#/components/schemas/IBGECensusReturn'
-#        '404':
-#          description: no data found
-
-#  /cad_unico:
-#    get:
-#      summary: Return the number of people and families from that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-#      tags:
-#        - CadÚnico
-#      parameters:
-#        - name: dims
-#          in: query
-#          description: Group data using a metric parameter
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: year,home_type
-#          schema:
-#            type: array
-#            items:
-#              type: string
-#              enum:
-#                - year
-#                - per_capita_income
-#                - home_type
-#                - home_location
-#                - education_families
-#                - education_families_level
-#                - education_families_conclude
-#        - name: filter
-#          in: query
-#          description: Filter data
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: ethnic:["2","6"],gender:"1"
-#          schema:
-#            type: array
-#            items:
-#              type: object
-#              properties:
-#                year:
-#                  type: "array"
-#                  items: 
-#                      type: "string"
-#                      enum: ['2012', '2013', '2014', '2015', '2016']
-#                per_capita_income:
-#                  type: "array"
-#                  items:
-#                    type: "string"
-#                home_type:
-#                  type: "array"
-#                  items:
-#                    type: "string"
-#                    enum: [null, '1','2','3']
-#                home_location:
-#                  type: 'array'
-#                  items:
-#                    type: "number"
-#                education_families_conclude:
-#                  type: "array"
-#                  items:
-#                    type: "string"
-#                    enum: [null, '1', '2']
-#                education_families:
-#                  type: 'array'
-#                  items:
-#                    type: "string"
-#                    enum: [null, '1','2','3','4','5','6','7','8','9','10','11','12','13','14','15']
-#                education_families_level:
-#                  type: 'array'
-#                  items:
-#                    type: "string"
-#                    enum: [null,'1','2','3','4','5','6','7','8','9','10']
-
-#      responses:
-#        '200':
-#          description: successful operation
-#          content:
-#            application/json:
-#              schema:
-#                $ref: '#/components/schemas/CadUnicoReturn'
-#        '404':
-#          description: no data found
-                  
-  /african_culture:
-    get:
-      summary: Return the type of house and location of the houses that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - cod_local_home
-                - home_type
-                - home_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                cod_local_home:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2']
-                home_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3']
-                home_location:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1301902','1303809', '1304237','1500107','1502806','1503705','1503903','1504604','1504901','1505205']
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/AfricanCulture'
-        '404':
-          description: no data found
-          
-  /african_rights:
-    get:
-      summary: Return the education level and number of families that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - education_families_conclude
-                - education_families_level
-                - education_families
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                education_families_conclude:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','null']
-                education_families_level:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','7','8','9','null']
-                education_families:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['3','4','5','6','7','8','9','12','13','null']
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/AfricanRights'
-        '404':
-          description: no data found
-
-  /african_sustentability:
-    get:
-      summary: Return the average per capita income from families that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - family_type
-                - per_capita_income
-
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                vlr_renda_media_fam:
-                  type: "array"
-                  items:
-                    type: "number"
-                    minimum: 0
-                    maximum: 3000
-                    
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/AfricanSustentability'
-        '404':
-          description: no data found
-          
-  /eixo_2:
-    get:
-      summary: Return the infraestructure and life quality information about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - family_type
-                - cod_local_home
-                - cod_home_lighting
-                - cod_home_trash_destiny
-                - cod_home_watter_supply
-                - cod_sanitary_dump
-                - home_type
-                - home_location
-                - uf
-                - region
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                family_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['201','202','203','204','205','301','302','303','304','305','306','101','0','null']
-                cod_local_home:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2,','NA','null']
-                cod_home_lighting:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','NA','null']
-                cod_home_trash_destiny:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','null','NA']
-                cod_home_watter_supply:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','null','NA']
-                home_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1', '2', '3', 'null']  
-                uf:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
-                region:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']                       
-                cod_escoa_sanitario_domic_fam:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','null','NA']   
-                    
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/Eixo2'
-        '404':
-          description: no data found
-
-  /eixo_3:
-    get:
-      summary: Return the local development and productive inclusion about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - family_type
-                - cod_home_bolsa_familia
-                - cod_agriculture_job
-                - per_capita_income
-                - home_location
-                - uf
-                - region
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                family_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['201','202','203','204','205','301','302','303','304','305','306','101','0','null']
-                cod_home_bolsa_familia:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['0','1','null']
-                cod_agriculture_job:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['0','1','null','NA']
-                per_capita_income:
-                  type: "array"
-                  items:
-                    type: "string"
-                    minimum: 0
-                    maximum: 2800
-                home_location:    
-                  type: "array"
-                  items:
-                    type: "string"
-                    minimum: 1100015
-                    maximum: 5300108
-                uf:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
-                region:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']   
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/Eixo3'
-        '404':
-          description: no data found
-          
-  /eixo_4:
-    get:
-      summary: Return the rights and citizenship information about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - cod_local_home
-                - age
-                - education_families_conclude
-                - education_families_level
-                - education_families
-                - uf
-                - region
-                - gender
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                age:
-                  type: "array"
-                  items:
-                    type: "string"
-                    minimum: 0
-                    maximum: 128
-                education_families_conclude:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','null']
-                education_families_level:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','1','3','4','5','6','7','8','9','10']
-                education_families:    
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','null']
-                uf:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
-                region:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']   
-                gender:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','null']   
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/Eixo4'
-        '404':
-          description: no data found
-          
-  /quilombola_metrics:
-    get:
-      summary: Return the useful metrics for quilombola families obtained by CadÚnico, like the maximum, minimum and average income they have, per year. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2016"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
- 
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/metrics'
-        '404':
-          description: no data found          
-        
-components:
-  schemas:
-
-    Eixo2:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_eixo_2 queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        ind_parc_mds_fam:
-          type: "number"
-        cod_local_domic_fam:
-          type: "number"
-        cod_iluminacao_domic_fam:
-          type: "number"
-        cod_destino_lixo_domic_fam:
-          type: "number"
-        cod_abaste_agua_domic_fam:
-          type: "number"
-        cod_especie_domic_fam:
-          type: "number"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        cod_escoa_sanitario_domic_fam:
-          type: "number"
-    Eixo3:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_eixo_3 queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        ind_parc_mds_fam:
-          type: "number"
-        marc_pbf:
-          type: "number"
-        ind_familia_quilombola_fam:
-          type: "number"
-        cod_agricultura_trab_memb:
-          type: "number"
-        vlr_renda_media_fam:
-          type: "number"
-        cd_ibge:
-          type: "number"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        cod_escoa_sanitario_domic_fam:
-          type: "number"
-   
-    Eixo4:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_eixo_3 queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        idade:
-          type: "number"
-        cod_concluiu_frequentou_memb:
-          type: "string"
-        cod_ano_serie_frequentou_memb:
-          type: "string"
-        cod_curso_frequentou_pessoa_memb:
-          type: "string"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        genero:
-          type: "string"    
-          
-    metrics:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_metrics queries
-      properties:
-        ano_pesquisa:
-          type: "number"
-
-    AfricanSustentability:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in african_rights queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        vlr_renda_media_fam:
-          type: "number"
-
-          
-    AfricanRights:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in african_rights queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        cod_concluiu_frequentou_memb:
-          type: "string"
-        cod_ano_serie_frequentou_memb:
-          type: "string"
-        cod_curso_frequentou_pessoa_memb:
-          type: "string"
-          
-    AfricanCulture:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in african_culture queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        cod_local_domic_fam:
-          type: "string"
-        cod_especie_domic_fam:
-          type: "string"
-        cd_ibge:
-          type: "string"
-        
-#    CadUnicoReturn:
-#      type: object
-#      required: ['total']
-#      description: | 
-#        This model represents the return possibilities in CadUnico queries
-#      properties:
-#        total:
-#          type: "number"
-#        ano_pesquisa: 
-#          type: "number"
-#        vlr_renda_media_fam:      
-#          type: "number"
-#        cod_especie_domic_fam: 
-#          type: "string"
-#        cd_ibge: 
-#          type: "string"
-#        cod_concluiu_frequentou_memb: 
-#          type: "string"  
-#        cod_ano_serie_frequentou_memb:
-#          type: "string"     
-#        cod_curso_frequentou_pessoa_memb:
-#          type: "string"  
-          
-    course:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in course queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"
-    courseFIES:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in courseFIES queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"
-    coursePROUNI:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in course queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"      
-    institution:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institution queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"  
-
-    institutionFIES:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institutionFIES queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-          
-    institutionPROUNI:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institutionPROUNI queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-          
-          
-    institutionPrivate:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institution queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"   
-          
-    ibge_code:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in ibge_code queries
-      properties:
-        no_cidade:
-          type: "string"
-        co_cidade:
-          type: "number"
-        sgl_estado: 
-          type: "string"           
-          
-#    IBGECensusReturn:
-#      type: object
-#      required: ['total']
-#      description: |
-#        This model represents the return possibilities in IBGE Census queries
-#      properties:
-#        total:
-#          type: "number"
-#        co_cor_raca:
-#          type:  "string"
-##        co_sexo:
-#          type:  "string"
-#        co_religiao:
-#          type:  "string"
-#        nu_sal_min_todos_trabalhos:
-#          type: "number"
-#        nu_idade_calculada_anos:
-#          type: "number" 
-#        co_curso_mais_elevado_freq:
-#          type: "string" 
- #       co_freq_escola_creche:
-#          type: "string"
-#        co_condicao_atividade_semana_ref:
-#          type: "string" 
-#       co_nivel_instrucao:
-#         type: "string" 
-#        co_posicao_na_ocupacao_e_categoria_do_emprego:
-#          type: "string" 
-#        co_situacao_dom:
-#          type: "string" 
-#        co_condicao_ocupacao_semana_ref:
-#          type: "string" 
-#        vl_rendimneto_mensal_domicilio_sal_min_per_capita:
-#          type: "number" 
-#        co_relacao_responsavel_dom:
-#          type: "string"   
-          
-    BasicInepReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is not needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"
-    BasicInepReturnWithLocationInfo:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"
-              region:
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-              uf:
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-                
-    vacancy:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in vacancy queries
-      properties:
-        total:
-          type: "number"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        year:
-          type: "number"
-        cod_ies:
-          type: "integer"
-        campus:
-          type: "string"
-        curso:
-          type: "string"
-        turno:
-          type: "string"
-        nome_ies:
-          type: "string"
-        cod_especie_domic_fam:
-          type: "number"
-        total_vagas_ampla_concorrencia_nao_pcd:
-          type: "number"
-        total_vagas_ampla_concorrencia_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_ppi_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_ppi_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_outros_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_outros_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_ppi_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_ppi_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_outros_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_outros_pcd:
-          type: "number"
-        total_total_pcd:
-          type: "number"
-
-
-          
-    FiesReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in FIES queries.
-        Note that there will always exists the total and nu_ano keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'nu_ano']
-            properties:
-              total:
-                type: "number"
-              nu_ano:
-                type: "integer"
-                format: "int32"
-              ds_sexo:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_raca_cor:
-                type: "string"
-                enum: ['Amarelo','Branco','Negro','Pardo','Índio']
-              ds_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              no_campus:
-                type: "string"
-              nu_percent_solicitado_financ:
-                type: integer
-                enum: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ]
-              tp_fianca:
-                type: "string"
-                enum: ["F", "N", "S"]
-                description: |
-                  Meanings of each letter:
-                
-                  F - Fundo de Garantia de Operações de Crédito Educativo – FGEDUC
-                  
-                  N - Normal/Convencional
-                  
-                  S - Solidária
-              region:
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-              uf:
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-    PnadReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in PNAD queries.
-        Note that there will always exists the total and nu_ano_referencia keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'nu_ano_referencia']
-            properties:
-              total:
-                type: "number"
-              nu_ano_referencia:
-                type: "integer"
-                format: "int32"
-              co_cor_raca: 
-                type: "string"
-                enum: ['0', '2', '4', '6', '8', '9']
-              co_rede_ensino:
-                type: "string"
-                enum: ['2', '4']
-              co_area_rede_publica_ensino:
-                type: "string"
-                enum: ['2','4','6']
-              co_curso:
-                type: "string"
-                enum: ['1','2','3','4','5','6','10','11']
-              uf:
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"] 
-              region:
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-    ProuniReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in PROUNI queries.
-        Note that there will always exists the total and ano_concessao_bolsa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'ano_concessao_bolsa']
-            properties:
-              total:
-                type: "number"
-              ano_concessao_bolsa:
-                type: "integer"
-                format: "int32"
-              nome_turno_curso_bolsa:
-              # shift
-                type: "string"
-                enum: ['Curso a distância', 'Integral', 'Matutino', 'Noturno', 'Vespertino']
-              sexo_beneficiario_bolsa:
-              # gender
-                type: "string"
-                enum: ["Masculino", "Feminino"]
-              raca_beneficiario_bolsa:
-              # ethnic
-                type: "string"
-                enum: ['Amarela', 'Branca', 'Indígena', 'Não Informada', 'Parda', 'Preta']
-              nome_curso_bolsa:
-              # course
-                type: "string"
-              nome_ies_bolsa:
-              # institution
-                type: "string"
-              tipo_bolsa:
-              # scholarship
-                type: "string"
-                enum: ["BOLSA INTEGRAL", "BOLSA PARCIAL 50%"]               
-              sigla_uf_beneficiario_bolsa:
-              # uf
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]            
-              regiao_beneficiario_bolsa:
-              # region
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-    SocialSupportReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is not needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"  
-              in_apoio_alimentacao:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_bolsa_pemanencia:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_bolsa_trabalho:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_material_didatico:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_moradia:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_transporte:
-                type: "string"
-                enum: ["0", "1"]
-    InepLoanReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is not needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              refund_fies:
-                type: "string"
-                enum: ["0", "1"]
-              refund_state:
-                  type: "string"
-                  enum: ["0", "1"]
-              refund_city:
-                type: "string"
-                enum: ["0", "1"]
-              refund_edu_inst:
-                type: "string"
-                enum: ["0", "1"]
-              refund_org:
-                type: "string"
-                enum: ["0", "1"]
-              refund_others:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_prouni_integral:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_prouni_partial:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_state:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_city:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_edu_inst:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_org:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_others:
-                type: "string"
-                enum: ["0", "1"]
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/traditional_families.js b/src/libs/routes/SMPPIR/traditional_families.js
new file mode 100644
index 00000000..67704975
--- /dev/null
+++ b/src/libs/routes/SMPPIR/traditional_families.js
@@ -0,0 +1,130 @@
+/*
+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 cad_unico = 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: 'year',
+    table: 'traditional_families_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo',
+    },
+})
+
+.addValue({
+    name: 'family_type',
+    table: 'traditional_families_ag',
+    tableField: 'ind_tipo_familia',
+    resultField: 'ind_parc_mds_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ind_tipo_familia',
+    },
+})
+
+.addValue({
+    name: 'per_capita_income',
+    table: 'traditional_families_ag',
+    tableField: 'renda_media',
+    resultField: 'vlr_renda_media_fam',
+    where: {
+        relation: '=',
+        type: 'float',
+        field: 'renda_media',
+    },
+})
+
+.addValue({
+    name: 'home_type',
+    table: 'traditional_families_ag',
+    tableField: 'cod_especie_domicilio',
+    resultField: 'cod_especie_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_especie_domicilio',
+    },
+})
+
+.addValue({
+    name: 'uf',
+    table: 'traditional_families_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado',
+    },
+})
+.addValue({
+    name: 'region',
+    table: 'traditional_families_ag',
+    tableField : 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao',
+    },
+})
+
+;
+
+
+cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
+    console.log(req.sql.toString());
+    // Use COUNT to get Family and SUM to get people, as the indicator needs families, COUNT is being used.
+    req.sql.field('COUNT(DISTINCT id_familia) AS Total')
+        .from('traditional_families_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico;
diff --git a/src/libs/routes/SMPPIR/traditional_families_people.js b/src/libs/routes/SMPPIR/traditional_families_people.js
new file mode 100644
index 00000000..ada6d513
--- /dev/null
+++ b/src/libs/routes/SMPPIR/traditional_families_people.js
@@ -0,0 +1,106 @@
+/*
+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 cad_unico = 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: 'year',
+    table: 'traditional_families_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo',
+    },
+})
+
+.addValue({
+    name: 'education_families',
+    table: 'traditional_families_ag',
+    tableField: 'curso_frequentou',
+    resultField: 'cod_curso_frequentou_pessoa_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'curso_frequentou',
+    },
+})
+
+.addValue({
+    name: 'uf',
+    table: 'traditional_families_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado',
+    },
+})
+.addValue({
+    name: 'region',
+    table: 'traditional_families_ag',
+    tableField : 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao',
+    },
+})
+
+;
+
+
+cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
+    console.log(req.sql.toString());
+    // Use COUNT to get Family and SUM to get people, as the indicator needs families, COUNT is being used.
+    req.sql.field('SUM(total) AS Total')
+        .from('traditional_families_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico;
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 27f59dd7..d4b1f738 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -96,6 +96,10 @@ const sim = require(`${libs}/routes/SMPPIR/sim`)
 
 const taxa_homicidios = require(`${libs}/routes/SMPPIR/taxa_homicidios`)
 
+const traditional_families = require(`${libs}/routes/SMPPIR/traditional_families`)
+
+const traditional_families_people = require(`${libs}/routes/SMPPIR/traditional_families_people`)
+
 const universityEnrollment = require(`${libs}/routes/universityEnrollment`);
 
 const courseCount = require(`${libs}/routes/courseCount`);
@@ -144,5 +148,7 @@ api.use('/youth_jobs', youth_jobs)
 api.use('/youth_education', youth_education)
 api.use('/sim', sim)
 api.use('/taxa_homicidios', taxa_homicidios)
+api.use('/traditional_families', traditional_families)
+api.use('/traditional_families_people', traditional_families_people)
 
 module.exports = api;
-- 
GitLab


From b91b07c4d81fbba6c53d5f06eaeb1ce20982ecdb Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
Date: Wed, 5 Aug 2020 09:15:12 -0300
Subject: [PATCH 04/39] Add missing API Spec

Signed-off-by: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
---
  SMPPIR-API Specification.yaml  | 2973 +++++++++++++++++++++++++++++++
 1 file changed, 2973 insertions(+)
 create mode 100644  SMPPIR-API Specification.yaml 

diff --git a/ SMPPIR-API Specification.yaml  b/ SMPPIR-API Specification.yaml 
new file mode 100644
index 00000000..a79e6491
--- /dev/null
+++ b/ SMPPIR-API Specification.yaml 	
@@ -0,0 +1,2973 @@
+# Specification of SMPPIR API using OpenAPI 3.0
+# For the specification of OpenAPI 3.0, please refer to: https://swagger.io/docs/specification/about/
+openapi: "3.0.0"
+info:
+  version: 1.0.0
+  title: SMPPIR - API
+  description: 'This API provides access to quotas data based in [INEP - Census of higher education](http://portal.inep.gov.br/web/guest/microdados), [PNAD - People information](http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40), [FIES](http://www.fnde.gov.br/dadosabertos/dataset/fundo-de-financiamento-estudantil-fies), [PROUNI](http://dadosabertos.mec.gov.br/prouni)'
+ 
+servers:
+  - url: http://seppirdev.c3sl.ufpr.br:4000/api/v1
+
+tags:
+  - name: INEP
+    description: "Contains queries made with data from the INEP database listed above. This section's concern is the undergraduation students"
+    externalDocs:
+      url: http://portal.inep.gov.br/web/guest/microdados
+  - name: FIES
+    description: "Contains queries made with data from the FIES database listed above. This section's concern is the loan for undergraduation students"
+    externalDocs:
+      url: http://www.fnde.gov.br/dadosabertos/dataset/fundo-de-financiamento-estudantil-fies
+  - name: PNAD
+    description: "Contains queries made with data from the PNAD database listed above. This section's concern is the educational level of the population between 18 and 24 years old"
+    externalDocs:
+      url: http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40
+  - name: PROUNI
+    description: "Contains queries made with data from the PROUNI database listed above. This section's concern is the federal scholarship"
+    externalDocs:
+      url: http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40
+#  - name: IBGE - Census
+#    description: "Contains queries made with data from IBGE Census"
+#    externalDocs:
+#url:  https://ww2.ibge.gov.br/home/estatistica/populacao/censo2010/resultados_gerais_amostra/resultados_gerais_amostra_tab_uf_microdados.shtm
+  - name: CadÚnico
+    description: "Contains queries made with data from CadÚnico"
+    externalDocs:
+      url: https://aplicacoes.mds.gov.br/sagi/portal/index.php?grupo=212 
+  - name: EXTRA
+    description: "Contains data from auxiliary extra routes"
+    externalDocs:
+      url:  https://ww2.ibge.gov.br/home/estatistica/populacao/censo2010/resultados_gerais_amostra/resultados_gerais_amostra_tab_uf_microdados.shtm
+
+paths:
+  /admission:
+    get:
+      summary: Return the number of quotasholder that entered in a federal institution. This route uses the INEP database listed above
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - shift
+                - gender
+                - ethnic
+                - course
+                - institution
+                - institution_cod
+                - year
+                - min_year
+                - max_year
+                - cod_offer_location
+                - name_offer_location
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Noturno"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: array
+                  items:
+                    type: string
+                gender:
+                  type: array
+                  items:
+                    type: string
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_code:
+                  type: array
+                  items:
+                    type: integer
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                cod_offer_location:
+                  type: array
+                  items:
+                    type: integer
+                name_offer_location:
+                  type: array
+                  items:
+                    type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/BasicInepReturn'
+        '404':
+          description: no data found
+  /evader:
+    get:
+      summary: Return the number of quotasholder that had been studying in a federal institution and drop out. This route uses the INEP database listed above
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - shift
+                - gender
+                - ethnic
+                - course
+                - institution
+                - institution_cod
+                - year
+                - min_year
+                - max_year
+                - cod_offer_location
+                - name_offer_location
+                - region
+                - uf
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Noturno"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: array
+                  items:
+                    type: string
+                gender:
+                  type: array
+                  items:
+                    type: string
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_code:
+                  type: array
+                  items:
+                    type: integer
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                cod_offer_location:
+                  type: array
+                  items:
+                    type: integer
+                name_offer_location:
+                  type: array
+                  items:
+                    type: string
+                region:
+                  type: array
+                  items:
+                    type: string
+                uf:
+                  type: array
+                  items:
+                    type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/BasicInepReturnWithLocationInfo'
+        '404':
+          description: no data found  
+  /extracurricular_activities:
+    get:
+      summary: Return the number of quotasholder that studie in a federal institution and do any type of extracurricular activity (Intership, Teacher's Assistant, etc.). This route uses the INEP database listed above
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - shift
+                - gender
+                - ethnic
+                - course
+                - institution
+                - institution_cod
+                - year
+                - min_year
+                - max_year
+                - cod_offer_location
+                - name_offer_location
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Noturno"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: array
+                  items:
+                    type: string
+                gender:
+                  type: array
+                  items:
+                    type: string
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_code:
+                  type: array
+                  items:
+                    type: integer
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                cod_offer_location:
+                  type: array
+                  items:
+                    type: integer
+                name_offer_location:
+                  type: array
+                  items:
+                    type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/BasicInepReturn'
+        '404':
+          description: no data found  
+  /fies:
+    get:
+      summary: Return the number of students that got a loan from FIES. This route uses the FIES database listed above
+      tags:
+        - FIES
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - gender
+                - ethnic
+                - course
+                - institution
+                - institution_cod
+                - offer_location
+                - loan
+                - loan_type
+                - uf
+                - region
+                - year
+                - min_year
+                - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: gender:"Feminino",ethnic:["Branco","Pardo"]
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                gender:
+                  type: array
+                  items:
+                    type: string
+                    enum: ['Masculino', 'Feminino']
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                    enum: ['Amarelo', 'Branco', 'Negro', 'Pardo', 'Índio']
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_cod:
+                  type: array
+                  items:
+                    type: integer
+                offer_location:
+                  type: array
+                  items:
+                    type: string
+                loan:
+                  type: array
+                  items:
+                    type: integer
+                    enum: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ]
+                loan_type:
+                  type: array
+                  items:
+                    type: string
+                    enum: ["F", "N", "S"]
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                region:
+                  type: array
+                  items:
+                    type: string
+                    enum: [ 'Norte', 'Nordeste', 'Centro-Oeste', 'Sul', 'Sudeste' ]
+                uf:
+                  type: array
+                  items:
+                    type: string
+                    enum: [ 'AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SP', 'SE', 'TO' ]
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/FiesReturn'
+        '404':
+          description: no data found  
+  /graduate:
+    get:
+      summary: Return the number of quotasholder that had been studying in a federal institution and finished their studies
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - shift
+                - gender
+                - ethnic
+                - course
+                - institution
+                - institution_cod
+                - year
+                - min_year
+                - max_year
+                - cod_offer_location
+                - name_offer_location
+                - region
+                - uf
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Noturno"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: array
+                  items:
+                    type: string
+                gender:
+                  type: array
+                  items:
+                    type: string
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_code:
+                  type: array
+                  items:
+                    type: integer
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                cod_offer_location:
+                  type: array
+                  items:
+                    type: integer
+                name_offer_location:
+                  type: array
+                  items:
+                    type: string
+                region:
+                  type: array
+                  items:
+                    type: string
+                uf:
+                  type: array
+                  items:
+                    type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/BasicInepReturnWithLocationInfo'
+        '404':
+          description: no data found
+  
+  /course:
+    get:
+      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the INEP database listed above
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - year
+               - min_year
+               - max_year
+               - uf
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2015", uf:"PR"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: number
+                min_year:
+                  type: number
+                max_year:
+                  type: number
+                uf:
+                  type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/course'
+        '404':
+          description: no data found  
+ 
+  /courseFIES:
+    get:
+      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the FIES database listed above
+      tags:
+        - FIES
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - year
+               - min_year
+               - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2015"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: number
+                min_year:
+                  type: number
+                max_year:
+                  type: number
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/coursePROUNI'
+        '404':
+          description: no data found  
+
+  /coursePROUNI:
+    get:
+      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the PROUNI database listed above
+      tags:
+        - PROUNI
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - year
+               - min_year
+               - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2015"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: number
+                min_year:
+                  type: number
+                max_year:
+                  type: number
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/courseFIES'
+        '404':
+          description: no data found  
+          
+  /institution:
+    get:
+      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the INEP database listed above
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - year
+               - min_year
+               - max_year
+               - uf
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2015", uf:"PR"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: number
+                min_year:
+                  type: number
+                max_year:
+                  type: number
+                uf:
+                  type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/institution'
+        '404':
+          description: no data found  
+          
+  /institutionFIES:
+    get:
+      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the FIES database listed above
+      tags:
+        - FIES
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - year
+               - min_year
+               - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2015"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: number
+                min_year:
+                  type: number
+                max_year:
+                  type: number
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/institutionFIES'
+        '404':
+          description: no data found            
+          
+  /institutionPROUNI:
+    get:
+      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the PROUNI database listed above
+      tags:
+        - PROUNI
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - year
+               - min_year
+               - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2015"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: number
+                min_year:
+                  type: number
+                max_year:
+                  type: number
+
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/institutionPROUNI'
+        '404':
+          description: no data found            
+  
+  /ibge_code:
+    get:
+      summary: Return the name and code of a city as well as the code for the state the city is in. This route uses the IBGE database listed above.
+      tags:
+        - EXTRA
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - city_name
+               - city_code
+               - state
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: city_name:"Curitiba", state:"17"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                city_name:
+                  type: string
+                city_code:
+                  type: number
+                state:
+                  type: number
+
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ibge_code'
+        '404':
+          description: no data found  
+          
+  /institutionPrivate:
+    get:
+      summary: Return the existing IFES(Instituto Federal de Educação Superior) that are private. This route uses the INEP database listed above
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,uf
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+               - year
+               - min_year
+               - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2015"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: number
+                min_year:
+                  type: number
+                max_year:
+                  type: number
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/institutionPrivate'
+        '404':
+          description: no data found   
+     
+  /vacancy:
+    get:
+      summary: Return the number of quotasholder spots that are open to students in a federal institution
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - region
+                - uf
+                - cod_ies
+                - campus
+                - course
+                - shift
+                - name_ies
+                - year
+                - min_year
+                - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Noturno"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: array
+                  items:
+                    type: string
+                gender:
+                  type: array
+                  items:
+                    type: string
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_code:
+                  type: array
+                  items:
+                    type: integer
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                cod_offer_location:
+                  type: array
+                  items:
+                    type: integer
+                name_offer_location:
+                  type: array
+                  items:
+                    type: string
+                region:
+                  type: array
+                  items:
+                    type: string
+                uf:
+                  type: array
+                  items:
+                    type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/vacancy'
+        '404':
+          description: no data found
+          
+  /pnad:
+    get:
+      summary: Return the number of people obtained by IBGE in the PNAD research. This route uses the PNAD database listed above
+      tags:
+        - PNAD
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: level_of_education,type_of_school
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - ethnic
+                - type_of_school
+                - type_of_public_school
+                - level_of_education
+                - uf
+                - region
+                - year
+                - min_year
+                - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: level_of_education:["2","6"],type_of_school:"4"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                ethnic:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['0', '2', '4', '6', '8', '9']
+                type_of_school:
+                    type: "array"
+                    items: 
+                        type: "string"
+                        enum: ['2', '4']
+                type_of_public_school:
+                    type: "array"
+                    items: 
+                        type: "string"
+                        enum: ['2','4','6']
+                level_of_education:
+                    type: "array"
+                    items: 
+                        type: "string"
+                        enum: ['1','2','3','4','5','6','10','11']
+                uf:
+                    type: "array"
+                    items: 
+                        type: "string"
+                        enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
+                region:
+                    type: "array"
+                    items: 
+                        type: "string"
+                        enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
+                year:
+                    type: "array"
+                    items: 
+                        type: "integer"
+                min_year:
+                    type: "integer"
+                max_year:
+                    type: "integer"
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/PnadReturn'
+        '404':
+          description: no data found
+  /prouni:
+    get:
+      summary: Return the number of people that received a scholarship from PROUNI. This route uses the PROUNI database listed above
+      tags:
+        - PROUNI
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - shift
+                - gender
+                - ethnic
+                - course
+                - institution
+                - scholarship
+                - uf
+                - region
+                - year
+                - min_year
+                - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Curso a distância"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: "string"
+                  enum: ["Curso a distância", "Integral", "Matutino", "Noturno", "Vespertino"]
+                gender:
+                  type: "string"
+                  enum: ["Masculino", "Feminino"]
+                ethnic:
+                  type: "string"
+                  enum: ["Amarela", "Branca", "Indígena", "Não Informada", "Parda", "Preta"]
+                course:
+                  type: "string"
+                institution:
+                  type: "string"
+                scholarship:
+                  type: "string"
+                  enum: ["BOLSA INTEGRAL", "BOLSA PARCIAL 50%"]
+                uf:
+                    type: "array"
+                    items: 
+                        type: "string"
+                        enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
+                region:
+                    type: "array"
+                    items: 
+                        type: "string"
+                        enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
+                year:
+                    type: "array"
+                    items: 
+                        type: "integer"
+                min_year:
+                    type: "integer"
+                max_year:
+                    type: "integer"
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ProuniReturn'
+        '404':
+          description: no data found
+  /social_support:
+    get:
+      summary: Return the number of quotasholder that had been studying in a federal institution and had some sort of social support
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - shift
+                - gender
+                - ethnic
+                - course
+                - institution
+                - institution_cod
+                - food_support
+                - support
+                - work_support
+                - courseware_support
+                - housing_support
+                - transport_support
+                - year
+                - min_year
+                - max_year
+                - cod_offer_location
+                - name_offer_location
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Noturno"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: array
+                  items:
+                    type: string
+                gender:
+                  type: array
+                  items:
+                    type: string
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_code:
+                  type: array
+                  items:
+                    type: integer
+                food_support:
+                  type: array
+                  items:
+                    type: string
+                support:
+                  type: array
+                  items:
+                    type: string
+                work_support:
+                  type: array
+                  items:
+                    type: string
+                courseware_support:
+                  type: array
+                  items:
+                    type: string
+                housing_support:
+                  type: array
+                  items:
+                    type: string
+                transport_support:
+                  type: array
+                  items:
+                    type: string
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                cod_offer_location:
+                  type: array
+                  items:
+                    type: integer
+                name_offer_location:
+                  type: array
+                  items:
+                    type: string
+
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/SocialSupportReturn'
+        '404':
+          description: no data found
+  /student_loans:
+    get:
+      summary: Return the number of quotasholder that had been studying in a federal institution and contracted some sort of loan
+      tags:
+        - INEP
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift,gender,ethnic
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - cod_offer_location
+                - name_offer_location
+                - shift
+                - gender
+                - ethnic
+                - course
+                - institution
+                - institution_cod
+                - refund_fies
+                - refund_state
+                - refund_city
+                - refund_edu_inst
+                - refund_org
+                - refund_others
+                - no_refund_prouni_integral
+                - no_refund_prouni_partial
+                - no_refund_state
+                - no_refund_city
+                - no_refund_edu_inst
+                - no_refund_org
+                - no_refund_others
+                - year
+                - min_year
+                - max_year
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: shift:["Integral","Noturno"],gender:"Feminino"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                shift:
+                  type: array
+                  items:
+                    type: string
+                gender:
+                  type: array
+                  items:
+                    type: string
+                ethnic:
+                  type: array
+                  items:
+                    type: string
+                course:
+                  type: array
+                  items:
+                    type: string
+                institution:
+                  type: array
+                  items:
+                    type: string
+                institution_code:
+                  type: array
+                  items:
+                    type: integer
+                refund_fies:
+                  type: array
+                  items:
+                      type: string
+                refund_state:
+                  type: array
+                  items:
+                      type: string
+                refund_city:
+                  type: array
+                  items:
+                      type: string
+                refund_edu_inst:
+                  type: array
+                  items:
+                      type: string
+                refund_org:
+                  type: array
+                  items:
+                      type: string
+                refund_others:
+                  type: array
+                  items:
+                      type: string
+                no_refund_prouni_integral:
+                  type: array
+                  items:
+                      type: string
+                no_refund_prouni_partial:
+                  type: array
+                  items:
+                      type: string
+                no_refund_state:
+                  type: array
+                  items:
+                      type: string
+                no_refund_city:
+                  type: array
+                  items:
+                      type: string
+                no_refund_edu_inst:
+                  type: array
+                  items:
+                      type: string
+                no_refund_org:
+                  type: array
+                  items:
+                      type: string
+                no_refund_others:
+                  type: array
+                  items:
+                      type: string
+                year:
+                  type: array
+                  items:
+                    type: integer
+                min_year:
+                  type: integer
+                max_year:
+                  type: integer
+                cod_offer_location:
+                  type: array
+                  items:
+                    type: integer
+                name_offer_location:
+                  type: array
+                  items:
+                    type: string
+                region:
+                  type: array
+                  items:
+                    type: string
+                uf:
+                  type: array
+                  items:
+                    type: string
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/InepLoanReturn'
+        '404':
+          description: no data found
+  
+#  /ibge_census:
+#    get:
+#      summary: Return the number of people obtained by IBGE in the last census. This route uses the IBGE data listed above
+#      tags:
+#        - IBGE - Census
+#      parameters:
+#        - name: dims
+#          in: query
+#          description: Group data using a metric parameter
+#          allowReserved: true
+#          required: false
+#          explode: false
+#          style: form
+#          example: ethnic,gender
+#          schema:
+#            type: array
+#            items:
+#              type: string
+#              enum:
+#                - ethnic
+#                - gender
+#                - religion
+#                - income_range
+#                - age
+#                - age_greater_than
+#                - age_lesser_than
+#                - highest_education
+#                - school_daycare
+#                - work_status
+#                - education_level
+#                - ocupation_position_and_category
+#                - home_status
+#                - work_condition
+#                - mensal_home_income_range
+#                - relation_homeowner
+#        - name: filter
+#          in: query
+#          description: Filter data
+#          allowReserved: true
+#          required: false
+#          explode: false
+#          style: form
+#          example: ethnic:["2","6"],gender:"1"
+#          schema:
+#            type: array
+#            items:
+#              type: object
+#              properties:
+#                ethnic:
+#                  type: "array"
+#                  items: 
+#                      type: "string"
+#                      enum: ['1', '2', '3', '4', '5', '9']
+#                gender:
+#                    type: "array"
+#                    items: 
+#                        type: "string"
+#                        enum: ['1', '2']
+#                religion:
+#                    type: "array"
+#                    items: 
+#                        type: "string"
+#                        enum: ['0', '1', '2', '110', '111', '112', '120', '130', '140', '149', '199', '210', '219', '220', '221', '222', '223', '224', '225', '229', '230', '231', '232', '239', '240', '241', '242', '243', '244', '245', '249', '250', '251', '259', '260', '261', '262', '269', '270', '279', '280', '289', '300', '310', '311', '312', '319', '320', '329', '330', '339', '340', '349', '350', '359', '360', '369', '370', '379', '380', '389', '390', '399', '400', '401', '409', '420', '429', '430', '439', '440', '449', '450', '451', '452', '453', '454', '455', '460', '469', '470', '479', '480', '489', '490', '492', '499', '510', '519', '520', '529', '530', '590', '599', '610', '619', '620', '629', '630', '639', '640', '641', '649', '710', '711', '719', '740', '741', '749', '750', '751', '752', '753', '754', '755', '759', '760', '761', '762', '763', '764', '765', '766', '790', '791', '792', '793', '799', '810', '811', '819', '820', '821', '829', '830', '831', '832', '834', '839', '850', '890', '891', '892', '893', '894', '895', '896', '990', '999', ]
+#                income_range:
+#                    type: "array"
+#                    items: 
+#                        type: "number"
+#                age:
+#                    type: "array"
+#                    items: 
+#                        type: "integer"
+#                age_greater_than:
+#                    type: "array"
+#                    items: 
+#                        type: "integer"
+#                age_lesser_than:
+#                    type: "array"
+#                    items: 
+#                        type: "integer"
+#                highest_education:
+#                    type: "array"
+#                    items: 
+#                        type: "string"
+#                        enum: [null, '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14']    
+#                school_daycare:
+#                    type: "array"
+#                    items: 
+#                        type: "string"
+#                        enum: ['1', '2','3', '4']
+#                work_status:
+#                    type: "array"
+#                    items: 
+#                        type: "string"
+#                        enum: [null, '1', '2']
+#                education_level:
+#                    type: "array"
+#                    items: 
+#                        type: "string"
+#                        enum: ['1', '2', '3', '4', '5']
+#                ocupation_position_and_category:
+#                    type: "array"
+#                    items: 
+#                        type: "string"
+#                        enum: ['1', '2']    
+#                home_status: 
+#                    type: "array"
+#                    items:
+#                        type: "string"
+#                        enum: ['1', '2']    
+#                work_condition: 
+#                    type: "array"
+#                    items:
+#                        type: "string"
+#                        enum: [null, '1', '2']   
+#                mensal_home_income_range: 
+#                    type: "array"
+#                    items:
+#                        type: "number"  
+#                relation_homeowner: 
+#                    type: "array"
+#                    items:
+#                        type: "string" 
+#                        enum: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']
+#
+#      responses:
+#        '200':
+#          description: successful operation
+#          content:
+#            application/json:
+#              schema:
+#                $ref: '#/components/schemas/IBGECensusReturn'
+#        '404':
+#          description: no data found
+
+#  /cad_unico:
+#    get:
+#      summary: Return the number of people and families from that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
+#      tags:
+#        - CadÚnico
+#      parameters:
+#        - name: dims
+#          in: query
+#          description: Group data using a metric parameter
+#          allowReserved: true
+#          required: false
+#          explode: false
+#          style: form
+#          example: year,home_type
+#          schema:
+#            type: array
+#            items:
+#              type: string
+#              enum:
+#                - year
+#                - per_capita_income
+#                - home_type
+#                - home_location
+#                - education_families
+#                - education_families_level
+#                - education_families_conclude
+#        - name: filter
+#          in: query
+#          description: Filter data
+#          allowReserved: true
+#          required: false
+#          explode: false
+#          style: form
+#          example: ethnic:["2","6"],gender:"1"
+#          schema:
+#            type: array
+#            items:
+#              type: object
+#              properties:
+#                year:
+#                  type: "array"
+#                  items: 
+#                      type: "string"
+#                      enum: ['2012', '2013', '2014', '2015', '2016']
+#                per_capita_income:
+#                  type: "array"
+#                  items:
+#                    type: "string"
+#                home_type:
+#                  type: "array"
+#                  items:
+#                    type: "string"
+#                    enum: [null, '1','2','3']
+#                home_location:
+#                  type: 'array'
+#                  items:
+#                    type: "number"
+#                education_families_conclude:
+#                  type: "array"
+#                  items:
+#                    type: "string"
+#                    enum: [null, '1', '2']
+#                education_families:
+#                  type: 'array'
+#                  items:
+#                    type: "string"
+#                    enum: [null, '1','2','3','4','5','6','7','8','9','10','11','12','13','14','15']
+#                education_families_level:
+#                  type: 'array'
+#                  items:
+#                    type: "string"
+#                    enum: [null,'1','2','3','4','5','6','7','8','9','10']
+
+#      responses:
+#        '200':
+#          description: successful operation
+#          content:
+#            application/json:
+#              schema:
+#                $ref: '#/components/schemas/CadUnicoReturn'
+#        '404':
+#          description: no data found
+                  
+  /african_culture:
+    get:
+      summary: Return the type of house and location of the houses that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
+      tags:
+        - CadÚnico      
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,home_type
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - year
+                - cod_local_home
+                - home_type
+                - home_location
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: ethnic:["2","6"],gender:"1"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
+                cod_local_home:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2']
+                home_type:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','3']
+                home_location:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1301902','1303809', '1304237','1500107','1502806','1503705','1503903','1504604','1504901','1505205']
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/AfricanCulture'
+        '404':
+          description: no data found
+          
+  /african_rights:
+    get:
+      summary: Return the education level and number of families that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
+      tags:
+        - CadÚnico      
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,home_type
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - year
+                - education_families_conclude
+                - education_families_level
+                - education_families
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: ethnic:["2","6"],gender:"1"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
+                education_families_conclude:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','null']
+                education_families_level:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','3','4','5','6','7','8','9','null']
+                education_families:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['3','4','5','6','7','8','9','12','13','null']
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/AfricanRights'
+        '404':
+          description: no data found
+
+  /african_sustentability:
+    get:
+      summary: Return the average per capita income from families that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
+      tags:
+        - CadÚnico      
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,home_type
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - year
+                - family_type
+                - per_capita_income
+
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: ethnic:["2","6"],gender:"1"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
+                vlr_renda_media_fam:
+                  type: "array"
+                  items:
+                    type: "number"
+                    minimum: 0
+                    maximum: 3000
+                    
+
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/AfricanSustentability'
+        '404':
+          description: no data found
+          
+  /eixo_2:
+    get:
+      summary: Return the infraestructure and life quality information about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
+      tags:
+        - CadÚnico      
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,home_type
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - year
+                - family_type
+                - cod_local_home
+                - cod_home_lighting
+                - cod_home_trash_destiny
+                - cod_home_watter_supply
+                - cod_sanitary_dump
+                - home_type
+                - home_location
+                - uf
+                - region
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: ethnic:["2","6"],gender:"1"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
+                family_type:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['201','202','203','204','205','301','302','303','304','305','306','101','0','null']
+                cod_local_home:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2,','NA','null']
+                cod_home_lighting:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','3','4','5','6','NA','null']
+                cod_home_trash_destiny:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','3','4','5','6','null','NA']
+                cod_home_watter_supply:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','3','4','null','NA']
+                home_type:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1', '2', '3', 'null']  
+                uf:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
+                region:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']                       
+                cod_escoa_sanitario_domic_fam:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','3','4','5','6','null','NA']   
+                    
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Eixo2'
+        '404':
+          description: no data found
+
+  /eixo_3:
+    get:
+      summary: Return the local development and productive inclusion about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
+      tags:
+        - CadÚnico      
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,home_type
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - year
+                - family_type
+                - cod_home_bolsa_familia
+                - cod_agriculture_job
+                - per_capita_income
+                - home_location
+                - uf
+                - region
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: ethnic:["2","6"],gender:"1"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
+                family_type:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['201','202','203','204','205','301','302','303','304','305','306','101','0','null']
+                cod_home_bolsa_familia:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['0','1','null']
+                cod_agriculture_job:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['0','1','null','NA']
+                per_capita_income:
+                  type: "array"
+                  items:
+                    type: "string"
+                    minimum: 0
+                    maximum: 2800
+                home_location:    
+                  type: "array"
+                  items:
+                    type: "string"
+                    minimum: 1100015
+                    maximum: 5300108
+                uf:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
+                region:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']   
+
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Eixo3'
+        '404':
+          description: no data found
+          
+  /eixo_4:
+    get:
+      summary: Return the rights and citizenship information about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
+      tags:
+        - CadÚnico      
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,home_type
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - year
+                - cod_local_home
+                - age
+                - education_families_conclude
+                - education_families_level
+                - education_families
+                - uf
+                - region
+                - gender
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: ethnic:["2","6"],gender:"1"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
+                age:
+                  type: "array"
+                  items:
+                    type: "string"
+                    minimum: 0
+                    maximum: 128
+                education_families_conclude:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','null']
+                education_families_level:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','1','3','4','5','6','7','8','9','10']
+                education_families:    
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','null']
+                uf:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
+                region:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']   
+                gender:
+                  type: "array"
+                  items:
+                    type: "string"
+                    enum: ['1','2','null']   
+
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Eixo4'
+        '404':
+          description: no data found
+          
+  /quilombola_metrics:
+    get:
+      summary: Return the useful metrics for quilombola families obtained by CadÚnico, like the maximum, minimum and average income they have, per year. This route uses the CadUnico data listed above
+      tags:
+        - CadÚnico      
+      parameters:
+        - name: dims
+          in: query
+          description: Group data using a metric parameter
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year,home_type
+          schema:
+            type: array
+            items:
+              type: string
+              enum:
+                - year
+
+        - name: filter
+          in: query
+          description: Filter data
+          allowReserved: true
+          required: false
+          explode: false
+          style: form
+          example: year:"2016"
+          schema:
+            type: array
+            items:
+              type: object
+              properties:
+                year:
+                  type: "array"
+                  items: 
+                      type: "string"
+                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
+ 
+
+      responses:
+        '200':
+          description: successful operation
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/metrics'
+        '404':
+          description: no data found          
+        
+components:
+  schemas:
+
+    Eixo2:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in quilombola_eixo_2 queries
+      properties:
+        total:
+          type: "number"
+        ano_pesquisa:
+          type: "number"
+        ind_parc_mds_fam:
+          type: "number"
+        cod_local_domic_fam:
+          type: "number"
+        cod_iluminacao_domic_fam:
+          type: "number"
+        cod_destino_lixo_domic_fam:
+          type: "number"
+        cod_abaste_agua_domic_fam:
+          type: "number"
+        cod_especie_domic_fam:
+          type: "number"
+        uf:
+          type: "string"
+        region:
+          type: "string"
+        cod_escoa_sanitario_domic_fam:
+          type: "number"
+    Eixo3:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in quilombola_eixo_3 queries
+      properties:
+        total:
+          type: "number"
+        ano_pesquisa:
+          type: "number"
+        ind_parc_mds_fam:
+          type: "number"
+        marc_pbf:
+          type: "number"
+        ind_familia_quilombola_fam:
+          type: "number"
+        cod_agricultura_trab_memb:
+          type: "number"
+        vlr_renda_media_fam:
+          type: "number"
+        cd_ibge:
+          type: "number"
+        uf:
+          type: "string"
+        region:
+          type: "string"
+        cod_escoa_sanitario_domic_fam:
+          type: "number"
+   
+    Eixo4:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in quilombola_eixo_3 queries
+      properties:
+        total:
+          type: "number"
+        ano_pesquisa:
+          type: "number"
+        idade:
+          type: "number"
+        cod_concluiu_frequentou_memb:
+          type: "string"
+        cod_ano_serie_frequentou_memb:
+          type: "string"
+        cod_curso_frequentou_pessoa_memb:
+          type: "string"
+        uf:
+          type: "string"
+        region:
+          type: "string"
+        genero:
+          type: "string"    
+          
+    metrics:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in quilombola_metrics queries
+      properties:
+        ano_pesquisa:
+          type: "number"
+
+    AfricanSustentability:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in african_rights queries
+      properties:
+        total:
+          type: "number"
+        ano_pesquisa:
+          type: "number"
+        vlr_renda_media_fam:
+          type: "number"
+
+          
+    AfricanRights:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in african_rights queries
+      properties:
+        total:
+          type: "number"
+        ano_pesquisa:
+          type: "number"
+        cod_concluiu_frequentou_memb:
+          type: "string"
+        cod_ano_serie_frequentou_memb:
+          type: "string"
+        cod_curso_frequentou_pessoa_memb:
+          type: "string"
+          
+    AfricanCulture:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in african_culture queries
+      properties:
+        total:
+          type: "number"
+        ano_pesquisa:
+          type: "number"
+        cod_local_domic_fam:
+          type: "string"
+        cod_especie_domic_fam:
+          type: "string"
+        cd_ibge:
+          type: "string"
+        
+#    CadUnicoReturn:
+#      type: object
+#      required: ['total']
+#      description: | 
+#        This model represents the return possibilities in CadUnico queries
+#      properties:
+#        total:
+#          type: "number"
+#        ano_pesquisa: 
+#          type: "number"
+#        vlr_renda_media_fam:      
+#          type: "number"
+#        cod_especie_domic_fam: 
+#          type: "string"
+#        cd_ibge: 
+#          type: "string"
+#        cod_concluiu_frequentou_memb: 
+#          type: "string"  
+#        cod_ano_serie_frequentou_memb:
+#          type: "string"     
+#        cod_curso_frequentou_pessoa_memb:
+#          type: "string"  
+          
+    course:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in course queries
+      properties:
+        total:
+          type: "number"
+        year:
+          type: "number"
+        uf: 
+          type: "string"
+    courseFIES:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in courseFIES queries
+      properties:
+        total:
+          type: "number"
+        year:
+          type: "number"
+        uf: 
+          type: "string"
+    coursePROUNI:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in course queries
+      properties:
+        total:
+          type: "number"
+        year:
+          type: "number"
+        uf: 
+          type: "string"      
+    institution:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in institution queries
+      properties:
+        total:
+          type: "number"
+        year:
+          type: "number"
+        uf: 
+          type: "string"  
+
+    institutionFIES:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in institutionFIES queries
+      properties:
+        total:
+          type: "number"
+        year:
+          type: "number"
+          
+    institutionPROUNI:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in institutionPROUNI queries
+      properties:
+        total:
+          type: "number"
+        year:
+          type: "number"
+          
+          
+    institutionPrivate:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in institution queries
+      properties:
+        total:
+          type: "number"
+        year:
+          type: "number"
+        uf: 
+          type: "string"   
+          
+    ibge_code:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in ibge_code queries
+      properties:
+        no_cidade:
+          type: "string"
+        co_cidade:
+          type: "number"
+        sgl_estado: 
+          type: "string"           
+          
+#    IBGECensusReturn:
+#      type: object
+#      required: ['total']
+#      description: |
+#        This model represents the return possibilities in IBGE Census queries
+#      properties:
+#        total:
+#          type: "number"
+#        co_cor_raca:
+#          type:  "string"
+##        co_sexo:
+#          type:  "string"
+#        co_religiao:
+#          type:  "string"
+#        nu_sal_min_todos_trabalhos:
+#          type: "number"
+#        nu_idade_calculada_anos:
+#          type: "number" 
+#        co_curso_mais_elevado_freq:
+#          type: "string" 
+ #       co_freq_escola_creche:
+#          type: "string"
+#        co_condicao_atividade_semana_ref:
+#          type: "string" 
+#       co_nivel_instrucao:
+#         type: "string" 
+#        co_posicao_na_ocupacao_e_categoria_do_emprego:
+#          type: "string" 
+#        co_situacao_dom:
+#          type: "string" 
+#        co_condicao_ocupacao_semana_ref:
+#          type: "string" 
+#        vl_rendimneto_mensal_domicilio_sal_min_per_capita:
+#          type: "number" 
+#        co_relacao_responsavel_dom:
+#          type: "string"   
+          
+    BasicInepReturn:
+      type: object
+      required: ['result']
+      description: |
+        This model represents the return possibilities in INEP queries when location information is not needed.
+        Note that there will always exists the total and no_ano_pesquisa keys.
+        All the other keys are optional and appear if the dims paramter is used.
+      properties:
+        result:
+          type: array
+          items:
+            type: object
+            required: ['total', 'no_ano_pesquisa']
+            properties:
+              total:
+                type: "number"
+              no_ano_pesquisa:
+                type: "integer"
+                format: "int32"
+              ds_turno_aluno:
+                type: "string"
+                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
+              ds_sexo_aluno:
+                type: "string"
+                enum: ['Masculino', 'Feminino']
+              ds_cor_raca_aluno:
+                type: "string"
+                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
+              no_curso:
+                type: "string"
+              no_ies:
+                type: "string"
+              co_ies:
+                type: "integer"
+              co_local_oferta:
+                type: "integer"
+              no_local_oferta:
+                type: "string"
+    BasicInepReturnWithLocationInfo:
+      type: object
+      required: ['result']
+      description: |
+        This model represents the return possibilities in INEP queries when location information is needed.
+        Note that there will always exists the total and no_ano_pesquisa keys.
+        All the other keys are optional and appear if the dims paramter is used.
+      properties:
+        result:
+          type: array
+          items:
+            type: object
+            required: ['total', 'no_ano_pesquisa']
+            properties:
+              total:
+                type: "number"
+              no_ano_pesquisa:
+                type: "integer"
+                format: "int32"
+              ds_turno_aluno:
+                type: "string"
+                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
+              ds_sexo_aluno:
+                type: "string"
+                enum: ['Masculino', 'Feminino']
+              ds_cor_raca_aluno:
+                type: "string"
+                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
+              no_curso:
+                type: "string"
+              no_ies:
+                type: "string"
+              co_ies:
+                type: "integer"
+              co_local_oferta:
+                type: "integer"
+              no_local_oferta:
+                type: "string"
+              region:
+                type: "string"
+                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
+              uf:
+                type: "string"
+                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
+                
+    vacancy:
+      type: object
+      required: ['total']
+      description: |
+        This model represents the return possibilities in vacancy queries
+      properties:
+        total:
+          type: "number"
+        uf:
+          type: "string"
+        region:
+          type: "string"
+        year:
+          type: "number"
+        cod_ies:
+          type: "integer"
+        campus:
+          type: "string"
+        curso:
+          type: "string"
+        turno:
+          type: "string"
+        nome_ies:
+          type: "string"
+        cod_especie_domic_fam:
+          type: "number"
+        total_vagas_ampla_concorrencia_nao_pcd:
+          type: "number"
+        total_vagas_ampla_concorrencia_pcd:
+          type: "number"
+        total_vagas_cotas_renda_baixa_ppi_nao_pcd:
+          type: "number"
+        total_vagas_cotas_renda_baixa_ppi_pcd:
+          type: "number"
+        total_vagas_cotas_renda_baixa_outros_nao_pcd:
+          type: "number"
+        total_vagas_cotas_renda_baixa_outros_pcd:
+          type: "number"
+        total_vagas_cotas_renda_alta_ppi_nao_pcd:
+          type: "number"
+        total_vagas_cotas_renda_alta_ppi_pcd:
+          type: "number"
+        total_vagas_cotas_renda_alta_outros_nao_pcd:
+          type: "number"
+        total_vagas_cotas_renda_alta_outros_pcd:
+          type: "number"
+        total_total_pcd:
+          type: "number"
+
+
+          
+    FiesReturn:
+      type: object
+      required: ['result']
+      description: |
+        This model represents the return possibilities in FIES queries.
+        Note that there will always exists the total and nu_ano keys.
+        All the other keys are optional and appear if the dims paramter is used.
+      properties:
+        result:
+          type: array
+          items:
+            type: object
+            required: ['total', 'nu_ano']
+            properties:
+              total:
+                type: "number"
+              nu_ano:
+                type: "integer"
+                format: "int32"
+              ds_sexo:
+                type: "string"
+                enum: ['Masculino', 'Feminino']
+              ds_raca_cor:
+                type: "string"
+                enum: ['Amarelo','Branco','Negro','Pardo','Índio']
+              ds_curso:
+                type: "string"
+              no_ies:
+                type: "string"
+              co_ies:
+                type: "integer"
+              no_campus:
+                type: "string"
+              nu_percent_solicitado_financ:
+                type: integer
+                enum: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ]
+              tp_fianca:
+                type: "string"
+                enum: ["F", "N", "S"]
+                description: |
+                  Meanings of each letter:
+                
+                  F - Fundo de Garantia de Operações de Crédito Educativo – FGEDUC
+                  
+                  N - Normal/Convencional
+                  
+                  S - Solidária
+              region:
+                type: "string"
+                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
+              uf:
+                type: "string"
+                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
+    PnadReturn:
+      type: object
+      required: ['result']
+      description: |
+        This model represents the return possibilities in PNAD queries.
+        Note that there will always exists the total and nu_ano_referencia keys.
+        All the other keys are optional and appear if the dims paramter is used.
+      properties:
+        result:
+          type: array
+          items:
+            type: object
+            required: ['total', 'nu_ano_referencia']
+            properties:
+              total:
+                type: "number"
+              nu_ano_referencia:
+                type: "integer"
+                format: "int32"
+              co_cor_raca: 
+                type: "string"
+                enum: ['0', '2', '4', '6', '8', '9']
+              co_rede_ensino:
+                type: "string"
+                enum: ['2', '4']
+              co_area_rede_publica_ensino:
+                type: "string"
+                enum: ['2','4','6']
+              co_curso:
+                type: "string"
+                enum: ['1','2','3','4','5','6','10','11']
+              uf:
+                type: "string"
+                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"] 
+              region:
+                type: "string"
+                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
+    ProuniReturn:
+      type: object
+      required: ['result']
+      description: |
+        This model represents the return possibilities in PROUNI queries.
+        Note that there will always exists the total and ano_concessao_bolsa keys.
+        All the other keys are optional and appear if the dims paramter is used.
+      properties:
+        result:
+          type: array
+          items:
+            type: object
+            required: ['total', 'ano_concessao_bolsa']
+            properties:
+              total:
+                type: "number"
+              ano_concessao_bolsa:
+                type: "integer"
+                format: "int32"
+              nome_turno_curso_bolsa:
+              # shift
+                type: "string"
+                enum: ['Curso a distância', 'Integral', 'Matutino', 'Noturno', 'Vespertino']
+              sexo_beneficiario_bolsa:
+              # gender
+                type: "string"
+                enum: ["Masculino", "Feminino"]
+              raca_beneficiario_bolsa:
+              # ethnic
+                type: "string"
+                enum: ['Amarela', 'Branca', 'Indígena', 'Não Informada', 'Parda', 'Preta']
+              nome_curso_bolsa:
+              # course
+                type: "string"
+              nome_ies_bolsa:
+              # institution
+                type: "string"
+              tipo_bolsa:
+              # scholarship
+                type: "string"
+                enum: ["BOLSA INTEGRAL", "BOLSA PARCIAL 50%"]               
+              sigla_uf_beneficiario_bolsa:
+              # uf
+                type: "string"
+                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]            
+              regiao_beneficiario_bolsa:
+              # region
+                type: "string"
+                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
+    SocialSupportReturn:
+      type: object
+      required: ['result']
+      description: |
+        This model represents the return possibilities in INEP queries when location information is not needed.
+        Note that there will always exists the total and no_ano_pesquisa keys.
+        All the other keys are optional and appear if the dims paramter is used.
+      properties:
+        result:
+          type: array
+          items:
+            type: object
+            required: ['total', 'no_ano_pesquisa']
+            properties:
+              total:
+                type: "number"
+              no_ano_pesquisa:
+                type: "integer"
+                format: "int32"
+              ds_turno_aluno:
+                type: "string"
+                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
+              ds_sexo_aluno:
+                type: "string"
+                enum: ['Masculino', 'Feminino']
+              ds_cor_raca_aluno:
+                type: "string"
+                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
+              no_curso:
+                type: "string"
+              no_ies:
+                type: "string"
+              co_ies:
+                type: "integer"
+              co_local_oferta:
+                type: "integer"
+              no_local_oferta:
+                type: "string"  
+              in_apoio_alimentacao:
+                type: "string"
+                enum: ["0", "1"]
+              in_apoio_bolsa_pemanencia:
+                type: "string"
+                enum: ["0", "1"]
+              in_apoio_bolsa_trabalho:
+                type: "string"
+                enum: ["0", "1"]
+              in_apoio_material_didatico:
+                type: "string"
+                enum: ["0", "1"]
+              in_apoio_moradia:
+                type: "string"
+                enum: ["0", "1"]
+              in_apoio_transporte:
+                type: "string"
+                enum: ["0", "1"]
+    InepLoanReturn:
+      type: object
+      required: ['result']
+      description: |
+        This model represents the return possibilities in INEP queries when location information is not needed.
+        Note that there will always exists the total and no_ano_pesquisa keys.
+        All the other keys are optional and appear if the dims paramter is used.
+      properties:
+        result:
+          type: array
+          items:
+            type: object
+            required: ['total', 'no_ano_pesquisa']
+            properties:
+              total:
+                type: "number"
+              no_ano_pesquisa:
+                type: "integer"
+                format: "int32"
+              ds_turno_aluno:
+                type: "string"
+                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
+              ds_sexo_aluno:
+                type: "string"
+                enum: ['Masculino', 'Feminino']
+              ds_cor_raca_aluno:
+                type: "string"
+                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
+              no_curso:
+                type: "string"
+              no_ies:
+                type: "string"
+              co_ies:
+                type: "integer"
+              refund_fies:
+                type: "string"
+                enum: ["0", "1"]
+              refund_state:
+                  type: "string"
+                  enum: ["0", "1"]
+              refund_city:
+                type: "string"
+                enum: ["0", "1"]
+              refund_edu_inst:
+                type: "string"
+                enum: ["0", "1"]
+              refund_org:
+                type: "string"
+                enum: ["0", "1"]
+              refund_others:
+                type: "string"
+                enum: ["0", "1"]
+              no_refund_prouni_integral:
+                type: "string"
+                enum: ["0", "1"]
+              no_refund_prouni_partial:
+                type: "string"
+                enum: ["0", "1"]
+              no_refund_state:
+                type: "string"
+                enum: ["0", "1"]
+              no_refund_city:
+                type: "string"
+                enum: ["0", "1"]
+              no_refund_edu_inst:
+                type: "string"
+                enum: ["0", "1"]
+              no_refund_org:
+                type: "string"
+                enum: ["0", "1"]
+              no_refund_others:
+                type: "string"
+                enum: ["0", "1"]
+              co_local_oferta:
+                type: "integer"
+              no_local_oferta:
+                type: "string"
\ No newline at end of file
-- 
GitLab


From 982242f178563f302eeaa2e25c9e89ec624edacc Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
Date: Wed, 5 Aug 2020 10:07:21 -0300
Subject: [PATCH 05/39] Add dimension to traditional_families_people

Signed-off-by: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
---
 .../routes/SMPPIR/traditional_families_people.js     | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/libs/routes/SMPPIR/traditional_families_people.js b/src/libs/routes/SMPPIR/traditional_families_people.js
index ada6d513..17549dd8 100644
--- a/src/libs/routes/SMPPIR/traditional_families_people.js
+++ b/src/libs/routes/SMPPIR/traditional_families_people.js
@@ -69,6 +69,18 @@ rqf.addField({
     },
 })
 
+.addValue({
+    name: 'family_type',
+    table: 'traditional_families_ag',
+    tableField: 'ind_tipo_familia',
+    resultField: 'ind_parc_mds_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ind_tipo_familia',
+    },
+})
+
 .addValue({
     name: 'uf',
     table: 'traditional_families_ag',
-- 
GitLab


From 5bdf0d23e9bac6e67a96439a663645202f935e47 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Thu, 6 Aug 2020 10:38:20 -0300
Subject: [PATCH 06/39] experimento com count nos eixos

---
 src/libs/routes/SMPPIR/eixo_2_count.js | 205 +++++++++++++++++++++++++
 src/libs/routes/SMPPIR/eixo_3_count.js | 167 ++++++++++++++++++++
 src/libs/routes/SMPPIR/eixo_4_count.js | 177 +++++++++++++++++++++
 3 files changed, 549 insertions(+)
 create mode 100644 src/libs/routes/SMPPIR/eixo_2_count.js
 create mode 100644 src/libs/routes/SMPPIR/eixo_3_count.js
 create mode 100644 src/libs/routes/SMPPIR/eixo_4_count.js

diff --git a/src/libs/routes/SMPPIR/eixo_2_count.js b/src/libs/routes/SMPPIR/eixo_2_count.js
new file mode 100644
index 00000000..38823fd2
--- /dev/null
+++ b/src/libs/routes/SMPPIR/eixo_2_count.js
@@ -0,0 +1,205 @@
+/*
+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 cad_unico = 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: 'year',
+    table: 'quilombola_eixo_2_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo',
+    },
+})
+
+.addValue({
+    name: 'family_type',
+    table: 'quilombola_eixo_2_ag',
+    tableField: 'ind_tipo_familia',
+    resultField: 'ind_parc_mds_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ind_tipo_familia',
+    },
+})
+
+.addValue({
+    name:'cod_local_home',
+    table:'quilombola_eixo_2_ag',
+    tableField:'cod_local_domicilio',
+    resultField:'cod_local_domic_fam',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'cod_local_domicilio',
+    },
+})
+
+.addValue({
+    name:'cod_home_lighting',
+    table:'quilombola_eixo_2_ag',
+    tableField:'cod_iluminacao_domicilio',
+    resultField:'cod_iluminacao_domic_fam',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'cod_iluminacao_domicilio',
+    },
+})
+
+.addValue({
+    name:'cod_home_trash_destiny',
+    table:'quilombola_eixo_2_ag',
+    tableField:'cod_destino_lixo_domicilio',
+    resultField:'cod_destino_lixo_domic_fam',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'cod_destino_lixo_domicilio',
+    },
+})
+
+.addValue({
+    name:'cod_home_watter_supply',
+    table:'quilombola_eixo_2_ag',
+    tableField:'cod_abastecimento_agua_domicilio',
+    resultField:'cod_abaste_agua_domic_fam',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'cod_abastecimento_agua_domicilio',
+    },
+})
+
+
+// .addValue({
+//     name:'quilombola_family',
+//     table:'quilombola_eixo_2_ag',
+//     tableField:'ind_familia_quilombola',
+//     resultField:'ind_familia_quilombola_fam',
+//     where: {
+//         relation:'=',
+//         type:'string',
+//         field:'ind_familia_quilombola',
+//     },
+// })
+
+
+
+.addValue({
+    name: 'home_type',
+    table: 'quilombola_eixo_2_ag',
+    tableField: 'cod_especie_domicilio',
+    resultField: 'cod_especie_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_especie_domicilio',
+    },
+})
+
+// .addValue({
+//     name: 'home_location',
+//     table: 'quilombola_eixo_2_ag',
+//     tableField: 'codigo_ibge',
+//     resultField: 'cd_ibge',
+//     where: {
+//         relation: '=',
+//         type: 'string',
+//         field: 'codigo_ibge',
+//     },
+// })
+
+
+.addValue({
+    name: 'uf',
+    table: 'quilombola_eixo_2_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado',
+    },
+})
+.addValue({
+    name: 'region',
+    table: 'quilombola_eixo_2_ag',
+    tableField : 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao',
+    },
+})
+
+.addValue({
+    name:'cod_sanitary_dump',
+    table:'quilombola_eixo_2_ag',
+    tableField:'cod_escoa_sanitario_domicilio',
+    resultField:'cod_escoa_sanitario_domic_fam',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'cod_escoa_sanitario_domic_fam',
+    },
+})
+
+;
+
+
+cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
+    console.log(req.sql.toString());
+    req.sql.field('count(total) AS Total')
+        .from('quilombola_eixo_2_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico;
diff --git a/src/libs/routes/SMPPIR/eixo_3_count.js b/src/libs/routes/SMPPIR/eixo_3_count.js
new file mode 100644
index 00000000..1440c51d
--- /dev/null
+++ b/src/libs/routes/SMPPIR/eixo_3_count.js
@@ -0,0 +1,167 @@
+/*
+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 cad_unico_count = 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: 'year',
+    table: 'quilombola_eixo_3_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo',
+    },
+})
+
+.addValue({
+    name: 'family_type',
+    table: 'quilombola_eixo_3_ag',
+    tableField: 'ind_tipo_familia',
+    resultField: 'ind_parc_mds_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ind_tipo_familia',
+    },
+})
+
+
+.addValue({
+    name:'cod_home_bolsa_familia',
+    table:'quilombola_eixo_3_ag',
+    tableField:'marca_programa_bolsa_familia',
+    resultField:'marc_pbf',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'marca_programa_bolsa_familia',
+    },
+})
+
+// .addValue({
+//     name:'quilombola_family',
+//     table:'quilombola_eixo_3_ag',
+//     tableField:'ind_familia_quilombola',
+//     resultField:'ind_familia_quilombola_fam',
+//     where: {
+//         relation:'=',
+//         type:'string',
+//         field:'ind_familia_quilombola',
+//     },
+// })
+
+.addValue({
+    name:'cod_agriculture_job',
+    table:'quilombola_eixo_3_ag',
+    tableField:'atividade_extrativista',
+    resultField:'cod_agricultura_trab_memb',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'atividade_extrativista',
+    },
+})
+
+
+.addValue({
+    name: 'per_capita_income',
+    table: 'quilombola_eixo_3_ag',
+    tableField: 'renda_media',
+    resultField: 'vlr_renda_media_fam',
+    where: {
+        relation: '=',
+        type: 'float',
+        field: 'renda_media',
+    },
+})
+
+.addValue({
+    name: 'home_location',
+    table: 'quilombola_eixo_3_ag',
+    tableField: 'codigo_ibge',
+    resultField: 'cd_ibge',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'codigo_ibge',
+    },
+})
+
+.addValue({
+    name: 'uf',
+    table: 'quilombola_eixo_3_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado',
+    },
+})
+.addValue({
+    name: 'region',
+    table: 'quilombola_eixo_3_ag',
+    tableField : 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao',
+    },
+})
+
+;
+
+
+cad_unico_count.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
+    console.log(req.sql.toString());
+    req.sql.field('count(total) AS Total')
+        .from('quilombola_eixo_3_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico_count;
diff --git a/src/libs/routes/SMPPIR/eixo_4_count.js b/src/libs/routes/SMPPIR/eixo_4_count.js
new file mode 100644
index 00000000..64b1d8cd
--- /dev/null
+++ b/src/libs/routes/SMPPIR/eixo_4_count.js
@@ -0,0 +1,177 @@
+/*
+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 cad_unico = 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: 'year',
+    table: 'quilombola_eixo_4_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo',
+    },
+})
+
+// .addValue({
+//     name:'cod_local_home',
+//     table:'quilombola_eixo_4_ag',
+//     tableField:'cod_local_domicilio',
+//     resultField:'cod_local_domic_fam',
+//     where: {
+//         relation:'=',
+//         type:'string',
+//         field:'cod_local_domicilio',
+//     },
+// })
+
+// .addValue({
+//     name:'quilombola_family',
+//     table:'quilombola_eixo_4_ag',
+//     tableField:'ind_familia_quilombola',
+//     resultField:'ind_familia_quilombola_fam',
+//     where: {
+//         relation:'=',
+//         type:'string',
+//         field:'ind_familia_quilombola',
+//     },
+// })
+
+.addValue({
+    name:'age',
+    table:'quilombola_eixo_4_ag',
+    tableField:'idade',
+    resultField:'idade',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'idade',
+    },
+})
+
+
+.addValue({
+    name: 'education_families_conclude',
+    table: 'quilombola_eixo_4_ag',
+    tableField: 'concluiu_frequentou',
+    resultField: 'cod_concluiu_frequentou_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'concluiu_frequentou',
+    },
+})
+.addValue({
+    name: 'education_families_level',
+    table: 'quilombola_eixo_4_ag',
+    tableField: 'ano_serie_frequentou',
+    resultField: 'cod_ano_serie_frequentou_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ano_serie_frequentou',
+    },
+})
+.addValue({
+    name: 'education_families',
+    table: 'quilombola_eixo_4_ag',
+    tableField: 'curso_frequentou',
+    resultField: 'cod_curso_frequentou_pessoa_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'curso_frequentou',
+    },
+})
+.addValue({
+    name: 'uf',
+    table: 'quilombola_eixo_4_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado',
+    },
+})
+
+.addValue({
+    name: 'region',
+    table: 'quilombola_eixo_4_ag',
+    tableField : 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao',
+    },
+})
+
+.addValue({
+    name:'gender',
+    table:'quilombola_eixo_4_ag',
+    tableField:'genero',
+    resultField:'genero',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'genero',
+    },
+})
+
+
+;
+
+
+cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
+    console.log(req.sql.toString());
+    req.sql.field('COUNT(total) AS Total')
+        .from('quilombola_eixo_4_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico;
-- 
GitLab


From b25c09f77f2b27aa16aa15062c8795fd65a76040 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Thu, 6 Aug 2020 10:55:36 -0300
Subject: [PATCH 07/39] fix count mal feito

---
 src/libs/routes/SMPPIR/eixo_2_count.js | 2 +-
 src/libs/routes/SMPPIR/eixo_3_count.js | 2 +-
 src/libs/routes/SMPPIR/eixo_4_count.js | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libs/routes/SMPPIR/eixo_2_count.js b/src/libs/routes/SMPPIR/eixo_2_count.js
index 38823fd2..0faa3539 100644
--- a/src/libs/routes/SMPPIR/eixo_2_count.js
+++ b/src/libs/routes/SMPPIR/eixo_2_count.js
@@ -197,7 +197,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('count(total) AS Total')
+    req.sql.field('count(distinct id_familia) AS Total')
         .from('quilombola_eixo_2_ag');
     next();
 }, query, response('cad_unico'));
diff --git a/src/libs/routes/SMPPIR/eixo_3_count.js b/src/libs/routes/SMPPIR/eixo_3_count.js
index 1440c51d..fde80c8c 100644
--- a/src/libs/routes/SMPPIR/eixo_3_count.js
+++ b/src/libs/routes/SMPPIR/eixo_3_count.js
@@ -159,7 +159,7 @@ rqf.addField({
 
 cad_unico_count.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('count(total) AS Total')
+    req.sql.field('count(distinct id_familia) AS Total')
         .from('quilombola_eixo_3_ag');
     next();
 }, query, response('cad_unico'));
diff --git a/src/libs/routes/SMPPIR/eixo_4_count.js b/src/libs/routes/SMPPIR/eixo_4_count.js
index 64b1d8cd..e66a8fa1 100644
--- a/src/libs/routes/SMPPIR/eixo_4_count.js
+++ b/src/libs/routes/SMPPIR/eixo_4_count.js
@@ -169,7 +169,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('COUNT(total) AS Total')
+    req.sql.field('COUNT(distinct id_familia) AS Total')
         .from('quilombola_eixo_4_ag');
     next();
 }, query, response('cad_unico'));
-- 
GitLab


From 0b15f76756412074169f51fa648408f84e493280 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Thu, 6 Aug 2020 11:44:22 -0300
Subject: [PATCH 08/39] add rotas

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

diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index d4b1f738..4b0cdd71 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -74,6 +74,12 @@ const eixo_3 = require(`${libs}/routes/SMPPIR/eixo_3`)
 
 const eixo_4 = require(`${libs}/routes/SMPPIR/eixo_4`)
 
+const eixo_2_count = require(`${libs}/routes/SMPPIR/eixo_2_count`)
+
+const eixo_3_count = require(`${libs}/routes/SMPPIR/eixo_3_count`)
+
+const eixo_4_count = require(`${libs}/routes/SMPPIR/eixo_4_count`)
+
 const african_rights = require(`${libs}/routes/SMPPIR/african_rights`)
 
 const african_culture = require(`${libs}/routes/SMPPIR/african_culture`)
@@ -137,6 +143,9 @@ api.use('/vacancy', vacancies);
 api.use('/eixo_2', eixo_2);
 api.use('/eixo_3', eixo_3);
 api.use('/eixo_4', eixo_4);
+api.use('/eixo_2_count', eixo_2_count);
+api.use('/eixo_3_count', eixo_3_count);
+api.use('/eixo_4_count', eixo_4_count);
 api.use('/african_rights', african_rights);
 api.use('/african_culture', african_culture);
 api.use('/african_sustentability', african_sustentability);
-- 
GitLab


From f38fa33778fb203e930b834f7f7cd88a8efe7ae6 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Thu, 13 Aug 2020 11:05:26 -0300
Subject: [PATCH 09/39] add age to route

---
 src/libs/routes/SMPPIR/taxa_homicidios.js | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/libs/routes/SMPPIR/taxa_homicidios.js b/src/libs/routes/SMPPIR/taxa_homicidios.js
index 258ccdf2..395adf66 100644
--- a/src/libs/routes/SMPPIR/taxa_homicidios.js
+++ b/src/libs/routes/SMPPIR/taxa_homicidios.js
@@ -78,6 +78,30 @@ rqf.addField({
         field: 'raca_cor',
     },
 })
+
+.addValue({
+    name: 'min_idade',
+    table: 'sim',
+    tableField: 'idade_obito_anos',
+    resultField: 'idade',
+    where: {
+        relation: '>=',
+        type: 'integer',
+        field: 'idade_obito_anos',
+    },
+})
+.addValue({
+    name: 'max_idade',
+    table: 'sim',
+    tableField: 'idade_obito_anos',
+    resultField: 'idade',
+    where: {
+        relation: '<=',
+        type: 'integer',
+        field: 'idade_obito_anos',
+    },
+})
+
 router.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
     req.sql.field(
-- 
GitLab


From 1f6b3b7223c31522f43dc3c7577a01caf773579d Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Fri, 14 Aug 2020 10:07:58 -0300
Subject: [PATCH 10/39] fix

---
 src/libs/routes/SMPPIR/taxa_homicidios.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libs/routes/SMPPIR/taxa_homicidios.js b/src/libs/routes/SMPPIR/taxa_homicidios.js
index 395adf66..f1c4d93a 100644
--- a/src/libs/routes/SMPPIR/taxa_homicidios.js
+++ b/src/libs/routes/SMPPIR/taxa_homicidios.js
@@ -81,7 +81,7 @@ rqf.addField({
 
 .addValue({
     name: 'min_idade',
-    table: 'sim',
+    table: 'taxa_homicidios',
     tableField: 'idade_obito_anos',
     resultField: 'idade',
     where: {
@@ -92,7 +92,7 @@ rqf.addField({
 })
 .addValue({
     name: 'max_idade',
-    table: 'sim',
+    table: 'taxa_homicidios',
     tableField: 'idade_obito_anos',
     resultField: 'idade',
     where: {
-- 
GitLab


From 95509c096d7f3376e6f5fcb59766010c5ee69df4 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Wed, 19 Aug 2020 09:20:33 -0300
Subject: [PATCH 11/39] creating quotas acessibility page

---
 src/libs/routes/SMPPIR/education.js | 139 ++++++++++++++++++++++++++++
 1 file changed, 139 insertions(+)
 create mode 100644 src/libs/routes/SMPPIR/education.js

diff --git a/src/libs/routes/SMPPIR/education.js b/src/libs/routes/SMPPIR/education.js
new file mode 100644
index 00000000..812f0eda
--- /dev/null
+++ b/src/libs/routes/SMPPIR/education.js
@@ -0,0 +1,139 @@
+/*
+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;
-- 
GitLab


From 3cad9e2cf053cc19e599d48c03687402f66c8bcc Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Wed, 19 Aug 2020 09:55:11 -0300
Subject: [PATCH 12/39] creating quotas acessibility page

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

diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 4b0cdd71..23c1b92d 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -100,6 +100,8 @@ const youth_education = require(`${libs}/routes/SMPPIR/youth_education`)
 
 const sim = require(`${libs}/routes/SMPPIR/sim`)
 
+const education = require(`${libs}/routes/SMPPIR/education`)
+
 const taxa_homicidios = require(`${libs}/routes/SMPPIR/taxa_homicidios`)
 
 const traditional_families = require(`${libs}/routes/SMPPIR/traditional_families`)
@@ -156,6 +158,7 @@ api.use('/ciganos_sustentability', ciganos_sustentability);
 api.use('/youth_jobs', youth_jobs)
 api.use('/youth_education', youth_education)
 api.use('/sim', sim)
+api.use('/education', education)
 api.use('/taxa_homicidios', taxa_homicidios)
 api.use('/traditional_families', traditional_families)
 api.use('/traditional_families_people', traditional_families_people)
-- 
GitLab


From 7efb71145c8c7d90537e4b1b3602d837f21bd567 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Thu, 10 Sep 2020 11:52:37 -0300
Subject: [PATCH 13/39] creating indigenous routes (for three pages)"

---
 .../routes/SMPPIR/indigenas_development.js    | 135 +++++++++++++++
 .../routes/SMPPIR/indigenas_infrastructure.js | 155 ++++++++++++++++++
 src/libs/routes/SMPPIR/indigenas_rights.js    | 135 +++++++++++++++
 src/libs/routes/api.js                        |   9 +
 4 files changed, 434 insertions(+)
 create mode 100644 src/libs/routes/SMPPIR/indigenas_development.js
 create mode 100644 src/libs/routes/SMPPIR/indigenas_infrastructure.js
 create mode 100644 src/libs/routes/SMPPIR/indigenas_rights.js

diff --git a/src/libs/routes/SMPPIR/indigenas_development.js b/src/libs/routes/SMPPIR/indigenas_development.js
new file mode 100644
index 00000000..4486c8f5
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_development.js
@@ -0,0 +1,135 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var cad_unico_count = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'indigenas_development_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'family_type',
+    table: 'indigenas_development_ag',
+    tableField: 'ind_tipo_familia',
+    resultField: 'ind_parc_mds_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ind_tipo_familia'
+    }
+}).addValue({
+    name: 'cod_home_bolsa_familia',
+    table: 'indigenas_development_ag',
+    tableField: 'marca_programa_bolsa_familia',
+    resultField: 'marc_pbf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'marca_programa_bolsa_familia'
+    }
+}).addValue({
+    name: 'cod_agriculture_job',
+    table: 'indigenas_development_ag',
+    tableField: 'atividade_extrativista',
+    resultField: 'cod_agricultura_trab_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'atividade_extrativista'
+    }
+}).addValue({
+    name: 'per_capita_income',
+    table: 'indigenas_development_ag',
+    tableField: 'renda_media',
+    resultField: 'vlr_renda_media_fam',
+    where: {
+        relation: '=',
+        type: 'float',
+        field: 'renda_media'
+    }
+}).addValue({
+    name: 'home_location',
+    table: 'indigenas_development_ag',
+    tableField: 'codigo_ibge',
+    resultField: 'cd_ibge',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'codigo_ibge'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'indigenas_development_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado'
+    }
+}).addValue({
+    name: 'region',
+    table: 'indigenas_development_ag',
+    tableField: 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao'
+    }
+});
+
+cad_unico_count.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('SUM(total) AS Total').from('indigenas_development_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico_count;
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/indigenas_infrastructure.js b/src/libs/routes/SMPPIR/indigenas_infrastructure.js
new file mode 100644
index 00000000..470d4366
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_infrastructure.js
@@ -0,0 +1,155 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var cad_unico = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'family_type',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'ind_tipo_familia',
+    resultField: 'ind_parc_mds_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ind_tipo_familia'
+    }
+}).addValue({
+    name: 'cod_local_home',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'cod_local_domicilio',
+    resultField: 'cod_local_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_local_domicilio'
+    }
+}).addValue({
+    name: 'cod_home_lighting',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'cod_iluminacao_domicilio',
+    resultField: 'cod_iluminacao_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_iluminacao_domicilio'
+    }
+}).addValue({
+    name: 'cod_home_trash_destiny',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'cod_destino_lixo_domicilio',
+    resultField: 'cod_destino_lixo_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_destino_lixo_domicilio'
+    }
+}).addValue({
+    name: 'cod_home_watter_supply',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'cod_abastecimento_agua_domicilio',
+    resultField: 'cod_abaste_agua_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_abastecimento_agua_domicilio'
+    }
+}).addValue({
+    name: 'home_type',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'cod_especie_domicilio',
+    resultField: 'cod_especie_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_especie_domicilio'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado'
+    }
+}).addValue({
+    name: 'region',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao'
+    }
+}).addValue({
+    name: 'cod_sanitary_dump',
+    table: 'indigenas_infrastructure_ag',
+    tableField: 'cod_escoa_sanitario_domicilio',
+    resultField: 'cod_escoa_sanitario_domic_fam',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'cod_escoa_sanitario_domic_fam'
+    }
+});
+
+cad_unico.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('SUM(total) AS Total').from('indigenas_infrastructure_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico;
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/indigenas_rights.js b/src/libs/routes/SMPPIR/indigenas_rights.js
new file mode 100644
index 00000000..478b05f4
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_rights.js
@@ -0,0 +1,135 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var cad_unico = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'indigenas_rights_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_pesquisa',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'age',
+    table: 'indigenas_rights_ag',
+    tableField: 'idade',
+    resultField: 'idade',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'idade'
+    }
+}).addValue({
+    name: 'education_families_conclude',
+    table: 'indigenas_rights_ag',
+    tableField: 'concluiu_frequentou',
+    resultField: 'cod_concluiu_frequentou_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'concluiu_frequentou'
+    }
+}).addValue({
+    name: 'education_families_level',
+    table: 'indigenas_rights_ag',
+    tableField: 'ano_serie_frequentou',
+    resultField: 'cod_ano_serie_frequentou_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'ano_serie_frequentou'
+    }
+}).addValue({
+    name: 'education_families',
+    table: 'indigenas_rights_ag',
+    tableField: 'curso_frequentou',
+    resultField: 'cod_curso_frequentou_pessoa_memb',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'curso_frequentou'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'indigenas_rights_ag',
+    tableField: 'sigla_estado',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_estado'
+    }
+}).addValue({
+    name: 'region',
+    table: 'indigenas_rights_ag',
+    tableField: 'nome_regiao',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao'
+    }
+}).addValue({
+    name: 'gender',
+    table: 'indigenas_rights_ag',
+    tableField: 'genero',
+    resultField: 'genero',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'genero'
+    }
+});
+
+cad_unico.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('SUM(total) AS Total').from('indigenas_rights_ag');
+    next();
+}, query, response('cad_unico'));
+
+module.exports = cad_unico;
\ No newline at end of file
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 23c1b92d..053f3d31 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -116,6 +116,12 @@ const university = require(`${libs}/routes/university`);
 
 const universityTeacher = require(`${libs}/routes/universityTeacher`);
 
+const indigenas_infrastructure = require(`${libs}/routes/indigenas_infrastructure`);
+
+const indigenas_development = require(`${libs}/routes/indigenas_development`);
+
+const indigenas_rights =  require(`${libs}/routes/indigenas_rights`);
+
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
 });
@@ -162,5 +168,8 @@ api.use('/education', education)
 api.use('/taxa_homicidios', taxa_homicidios)
 api.use('/traditional_families', traditional_families)
 api.use('/traditional_families_people', traditional_families_people)
+api.use('/indigenas_infrastructure', indigenas_infrastructure)
+api.use('/indigenas_development', indigenas_development)
+api.use('/indigenas_rights', indigenas_rights)  
 
 module.exports = api;
-- 
GitLab


From e1b05987b710179c8465320930d38ce0e700568c Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Mon, 14 Sep 2020 11:56:14 -0300
Subject: [PATCH 14/39] test_1

---
 src/libs/routes/SMPPIR/eixo_3.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/libs/routes/SMPPIR/eixo_3.js b/src/libs/routes/SMPPIR/eixo_3.js
index 626290ed..312e5cc7 100644
--- a/src/libs/routes/SMPPIR/eixo_3.js
+++ b/src/libs/routes/SMPPIR/eixo_3.js
@@ -131,6 +131,18 @@ rqf.addField({
     },
 })
 
+.addValue({
+    name:'cod_local_home',
+    table:'quilombola_eixo_2_ag',
+    tableField:'cod_local_domicilio',
+    resultField:'cod_local_domic_fam',
+    where: {
+        relation:'=',
+        type:'string',
+        field:'cod_local_domicilio',
+    },
+})
+
 .addValue({
     name: 'uf',
     table: 'quilombola_eixo_3_ag',
@@ -159,7 +171,7 @@ rqf.addField({
 
 cad_unico_count.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total')
+    req.sql.field('COUNT(distinct id_familia) AS Total')
         .from('quilombola_eixo_3_ag');
     next();
 }, query, response('cad_unico'));
-- 
GitLab


From 63b37a939ba56bf33edc0f8e71a1290ab785e9e2 Mon Sep 17 00:00:00 2001
From: "Henrique V. Ehrenfried" <hvehrenfried@inf.ufpr.br>
Date: Tue, 15 Sep 2020 09:27:23 -0300
Subject: [PATCH 15/39] Fix routes of files

Signed-off-by: Henrique V. Ehrenfried <hvehrenfried@inf.ufpr.br>
---
 src/libs/routes/api.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 053f3d31..8a0006b1 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -116,11 +116,11 @@ const university = require(`${libs}/routes/university`);
 
 const universityTeacher = require(`${libs}/routes/universityTeacher`);
 
-const indigenas_infrastructure = require(`${libs}/routes/indigenas_infrastructure`);
+const indigenas_infrastructure = require(`${libs}/routes/SMPPIR/indigenas_infrastructure`);
 
-const indigenas_development = require(`${libs}/routes/indigenas_development`);
+const indigenas_development = require(`${libs}/routes/SMPPIR/indigenas_development`);
 
-const indigenas_rights =  require(`${libs}/routes/indigenas_rights`);
+const indigenas_rights =  require(`${libs}/routes/SMPPIR/indigenas_rights`);
 
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
-- 
GitLab


From 02f59e6b13dea91f204534a8a640ad216703c70d Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Thu, 17 Sep 2020 11:47:03 -0300
Subject: [PATCH 16/39] add information to eixo

---
 src/libs/routes/SMPPIR/eixo_3.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/routes/SMPPIR/eixo_3.js b/src/libs/routes/SMPPIR/eixo_3.js
index 312e5cc7..7a3472d2 100644
--- a/src/libs/routes/SMPPIR/eixo_3.js
+++ b/src/libs/routes/SMPPIR/eixo_3.js
@@ -133,7 +133,7 @@ rqf.addField({
 
 .addValue({
     name:'cod_local_home',
-    table:'quilombola_eixo_2_ag',
+    table:'quilombola_eixo_3_ag',
     tableField:'cod_local_domicilio',
     resultField:'cod_local_domic_fam',
     where: {
-- 
GitLab


From 9c2cc68ac5dd81ac88e99f1d1e37995ad7def24c Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Tue, 29 Sep 2020 10:05:43 -0300
Subject: [PATCH 17/39] creating indigenas_territorial route

---
 src/libs/routes/SMPPIR/indigenas_terras.js | 125 +++++++++++++++++++++
 src/libs/routes/api.js                     |   5 +-
 2 files changed, 129 insertions(+), 1 deletion(-)
 create mode 100644 src/libs/routes/SMPPIR/indigenas_terras.js

diff --git a/src/libs/routes/SMPPIR/indigenas_terras.js b/src/libs/routes/SMPPIR/indigenas_terras.js
new file mode 100644
index 00000000..408ff151
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_terras.js
@@ -0,0 +1,125 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var indigenasTerritorialApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'terras_indigenas',
+    tableField: 'ano',
+    resultField: 'ano_divulgacao',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano'
+    }
+}).addValue({
+    name: 'local_name',
+    table: 'terras_indigenas',
+    tableField: 'nome_terra',
+    resultField: 'nome_terra_indigena',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_terra'
+    }
+}).addValue({
+    name: 'ethnic_name',
+    table: 'terras_indigenas',
+    tableField: 'nome_etnia',
+    resultField: 'etnia_indigena',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_etnia'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'terras_indigenas',
+    tableField: 'sigla_uf',
+    resultField: 'unidade_federativa',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_uf'
+    }
+}).addValue({
+    name: 'area',
+    table: 'terras_indigenas',
+    tableField: 'tamanho_superficie',
+    resultField: 'superficie(ha)',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'tamanho_superficie'
+    }
+}).addValue({
+    name: 'process_stage',
+    table: 'terras_indigenas',
+    tableField: 'fase_procedimento',
+    resultField: 'fase_do_procedimento',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'fase_procedimento'
+    }
+}).addValue({
+    name: 'modality',
+    table: 'terras_indigenas',
+    tableField: 'tipo_modalidade',
+    resultField: 'tipo_modalidade',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'tipo_modalidade'
+    }
+});
+
+indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('SUM(total) AS Total').from('terras_indigenas');
+    next();
+}, query, response('terras_ind'));
+
+module.exports = indigenasTerritorialApp;
\ No newline at end of file
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 8a0006b1..423c46fb 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -122,6 +122,8 @@ const indigenas_development = require(`${libs}/routes/SMPPIR/indigenas_developme
 
 const indigenas_rights =  require(`${libs}/routes/SMPPIR/indigenas_rights`);
 
+const indigenas_territorial = require(`${libs}/routes/SMPPIR/indigenas_territorial`);
+
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
 });
@@ -170,6 +172,7 @@ api.use('/traditional_families', traditional_families)
 api.use('/traditional_families_people', traditional_families_people)
 api.use('/indigenas_infrastructure', indigenas_infrastructure)
 api.use('/indigenas_development', indigenas_development)
-api.use('/indigenas_rights', indigenas_rights)  
+api.use('/indigenas_rights', indigenas_rights)
+api.use('/indigenas_territorial', indigenas_territorial)
 
 module.exports = api;
-- 
GitLab


From 33c23a2a026fc48ad24c978d87e5b7c7fb0c5be4 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Tue, 29 Sep 2020 10:36:31 -0300
Subject: [PATCH 18/39] fixing name

---
 .../SMPPIR/{indigenas_terras.js => indigenas_territorial.js}      | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename src/libs/routes/SMPPIR/{indigenas_terras.js => indigenas_territorial.js} (100%)

diff --git a/src/libs/routes/SMPPIR/indigenas_terras.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
similarity index 100%
rename from src/libs/routes/SMPPIR/indigenas_terras.js
rename to src/libs/routes/SMPPIR/indigenas_territorial.js
-- 
GitLab


From 7764533213c8d7c49e6617a26e79b1512b5b2e46 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Fri, 9 Oct 2020 11:22:39 -0300
Subject: [PATCH 19/39] creating/fixing indigenous schools,enrollment and
 territorial routes

---
 .../routes/SMPPIR/indigenas_enrollment.js     | 145 ++++++++++++++++++
 src/libs/routes/SMPPIR/indigenas_schools.js   | 145 ++++++++++++++++++
 .../routes/SMPPIR/indigenas_territorial.js    | 125 +++++++++++++++
 src/libs/routes/api.js                        |   9 +-
 4 files changed, 423 insertions(+), 1 deletion(-)
 create mode 100644 src/libs/routes/SMPPIR/indigenas_enrollment.js
 create mode 100644 src/libs/routes/SMPPIR/indigenas_schools.js
 create mode 100644 src/libs/routes/SMPPIR/indigenas_territorial.js

diff --git a/src/libs/routes/SMPPIR/indigenas_enrollment.js b/src/libs/routes/SMPPIR/indigenas_enrollment.js
new file mode 100644
index 00000000..40408fba
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_enrollment.js
@@ -0,0 +1,145 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var indigenasSchoolsApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'indigenas_schools_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_censo',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'localizacao_diferenciada',
+    table: 'indigenas_schools_ag',
+    tableField: 'localizacao_diferenciada_id',
+    resultField: 'cod_localizacao_diferenciada',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'localizacao_diferenciada_id'
+    }
+}).addValue({
+    name: 'agua',
+    table: 'indigenas_schools_ag',
+    tableField: 'agua_rede_publica',
+    resultField: 'abastecimento_agua_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'agua_rede_publica'
+    }
+}).addValue({
+    name: 'energia',
+    table: 'indigenas_schools_ag',
+    tableField: 'energia_rede_publica',
+    resultField: 'abastecimento_energia_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'energia_rede_publica'
+    }
+}).addValue({
+    name: 'esgoto',
+    table: 'indigenas_schools_ag',
+    tableField: 'esgoto_rede_publica',
+    resultField: 'esgotamento_snaitario_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'esgoto_rede_publica'
+    }
+}).addValue({
+    name: 'lixo',
+    table: 'indigenas_schools_ag',
+    tableField: 'lixo_coleta_periodica',
+    resultField: 'coleta_lixo_periodica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'lixo_coleta_periodica'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'indigenas_schools_ag',
+    tableField: 'sigla',
+    resultField: 'sigla_uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla'
+    }
+}).addValue({
+    name: 'id',
+    table: 'indigenas_schools_ag',
+    tableField: 'id',
+    resultField: 'escola_id',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'id'
+    }
+}).addValue({
+    name: 'etapa_ensino',
+    table: 'indigenas_schools_ag',
+    tableField: 'etapa_ensino',
+    resultField: 'etapa_ensino',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'etapa_ensino'
+    }
+});
+
+indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('SUM(total) AS Total').from('terras_indigenas');
+    next();
+}, query, response('terras_ind'));
+
+module.exports = indigenasSchoolsApp;
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/indigenas_schools.js b/src/libs/routes/SMPPIR/indigenas_schools.js
new file mode 100644
index 00000000..a2c36ed6
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_schools.js
@@ -0,0 +1,145 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var indigenasSchoolsApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'indigenas_schools_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_censo',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'localizacao_diferenciada',
+    table: 'indigenas_schools_ag',
+    tableField: 'localizacao_diferenciada_id',
+    resultField: 'cod_localizacao_diferenciada',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'localizacao_diferenciada_id'
+    }
+}).addValue({
+    name: 'agua',
+    table: 'indigenas_schools_ag',
+    tableField: 'agua_rede_publica',
+    resultField: 'abastecimento_agua_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'agua_rede_publica'
+    }
+}).addValue({
+    name: 'energia',
+    table: 'indigenas_schools_ag',
+    tableField: 'energia_rede_publica',
+    resultField: 'abastecimento_energia_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'energia_rede_publica'
+    }
+}).addValue({
+    name: 'esgoto',
+    table: 'indigenas_schools_ag',
+    tableField: 'esgoto_rede_publica',
+    resultField: 'esgotamento_snaitario_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'esgoto_rede_publica'
+    }
+}).addValue({
+    name: 'lixo',
+    table: 'indigenas_schools_ag',
+    tableField: 'lixo_coleta_periodica',
+    resultField: 'coleta_lixo_periodica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'lixo_coleta_periodica'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'indigenas_schools_ag',
+    tableField: 'sigla',
+    resultField: 'sigla_uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla'
+    }
+}).addValue({
+    name: 'id',
+    table: 'indigenas_schools_ag',
+    tableField: 'id',
+    resultField: 'escola_id',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'id'
+    }
+}).addValue({
+    name: 'etapa_ensino',
+    table: 'indigenas_schools_ag',
+    tableField: 'etapa_ensino',
+    resultField: 'etapa_ensino',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'etapa_ensino'
+    }
+});
+
+indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('COUNT(distinct id) AS Total').from('terras_indigenas');
+    next();
+}, query, response('terras_ind'));
+
+module.exports = indigenasSchoolsApp;
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/indigenas_territorial.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
new file mode 100644
index 00000000..1336a973
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_territorial.js
@@ -0,0 +1,125 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var indigenasTerritorialApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'terras_indigenas',
+    tableField: 'ano',
+    resultField: 'ano_divulgacao',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano'
+    }
+}).addValue({
+    name: 'local_name',
+    table: 'terras_indigenas',
+    tableField: 'nome_terra',
+    resultField: 'nome_terra_indigena',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_terra'
+    }
+}).addValue({
+    name: 'ethnic_name',
+    table: 'terras_indigenas',
+    tableField: 'nome_etnia',
+    resultField: 'etnia_indigena',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_etnia'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'terras_indigenas',
+    tableField: 'sigla_uf',
+    resultField: 'unidade_federativa',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_uf'
+    }
+}).addValue({
+    name: 'area',
+    table: 'terras_indigenas',
+    tableField: 'tamanho_superficie',
+    resultField: 'superficie(ha)',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'tamanho_superficie'
+    }
+}).addValue({
+    name: 'process_stage',
+    table: 'terras_indigenas',
+    tableField: 'fase_procedimento',
+    resultField: 'fase_do_procedimento',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'fase_procedimento'
+    }
+}).addValue({
+    name: 'modality',
+    table: 'terras_indigenas',
+    tableField: 'tipo_modalidade',
+    resultField: 'tipo_modalidade',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'tipo_modalidade'
+    }
+});
+
+indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('COUNT(*) AS Total').from('terras_indigenas');
+    next();
+}, query, response('terras_ind'));
+
+module.exports = indigenasTerritorialApp;
\ No newline at end of file
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 053f3d31..239b5003 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -122,6 +122,10 @@ const indigenas_development = require(`${libs}/routes/indigenas_development`);
 
 const indigenas_rights =  require(`${libs}/routes/indigenas_rights`);
 
+const indigenas_schools = require(`${libs}/routes/SMPPIR/indigenas_schools`);
+
+const indigenas_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment`);
+
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
 });
@@ -170,6 +174,9 @@ api.use('/traditional_families', traditional_families)
 api.use('/traditional_families_people', traditional_families_people)
 api.use('/indigenas_infrastructure', indigenas_infrastructure)
 api.use('/indigenas_development', indigenas_development)
-api.use('/indigenas_rights', indigenas_rights)  
+api.use('/indigenas_rights', indigenas_rights)
+api.use('/indigenas_territorial', indigenas_territorial)
+api.use('/indigenas_schools', indigenas_schools)
+api.use('/indigenas_enrollment', indigenas_enrollment)
 
 module.exports = api;
-- 
GitLab


From 0d61148a0eaf3c6141833a5858a836dd147f1df9 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Fri, 9 Oct 2020 11:22:39 -0300
Subject: [PATCH 20/39] creating/fixing indigenous schools,enrollment and
 territorial routes

---
 .../routes/SMPPIR/indigenas_enrollment.js     | 145 ++++++++++++++++++
 src/libs/routes/SMPPIR/indigenas_schools.js   | 145 ++++++++++++++++++
 .../routes/SMPPIR/indigenas_territorial.js    |   2 +-
 src/libs/routes/api.js                        |   6 +
 4 files changed, 297 insertions(+), 1 deletion(-)
 create mode 100644 src/libs/routes/SMPPIR/indigenas_enrollment.js
 create mode 100644 src/libs/routes/SMPPIR/indigenas_schools.js

diff --git a/src/libs/routes/SMPPIR/indigenas_enrollment.js b/src/libs/routes/SMPPIR/indigenas_enrollment.js
new file mode 100644
index 00000000..40408fba
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_enrollment.js
@@ -0,0 +1,145 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var indigenasSchoolsApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'indigenas_schools_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_censo',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'localizacao_diferenciada',
+    table: 'indigenas_schools_ag',
+    tableField: 'localizacao_diferenciada_id',
+    resultField: 'cod_localizacao_diferenciada',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'localizacao_diferenciada_id'
+    }
+}).addValue({
+    name: 'agua',
+    table: 'indigenas_schools_ag',
+    tableField: 'agua_rede_publica',
+    resultField: 'abastecimento_agua_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'agua_rede_publica'
+    }
+}).addValue({
+    name: 'energia',
+    table: 'indigenas_schools_ag',
+    tableField: 'energia_rede_publica',
+    resultField: 'abastecimento_energia_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'energia_rede_publica'
+    }
+}).addValue({
+    name: 'esgoto',
+    table: 'indigenas_schools_ag',
+    tableField: 'esgoto_rede_publica',
+    resultField: 'esgotamento_snaitario_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'esgoto_rede_publica'
+    }
+}).addValue({
+    name: 'lixo',
+    table: 'indigenas_schools_ag',
+    tableField: 'lixo_coleta_periodica',
+    resultField: 'coleta_lixo_periodica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'lixo_coleta_periodica'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'indigenas_schools_ag',
+    tableField: 'sigla',
+    resultField: 'sigla_uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla'
+    }
+}).addValue({
+    name: 'id',
+    table: 'indigenas_schools_ag',
+    tableField: 'id',
+    resultField: 'escola_id',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'id'
+    }
+}).addValue({
+    name: 'etapa_ensino',
+    table: 'indigenas_schools_ag',
+    tableField: 'etapa_ensino',
+    resultField: 'etapa_ensino',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'etapa_ensino'
+    }
+});
+
+indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('SUM(total) AS Total').from('terras_indigenas');
+    next();
+}, query, response('terras_ind'));
+
+module.exports = indigenasSchoolsApp;
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/indigenas_schools.js b/src/libs/routes/SMPPIR/indigenas_schools.js
new file mode 100644
index 00000000..a2c36ed6
--- /dev/null
+++ b/src/libs/routes/SMPPIR/indigenas_schools.js
@@ -0,0 +1,145 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var indigenasSchoolsApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'indigenas_schools_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_censo',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'localizacao_diferenciada',
+    table: 'indigenas_schools_ag',
+    tableField: 'localizacao_diferenciada_id',
+    resultField: 'cod_localizacao_diferenciada',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'localizacao_diferenciada_id'
+    }
+}).addValue({
+    name: 'agua',
+    table: 'indigenas_schools_ag',
+    tableField: 'agua_rede_publica',
+    resultField: 'abastecimento_agua_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'agua_rede_publica'
+    }
+}).addValue({
+    name: 'energia',
+    table: 'indigenas_schools_ag',
+    tableField: 'energia_rede_publica',
+    resultField: 'abastecimento_energia_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'energia_rede_publica'
+    }
+}).addValue({
+    name: 'esgoto',
+    table: 'indigenas_schools_ag',
+    tableField: 'esgoto_rede_publica',
+    resultField: 'esgotamento_snaitario_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'esgoto_rede_publica'
+    }
+}).addValue({
+    name: 'lixo',
+    table: 'indigenas_schools_ag',
+    tableField: 'lixo_coleta_periodica',
+    resultField: 'coleta_lixo_periodica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'lixo_coleta_periodica'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'indigenas_schools_ag',
+    tableField: 'sigla',
+    resultField: 'sigla_uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla'
+    }
+}).addValue({
+    name: 'id',
+    table: 'indigenas_schools_ag',
+    tableField: 'id',
+    resultField: 'escola_id',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'id'
+    }
+}).addValue({
+    name: 'etapa_ensino',
+    table: 'indigenas_schools_ag',
+    tableField: 'etapa_ensino',
+    resultField: 'etapa_ensino',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'etapa_ensino'
+    }
+});
+
+indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('COUNT(distinct id) AS Total').from('terras_indigenas');
+    next();
+}, query, response('terras_ind'));
+
+module.exports = indigenasSchoolsApp;
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/indigenas_territorial.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
index 408ff151..1336a973 100644
--- a/src/libs/routes/SMPPIR/indigenas_territorial.js
+++ b/src/libs/routes/SMPPIR/indigenas_territorial.js
@@ -118,7 +118,7 @@ rqf.addField({
 
 indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total').from('terras_indigenas');
+    req.sql.field('COUNT(*) AS Total').from('terras_indigenas');
     next();
 }, query, response('terras_ind'));
 
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 423c46fb..500a577c 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -124,6 +124,10 @@ const indigenas_rights =  require(`${libs}/routes/SMPPIR/indigenas_rights`);
 
 const indigenas_territorial = require(`${libs}/routes/SMPPIR/indigenas_territorial`);
 
+const indigenas_schools = require(`${libs}/routes/SMPPIR/indigenas_schools`);
+
+const indigenas_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment`);
+
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
 });
@@ -174,5 +178,7 @@ api.use('/indigenas_infrastructure', indigenas_infrastructure)
 api.use('/indigenas_development', indigenas_development)
 api.use('/indigenas_rights', indigenas_rights)
 api.use('/indigenas_territorial', indigenas_territorial)
+api.use('/indigenas_schools', indigenas_schools)
+api.use('/indigenas_enrollment', indigenas_enrollment)
 
 module.exports = api;
-- 
GitLab


From 1fba58f6e39acaf3f5282b2d611b76bd62cb8592 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Fri, 9 Oct 2020 11:34:20 -0300
Subject: [PATCH 21/39] fixing indigenous route

---
 src/libs/routes/SMPPIR/indigenas_enrollment.js | 2 +-
 src/libs/routes/SMPPIR/indigenas_schools.js    | 2 +-
 src/libs/routes/api.js                         | 4 ----
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_enrollment.js b/src/libs/routes/SMPPIR/indigenas_enrollment.js
index 40408fba..ee69fec0 100644
--- a/src/libs/routes/SMPPIR/indigenas_enrollment.js
+++ b/src/libs/routes/SMPPIR/indigenas_enrollment.js
@@ -140,6 +140,6 @@ indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next)
     console.log(req.sql.toString());
     req.sql.field('SUM(total) AS Total').from('terras_indigenas');
     next();
-}, query, response('terras_ind'));
+}, query, response('indigenas_mat'));
 
 module.exports = indigenasSchoolsApp;
\ No newline at end of file
diff --git a/src/libs/routes/SMPPIR/indigenas_schools.js b/src/libs/routes/SMPPIR/indigenas_schools.js
index a2c36ed6..b1eaae31 100644
--- a/src/libs/routes/SMPPIR/indigenas_schools.js
+++ b/src/libs/routes/SMPPIR/indigenas_schools.js
@@ -140,6 +140,6 @@ indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next)
     console.log(req.sql.toString());
     req.sql.field('COUNT(distinct id) AS Total').from('terras_indigenas');
     next();
-}, query, response('terras_ind'));
+}, query, response('indigenas_esc'));
 
 module.exports = indigenasSchoolsApp;
\ No newline at end of file
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 2b03e9dc..500a577c 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -128,10 +128,6 @@ const indigenas_schools = require(`${libs}/routes/SMPPIR/indigenas_schools`);
 
 const indigenas_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment`);
 
-const indigenas_schools = require(`${libs}/routes/SMPPIR/indigenas_schools`);
-
-const indigenas_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment`);
-
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
 });
-- 
GitLab


From a83e8d53381cad938c1780a76d39b333e05a75b6 Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Wed, 14 Oct 2020 10:01:11 -0300
Subject: [PATCH 22/39] fixing indigenous routes

---
 src/libs/routes/SMPPIR/indigenas_enrollment.js  |  2 +-
 src/libs/routes/SMPPIR/indigenas_schools.js     |  2 +-
 src/libs/routes/SMPPIR/indigenas_territorial.js | 10 ++++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_enrollment.js b/src/libs/routes/SMPPIR/indigenas_enrollment.js
index ee69fec0..d07bf14d 100644
--- a/src/libs/routes/SMPPIR/indigenas_enrollment.js
+++ b/src/libs/routes/SMPPIR/indigenas_enrollment.js
@@ -138,7 +138,7 @@ rqf.addField({
 
 indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total').from('terras_indigenas');
+    req.sql.field('SUM(total) AS Total').from('indigenas_schools_ag');
     next();
 }, query, response('indigenas_mat'));
 
diff --git a/src/libs/routes/SMPPIR/indigenas_schools.js b/src/libs/routes/SMPPIR/indigenas_schools.js
index b1eaae31..51257142 100644
--- a/src/libs/routes/SMPPIR/indigenas_schools.js
+++ b/src/libs/routes/SMPPIR/indigenas_schools.js
@@ -138,7 +138,7 @@ rqf.addField({
 
 indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('COUNT(distinct id) AS Total').from('terras_indigenas');
+    req.sql.field('COUNT(distinct id) AS Total').from('indigenas_schools_ag');
     next();
 }, query, response('indigenas_esc'));
 
diff --git a/src/libs/routes/SMPPIR/indigenas_territorial.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
index 1336a973..2ca8a0f3 100644
--- a/src/libs/routes/SMPPIR/indigenas_territorial.js
+++ b/src/libs/routes/SMPPIR/indigenas_territorial.js
@@ -114,6 +114,16 @@ rqf.addField({
         type: 'string',
         field: 'tipo_modalidade'
     }
+}).addValue({
+    name: 'county',
+    table: 'terras_indigenas',
+    tableField: 'nome_municipio',
+    resultField: 'nome_municipio',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_municipio'
+    }
 });
 
 indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
-- 
GitLab


From 8d193f1599f83c40e9a336823ce678eb688bd7f0 Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Wed, 14 Oct 2020 10:05:35 -0300
Subject: [PATCH 23/39] fixing indigenas_enrollment route

---
 src/libs/routes/SMPPIR/indigenas_enrollment.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_enrollment.js b/src/libs/routes/SMPPIR/indigenas_enrollment.js
index d07bf14d..89812570 100644
--- a/src/libs/routes/SMPPIR/indigenas_enrollment.js
+++ b/src/libs/routes/SMPPIR/indigenas_enrollment.js
@@ -22,7 +22,7 @@ along with SMPPIR-Node.  If not, see <https://www.gnu.org/licenses/>.
 
 var express = require('express');
 
-var indigenasSchoolsApp = express.Router();
+var indigenasEnrollmentApp = express.Router();
 
 var libs = process.cwd() + '/libs';
 
@@ -136,10 +136,10 @@ rqf.addField({
     }
 });
 
-indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+indigenasEnrollmentApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
     req.sql.field('SUM(total) AS Total').from('indigenas_schools_ag');
     next();
 }, query, response('indigenas_mat'));
 
-module.exports = indigenasSchoolsApp;
\ No newline at end of file
+module.exports = indigenasEnrollmentApp;
\ No newline at end of file
-- 
GitLab


From cdfc0b97a183d00d2751f84f05ff7af885ad73c8 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Wed, 28 Oct 2020 11:04:20 -0300
Subject: [PATCH 24/39] changing institution base query

---
 src/libs/routes/SMPPIR/institution.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libs/routes/SMPPIR/institution.js b/src/libs/routes/SMPPIR/institution.js
index 2222548f..ae7bc0a8 100644
--- a/src/libs/routes/SMPPIR/institution.js
+++ b/src/libs/routes/SMPPIR/institution.js
@@ -101,9 +101,11 @@ rqf.addField({
 
 institution.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
     req.sql.field('nome_ies AS no_ies')
+        .field('sigla_ies AS sgl_ies')
         .field('cod_ies AS co_ies')
         .from('institution_ag')
         .group('nome_ies')
+        .group('sigla_ies')
         .group('cod_ies')
         .order('nome_ies');
     next();
-- 
GitLab


From f2389442b024895d2ed73ab9a29fdfa9c58c74c7 Mon Sep 17 00:00:00 2001
From: Nicollas <ns17@inf.ufpr.br>
Date: Tue, 3 Nov 2020 10:28:12 -0300
Subject: [PATCH 25/39] adding uf/region and quotas filters

---
 src/libs/routes/SMPPIR/admission.js      | 22 ++++++++++++++++
 src/libs/routes/SMPPIR/social_support.js | 33 ++++++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/src/libs/routes/SMPPIR/admission.js b/src/libs/routes/SMPPIR/admission.js
index 80245eb2..65bfea2a 100644
--- a/src/libs/routes/SMPPIR/admission.js
+++ b/src/libs/routes/SMPPIR/admission.js
@@ -142,6 +142,28 @@ rqf.addField({
         type: 'integer',
         field: 'ano_censo',
     },
+})
+.addValue({
+    name: 'region',
+    table: 'admission_ag',
+    tableField: 'nome_regiao_ies',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao_ies',
+    },
+})
+.addValue({
+    name: 'uf',
+    table: 'admission_ag',
+    tableField: 'sigla_uf_ies',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_uf_ies',
+    },
 });
 
 admissionApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
diff --git a/src/libs/routes/SMPPIR/social_support.js b/src/libs/routes/SMPPIR/social_support.js
index 4a575264..6d55304f 100644
--- a/src/libs/routes/SMPPIR/social_support.js
+++ b/src/libs/routes/SMPPIR/social_support.js
@@ -177,6 +177,17 @@ rqf.addField({
         field: 'apoio_transporte',
     },
 })
+.addValue({
+    name: 'quota',
+    table: 'social_support_ag',
+    tableField: 'reserva_vagas',
+    resultField: 'reserva_vagas',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'reserva_vagas',
+    },
+})
 .addValue({
     name: 'year',
     table: 'social_support_ag',
@@ -209,6 +220,28 @@ rqf.addField({
         type: 'integer',
         field: 'ano_censo',
     },
+})
+.addValue({
+    name: 'region',
+    table: 'social_support_ag',
+    tableField: 'nome_regiao_ies',
+    resultField: 'region',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao_ies',
+    },
+})
+.addValue({
+    name: 'uf',
+    table: 'social_support_ag',
+    tableField: 'sigla_uf_ies',
+    resultField: 'uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla_uf_ies',
+    },
 });
 
 social_supportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
-- 
GitLab


From 2eb6fd5f01eae9c6363c19b7e11f02e202398ee6 Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Wed, 18 Nov 2020 11:45:47 -0300
Subject: [PATCH 26/39] adding region route

---
 .../routes/SMPPIR/indigenas_territorial.js    | 26 +++++++++++++------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_territorial.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
index 2ca8a0f3..78e59f4a 100644
--- a/src/libs/routes/SMPPIR/indigenas_territorial.js
+++ b/src/libs/routes/SMPPIR/indigenas_territorial.js
@@ -46,7 +46,7 @@ rqf.addField({
     where: false
 }).addValue({
     name: 'year',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'ano',
     resultField: 'ano_divulgacao',
     where: {
@@ -56,7 +56,7 @@ rqf.addField({
     }
 }).addValue({
     name: 'local_name',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'nome_terra',
     resultField: 'nome_terra_indigena',
     where: {
@@ -66,7 +66,7 @@ rqf.addField({
     }
 }).addValue({
     name: 'ethnic_name',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'nome_etnia',
     resultField: 'etnia_indigena',
     where: {
@@ -76,7 +76,7 @@ rqf.addField({
     }
 }).addValue({
     name: 'uf',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'sigla_uf',
     resultField: 'unidade_federativa',
     where: {
@@ -86,7 +86,7 @@ rqf.addField({
     }
 }).addValue({
     name: 'area',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'tamanho_superficie',
     resultField: 'superficie(ha)',
     where: {
@@ -96,7 +96,7 @@ rqf.addField({
     }
 }).addValue({
     name: 'process_stage',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'fase_procedimento',
     resultField: 'fase_do_procedimento',
     where: {
@@ -106,7 +106,7 @@ rqf.addField({
     }
 }).addValue({
     name: 'modality',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'tipo_modalidade',
     resultField: 'tipo_modalidade',
     where: {
@@ -116,7 +116,7 @@ rqf.addField({
     }
 }).addValue({
     name: 'county',
-    table: 'terras_indigenas',
+    table: 'indigenas_territorial_ag',
     tableField: 'nome_municipio',
     resultField: 'nome_municipio',
     where: {
@@ -124,6 +124,16 @@ rqf.addField({
         type: 'string',
         field: 'nome_municipio'
     }
+}).addValue({
+    name: 'region',
+    table: 'indigenas_territorial_ag',
+    tableField: 'regiao',
+    resultField: 'nome_regiao',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_regiao'
+    }
 });
 
 indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
-- 
GitLab


From 30e29e180f6dc44260b1a1d749e81592fae821e3 Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Thu, 19 Nov 2020 10:27:24 -0300
Subject: [PATCH 27/39] fix indigenas_territorial

---
 src/libs/routes/SMPPIR/indigenas_territorial.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_territorial.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
index 78e59f4a..5667e386 100644
--- a/src/libs/routes/SMPPIR/indigenas_territorial.js
+++ b/src/libs/routes/SMPPIR/indigenas_territorial.js
@@ -138,7 +138,7 @@ rqf.addField({
 
 indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('COUNT(*) AS Total').from('terras_indigenas');
+    req.sql.field('COUNT(*) AS Total').from('indigenas_territorial_ag');
     next();
 }, query, response('terras_ind'));
 
-- 
GitLab


From cac03929f9ba16f0c862286293887d2abb117f0a Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <hvehrenfried@inf.ufpr.br>
Date: Fri, 20 Nov 2020 10:12:49 -0300
Subject: [PATCH 28/39] Update Dockerfile

---
 Dockerfile | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 8574cf98..f0c33152 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,8 @@
-FROM node:9.5.0-stretch
+FROM node:dubnium-stretch
 
-RUN apt-get -y update -qq && apt-get install -y -qq apt-utils
+RUN apt-get -y update && apt-get install -y apt-utils
 
-RUN npm install --global gulp gulp-cli babel babel-cli babel-core babel-register mocha gulp-mocha gulp-eslint istanbul
+RUN npm install --global gulp gulp-cli babel babel-cli babel-core babel-register mocha gulp-mocha gulp-eslint istanbul --force
 
 RUN mkdir API
 
@@ -12,7 +12,11 @@ WORKDIR ./API
 
 RUN npm install
 
-RUN gulp build 
+RUN npm un -g gulp
+
+RUN npm i -g gulp@3.9.0
+
+RUN gulp build
 
 EXPOSE 4000
 
@@ -20,4 +24,4 @@ CMD gulp
 
 # sudo docker build --tag api-smppir .
 
-# sudo docker run --rm -p 4000:4000 --net="host" --name api-smppir api-smppir
\ No newline at end of file
+# sudo docker run --rm -p 4000:4000 --net="host" --name api-smppir api-smppir
-- 
GitLab


From e5424d64ff70f97abcacfce4d79048ea12749b30 Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <h.v.ehrenfried@hotmail.com>
Date: Mon, 23 Nov 2020 11:18:32 -0300
Subject: [PATCH 29/39] Add new data type: like_string

Signed-off-by: Henrique Varella Ehrenfried <h.v.ehrenfried@hotmail.com>
---
  SMPPIR-API Specification.yaml                | 2973 -----------------
 src/libs/middlewares/reqQueryFields.js        |    1 +
 .../routes/SMPPIR/indigenas_territorial.js    |    8 +-
 3 files changed, 5 insertions(+), 2977 deletions(-)
 delete mode 100644  SMPPIR-API Specification.yaml 

diff --git a/ SMPPIR-API Specification.yaml  b/ SMPPIR-API Specification.yaml 
deleted file mode 100644
index a79e6491..00000000
--- a/ SMPPIR-API Specification.yaml 	
+++ /dev/null
@@ -1,2973 +0,0 @@
-# Specification of SMPPIR API using OpenAPI 3.0
-# For the specification of OpenAPI 3.0, please refer to: https://swagger.io/docs/specification/about/
-openapi: "3.0.0"
-info:
-  version: 1.0.0
-  title: SMPPIR - API
-  description: 'This API provides access to quotas data based in [INEP - Census of higher education](http://portal.inep.gov.br/web/guest/microdados), [PNAD - People information](http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40), [FIES](http://www.fnde.gov.br/dadosabertos/dataset/fundo-de-financiamento-estudantil-fies), [PROUNI](http://dadosabertos.mec.gov.br/prouni)'
- 
-servers:
-  - url: http://seppirdev.c3sl.ufpr.br:4000/api/v1
-
-tags:
-  - name: INEP
-    description: "Contains queries made with data from the INEP database listed above. This section's concern is the undergraduation students"
-    externalDocs:
-      url: http://portal.inep.gov.br/web/guest/microdados
-  - name: FIES
-    description: "Contains queries made with data from the FIES database listed above. This section's concern is the loan for undergraduation students"
-    externalDocs:
-      url: http://www.fnde.gov.br/dadosabertos/dataset/fundo-de-financiamento-estudantil-fies
-  - name: PNAD
-    description: "Contains queries made with data from the PNAD database listed above. This section's concern is the educational level of the population between 18 and 24 years old"
-    externalDocs:
-      url: http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40
-  - name: PROUNI
-    description: "Contains queries made with data from the PROUNI database listed above. This section's concern is the federal scholarship"
-    externalDocs:
-      url: http://www.ibge.gov.br/home/estatistica/pesquisas/pesquisa_resultados.php?id_pesquisa=40
-#  - name: IBGE - Census
-#    description: "Contains queries made with data from IBGE Census"
-#    externalDocs:
-#url:  https://ww2.ibge.gov.br/home/estatistica/populacao/censo2010/resultados_gerais_amostra/resultados_gerais_amostra_tab_uf_microdados.shtm
-  - name: CadÚnico
-    description: "Contains queries made with data from CadÚnico"
-    externalDocs:
-      url: https://aplicacoes.mds.gov.br/sagi/portal/index.php?grupo=212 
-  - name: EXTRA
-    description: "Contains data from auxiliary extra routes"
-    externalDocs:
-      url:  https://ww2.ibge.gov.br/home/estatistica/populacao/censo2010/resultados_gerais_amostra/resultados_gerais_amostra_tab_uf_microdados.shtm
-
-paths:
-  /admission:
-    get:
-      summary: Return the number of quotasholder that entered in a federal institution. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturn'
-        '404':
-          description: no data found
-  /evader:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and drop out. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-                - region
-                - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturnWithLocationInfo'
-        '404':
-          description: no data found  
-  /extracurricular_activities:
-    get:
-      summary: Return the number of quotasholder that studie in a federal institution and do any type of extracurricular activity (Intership, Teacher's Assistant, etc.). This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturn'
-        '404':
-          description: no data found  
-  /fies:
-    get:
-      summary: Return the number of students that got a loan from FIES. This route uses the FIES database listed above
-      tags:
-        - FIES
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - offer_location
-                - loan
-                - loan_type
-                - uf
-                - region
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: gender:"Feminino",ethnic:["Branco","Pardo"]
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                gender:
-                  type: array
-                  items:
-                    type: string
-                    enum: ['Masculino', 'Feminino']
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                    enum: ['Amarelo', 'Branco', 'Negro', 'Pardo', 'Índio']
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_cod:
-                  type: array
-                  items:
-                    type: integer
-                offer_location:
-                  type: array
-                  items:
-                    type: string
-                loan:
-                  type: array
-                  items:
-                    type: integer
-                    enum: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ]
-                loan_type:
-                  type: array
-                  items:
-                    type: string
-                    enum: ["F", "N", "S"]
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                region:
-                  type: array
-                  items:
-                    type: string
-                    enum: [ 'Norte', 'Nordeste', 'Centro-Oeste', 'Sul', 'Sudeste' ]
-                uf:
-                  type: array
-                  items:
-                    type: string
-                    enum: [ 'AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SP', 'SE', 'TO' ]
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/FiesReturn'
-        '404':
-          description: no data found  
-  /graduate:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and finished their studies
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-                - region
-                - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/BasicInepReturnWithLocationInfo'
-        '404':
-          description: no data found
-  
-  /course:
-    get:
-      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-               - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015", uf:"PR"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-                uf:
-                  type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/course'
-        '404':
-          description: no data found  
- 
-  /courseFIES:
-    get:
-      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the FIES database listed above
-      tags:
-        - FIES
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/coursePROUNI'
-        '404':
-          description: no data found  
-
-  /coursePROUNI:
-    get:
-      summary: Return the available courses made available by the IFES(Instituto Federal de Educação Superior). This route uses the PROUNI database listed above
-      tags:
-        - PROUNI
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/courseFIES'
-        '404':
-          description: no data found  
-          
-  /institution:
-    get:
-      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-               - uf
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015", uf:"PR"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-                uf:
-                  type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institution'
-        '404':
-          description: no data found  
-          
-  /institutionFIES:
-    get:
-      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the FIES database listed above
-      tags:
-        - FIES
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institutionFIES'
-        '404':
-          description: no data found            
-          
-  /institutionPROUNI:
-    get:
-      summary: Return the exiting IFES(Instituto Federal de Educação Superior) that are public. This route uses the PROUNI database listed above
-      tags:
-        - PROUNI
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institutionPROUNI'
-        '404':
-          description: no data found            
-  
-  /ibge_code:
-    get:
-      summary: Return the name and code of a city as well as the code for the state the city is in. This route uses the IBGE database listed above.
-      tags:
-        - EXTRA
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - city_name
-               - city_code
-               - state
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: city_name:"Curitiba", state:"17"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                city_name:
-                  type: string
-                city_code:
-                  type: number
-                state:
-                  type: number
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/ibge_code'
-        '404':
-          description: no data found  
-          
-  /institutionPrivate:
-    get:
-      summary: Return the existing IFES(Instituto Federal de Educação Superior) that are private. This route uses the INEP database listed above
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,uf
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-               - year
-               - min_year
-               - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2015"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: number
-                min_year:
-                  type: number
-                max_year:
-                  type: number
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/institutionPrivate'
-        '404':
-          description: no data found   
-     
-  /vacancy:
-    get:
-      summary: Return the number of quotasholder spots that are open to students in a federal institution
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - region
-                - uf
-                - cod_ies
-                - campus
-                - course
-                - shift
-                - name_ies
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/vacancy'
-        '404':
-          description: no data found
-          
-  /pnad:
-    get:
-      summary: Return the number of people obtained by IBGE in the PNAD research. This route uses the PNAD database listed above
-      tags:
-        - PNAD
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: level_of_education,type_of_school
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - ethnic
-                - type_of_school
-                - type_of_public_school
-                - level_of_education
-                - uf
-                - region
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: level_of_education:["2","6"],type_of_school:"4"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                ethnic:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['0', '2', '4', '6', '8', '9']
-                type_of_school:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['2', '4']
-                type_of_public_school:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['2','4','6']
-                level_of_education:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['1','2','3','4','5','6','10','11']
-                uf:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-                region:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-                year:
-                    type: "array"
-                    items: 
-                        type: "integer"
-                min_year:
-                    type: "integer"
-                max_year:
-                    type: "integer"
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/PnadReturn'
-        '404':
-          description: no data found
-  /prouni:
-    get:
-      summary: Return the number of people that received a scholarship from PROUNI. This route uses the PROUNI database listed above
-      tags:
-        - PROUNI
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - scholarship
-                - uf
-                - region
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Curso a distância"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: "string"
-                  enum: ["Curso a distância", "Integral", "Matutino", "Noturno", "Vespertino"]
-                gender:
-                  type: "string"
-                  enum: ["Masculino", "Feminino"]
-                ethnic:
-                  type: "string"
-                  enum: ["Amarela", "Branca", "Indígena", "Não Informada", "Parda", "Preta"]
-                course:
-                  type: "string"
-                institution:
-                  type: "string"
-                scholarship:
-                  type: "string"
-                  enum: ["BOLSA INTEGRAL", "BOLSA PARCIAL 50%"]
-                uf:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-                region:
-                    type: "array"
-                    items: 
-                        type: "string"
-                        enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-                year:
-                    type: "array"
-                    items: 
-                        type: "integer"
-                min_year:
-                    type: "integer"
-                max_year:
-                    type: "integer"
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/ProuniReturn'
-        '404':
-          description: no data found
-  /social_support:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and had some sort of social support
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - food_support
-                - support
-                - work_support
-                - courseware_support
-                - housing_support
-                - transport_support
-                - year
-                - min_year
-                - max_year
-                - cod_offer_location
-                - name_offer_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                food_support:
-                  type: array
-                  items:
-                    type: string
-                support:
-                  type: array
-                  items:
-                    type: string
-                work_support:
-                  type: array
-                  items:
-                    type: string
-                courseware_support:
-                  type: array
-                  items:
-                    type: string
-                housing_support:
-                  type: array
-                  items:
-                    type: string
-                transport_support:
-                  type: array
-                  items:
-                    type: string
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/SocialSupportReturn'
-        '404':
-          description: no data found
-  /student_loans:
-    get:
-      summary: Return the number of quotasholder that had been studying in a federal institution and contracted some sort of loan
-      tags:
-        - INEP
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift,gender,ethnic
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - cod_offer_location
-                - name_offer_location
-                - shift
-                - gender
-                - ethnic
-                - course
-                - institution
-                - institution_cod
-                - refund_fies
-                - refund_state
-                - refund_city
-                - refund_edu_inst
-                - refund_org
-                - refund_others
-                - no_refund_prouni_integral
-                - no_refund_prouni_partial
-                - no_refund_state
-                - no_refund_city
-                - no_refund_edu_inst
-                - no_refund_org
-                - no_refund_others
-                - year
-                - min_year
-                - max_year
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: shift:["Integral","Noturno"],gender:"Feminino"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                shift:
-                  type: array
-                  items:
-                    type: string
-                gender:
-                  type: array
-                  items:
-                    type: string
-                ethnic:
-                  type: array
-                  items:
-                    type: string
-                course:
-                  type: array
-                  items:
-                    type: string
-                institution:
-                  type: array
-                  items:
-                    type: string
-                institution_code:
-                  type: array
-                  items:
-                    type: integer
-                refund_fies:
-                  type: array
-                  items:
-                      type: string
-                refund_state:
-                  type: array
-                  items:
-                      type: string
-                refund_city:
-                  type: array
-                  items:
-                      type: string
-                refund_edu_inst:
-                  type: array
-                  items:
-                      type: string
-                refund_org:
-                  type: array
-                  items:
-                      type: string
-                refund_others:
-                  type: array
-                  items:
-                      type: string
-                no_refund_prouni_integral:
-                  type: array
-                  items:
-                      type: string
-                no_refund_prouni_partial:
-                  type: array
-                  items:
-                      type: string
-                no_refund_state:
-                  type: array
-                  items:
-                      type: string
-                no_refund_city:
-                  type: array
-                  items:
-                      type: string
-                no_refund_edu_inst:
-                  type: array
-                  items:
-                      type: string
-                no_refund_org:
-                  type: array
-                  items:
-                      type: string
-                no_refund_others:
-                  type: array
-                  items:
-                      type: string
-                year:
-                  type: array
-                  items:
-                    type: integer
-                min_year:
-                  type: integer
-                max_year:
-                  type: integer
-                cod_offer_location:
-                  type: array
-                  items:
-                    type: integer
-                name_offer_location:
-                  type: array
-                  items:
-                    type: string
-                region:
-                  type: array
-                  items:
-                    type: string
-                uf:
-                  type: array
-                  items:
-                    type: string
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/InepLoanReturn'
-        '404':
-          description: no data found
-  
-#  /ibge_census:
-#    get:
-#      summary: Return the number of people obtained by IBGE in the last census. This route uses the IBGE data listed above
-#      tags:
-#        - IBGE - Census
-#      parameters:
-#        - name: dims
-#          in: query
-#          description: Group data using a metric parameter
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: ethnic,gender
-#          schema:
-#            type: array
-#            items:
-#              type: string
-#              enum:
-#                - ethnic
-#                - gender
-#                - religion
-#                - income_range
-#                - age
-#                - age_greater_than
-#                - age_lesser_than
-#                - highest_education
-#                - school_daycare
-#                - work_status
-#                - education_level
-#                - ocupation_position_and_category
-#                - home_status
-#                - work_condition
-#                - mensal_home_income_range
-#                - relation_homeowner
-#        - name: filter
-#          in: query
-#          description: Filter data
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: ethnic:["2","6"],gender:"1"
-#          schema:
-#            type: array
-#            items:
-#              type: object
-#              properties:
-#                ethnic:
-#                  type: "array"
-#                  items: 
-#                      type: "string"
-#                      enum: ['1', '2', '3', '4', '5', '9']
-#                gender:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2']
-#                religion:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['0', '1', '2', '110', '111', '112', '120', '130', '140', '149', '199', '210', '219', '220', '221', '222', '223', '224', '225', '229', '230', '231', '232', '239', '240', '241', '242', '243', '244', '245', '249', '250', '251', '259', '260', '261', '262', '269', '270', '279', '280', '289', '300', '310', '311', '312', '319', '320', '329', '330', '339', '340', '349', '350', '359', '360', '369', '370', '379', '380', '389', '390', '399', '400', '401', '409', '420', '429', '430', '439', '440', '449', '450', '451', '452', '453', '454', '455', '460', '469', '470', '479', '480', '489', '490', '492', '499', '510', '519', '520', '529', '530', '590', '599', '610', '619', '620', '629', '630', '639', '640', '641', '649', '710', '711', '719', '740', '741', '749', '750', '751', '752', '753', '754', '755', '759', '760', '761', '762', '763', '764', '765', '766', '790', '791', '792', '793', '799', '810', '811', '819', '820', '821', '829', '830', '831', '832', '834', '839', '850', '890', '891', '892', '893', '894', '895', '896', '990', '999', ]
-#                income_range:
-#                    type: "array"
-#                    items: 
-#                        type: "number"
-#                age:
-#                    type: "array"
-#                    items: 
-#                        type: "integer"
-#                age_greater_than:
-#                    type: "array"
-#                    items: 
-#                        type: "integer"
-#                age_lesser_than:
-#                    type: "array"
-#                    items: 
-#                        type: "integer"
-#                highest_education:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: [null, '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14']    
-#                school_daycare:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2','3', '4']
-#                work_status:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: [null, '1', '2']
-#                education_level:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2', '3', '4', '5']
-#                ocupation_position_and_category:
-#                    type: "array"
-#                    items: 
-#                        type: "string"
-#                        enum: ['1', '2']    
-#                home_status: 
-#                    type: "array"
-#                    items:
-#                        type: "string"
-#                        enum: ['1', '2']    
-#                work_condition: 
-#                    type: "array"
-#                    items:
-#                        type: "string"
-#                        enum: [null, '1', '2']   
-#                mensal_home_income_range: 
-#                    type: "array"
-#                    items:
-#                        type: "number"  
-#                relation_homeowner: 
-#                    type: "array"
-#                    items:
-#                        type: "string" 
-#                        enum: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']
-#
-#      responses:
-#        '200':
-#          description: successful operation
-#          content:
-#            application/json:
-#              schema:
-#                $ref: '#/components/schemas/IBGECensusReturn'
-#        '404':
-#          description: no data found
-
-#  /cad_unico:
-#    get:
-#      summary: Return the number of people and families from that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-#      tags:
-#        - CadÚnico
-#      parameters:
-#        - name: dims
-#          in: query
-#          description: Group data using a metric parameter
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: year,home_type
-#          schema:
-#            type: array
-#            items:
-#              type: string
-#              enum:
-#                - year
-#                - per_capita_income
-#                - home_type
-#                - home_location
-#                - education_families
-#                - education_families_level
-#                - education_families_conclude
-#        - name: filter
-#          in: query
-#          description: Filter data
-#          allowReserved: true
-#          required: false
-#          explode: false
-#          style: form
-#          example: ethnic:["2","6"],gender:"1"
-#          schema:
-#            type: array
-#            items:
-#              type: object
-#              properties:
-#                year:
-#                  type: "array"
-#                  items: 
-#                      type: "string"
-#                      enum: ['2012', '2013', '2014', '2015', '2016']
-#                per_capita_income:
-#                  type: "array"
-#                  items:
-#                    type: "string"
-#                home_type:
-#                  type: "array"
-#                  items:
-#                    type: "string"
-#                    enum: [null, '1','2','3']
-#                home_location:
-#                  type: 'array'
-#                  items:
-#                    type: "number"
-#                education_families_conclude:
-#                  type: "array"
-#                  items:
-#                    type: "string"
-#                    enum: [null, '1', '2']
-#                education_families:
-#                  type: 'array'
-#                  items:
-#                    type: "string"
-#                    enum: [null, '1','2','3','4','5','6','7','8','9','10','11','12','13','14','15']
-#                education_families_level:
-#                  type: 'array'
-#                  items:
-#                    type: "string"
-#                    enum: [null,'1','2','3','4','5','6','7','8','9','10']
-
-#      responses:
-#        '200':
-#          description: successful operation
-#          content:
-#            application/json:
-#              schema:
-#                $ref: '#/components/schemas/CadUnicoReturn'
-#        '404':
-#          description: no data found
-                  
-  /african_culture:
-    get:
-      summary: Return the type of house and location of the houses that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - cod_local_home
-                - home_type
-                - home_location
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                cod_local_home:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2']
-                home_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3']
-                home_location:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1301902','1303809', '1304237','1500107','1502806','1503705','1503903','1504604','1504901','1505205']
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/AfricanCulture'
-        '404':
-          description: no data found
-          
-  /african_rights:
-    get:
-      summary: Return the education level and number of families that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - education_families_conclude
-                - education_families_level
-                - education_families
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                education_families_conclude:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','null']
-                education_families_level:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','7','8','9','null']
-                education_families:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['3','4','5','6','7','8','9','12','13','null']
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/AfricanRights'
-        '404':
-          description: no data found
-
-  /african_sustentability:
-    get:
-      summary: Return the average per capita income from families that belongs to 'terreiro communities' obtained by CadÚnico. This route uses the IBGE data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - family_type
-                - per_capita_income
-
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                vlr_renda_media_fam:
-                  type: "array"
-                  items:
-                    type: "number"
-                    minimum: 0
-                    maximum: 3000
-                    
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/AfricanSustentability'
-        '404':
-          description: no data found
-          
-  /eixo_2:
-    get:
-      summary: Return the infraestructure and life quality information about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - family_type
-                - cod_local_home
-                - cod_home_lighting
-                - cod_home_trash_destiny
-                - cod_home_watter_supply
-                - cod_sanitary_dump
-                - home_type
-                - home_location
-                - uf
-                - region
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                family_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['201','202','203','204','205','301','302','303','304','305','306','101','0','null']
-                cod_local_home:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2,','NA','null']
-                cod_home_lighting:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','NA','null']
-                cod_home_trash_destiny:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','null','NA']
-                cod_home_watter_supply:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','null','NA']
-                home_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1', '2', '3', 'null']  
-                uf:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
-                region:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']                       
-                cod_escoa_sanitario_domic_fam:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','null','NA']   
-                    
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/Eixo2'
-        '404':
-          description: no data found
-
-  /eixo_3:
-    get:
-      summary: Return the local development and productive inclusion about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - family_type
-                - cod_home_bolsa_familia
-                - cod_agriculture_job
-                - per_capita_income
-                - home_location
-                - uf
-                - region
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                family_type:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['201','202','203','204','205','301','302','303','304','305','306','101','0','null']
-                cod_home_bolsa_familia:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['0','1','null']
-                cod_agriculture_job:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['0','1','null','NA']
-                per_capita_income:
-                  type: "array"
-                  items:
-                    type: "string"
-                    minimum: 0
-                    maximum: 2800
-                home_location:    
-                  type: "array"
-                  items:
-                    type: "string"
-                    minimum: 1100015
-                    maximum: 5300108
-                uf:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
-                region:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']   
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/Eixo3'
-        '404':
-          description: no data found
-          
-  /eixo_4:
-    get:
-      summary: Return the rights and citizenship information about quilombola families obtained by CadÚnico. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-                - cod_local_home
-                - age
-                - education_families_conclude
-                - education_families_level
-                - education_families
-                - uf
-                - region
-                - gender
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: ethnic:["2","6"],gender:"1"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
-                age:
-                  type: "array"
-                  items:
-                    type: "string"
-                    minimum: 0
-                    maximum: 128
-                education_families_conclude:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','null']
-                education_families_level:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','1','3','4','5','6','7','8','9','10']
-                education_families:    
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','null']
-                uf:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['RS', 'BA', 'PA', 'PR', 'GO', 'MA', 'AL','SE', 'MG', 'PE', 'PI','RN', 'ES', 'PB', 'CE', 'SP', 'SC', 'MS', 'MT', 'AM', 'AP', 'RO', 'TO', 'RJ', 'AC','DF','RR']                        
-                region:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['norte','nordeste','sul','centro-oeste','sudeste']   
-                gender:
-                  type: "array"
-                  items:
-                    type: "string"
-                    enum: ['1','2','null']   
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/Eixo4'
-        '404':
-          description: no data found
-          
-  /quilombola_metrics:
-    get:
-      summary: Return the useful metrics for quilombola families obtained by CadÚnico, like the maximum, minimum and average income they have, per year. This route uses the CadUnico data listed above
-      tags:
-        - CadÚnico      
-      parameters:
-        - name: dims
-          in: query
-          description: Group data using a metric parameter
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year,home_type
-          schema:
-            type: array
-            items:
-              type: string
-              enum:
-                - year
-
-        - name: filter
-          in: query
-          description: Filter data
-          allowReserved: true
-          required: false
-          explode: false
-          style: form
-          example: year:"2016"
-          schema:
-            type: array
-            items:
-              type: object
-              properties:
-                year:
-                  type: "array"
-                  items: 
-                      type: "string"
-                      enum: ['2012', '2013', '2014', '2015', '2016','2017']
- 
-
-      responses:
-        '200':
-          description: successful operation
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/metrics'
-        '404':
-          description: no data found          
-        
-components:
-  schemas:
-
-    Eixo2:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_eixo_2 queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        ind_parc_mds_fam:
-          type: "number"
-        cod_local_domic_fam:
-          type: "number"
-        cod_iluminacao_domic_fam:
-          type: "number"
-        cod_destino_lixo_domic_fam:
-          type: "number"
-        cod_abaste_agua_domic_fam:
-          type: "number"
-        cod_especie_domic_fam:
-          type: "number"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        cod_escoa_sanitario_domic_fam:
-          type: "number"
-    Eixo3:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_eixo_3 queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        ind_parc_mds_fam:
-          type: "number"
-        marc_pbf:
-          type: "number"
-        ind_familia_quilombola_fam:
-          type: "number"
-        cod_agricultura_trab_memb:
-          type: "number"
-        vlr_renda_media_fam:
-          type: "number"
-        cd_ibge:
-          type: "number"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        cod_escoa_sanitario_domic_fam:
-          type: "number"
-   
-    Eixo4:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_eixo_3 queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        idade:
-          type: "number"
-        cod_concluiu_frequentou_memb:
-          type: "string"
-        cod_ano_serie_frequentou_memb:
-          type: "string"
-        cod_curso_frequentou_pessoa_memb:
-          type: "string"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        genero:
-          type: "string"    
-          
-    metrics:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in quilombola_metrics queries
-      properties:
-        ano_pesquisa:
-          type: "number"
-
-    AfricanSustentability:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in african_rights queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        vlr_renda_media_fam:
-          type: "number"
-
-          
-    AfricanRights:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in african_rights queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        cod_concluiu_frequentou_memb:
-          type: "string"
-        cod_ano_serie_frequentou_memb:
-          type: "string"
-        cod_curso_frequentou_pessoa_memb:
-          type: "string"
-          
-    AfricanCulture:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in african_culture queries
-      properties:
-        total:
-          type: "number"
-        ano_pesquisa:
-          type: "number"
-        cod_local_domic_fam:
-          type: "string"
-        cod_especie_domic_fam:
-          type: "string"
-        cd_ibge:
-          type: "string"
-        
-#    CadUnicoReturn:
-#      type: object
-#      required: ['total']
-#      description: | 
-#        This model represents the return possibilities in CadUnico queries
-#      properties:
-#        total:
-#          type: "number"
-#        ano_pesquisa: 
-#          type: "number"
-#        vlr_renda_media_fam:      
-#          type: "number"
-#        cod_especie_domic_fam: 
-#          type: "string"
-#        cd_ibge: 
-#          type: "string"
-#        cod_concluiu_frequentou_memb: 
-#          type: "string"  
-#        cod_ano_serie_frequentou_memb:
-#          type: "string"     
-#        cod_curso_frequentou_pessoa_memb:
-#          type: "string"  
-          
-    course:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in course queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"
-    courseFIES:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in courseFIES queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"
-    coursePROUNI:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in course queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"      
-    institution:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institution queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"  
-
-    institutionFIES:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institutionFIES queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-          
-    institutionPROUNI:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institutionPROUNI queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-          
-          
-    institutionPrivate:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in institution queries
-      properties:
-        total:
-          type: "number"
-        year:
-          type: "number"
-        uf: 
-          type: "string"   
-          
-    ibge_code:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in ibge_code queries
-      properties:
-        no_cidade:
-          type: "string"
-        co_cidade:
-          type: "number"
-        sgl_estado: 
-          type: "string"           
-          
-#    IBGECensusReturn:
-#      type: object
-#      required: ['total']
-#      description: |
-#        This model represents the return possibilities in IBGE Census queries
-#      properties:
-#        total:
-#          type: "number"
-#        co_cor_raca:
-#          type:  "string"
-##        co_sexo:
-#          type:  "string"
-#        co_religiao:
-#          type:  "string"
-#        nu_sal_min_todos_trabalhos:
-#          type: "number"
-#        nu_idade_calculada_anos:
-#          type: "number" 
-#        co_curso_mais_elevado_freq:
-#          type: "string" 
- #       co_freq_escola_creche:
-#          type: "string"
-#        co_condicao_atividade_semana_ref:
-#          type: "string" 
-#       co_nivel_instrucao:
-#         type: "string" 
-#        co_posicao_na_ocupacao_e_categoria_do_emprego:
-#          type: "string" 
-#        co_situacao_dom:
-#          type: "string" 
-#        co_condicao_ocupacao_semana_ref:
-#          type: "string" 
-#        vl_rendimneto_mensal_domicilio_sal_min_per_capita:
-#          type: "number" 
-#        co_relacao_responsavel_dom:
-#          type: "string"   
-          
-    BasicInepReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is not needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"
-    BasicInepReturnWithLocationInfo:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"
-              region:
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-              uf:
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-                
-    vacancy:
-      type: object
-      required: ['total']
-      description: |
-        This model represents the return possibilities in vacancy queries
-      properties:
-        total:
-          type: "number"
-        uf:
-          type: "string"
-        region:
-          type: "string"
-        year:
-          type: "number"
-        cod_ies:
-          type: "integer"
-        campus:
-          type: "string"
-        curso:
-          type: "string"
-        turno:
-          type: "string"
-        nome_ies:
-          type: "string"
-        cod_especie_domic_fam:
-          type: "number"
-        total_vagas_ampla_concorrencia_nao_pcd:
-          type: "number"
-        total_vagas_ampla_concorrencia_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_ppi_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_ppi_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_outros_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_baixa_outros_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_ppi_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_ppi_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_outros_nao_pcd:
-          type: "number"
-        total_vagas_cotas_renda_alta_outros_pcd:
-          type: "number"
-        total_total_pcd:
-          type: "number"
-
-
-          
-    FiesReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in FIES queries.
-        Note that there will always exists the total and nu_ano keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'nu_ano']
-            properties:
-              total:
-                type: "number"
-              nu_ano:
-                type: "integer"
-                format: "int32"
-              ds_sexo:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_raca_cor:
-                type: "string"
-                enum: ['Amarelo','Branco','Negro','Pardo','Índio']
-              ds_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              no_campus:
-                type: "string"
-              nu_percent_solicitado_financ:
-                type: integer
-                enum: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ]
-              tp_fianca:
-                type: "string"
-                enum: ["F", "N", "S"]
-                description: |
-                  Meanings of each letter:
-                
-                  F - Fundo de Garantia de Operações de Crédito Educativo – FGEDUC
-                  
-                  N - Normal/Convencional
-                  
-                  S - Solidária
-              region:
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-              uf:
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
-    PnadReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in PNAD queries.
-        Note that there will always exists the total and nu_ano_referencia keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'nu_ano_referencia']
-            properties:
-              total:
-                type: "number"
-              nu_ano_referencia:
-                type: "integer"
-                format: "int32"
-              co_cor_raca: 
-                type: "string"
-                enum: ['0', '2', '4', '6', '8', '9']
-              co_rede_ensino:
-                type: "string"
-                enum: ['2', '4']
-              co_area_rede_publica_ensino:
-                type: "string"
-                enum: ['2','4','6']
-              co_curso:
-                type: "string"
-                enum: ['1','2','3','4','5','6','10','11']
-              uf:
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"] 
-              region:
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-    ProuniReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in PROUNI queries.
-        Note that there will always exists the total and ano_concessao_bolsa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'ano_concessao_bolsa']
-            properties:
-              total:
-                type: "number"
-              ano_concessao_bolsa:
-                type: "integer"
-                format: "int32"
-              nome_turno_curso_bolsa:
-              # shift
-                type: "string"
-                enum: ['Curso a distância', 'Integral', 'Matutino', 'Noturno', 'Vespertino']
-              sexo_beneficiario_bolsa:
-              # gender
-                type: "string"
-                enum: ["Masculino", "Feminino"]
-              raca_beneficiario_bolsa:
-              # ethnic
-                type: "string"
-                enum: ['Amarela', 'Branca', 'Indígena', 'Não Informada', 'Parda', 'Preta']
-              nome_curso_bolsa:
-              # course
-                type: "string"
-              nome_ies_bolsa:
-              # institution
-                type: "string"
-              tipo_bolsa:
-              # scholarship
-                type: "string"
-                enum: ["BOLSA INTEGRAL", "BOLSA PARCIAL 50%"]               
-              sigla_uf_beneficiario_bolsa:
-              # uf
-                type: "string"
-                enum: ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]            
-              regiao_beneficiario_bolsa:
-              # region
-                type: "string"
-                enum: ['Norte', 'Nordeste',  'Centro-Oeste', 'Sul', 'Sudeste']
-    SocialSupportReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is not needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"  
-              in_apoio_alimentacao:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_bolsa_pemanencia:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_bolsa_trabalho:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_material_didatico:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_moradia:
-                type: "string"
-                enum: ["0", "1"]
-              in_apoio_transporte:
-                type: "string"
-                enum: ["0", "1"]
-    InepLoanReturn:
-      type: object
-      required: ['result']
-      description: |
-        This model represents the return possibilities in INEP queries when location information is not needed.
-        Note that there will always exists the total and no_ano_pesquisa keys.
-        All the other keys are optional and appear if the dims paramter is used.
-      properties:
-        result:
-          type: array
-          items:
-            type: object
-            required: ['total', 'no_ano_pesquisa']
-            properties:
-              total:
-                type: "number"
-              no_ano_pesquisa:
-                type: "integer"
-                format: "int32"
-              ds_turno_aluno:
-                type: "string"
-                enum: ['Integral', 'Matutino', 'Noturno', 'Não aplicável', 'Vespertino']
-              ds_sexo_aluno:
-                type: "string"
-                enum: ['Masculino', 'Feminino']
-              ds_cor_raca_aluno:
-                type: "string"
-                enum: ['Aluno não quis declarar cor/raça', 'Amarela', 'Branca', 'Indígena', 'Parda', 'Preta']
-              no_curso:
-                type: "string"
-              no_ies:
-                type: "string"
-              co_ies:
-                type: "integer"
-              refund_fies:
-                type: "string"
-                enum: ["0", "1"]
-              refund_state:
-                  type: "string"
-                  enum: ["0", "1"]
-              refund_city:
-                type: "string"
-                enum: ["0", "1"]
-              refund_edu_inst:
-                type: "string"
-                enum: ["0", "1"]
-              refund_org:
-                type: "string"
-                enum: ["0", "1"]
-              refund_others:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_prouni_integral:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_prouni_partial:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_state:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_city:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_edu_inst:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_org:
-                type: "string"
-                enum: ["0", "1"]
-              no_refund_others:
-                type: "string"
-                enum: ["0", "1"]
-              co_local_oferta:
-                type: "integer"
-              no_local_oferta:
-                type: "string"
\ No newline at end of file
diff --git a/src/libs/middlewares/reqQueryFields.js b/src/libs/middlewares/reqQueryFields.js
index 424ef59b..74d64d9a 100644
--- a/src/libs/middlewares/reqQueryFields.js
+++ b/src/libs/middlewares/reqQueryFields.js
@@ -28,6 +28,7 @@ function parseWhereValue(type, value) {
     if(type === 'integer') return parseInt(value, 10);
     if(type === 'double') return parseFloat(value);
     if(type === 'string') return value;
+    if(type === 'like_string') return value;
     if(type === 'boolean') {
         if(value === null || typeof value === 'boolean') {
             return value;
diff --git a/src/libs/routes/SMPPIR/indigenas_territorial.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
index 5667e386..e88ee456 100644
--- a/src/libs/routes/SMPPIR/indigenas_territorial.js
+++ b/src/libs/routes/SMPPIR/indigenas_territorial.js
@@ -80,8 +80,8 @@ rqf.addField({
     tableField: 'sigla_uf',
     resultField: 'unidade_federativa',
     where: {
-        relation: '=',
-        type: 'string',
+        relation: 'LIKE',
+        type: 'like_string',
         field: 'sigla_uf'
     }
 }).addValue({
@@ -130,8 +130,8 @@ rqf.addField({
     tableField: 'regiao',
     resultField: 'nome_regiao',
     where: {
-        relation: '=',
-        type: 'string',
+        relation: 'LIKE',
+        type: 'like_string',
         field: 'nome_regiao'
     }
 });
-- 
GitLab


From b184a91f0c74f089cce45d49e41257c1778e156e Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <h.v.ehrenfried@hotmail.com>
Date: Mon, 23 Nov 2020 11:21:19 -0300
Subject: [PATCH 30/39] Allow like_string to use wildcards

Signed-off-by: Henrique Varella Ehrenfried <h.v.ehrenfried@hotmail.com>
---
 src/libs/middlewares/reqQueryFields.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/middlewares/reqQueryFields.js b/src/libs/middlewares/reqQueryFields.js
index 74d64d9a..34fdd0ba 100644
--- a/src/libs/middlewares/reqQueryFields.js
+++ b/src/libs/middlewares/reqQueryFields.js
@@ -28,7 +28,7 @@ function parseWhereValue(type, value) {
     if(type === 'integer') return parseInt(value, 10);
     if(type === 'double') return parseFloat(value);
     if(type === 'string') return value;
-    if(type === 'like_string') return value;
+    if(type === 'like_string') return "%"+value+"%";
     if(type === 'boolean') {
         if(value === null || typeof value === 'boolean') {
             return value;
-- 
GitLab


From dd13d2888a481b378758aaf770b4f1f99acd7cc0 Mon Sep 17 00:00:00 2001
From: Henrique Varella Ehrenfried <h.v.ehrenfried@hotmail.com>
Date: Mon, 23 Nov 2020 11:27:38 -0300
Subject: [PATCH 31/39] Fix bug with region in indigenas_territorail

Signed-off-by: Henrique Varella Ehrenfried <h.v.ehrenfried@hotmail.com>
---
 src/libs/routes/SMPPIR/indigenas_territorial.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_territorial.js b/src/libs/routes/SMPPIR/indigenas_territorial.js
index e88ee456..e5274dbf 100644
--- a/src/libs/routes/SMPPIR/indigenas_territorial.js
+++ b/src/libs/routes/SMPPIR/indigenas_territorial.js
@@ -132,7 +132,7 @@ rqf.addField({
     where: {
         relation: 'LIKE',
         type: 'like_string',
-        field: 'nome_regiao'
+        field: 'regiao'
     }
 });
 
-- 
GitLab


From a821d54889cf7f6a316b7d2efb37d43d4bbf154b Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Wed, 25 Nov 2020 12:14:57 -0300
Subject: [PATCH 32/39] create quilombola schools routes

---
 src/libs/routes/SMPPIR/quilombola_schools.js | 145 +++++++++++++++++++
 1 file changed, 145 insertions(+)
 create mode 100644 src/libs/routes/SMPPIR/quilombola_schools.js

diff --git a/src/libs/routes/SMPPIR/quilombola_schools.js b/src/libs/routes/SMPPIR/quilombola_schools.js
new file mode 100644
index 00000000..38665357
--- /dev/null
+++ b/src/libs/routes/SMPPIR/quilombola_schools.js
@@ -0,0 +1,145 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var quilombolaSchoolsApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'quilombola_schools_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_censo',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'localizacao_diferenciada',
+    table: 'quilombola_schools_ag',
+    tableField: 'localizacao_diferenciada_id',
+    resultField: 'cod_localizacao_diferenciada',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'localizacao_diferenciada_id'
+    }
+}).addValue({
+    name: 'agua',
+    table: 'quilombola_schools_ag',
+    tableField: 'agua_rede_publica',
+    resultField: 'abastecimento_agua_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'agua_rede_publica'
+    }
+}).addValue({
+    name: 'energia',
+    table: 'quilombola_schools_ag',
+    tableField: 'energia_rede_publica',
+    resultField: 'abastecimento_energia_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'energia_rede_publica'
+    }
+}).addValue({
+    name: 'esgoto',
+    table: 'quilombola_schools_ag',
+    tableField: 'esgoto_rede_publica',
+    resultField: 'esgotamento_snaitario_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'esgoto_rede_publica'
+    }
+}).addValue({
+    name: 'lixo',
+    table: 'quilombola_schools_ag',
+    tableField: 'lixo_coleta_periodica',
+    resultField: 'coleta_lixo_periodica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'lixo_coleta_periodica'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'quilombola_schools_ag',
+    tableField: 'sigla',
+    resultField: 'sigla_uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla'
+    }
+}).addValue({
+    name: 'id',
+    table: 'quilombola_schools_ag',
+    tableField: 'id',
+    resultField: 'escola_id',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'id'
+    }
+}).addValue({
+    name: 'etapa_ensino',
+    table: 'quilombola_schools_ag',
+    tableField: 'etapa_ensino',
+    resultField: 'etapa_ensino',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'etapa_ensino'
+    }
+});
+
+quilombolaSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('COUNT(distinct id) AS Total').from('quilombola_schools_ag');
+    next();
+}, query, response('quilombola_esc'));
+
+module.exports = quilombolaSchoolsApp;
\ No newline at end of file
-- 
GitLab


From 52fd759d0115fb9f5cf5b17678fe1bf5c2763c90 Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Thu, 26 Nov 2020 09:47:27 -0300
Subject: [PATCH 33/39] fix route quilombola_schools

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

diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 500a577c..072c8613 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -128,6 +128,8 @@ const indigenas_schools = require(`${libs}/routes/SMPPIR/indigenas_schools`);
 
 const indigenas_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment`);
 
+const quilombola_schools = require(`${libs}/routes/SMPPIR/quilombola_schools`);
+
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
 });
@@ -180,5 +182,6 @@ api.use('/indigenas_rights', indigenas_rights)
 api.use('/indigenas_territorial', indigenas_territorial)
 api.use('/indigenas_schools', indigenas_schools)
 api.use('/indigenas_enrollment', indigenas_enrollment)
+api.use('/quilombola_schools', quilombola_schools)
 
 module.exports = api;
-- 
GitLab


From d9bf00e647b4a99b53796c9df666e82807b3d8fa Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Thu, 26 Nov 2020 09:57:28 -0300
Subject: [PATCH 34/39] create quilombola_enrollment routes

---
 .../routes/SMPPIR/quilombola_enrollment.js    | 145 ++++++++++++++++++
 src/libs/routes/api.js                        |   3 +
 2 files changed, 148 insertions(+)
 create mode 100644 src/libs/routes/SMPPIR/quilombola_enrollment.js

diff --git a/src/libs/routes/SMPPIR/quilombola_enrollment.js b/src/libs/routes/SMPPIR/quilombola_enrollment.js
new file mode 100644
index 00000000..a41bab05
--- /dev/null
+++ b/src/libs/routes/SMPPIR/quilombola_enrollment.js
@@ -0,0 +1,145 @@
+'use strict';
+
+/*
+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/>.
+*/
+
+var express = require('express');
+
+var quilombolaEnrollmentApp = express.Router();
+
+var libs = process.cwd() + '/libs';
+
+var squel = require('squel');
+
+var query = require(libs + '/middlewares/query').query;
+
+var response = require(libs + '/middlewares/response');
+
+var ReqQueryFields = require(libs + '/middlewares/reqQueryFields');
+
+var rqf = new ReqQueryFields();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValue({
+    name: 'year',
+    table: 'quilombola_schools_ag',
+    tableField: 'ano_censo',
+    resultField: 'ano_censo',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'localizacao_diferenciada',
+    table: 'quilombola_schools_ag',
+    tableField: 'localizacao_diferenciada_id',
+    resultField: 'cod_localizacao_diferenciada',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'localizacao_diferenciada_id'
+    }
+}).addValue({
+    name: 'agua',
+    table: 'quilombola_schools_ag',
+    tableField: 'agua_rede_publica',
+    resultField: 'abastecimento_agua_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'agua_rede_publica'
+    }
+}).addValue({
+    name: 'energia',
+    table: 'quilombola_schools_ag',
+    tableField: 'energia_rede_publica',
+    resultField: 'abastecimento_energia_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'energia_rede_publica'
+    }
+}).addValue({
+    name: 'esgoto',
+    table: 'quilombola_schools_ag',
+    tableField: 'esgoto_rede_publica',
+    resultField: 'esgotamento_snaitario_rede_publica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'esgoto_rede_publica'
+    }
+}).addValue({
+    name: 'lixo',
+    table: 'quilombola_schools_ag',
+    tableField: 'lixo_coleta_periodica',
+    resultField: 'coleta_lixo_periodica',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'lixo_coleta_periodica'
+    }
+}).addValue({
+    name: 'uf',
+    table: 'quilombola_schools_ag',
+    tableField: 'sigla',
+    resultField: 'sigla_uf',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'sigla'
+    }
+}).addValue({
+    name: 'id',
+    table: 'quilombola_schools_ag',
+    tableField: 'id',
+    resultField: 'escola_id',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'id'
+    }
+}).addValue({
+    name: 'etapa_ensino',
+    table: 'quilombola_schools_ag',
+    tableField: 'etapa_ensino',
+    resultField: 'etapa_ensino',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'etapa_ensino'
+    }
+});
+
+quilombolaEnrollmentApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
+    console.log(req.sql.toString());
+    req.sql.field('SUM(total) AS Total').from('quilombola_schools_ag');
+    next();
+}, query, response('quilombola_mat'));
+
+module.exports = quilombolaEnrollmentApp;
\ No newline at end of file
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 072c8613..47cdac5d 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -130,6 +130,8 @@ const indigenas_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment
 
 const quilombola_schools = require(`${libs}/routes/SMPPIR/quilombola_schools`);
 
+const quilombola_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment`);
+
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
 });
@@ -183,5 +185,6 @@ api.use('/indigenas_territorial', indigenas_territorial)
 api.use('/indigenas_schools', indigenas_schools)
 api.use('/indigenas_enrollment', indigenas_enrollment)
 api.use('/quilombola_schools', quilombola_schools)
+api.use('/quilombola_enrollment', quilombola_enrollment)
 
 module.exports = api;
-- 
GitLab


From 9e5f914445bcd623da77c739cb33b71531474e9a Mon Sep 17 00:00:00 2001
From: ns17 <ns17@inf.ufpr.br>
Date: Thu, 26 Nov 2020 10:13:29 -0300
Subject: [PATCH 35/39] fix quilombola_enrollment route

---
 src/libs/routes/api.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 47cdac5d..a08e0a42 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -130,7 +130,7 @@ const indigenas_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment
 
 const quilombola_schools = require(`${libs}/routes/SMPPIR/quilombola_schools`);
 
-const quilombola_enrollment = require(`${libs}/routes/SMPPIR/indigenas_enrollment`);
+const quilombola_enrollment = require(`${libs}/routes/SMPPIR/quilombola_enrollment`);
 
 api.get('/', (req, res) => {
     res.json({ msg: 'SMPPIR API is running' });
-- 
GitLab


From 92faeeafee3e656cb147b715370af314762bcc51 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Wed, 16 Dec 2020 11:39:31 -0300
Subject: [PATCH 36/39] I430

---
 src/libs/routes/SMPPIR/indigenas_infrastructure.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_infrastructure.js b/src/libs/routes/SMPPIR/indigenas_infrastructure.js
index 470d4366..34fbf963 100644
--- a/src/libs/routes/SMPPIR/indigenas_infrastructure.js
+++ b/src/libs/routes/SMPPIR/indigenas_infrastructure.js
@@ -148,7 +148,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total').from('indigenas_infrastructure_ag');
+    req.sql.field('COUNT(total) AS Total').from('indigenas_infrastructure_ag');
     next();
 }, query, response('cad_unico'));
 
-- 
GitLab


From 88c4299345990516a04b3c28a76309dabc987522 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Wed, 16 Dec 2020 11:54:41 -0300
Subject: [PATCH 37/39] i340

---
 src/libs/routes/SMPPIR/indigenas_development.js    | 2 +-
 src/libs/routes/SMPPIR/indigenas_infrastructure.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_development.js b/src/libs/routes/SMPPIR/indigenas_development.js
index 4486c8f5..286b9481 100644
--- a/src/libs/routes/SMPPIR/indigenas_development.js
+++ b/src/libs/routes/SMPPIR/indigenas_development.js
@@ -128,7 +128,7 @@ rqf.addField({
 
 cad_unico_count.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('SUM(total) AS Total').from('indigenas_development_ag');
+    req.sql.field('COUNT(total) AS Total').from('indigenas_development_ag');
     next();
 }, query, response('cad_unico'));
 
diff --git a/src/libs/routes/SMPPIR/indigenas_infrastructure.js b/src/libs/routes/SMPPIR/indigenas_infrastructure.js
index 34fbf963..470d4366 100644
--- a/src/libs/routes/SMPPIR/indigenas_infrastructure.js
+++ b/src/libs/routes/SMPPIR/indigenas_infrastructure.js
@@ -148,7 +148,7 @@ rqf.addField({
 
 cad_unico.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('COUNT(total) AS Total').from('indigenas_infrastructure_ag');
+    req.sql.field('SUM(total) AS Total').from('indigenas_infrastructure_ag');
     next();
 }, query, response('cad_unico'));
 
-- 
GitLab


From 451f2376965c2896020b2bb3ad3542809fd12250 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Wed, 16 Dec 2020 11:55:35 -0300
Subject: [PATCH 38/39] i340

---
 src/libs/routes/SMPPIR/indigenas_development.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/routes/SMPPIR/indigenas_development.js b/src/libs/routes/SMPPIR/indigenas_development.js
index 286b9481..70bd03d6 100644
--- a/src/libs/routes/SMPPIR/indigenas_development.js
+++ b/src/libs/routes/SMPPIR/indigenas_development.js
@@ -128,7 +128,7 @@ rqf.addField({
 
 cad_unico_count.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
     console.log(req.sql.toString());
-    req.sql.field('COUNT(total) AS Total').from('indigenas_development_ag');
+    req.sql.field('COUNT(distinct id_familia) AS Total').from('indigenas_development_ag');
     next();
 }, query, response('cad_unico'));
 
-- 
GitLab


From 73b780823e9b82d21c5c595b334be6bc8dfd6ce6 Mon Sep 17 00:00:00 2001
From: Rafael S Castliho <rscastilho@inf.ufpr.br>
Date: Thu, 17 Dec 2020 10:28:03 -0300
Subject: [PATCH 39/39] i438

---
 src/libs/routes/SMPPIR/indigenas_enrollment.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/libs/routes/SMPPIR/indigenas_enrollment.js b/src/libs/routes/SMPPIR/indigenas_enrollment.js
index 89812570..4570ff20 100644
--- a/src/libs/routes/SMPPIR/indigenas_enrollment.js
+++ b/src/libs/routes/SMPPIR/indigenas_enrollment.js
@@ -134,6 +134,16 @@ rqf.addField({
         type: 'string',
         field: 'etapa_ensino'
     }
+}).addValue({
+    name: 'modalidade_ensino',
+    table: 'indigenas_schools_ag',
+    tableField: 'modalidade_ensino',
+    resultField: 'modalidade_ensino',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'modalidade_ensino'
+    }
 });
 
 indigenasEnrollmentApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
-- 
GitLab