About the Challenge | Technologies | Routes | Installation
Application that stores incoming and outgoing financial transactions, allowing the registration and listing of these transactions, in addition to allowing the creation of new records in the database by sending a csv file.
POST /transactions
{
"id": "uuid",
"title": "Salary",
"value": 3000,
"type": "income",
"category": "Lorem"
}
GET /transactions
{
"transactions": [
{
"id": "uuid",
"title": "Freelance",
"value": 4000,
"type": "income",
"category": {
"id": "uuid",
"title": "Salary"
}
},
{
"id": "uuid",
"title": "Salary",
"value": 2000,
"type": "income",
"category": {
"id": "uuid",
"title": "Others"
}
},
{
"id": "uuid",
"title": "Payment",
"value": 4000,
"type": "outcome",
"category": {
"id": "uuid",
"title": "Others"
}
},
{
"id": "uuid",
"title": "Product Lorem",
"value": 1200,
"type": "outcome",
"category": {
"id": "uuid",
"title": "Shopping"
}
}
],
"balance": {
"income": 6000,
"outcome": 5200,
"total": 800
}
}
Within balance, income is the sum of all transaction values with type
income. The outcome is the sum of all transaction values with type
outcome, and the total is the value of income - outcome
.
-
DELETE /transactions/:id
-
POST /transactions/import
The csv file must follow the model
- Clone the repository:
git@github.com:matheus-neves/challenge-database-upload.git
- Access the directory:
cd challenge-database-upload
- Install the dependencies:
yarn
- Run the server:
yarn dev:server
- Server running in
http://localhost:3333/
- Install Docker https://www.docker.com/get-started and check if was installed with the command:
docker version
- Run the command
docker run --name gostack_postgres -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres
- Verify if container was created
docker ps -a
- Create a database with name
gostack_challenge06
This challenge is under license from MIT. See the archive LICENSE for more details.
Challenge completed ✔️by Matheus Neves and created with 💜by Rocketseat 👋 Join the community!