From 320f7eafc9872cfeac5478dfd01ecd109becec2a Mon Sep 17 00:00:00 2001
From: fgs21 <fgs21@inf.ufpr.br>
Date: Thu, 12 Jun 2025 11:07:51 -0300
Subject: [PATCH] [hotfix] Removing some console.log() and fixing 'population
 out of school' results to 1 decimal place

---
 src/libs/routes_v1/courseAggregate.js       | 1 -
 src/libs/routes_v1/enrollmentAggregate.js   | 1 +
 src/libs/routes_v1/populationOutOfSchool.js | 6 +-----
 src/libs/routes_v1/rateSchool.js            | 3 ---
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/libs/routes_v1/courseAggregate.js b/src/libs/routes_v1/courseAggregate.js
index fdc6bd88..cf9a52f2 100644
--- a/src/libs/routes_v1/courseAggregate.js
+++ b/src/libs/routes_v1/courseAggregate.js
@@ -405,7 +405,6 @@ CourseAggregateApp.get('/', rqf.parse(), rqf.build(),  (req, res, next) => {
     .where('curso_superior_agregado.tp_nivel_acad = 1 AND qtd_cursos = 1')
     .group('curso_superior_agregado.ano_censo')
     .order('curso_superior_agregado.ano_censo')
-    console.log(req.sql.toString())
     next();
 }, query, id2str.transform(false), response('course_aggregate'));
 
diff --git a/src/libs/routes_v1/enrollmentAggregate.js b/src/libs/routes_v1/enrollmentAggregate.js
index db09b08d..408b952b 100644
--- a/src/libs/routes_v1/enrollmentAggregate.js
+++ b/src/libs/routes_v1/enrollmentAggregate.js
@@ -19,6 +19,7 @@ along with simcaq-node.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 const express = require('express');
+
 const { result } = require('lodash');
 
 const enrollmentAggregateApp = express.Router();
diff --git a/src/libs/routes_v1/populationOutOfSchool.js b/src/libs/routes_v1/populationOutOfSchool.js
index 99d991a5..d5686c23 100644
--- a/src/libs/routes_v1/populationOutOfSchool.js
+++ b/src/libs/routes_v1/populationOutOfSchool.js
@@ -445,14 +445,12 @@ function matchQueries(queryPartial, queryTotal) {
         if(objMatch) {
             newObj.denominator = result.total;
             newObj.pop_total = objMatch.total;
-            newObj.total = Math.round((objMatch.total / result.total) * 10000) / 100;
+            newObj.total = parseFloat(((objMatch.total / result.total) * 100).toFixed(1));
             match.push(newObj);
         }
     }
 )
 
-    console.log(match)
-
     return match;
 }
 
@@ -477,7 +475,6 @@ PopulationOutOfSchoolApp.get('/', rqf.parse(), rqf.build(),  (req, res, next) =>
         .order('pnad_novo.ano_ref')
         .order('pnad_novo.faixa_etaria_pop_out')
         req.querySet.push(attends_school);
-        console.log(attends_school.toString());
 
 
         // Then, the second object is created and stores the sum of all people without filters
@@ -501,7 +498,6 @@ PopulationOutOfSchoolApp.get('/', rqf.parse(), rqf.build(),  (req, res, next) =>
         // below is used
         let newObj = matchQueries(req.result[0], req.result[1]);
         req.result = newObj;
-        //console.log(attends_school.toString());
     } else {
         res.status(400);
         next({
diff --git a/src/libs/routes_v1/rateSchool.js b/src/libs/routes_v1/rateSchool.js
index a6a91b7b..37e0b283 100644
--- a/src/libs/routes_v1/rateSchool.js
+++ b/src/libs/routes_v1/rateSchool.js
@@ -257,8 +257,6 @@ function matchQueries(queryTotal, queryPartial) {
         keys.forEach((key) => {
             newObj[key] = result[key];
         });
-        // console.log('NEW OBJ');
-        // console.log(newObj);
         let index = keys.indexOf('total');
         if(index > -1) keys.splice(index, 1);
         let objMatch = null;
@@ -280,7 +278,6 @@ function matchQueries(queryTotal, queryPartial) {
         }
 
         if(objMatch) {
-            // console.log(objMatch);
             newObj.denominator = result.total;
             newObj.partial = objMatch.total;
             newObj.total = (objMatch.total / result.total) * 100;
-- 
GitLab