From ae55824037cc0d92a42b7267c32c0ddca63821b4 Mon Sep 17 00:00:00 2001
From: Fernando Gbur <fgs21@inf.ufpr.br>
Date: Wed, 17 Jul 2024 17:16:01 -0400
Subject: [PATCH] [ADD] Adding filters and dimensions to the route

---
 src/libs/routes_v1/rateSchoolNew.js | 84 -----------------------------
 1 file changed, 84 deletions(-)

diff --git a/src/libs/routes_v1/rateSchoolNew.js b/src/libs/routes_v1/rateSchoolNew.js
index 8b24d67d..4b76e5ee 100644
--- a/src/libs/routes_v1/rateSchoolNew.js
+++ b/src/libs/routes_v1/rateSchoolNew.js
@@ -24,8 +24,6 @@ const rateSchoolNewApp = express.Router();
 
 const libs = `${process.cwd()}/libs`;
 
-const squel = require('squel');
-
 const query = require(`${libs}/middlewares/query`).query;
 
 const response = require(`${libs}/middlewares/response`);
@@ -99,36 +97,6 @@ rqf.addField({
         foreign: 'cod_uf',
         foreignTable: 'pnad_novo'
     }
-}).addValue({
-    name: 'years_of_study',
-    table: 'pnad_novo',
-    tableField: 'anos_de_estudo',
-    resultField: 'years_of_study_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'anos_de_estudo'
-    }
-}).addValue({
-    name: 'instruction_level',
-    table: 'pnad_novo',
-    tableField: 'nivel_de_instrucao',
-    resultField: 'instruction_level_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'nivel_de_instrucao'
-    }
-}).addValue({
-    name: 'new_pnad_adm_dependency',
-    table: 'pnad_novo',
-    tableField: 'dependencia_adm',
-    resultField: 'new_pnad_adm_dependency_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'dependencia_adm'
-    }
 }).addValue({
     name: 'attends_school',
     table: 'pnad_novo',
@@ -139,46 +107,6 @@ rqf.addField({
         type: 'integer',
         field: 'frequenta_escola'
     }
-}).addValue({
-    name: 'modality',
-    table: 'pnad_novo',
-    tableField: 'modalidade',
-    resultField: 'modality_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'modalidade'
-    }
-}).addValue({
-    name: 'attended_modality',
-    table: 'pnad_novo',
-    tableField: 'nivel_etapa_modalidade_freq',
-    resultField: 'attended_modality_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'nivel_etapa_modalidade_freq'
-    }
-}).addValue({
-    name: 'illiteracy',
-    table: 'pnad_novo',
-    tableField: 'analfabetismo',
-    resultField: 'illiteracy_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'analfabetismo'
-    }
-}).addValue({
-    name: 'modality_shift',
-    table: 'pnad_novo',
-    tableField: 'turno_nivel_etapa',
-    resultField: 'modality_shift_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'turno_nivel_etapa'
-    }
 }).addValue({
     name: 'bolsa_familia',
     table: 'pnad_novo',
@@ -209,16 +137,6 @@ rqf.addField({
         type: 'integer',
         field: 'faixa_etaria'
     }
-}).addValue({
-    name: 'income_range',
-    table: 'pnad_novo',
-    tableField: 'faixa_rendimento_aux',
-    resultField: 'income_range_id',
-    where: {
-        relation: '=',
-        type: 'integer',
-        field: 'faixa_rendimento_aux'
-    }
 }).addValue({
     name: 'gender',
     table: 'pnad_novo',
@@ -325,8 +243,6 @@ function matchQueries(attendsSchoolObj, populationObj) {
         match.push(newObj);
     }
 
-    console.log(match)
-
     return match;
 }
 
-- 
GitLab