$ git clone [email protected]:jonysosin/accounting-notebook.git
$ cd backend/
$ npm install
$ cd frontend/
$ yarn install
You should execute each command in diferents terminal to
$ cd backend/
$ npm start
$ cd frontend/
$ yarn start
This endpoint is in charge of generating a new transaction for the account.
POST http://localhost:4001/api/transactions
Example of request body
{
"type": "debit",
"amount": "100"
}
This endpoint will return the information of the transaction.
GET http://localhost:4001/api/transactions/:transactionId
Example of request
GET http://localhost:4001/api/transactions/e7cc8b06-eafd-4518-bcad-27afae924bd5
Example of response
{
"id": "e7cc8b06-eafd-4518-bcad-27afae924bd5",
"type": "credit",
"amount": 200,
"effectiveDate": "2020-05-03T05:17:26.959Z"
}
This endpoint will return all the transactions for the account.
GET http://localhost:4001/api/transactions
Example of response
[
{
"id": "20a1d066-30ec-417c-ae57-13d6927a230f",
"type": "credit",
"amount": 200,
"effectiveDate": "2020-05-03T06:04:10.894Z"
},
{
"id": "2fc92747-f2a6-4f78-84cc-dd33e156551c",
"type": "debit",
"amount": 90,
"effectiveDate": "2020-05-03T06:04:12.338Z"
}
]
This endpoint will return the current balance of the account.
GET http://localhost:4001/api/transactions/balance
Example of response
{
"balance": 200
}