Each cardholder (customer) has an account with their data. For each operation done by the customer a transaction is created and associated with their respective account. Each transaction has a specific type (normal purchase, withdrawal, credit voucher or purchase with installments) Transactions of type purchase and withdrawal are registered with negative amounts, while transactions of credit voucher are registered with positive value.
Create the endpoints below according to the use cases previously mentioned.
POST /accounts (create an account) Request Body:
{
"document_number": "12345678900"
}
GET /accounts/:accountId (retrieve the account information) Response Body:
{
"account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"document_number": "12345678900"
}
POST /transactions (create a transaction) Request Body:
{
"account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": 4,
"amount": 123.45
}
- Docker
- Java17
To Run The application please use below commands
chmod +x run.sh
./run.sh
chmod +x clean.sh
./clean.sh