Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
7fc31867
Commit
7fc31867
authored
1 year ago
by
Fernando Gbur dos Santos
Browse files
Options
Downloads
Patches
Plain Diff
[ADD] Illieteracy convert file created, and added to id2str
parent
86cc749e
No related branches found
No related tags found
3 merge requests
!391
Hom -> Prod
,
!386
Merge development -> homologa
,
!385
Merge new_pnad -> development
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/libs/convert/Illiteracy.js
+30
-0
30 additions, 0 deletions
src/libs/convert/Illiteracy.js
src/libs/middlewares/id2str.js
+5
-2
5 additions, 2 deletions
src/libs/middlewares/id2str.js
src/libs/routes_v1/newPnad.js
+10
-6
10 additions, 6 deletions
src/libs/routes_v1/newPnad.js
with
45 additions
and
8 deletions
src/libs/convert/Illiteracy.js
0 → 100644
+
30
−
0
View file @
7fc31867
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-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.
simcaq-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 simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module
.
exports
=
function
newPnadAdmDependency
(
id
)
{
switch
(
id
)
{
case
0
:
return
'
Não
'
;
case
1
:
return
'
Sim
'
;
case
9
:
return
'
Não se aplica - 14 anos ou menos
'
;
}
};
This diff is collapsed.
Click to expand it.
src/libs/middlewares/id2str.js
+
5
−
2
View file @
7fc31867
...
@@ -102,6 +102,7 @@ const type = require(`${libs}/convert/type`);
...
@@ -102,6 +102,7 @@ const type = require(`${libs}/convert/type`);
const
level
=
require
(
`
${
libs
}
/convert/level`
);
const
level
=
require
(
`
${
libs
}
/convert/level`
);
const
scholarDependency
=
require
(
`
${
libs
}
/convert/scholarDependency`
);
const
scholarDependency
=
require
(
`
${
libs
}
/convert/scholarDependency`
);
const
newPnadAdmDependency
=
require
(
`
${
libs
}
/convert/newPnadAdmDependency`
);
const
newPnadAdmDependency
=
require
(
`
${
libs
}
/convert/newPnadAdmDependency`
);
const
Illiteracy
=
require
(
`
${
libs
}
/convert/Illiteracy`
);
const
ids
=
{
const
ids
=
{
gender_id
:
gender
,
gender_id
:
gender
,
...
@@ -195,7 +196,8 @@ const ids = {
...
@@ -195,7 +196,8 @@ const ids = {
type_id
:
type
,
type_id
:
type
,
level_id
:
level
,
level_id
:
level
,
scholar_dependency_id
:
scholarDependency
,
scholar_dependency_id
:
scholarDependency
,
new_pnad_adm_dependency_id
:
newPnadAdmDependency
new_pnad_adm_dependency_id
:
newPnadAdmDependency
,
illiteracy_id
:
Illiteracy
};
};
function
transform
(
removeId
=
false
)
{
function
transform
(
removeId
=
false
)
{
...
@@ -312,5 +314,6 @@ module.exports = {
...
@@ -312,5 +314,6 @@ module.exports = {
pee
,
pee
,
shift
,
shift
,
admDependencyPub
,
admDependencyPub
,
newPnadAdmDependency
newPnadAdmDependency
,
Illiteracy
};
};
This diff is collapsed.
Click to expand it.
src/libs/routes_v1/newPnad.js
+
10
−
6
View file @
7fc31867
...
@@ -49,11 +49,15 @@ PnadNovoApp.get('/years', (req, res, next) => {
...
@@ -49,11 +49,15 @@ PnadNovoApp.get('/years', (req, res, next) => {
},
query
,
response
(
'
years
'
));
},
query
,
response
(
'
years
'
));
PnadNovoApp
.
get
(
'
/illiteracy
'
,
(
req
,
res
,
next
)
=>
{
PnadNovoApp
.
get
(
'
/illiteracy
'
,
(
req
,
res
,
next
)
=>
{
req
.
result
=
[
req
.
result
=
[]
{
id
:
0
,
name
:
'
Não
'
},
{
id
:
1
,
name
:
'
Sim
'
},
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
{
id
:
9
,
name
:
'
Não se aplica - 14 anos ou menos
'
}
req
.
result
.
push
({
];
id
:
i
,
name
:
id2str
.
Illiteracy
(
i
)
});
req
.
result
.
push
({
id
:
9
,
name
:
id2str
.
Illiteracy
(
9
)});
}
next
();
next
();
},
response
(
'
illiteracy
'
));
},
response
(
'
illiteracy
'
));
...
@@ -148,7 +152,7 @@ rqf.addField({
...
@@ -148,7 +152,7 @@ rqf.addField({
name
:
'
illiteracy
'
,
name
:
'
illiteracy
'
,
table
:
'
pnad_novo
'
,
table
:
'
pnad_novo
'
,
tableField
:
'
analfabetismo
'
,
tableField
:
'
analfabetismo
'
,
resultField
:
'
illiteracy
'
,
resultField
:
'
illiteracy
_id
'
,
where
:
{
where
:
{
relation
:
'
=
'
,
relation
:
'
=
'
,
type
:
'
integer
'
,
type
:
'
integer
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment