From 613e743bb9d5061e6054762b8e260f5c84d5d38f Mon Sep 17 00:00:00 2001
From: godp21 <godp21@inf.ufpr.br>
Date: Wed, 11 May 2022 12:01:23 -0300
Subject: [PATCH] adding new diff_location to auxiliar route

---
 src/libs/routes/auxiliar.js | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/libs/routes/auxiliar.js b/src/libs/routes/auxiliar.js
index 08a910e5..51ff543e 100644
--- a/src/libs/routes/auxiliar.js
+++ b/src/libs/routes/auxiliar.js
@@ -101,27 +101,22 @@ auxiliarApp.get('/adm_dependency', (req, res, next) => {
 }, response('adm_dependency'));
 
 auxiliarApp.get('/location', (req, res, next) => {
-    req.result = [];
-    for(let i = 1; i <= 2; ++i) {
-        req.result.push({
-            id: i,
-            name: id2str.location(i)
-        });
-    };
+    req.result = [
+        {id: 1, name: 'Urbana'},
+        {id: 2, name: 'Rural'}
+    ];
     next();
 }, response('location'));
 
-auxiliarApp.get('/rural_location', (req, res, next) => {
+auxiliarApp.get('/diff_location', (req, res, next) => {
     req.result = [
-        {id: 1, name: "Urbana"},
-        {id: 2, name: "Rural"},
-        {id: 3, name: "Rural - Área de assentamento"},
-        {id: 4, name: "Rural - Terra indígena"},
-        {id: 5, name: "Rural - Área remanescente de quilombos"},
-        {id: 6, name: "Rural - Unidade de uso sustentável"}
+        {id: 0, name: "A escola não está em localidade diferenciada"},
+        {id: 1, name: "Área de assentamento"},
+        {id: 2, name: "Terra indígena"},
+        {id: 3, name: "Terra remanescente de quilombos"},
     ];
     next();
-}, response('rural_location'));
+}, response('diff_location'));
 
 auxiliarApp.get('/education_level_mod', (req, res, next) => {
     req.result = [];
@@ -316,6 +311,16 @@ rqf.addField({
         type: 'integer',
         field: 'localizacao_id'
     }
+}).addValue({
+    name: 'diff_location',
+    table: 'docente',
+    tableField: 'localizacao_diferenciada_par',
+    resultField: 'diff_location_id',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'localizacao_diferenciada_par'
+    }
 }).addValue({
     name: 'min_year',
     table: 'docente',
-- 
GitLab