O sistema é focado na parte de cobrança de dividas, nas quais ele recebe a informação de dividendos dos banco, assim organizamos de uma forma pratica e rapida para realizar o contato e assim realizar um acordo com o dividendo.
Objetivo • Api • Tecnologias • Devs •
Para utilizar o DevCobre você precisará:
git clone <link abaixo>
Após o clone do repositório sera necessario seguir os seguintes comandos:
yarn install
(caso esteja usando um docker)
$ sudo docker-compose up --build
$ sudo docker exec api yarn typeorm migration:generate src/migrations/client -d src/data-source.ts
$ sudo docker exec api yarn typeorm migration:run -d src/data-source.ts
Requisições para a API devem seguir os padrões:
Método | Descrição |
---|---|
GET |
Retorna informações de um ou mais registros. |
POST |
Utilizado para criar um novo registro. |
PATCH |
Atualiza dados de um registro ou altera sua situação. |
DELETE |
Remove um registro do sistema. |
Código | Descrição |
---|---|
200 |
Requisição executada com sucesso (success). |
201 |
Envio de dados para criação exectuado com sucesso (created). |
400 |
Erros de validação ou os campos informados não existem no sistema. |
404 |
Registro pesquisado não encontrado (Not found). |
409 |
Conflict. |
| Login• Client • Bank • Debts • Agreement • User • Contact History |
⚠ ⚠ ⚠ Obs: visando que esta aplicação é utilizada em uma empresa, é necessario a criação primeiramente da conta ADM, desta forma não sera possivel criar as demais rotas sem este usuario ADM ⚠ ⚠ ⚠
name
,email
epassword
: string
{
"name":"teste",
"email":"[email protected]",
"password":"2132"
}
{
"message":"Adm Created Width Sucess."
}
email
,password
:string
{
"email": "[email protected]",
"password": "test123-"
}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywicG9zaXRpb24iOiJ1c2VyIiwiZW1haWwiOiJ0ZXN0QG1haWwuY29tIiwiaWF0IjoxNjU4MjYxNjg3LCJleHAiOjE2NTgzNDgwODd9.clFa-cBGhLRnzLLdpyYyIsG8ceOa45izasNNwu-q2QQ"
}
⚠ ⚠ ⚠ Obs: visando que esta aplicação é utilizada em uma empresa, é necessario a criação primeiramente da conta ADM, desta forma não sera possivel criar as demais rotas sem este usuario ADM ⚠ ⚠ ⚠
name
,type
edocument
: string
{
"document": "89999999999998",
"name": "Empresa Devedora LTDA",
"type": "Juridico"
}
{
"document": "89999999999998",
"name": "Empresa Devedora LTDA",
"type": "Juridico"
}
{
"message": "Client already exists"
}
{
{
"document": "11111111111111",
"name": "Empresa Devedora LTDA",
"type": "Juridico",
"clientInfo": []
},
{
"document": "89999999999998",
"name": "Empresa Devedora LTDA",
"type": "Juridico",
"clientInfo": []
}
}
{
"document": "89999999999999",
"name": "Empresa Devedora LTDA",
"type": "Juridico",
"clientInfo": []
}
{
"message": "Updated client"
}
{
"message": "Client not found!"
}
{
"message": "Client deleted with sucess!"
}
{
"message": "Client not found!"
}
email
: stringtelephone
: number
{
"telephone": 5465448,
"email": "[email protected]"
}
{
"message": "Information entered successfully!"
}
{
"message": "Client not found!"
}
{
"document": "89999999999999",
"name": "Empresa Devedora LTDA",
"type": "Juridico",
"clientInfo": [
{
"id": 5,
"telephone": 5465448,
"email": "[email protected]"
}
]
}
{
"message": "Client not found"
}
{
"telephone": 22222222,
"email": "[email protected]"
}
{
"message": "Contact updated with sucess!"
}
{
"message": "Client contact not found!"
}
{
"message": "Client not found"
}
{
"message": "Contact deleted with sucess!"
}
{
"message": "Client contact not found!"
}
{
"message": "Client not found"
}
• Inicio API •
name
: string,
status
: boolean
{
"name": "Banco MaxDev",
"status": true
}
{
"name": "Banco MaxDev",
"status": true,
"id": 7
}
{
"message": "Bank already exists!"
}
{
"id": 7,
"name": "Banco MaxDev",
"status": true,
"bankContact": []
}
{
"name": "Banco MaxProPlus"
}
{
"message": "Updated Bank!"
}
{
"message": "Bank not found!"
}
{
"message": "Bank deleted witdh sucess!"
}
{
"message": "Bank not found!"
}
email
: string,
telephone
: number
{
"telephone": 122222,
"email": "[email protected]"
}
{
"message": "Information entered successfully!"
}
{
"message": "Bank not found!"
}
{
"message": "information already exists!"
}
{
"id": 7,
"name": "Banco MaxProPlus",
"status": true,
"bankContact": [
{
"id": 2,
"telephone": 122222,
"email": "[email protected]"
}
]
}
{
"message": "Bank not found!"
}
{
"telephone": 999999999,
"email": "[email protected]"
}
{
"message": "Bank Contact updated sucess!"
}
{
"message": "Bank not found!"
}
{
"message": "Bank Contact not found!"
}
{
"message": "Bank contact deleted witdh sucess!"
}
{
"message": "Bank not found!"
}
{
"message": "Bank contact not found!"
}
• Inicio API •
-
bankId
,debtValue
,debtOrigin
,ipoc
: number -
debType
,dateDebt
,documentClient
, : string (debType
- "emprestimo","credito")
{
"bankId": 1,
"documentClient": "334556232147",
"debtType": "emprestimo",
"debtValue": 1000,
"ipoc": 166445411,
"debtOrigin": 500,
"dateDebt": "2020-01-01"
}
{
"bank": {
"id": 1,
"name": "Caixa",
"status": true,
"bankContact": []
},
"client": {
"document": "334556232147",
"name": "Pereira",
"type": "Fisico",
"clientInfo": []
},
"dateDebt": "2020-01-01T00:00:00.000Z",
"debtOrigin": 500,
"debtValue": 1000,
"ipoc": "166445411",
"debtType": "emprestimo",
"id": 1,
"registration": "2022-07-20T20:22:53.676Z",
"debtStatus": true
}
{
"error": "ValidationError",
"message": "Document Client required."
}
{
"error": "ValidationError",
"message": "Ipoc required."
}
{
"error": "ValidationError",
"message": "Bank ID required."
}
Obs: caso não possua todos os dados no JSON sera dado a resposta de Bad Request
{
"id": 1,
"ipoc": "166445411",
"debtValue": "1000.00",
"debtOrigin": "500.00",
"debtType": "emprestimo",
"registration": "2022-07-20T20:22:53.676Z",
"dateDebt": "2020-01-01T00:00:00.000Z",
"debtStatus": true
},
{
"id": 2,
"ipoc": "166445711",
"debtValue": "2000.00",
"debtOrigin": "1100.00",
"debtType": "credito",
"registration": "2022-07-20T20:28:30.621Z",
"dateDebt": "2021-01-01T00:00:00.000Z",
"debtStatus": true
}
{
"id": 2,
"ipoc": "166445711",
"debtValue": "2000.00",
"debtOrigin": "1100.00",
"debtType": "credito",
"registration": "2022-07-20T20:28:30.621Z",
"dateDebt": "2021-01-01T00:00:00.000Z",
"debtStatus": true,
"client": {
"document": "334556232147",
"name": "Pereira",
"type": "Fisico",
"clientInfo": []
},
"bank": {
"id": 1,
"name": "Caixa",
"status": true,
"bankContact": []
}
}
{
"message": "Debt not found"
}
• Inicio API •
debts
: string
{
"debts": ["1", "2"]
}
{
"message": "Successfully allocated debts"
}
{
"message": "Debt not found!"
}
[
{
"id": 1,
"name": "teste",
"position": "ADM",
"debts": [
{
"id": 1,
"ipoc": "166445411",
"debtValue": "1000.00",
"debtOrigin": "500.00",
"debtType": "emprestimo",
"registration": "2022-07-20T20:22:53.676Z",
"dateDebt": "2020-01-01T00:00:00.000Z",
"debtStatus": true
},
{
"id": 2,
"ipoc": "166445711",
"debtValue": "2000.00",
"debtOrigin": "1100.00",
"debtType": "credito",
"registration": "2022-07-20T20:28:30.621Z",
"dateDebt": "2021-01-01T00:00:00.000Z",
"debtStatus": true
}
]
}
]
{
"agreedValue": 2000,
"dateAgree": "20-3-21",
"status": true,
"bank": 2,
"client": "334556232147",
"user": 8,
"formOfPayment": 2
}
{}
[
{
"id": 1,
"agreedvalue": "2000.00",
"dateagree": "2022-01-01T00:00:00.000Z",
"status": true,
"formOfPayment": "a vista",
"valueEntry": "2000",
"installments": "1x"
}
]
{
"id": 1,
"agreedvalue": "2000.00",
"dateagree": "2022-01-01T00:00:00.000Z",
"status": true,
"formOfPayment": "a vista",
"valueEntry": "2000",
"installments": "1x"
}
{
"message": "Agreement not found!"
}
agreedvalue
,dateagree
:string
status
:boolean
{
"agreedvalue":"1800.00",
"dateagree":"2022-01-10",
"status":false
}
{
"message": "Updated Agreement!"
}
{
"message": "Agreement not found!"
}
{
"message": "Agreement deleted with sucess!"
}
• Inicio API •
name
,email
,document
,address
,position
: string
{
"telephone": 21331233,
"address":"Rua 1",
"email": "[email protected]",
"name": "Pedro Paulo",
"password": "testE123-",
"position": "HR"
}
{
"id": 4,
"name": "Pedro Paulo",
"position": "HR",
"infos": {
"email": "[email protected]",
"telephone": "21331233",
"address": "Rua 1"
}
}
{
"message": "User already exists!"
}
{
"error": "ValidationError",
"message": "The password must contain an uppercase letter, a number and a special character."
}
[
{
"id": 1,
"name": "Ana",
"position": "ADM"
},
{
"id": 2,
"name": "Julio",
"position": "user"
},
{
"id": 3,
"name": "Paula",
"position": "HR"
},
{
"id": 4,
"name": "Pedro Paulo",
"position": "HR"
}
]
{
"id": 2,
"name": "Julio",
"position": "user",
"infos": {
"email": "[email protected]",
"telephone": 21331233,
"address": "Rua 45"
}
}
{
"message": "User not found!"
}
[
{
"id": 1,
"name": "teste",
"position": "ADM",
"debts": []
}
]
{
"message": "User not found!"
}
Obritorio - name
: string
{
"telephone": 21331233,
"address":"Rua 1",
"email": "[email protected]",
"name": "Pedro Paulo",
"position": "HR"
}
{
"message": "User updated!"
}
{
"message": "User does not exists!"
}
{
"message": "User deleted with sucess!"
}
{
"message": "User not found!"
}
• Inicio API •
date_contact
,note
: stringdebtId
,userId
:numberagreement
: boolean
{
"date_contact":"2022-01-01",
"agreement":false,
"note":"faltou ligar",
"debtId":5,
"userId":2
}
{
"date": "2022-01-01",
"agreement": false,
"note": "faltou ligar",
"debts": 5,
"user_entry_contact": "Maicel"
}
{
"id": 7,
"agreement": false,
"date_contact": "2022-01-01T00:00:00.000Z",
"note": "faltou ligar"
}
note
,date_contact
: stringagreement
: boolean
{
"note":"cliente atendeu mas não quis negociar",
"date_contact":"2022-07-19"
}
{
"message": "Update contact History"
}
{
"message": "Contact history not found!"
}
{
"message": "Contact history not found!"
}
{
"message": "Contact history not found!"
}
• Inicio API •
As seguintes ferramentas foram usadas na construção do projeto:
Danilo Valerio 🚀 |
Letícia Leal 🚀 |
Bráulio Silveira 🚀 |
Maciel A. Junior 🚀 |
Vinícius Martins 🚀 |
Vitor Schmidt 🚀 |
• Inicio •