Skip to content

StreInvest/Documenta-o_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

stapi

Investimentos

GET Investimentos

image

Status 200

{
    "response": [
        {
            "_id": "60a1aa920d83402158ac8358",
            "investment_name": "teste aberto",
            "status": "Open",
            "risk": "Severe",
            "category": "CDB",
            "consortium": {
                "_id": "6097ffb54ee8cc407bb8109c",
                "consortium_name": "caixa economica federal",
                "created_at": "2021-05-09T15:28:53.477Z",
                "updated_at": "2021-05-09T15:28:53.477Z",
                "__v": 0
            },
            "profitability": {
                "day": "00.01",
                "month": "00.10",
                "year": "01.00",
                "score": "00.05%",
                "minimum_value": "25.00"
            },
            "created_at": "2021-05-16T23:28:18.367Z",
            "updated_at": "2021-05-16T23:53:54.093Z",
            "__v": 0
        },
        {
            "_id": "60a40b55ecfbef0015a29f72",
            "investment_name": "boa para excluir",
            "status": "Close",
            "risk": "Severe",
            "category": "teste",
            "consortium": {
                "_id": "6097ffb54ee8cc407bb8109c",
                "consortium_name": "caixa economica federal",
                "created_at": "2021-05-09T15:28:53.477Z",
                "updated_at": "2021-05-09T15:28:53.477Z",
                "__v": 0
            },
            "profitability": {
                "day": "00.01",
                "month": "00.10",
                "year": "01.00",
                "score": "22.05%",
                "minimum_value": "10.00"
            },
            "created_at": "2021-05-18T18:45:41.232Z",
            "updated_at": "2021-05-18T19:10:37.186Z",
            "__v": 0
        }
    ],
    "paginate": {
        "limit": "2",
        "page": 1,
        "totalCurrentPage": "2"
    },
    "status": 200
}

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

POST Investimentos

image

body - dados enviados

{
    "investment_name": "bom pra voce",
    "status": "Close",
    "risk": "Moderate",
    "category": "Poupanca",
    "consortium": "60b03825fcf1440015381f38",
    "profitability": {
        "day": "01.00",
        "month": "09.50",
        "year": "20.00",
        "score": "100.00%",
        "minimum_value": "100.00"
    }
}

Status 201 Created

{
    "response": {
        "_id": "60bb9ff1f4fe4f0015a33b79",
        "investment_name": "bom pra voce teste",
        "status": "Close",
        "risk": "Moderate",
        "category": "Poupanca",
        "consortium": "60b03825fcf1440015381f38",
        "profitability": {
            "day": "01.00",
            "month": "09.50",
            "year": "20.00",
            "score": "100.00%",
            "minimum_value": "100.00"
        },
        "created_at": "2021-06-05T16:01:53.992Z",
        "updated_at": "2021-06-05T16:01:53.992Z",
        "__v": 0
    },
    "status": 201
}

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

Status 500 Internal Server Error - paramêtros incorreto

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error</title>
    </head>
    <body>
        <pre>Internal Server Error</pre>
    </body>
</html>

GET Investimento especifico

image

Status 200 Sucess

{
    "response": {
        "_id": "60a1aa920d83402158ac8358",
        "investment_name": "teste aberto",
        "status": "Open",
        "risk": "Severe",
        "category": "CDB",
        "consortium": {
            "_id": "6097ffb54ee8cc407bb8109c",
            "consortium_name": "caixa economica federal",
            "created_at": "2021-05-09T15:28:53.477Z",
            "updated_at": "2021-05-09T15:28:53.477Z",
            "__v": 0
        },
        "profitability": {
            "day": "00.01",
            "month": "00.10",
            "year": "01.00",
            "score": "00.05%",
            "minimum_value": "25.00"
        },
        "created_at": "2021-05-16T23:28:18.367Z",
        "updated_at": "2021-05-16T23:53:54.093Z",
        "__v": 0
    },
    "status": 200
}

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

Status 500 Internal Server Error - ID incorreto

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<title>Error</title>
</head>

<body>
	<pre>Internal Server Error</pre>
