Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AGES-Adocoes
Adocoes
Commits
905c5ebe
Commit
905c5ebe
authored
7 years ago
by
Thiago Rocha
Browse files
Options
Download
Email Patches
Plain Diff
fix interessado documentos
parent
f84e335d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
api/src/Interessado/Adapter.js
+4
-2
api/src/Interessado/Adapter.js
api/src/Interessado/Translator.js
+0
-1
api/src/Interessado/Translator.js
api/src/Model/index.js
+3
-1
api/src/Model/index.js
api/src/server.js
+14
-5
api/src/server.js
api/test/inicializacaoMongo.mongo
+13
-7
api/test/inicializacaoMongo.mongo
with
34 additions
and
16 deletions
+34
-16
api/src/Interessado/Adapter.js
View file @
905c5ebe
...
...
@@ -78,8 +78,10 @@ export default class Adapter {
deleteInterest
()
{}
getDocuments
(
id
)
{
console
.
log
(
id
);
return
this
.
Interessado
.
findById
(
id
).
select
(
'
outrosDocumentos
'
);
return
this
.
Interessado
.
findById
(
id
).
select
(
'
outrosDocumentos
'
)
.
then
((
result
,
err
)
=>
{
return
{
documentos
:
result
.
outrosDocumentos
}
});
}
}
This diff is collapsed.
Click to expand it.
api/src/Interessado/Translator.js
View file @
905c5ebe
...
...
@@ -246,7 +246,6 @@ export default class Translator {
id
:
request
.
params
.
id_interessado
,
...
request
.
body
}
console
.
log
(
body
);
const
interactor
=
new
this
.
Interactor
();
interactor
.
getDocuments
(
body
)
...
...
This diff is collapsed.
Click to expand it.
api/src/Model/index.js
View file @
905c5ebe
...
...
@@ -4,6 +4,7 @@ import Abrigo from "./abrigo.js";
import
Administrador
from
"
./administrador.js
"
;
import
Cidade
from
"
./cidade.js
"
;
import
Conteudo
from
"
./conteudo.js
"
;
import
Documento
from
"
./documento.js
"
;
import
Endereco
from
"
./endereco.js
"
;
import
Estado
from
"
./estado.js
"
;
import
Etnia
from
"
./etnia.js
"
;
...
...
@@ -25,6 +26,7 @@ export {
Administrador
,
Cidade
,
Conteudo
,
Documento
,
Endereco
,
Estado
,
Etnia
,
...
...
@@ -40,4 +42,4 @@ export {
Usuario
,
Vinculo
,
Visualizacao
};
\ No newline at end of file
};
This diff is collapsed.
Click to expand it.
api/src/server.js
View file @
905c5ebe
...
...
@@ -102,7 +102,7 @@ server.del("/usuarios/:id_usuario", AuthManager.userAuthenticated, function(req,
});
// P1
// RFU06: GET /usuarios/:id_usuario/perfis
// RFU06: GET /usuarios/:id_usuario/perfis
server
.
get
(
"
/usuarios/:id_usuario/perfis
"
,
AuthManager
.
userAuthenticated
,
function
(
req
,
res
)
{
const
usuarioTranslator
=
new
UsuarioTranslator
();
usuarioTranslator
.
getPerfilByUsuarioId
(
req
,
res
);
...
...
@@ -313,22 +313,31 @@ server.del("/interessados/:id_interessado/menores/:id_menor", AuthManager.userAu
// RFI17 (2017-2): GET /interessados/:id_interessado/mensagens
// RFI18 (2017-2): PUT /usuarios/:id_usuario/mensagens
// RFI19 (2017-2): POST /interessados/:id_interessado/documentos
// RFI20 (2017-2): GET /interessados/:id_interessado/documentos
/**
* @api {get} /interessados/:id_interessado/documentos Request User Documents
* @apiGroup Interessado
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "firstname": "John",
* "lastname": "Doe"
* "documentos": [
* {
* "numero": "233837164",
* "dataEmissao": "1991-12-12T00:00:00.000Z",
* "orgaoEmissor": "SSP",
* "tipoDocumento": "RG",
* "imagem": null
* }
* ]
* }
*/
// RFI20 (2017-2): GET /interessados/:id_interessado/documentos
server
.
get
(
"
/interessados/:id_interessado/documentos
"
,
AuthManager
.
is
Authenticated
,
(
req
,
res
)
=>
{
server
.
get
(
"
/interessados/:id_interessado/documentos
"
,
AuthManager
.
user
Authenticated
,
(
req
,
res
)
=>
{
const
interessadoTranslator
=
new
InteressadoTranslator
();
interessadoTranslator
.
getDocuments
(
req
,
res
);
})
})
;
// RFI21 (2017-2): GET /interessados/:id_interessado/documentos/:id_documento
//
//resource: Conteudos
//
...
...
This diff is collapsed.
Click to expand it.
api/test/inicializacaoMongo.mongo
View file @
905c5ebe
...
...
@@ -21,15 +21,21 @@ testUsuario = {
db.usuarios.update(testUsuario, testUsuario, {upsert:true})
testI
nteressado ={
name: "
blablabla
",
cpf: "
12345687901
",
nomeConjuge: "
maria
",
i
nteressado
1
={
name: "
Interessado 1
",
cpf: "
44356652045
",
nomeConjuge: "
Interessada 1
",
email: "teste@gmail.com",
dataNascimento: "1991-12-12",
dataNascimento: "1991-12-12
T00:00:00.000Z
",
renda: "10000",
comprovantesRenda: null,
outrosDocumentos: null,
outrosDocumentos: {
numero : "233837164",
dataEmissao: "1991-12-12T00:00:00.000Z",
orgaoEmissor: "SSP",
tipoDocumento: "RG",
imagem: null
},
enderecos: "rua das carmelias, 435",
telefones: "30257345",
interesses: null,
...
...
@@ -37,4 +43,4 @@ testInteressado ={
ativo: true
}
db.interessados.update(
testI
nteressado
,testI
nteressado, {upsert:true})
db.interessados.update(
i
nteressado
1, i
nteressado
1
, {upsert:true})
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help