This is an aplication for storing incoming an outgoing financial transactions, and also, allows the user to record and list these transactions.
- NodeJS
- TypeScript
- UUID
- JSON
- EXPRESS
Did apply models concepts, repositories and services.
-
Clone this repository:
git@github.com:mouracamila/node-concepts.git
-
Installing dependencies:
$ yarn
-
Running project:
$ yarn dev:server
🚀 Server started on port 3333!
POST /transactions
Name | Type | Required | Description |
---|---|---|---|
title | string | No | Name transaction |
value | number | Yes | Value transaction |
type | income or outcome | Yes | Income or Outcome |
SUCCESS
Code: 200
{
"id": <UUID>,
"title": <string>,
"value": <number>
"type": <income | outcome>
}
ERROR
Code: 400
{
"error": "Transaction type is invalid"
}
{
"error": "Value is invalid"
}
GET /transactions
SUCCESS
Code: 200
{
"id": <UUID>,
"title": <string>,
"value": <number>
"type": <income | outcome>
}
{
"balance": {
"income": <number>,
"outcome": <number>,
"total": <number>
}