Skip to content
Snippets Groups Projects
Commit 298bab31 authored by Rafael S Castilho's avatar Rafael S Castilho
Browse files

add youth_jobs

parent 4d7d31cd
Branches
No related tags found
2 merge requests!28Development,!20Jvt viva trabalho
/*
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 jvt_trabalho_ag = 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: 'jvt_trabalho_ag',
tableField: 'ano_censo',
resultField: 'ano_pesquisa',
where: {
relation: '=',
type: 'integer',
field: 'ano_censo',
},
})
.addValue({
name: 'cor_ raca',
table: 'jvt_trabalho_ag',
tableField: 'cor_raca',
resultField: 'cor_raca',
where: {
relation: '=',
type: 'integer',
field: 'cor_raca',
},
})
.addValue({
name: 'trabalhou',
table: 'jvt_trabalho_ag',
tableField: 'trabalhou_referencia',
resultField: 'trabalhou',
where: {
relation: '=',
type: 'integer',
field: 'trabalhou_referencia',
},
})
.addValue({
name: 'vinculo',
table: 'jvt_trabalho_ag',
tableField: 'tipo_vinculo',
resultField: 'vinculo',
where: {
relation: '=',
type: 'integer',
field: 'tipo_vinculo',
},
})
.addValue({
name: 'rendimento_faixa',
table: 'jvt_trabalho_ag',
tableField: 'rendimento_faixa',
resultField: 'rendimento_faixa',
where: {
relation: '=',
type: 'integer',
field: 'rendimento_faixa',
},
})
.addValue({
name: 'rendimento_bruto',
table: 'jvt_trabalho_ag',
tableField: 'rendimento_bruto',
resultField: 'rendimento_bruto',
where: {
relation: '=',
type: 'integer',
field: 'rendimento_bruto',
},
})
.addValue({
name: 'uf',
table: 'jvt_trabalho_ag',
tableField: 'sgl_uf',
resultField: 'uf',
where: {
relation: '=',
type: 'string',
field: 'uf',
},
})
jvt_trabalho_ag.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
console.log(req.sql.toString());
req.sql.field('SUM(total) AS Total')
.from('jvt_trabalho_ag');
next();
}, query, response('jvt_trabalho_ag'));
module.exports = jvt_trabalho_ag;
...@@ -88,6 +88,8 @@ const ciganos_culture = require(`${libs}/routes/SMPPIR/ciganos_culture`) ...@@ -88,6 +88,8 @@ const ciganos_culture = require(`${libs}/routes/SMPPIR/ciganos_culture`)
const ciganos_sustentability = require(`${libs}/routes/SMPPIR/ciganos_sustentability`) const ciganos_sustentability = require(`${libs}/routes/SMPPIR/ciganos_sustentability`)
const youth_jobs = require(`${libs}/routes/SMPPIR/youth_jobs`)
api.get('/', (req, res) => { api.get('/', (req, res) => {
res.json({ msg: 'SMPPIR API is running' }); res.json({ msg: 'SMPPIR API is running' });
...@@ -125,6 +127,7 @@ api.use(`/quilombola_metrics`,quilombola_metrics) ...@@ -125,6 +127,7 @@ api.use(`/quilombola_metrics`,quilombola_metrics)
api.use('/ciganos_rights', ciganos_rights); api.use('/ciganos_rights', ciganos_rights);
api.use('/ciganos_culture', ciganos_culture); api.use('/ciganos_culture', ciganos_culture);
api.use('/ciganos_sustentability', ciganos_sustentability); api.use('/ciganos_sustentability', ciganos_sustentability);
api.use('/youth_jobs', youth_jobs)
module.exports = api; module.exports = api;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment