2
I’m using Controller architecture, DTO, Repositoy, Service
Use Postman to test the requests, I can do POST on User normally and when I do GET Postman returns me
{
"id": 3,
"nome": "Arthur",
"cpf": "281.590.328-89",
"cnh": "35214349616",
"telefone": "(61) 99805-2147",
"email": "[email protected]",
"senha": "1234",
"perfil": "alugador",
"endereco": {
"id": 3,
"logradouro": "Quadra SHPS Quadra 502",
"bairro": "Setor Habitacional Pôr do Sol (Ceilândia)",
"numero": 927,
"complemento": " ",
"cidade": "Brasília",
"estado": "DF"
}
}
I do POST on Car passing User id and GET returns me:
{
"id": 4,
"usuarioRegistrador": {
"id": 3,
"nome": "Arthur",
"cpf": "281.590.328-89",
"cnh": "35214349616",
"telefone": "(61) 99805-2147",
"email": "[email protected]",
"senha": "1234",
"perfil": "alugador",
"endereco": {
"id": 3,
"logradouro": "Quadra SHPS Quadra 502",
"bairro": "Setor Habitacional Pôr do Sol (Ceilândia)",
"numero": 927,
"complemento": " ",
"cidade": "Brasília",
"estado": "DF"
}
},
"kmsRodados": 555.0,
"documentoCarro": "555",
"tipoCombustivel": "55",
"marca": "CAMARO",
"modelo": "GOL BOLA",
"placa": "TTT-1555",
"valorCarro": 363636.0,
"estaAlugado": true
}
When I do a POST on Rent, passing User id and Car id, GET returns me "carro":null
Can someone help me?
{
"id": 7,
"usuarioCliente": {
"id": 3,
"nome": "Arthur",
"cpf": "281.590.328-89",
"cnh": "35214349616",
"telefone": "(61) 99805-2147",
"email": "[email protected]",
"senha": "1234",
"perfil": "alugador",
"endereco": {
"id": 3,
"logradouro": "Quadra SHPS Quadra 502",
"bairro": "Setor Habitacional Pôr do Sol (Ceilândia)",
"numero": 927,
"complemento": " ",
"cidade": "Brasília",
"estado": "DF"
}
},
"carro": null,
"retirada": "2009-08-07",
"entrega": "2019-08-04",
"valor": 99.0
}