</body>

</html>

PUT Investimento

image

Body - parametros que deseja ser alterado

{
    "investment_name": "boa para excluir",
    "status": "Close",
    "risk": "Severe",
    "category": "teste",
    "consortium": "6097ffb54ee8cc407bb8109c",
    "profitability": {
        "day": "00.01",
        "month": "00.10",
        "year": "01.00",
        "score": "22.05%",
        "minimum_value": "10.00"
    }
}

Status 200 Sucess

{
    "response": {
        "_id": "60a40b55ecfbef0015a29f72",
        "investment_name": "boa para excluir",
        "status": "Close",
        "risk": "Severe",
        "category": "teste",
        "consortium": "6097ffb54ee8cc407bb8109c",
        "profitability": {
            "day": "00.01",
            "month": "00.10",
            "year": "01.00",
            "score": "22.05%",
            "minimum_value": "10.00"
        },
        "created_at": "2021-05-18T18:45:41.232Z",
        "updated_at": "2021-06-05T16:22:53.966Z",
        "__v": 0
    },
    "status": 200
}

Status 500 Internal Server Error - ID incorreto

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<title>Error</title>
</head>

<body>
	<pre>Internal Server Error</pre>
</body>

</html>

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

Status 500 Internal Server Error - paramêtros incorreto

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error</title>
    </head>
    <body>
        <pre>Internal Server Error</pre>
    </body>
</html>

DELETE investimento

image

status 204 No Content

  • não retorna nada (succeso)

Status 404Not Found

{
    "response": "User already deleted",
    "status": 404
}

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

Status 500 Internal Server Error - ID incorreto

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<title>Error</title>
</head>

<body>
	<pre>Internal Server Error</pre>
</body>

</html>

Consorcio - emissor do investimento

GET consorcio

image

Status 200 Sucess

{
    "response": [
        {
            "_id": "6097ffb54ee8cc407bb8109c",
            "consortium_name": "caixa economica federal",
            "created_at": "2021-05-09T15:28:53.477Z",
            "updated_at": "2021-05-09T15:28:53.477Z",
            "__v": 0
        }
    ],
    "paginate": {
        "limit": "1",
        "page": 1,
        "totalCurrentPage": "1"
    },
    "status": 200
}

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

POST consorcio

image

Body

{
    "consortium_name": "para ser excluido 2"
}

Status 201 created

{
    "response": {
        "_id": "60bcebe1035afd00158ba2ba",
        "consortium_name": "para ser excluido 2",
        "created_at": "2021-06-06T15:38:09.138Z",
        "updated_at": "2021-06-06T15:38:09.138Z",
        "__v": 0
    },
    "status": 201
}

Status 500 Internal Server Error - Consorcio já existente

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<title>Error</title>
</head>

<body>
	<pre>Internal Server Error</pre>
</body>

</html>

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

PUT consorcio

image

Body

{
    "consortium_name": "casas bahia - atualizado"
}

Status 200 Sucess

{
    "response": {
        "_id": "60bcebda035afd00158ba2b9",
        "consortium_name": "casas bahia - atualizado",
        "created_at": "2021-06-06T15:38:02.828Z",
        "updated_at": "2021-06-06T15:45:15.698Z",
        "__v": 0
    },
    "status": 200
}

Status 400 Bad Request dados já foi alterado ou parametros enviado incorretamente via body

{
    "response": "it was not possible to update, check the data is being sent correctly",
    "status": 400
}

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

Status 500 Internal Server Error - ID Invalido

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<title>Error</title>
</head>

<body>
	<pre>Internal Server Error</pre>
</body>

</html>

DELETE consorcio

image

status 204 No Content

  • não retorna nada (succeso)

Status 404Not Found

{
    "response": "User already deleted",
    "status": 404
}

Status 401 Unauthorized

{
    "response": "you don't have access",
    "status": 401
}

Status 500 Internal Server Error - ID incorreto

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<title>Error</title>
</head>

<body>
	<pre>Internal Server Error</pre>
</body>

</html>

Releases

No releases published

Packages

No packages published