Account Transaction API
Account Transaction API
This exposes two end point ,
Sending money between accounts
Requesting account statement with account balance and list of transaction
assumption is here the customer is present else it throws a descriptive error response with code.
To run the application, below are the steps assuming the git client present on the system.
From Eclipse - TransactionServiceInitiation.java run (initiation class)
POST /accounts/transfer
{
“amount”:100,
“dstAccountId”: “1”,
“srcAccountId”: “2”
}
curl -X POST —header ‘Content-Type: application/json’ —header ‘Accept: application/json’ -d ‘{
“amount”:100,
“dstAccountId”: “1”,
“srcAccountId”: “2”
}’ ‘http://localhost:8080/accounts/transfer‘
Endpoint - GET /accounts/{accountId}/statement
curl -X GET —header ‘Accept: application/json’ ‘http://localhost:8080/accounts/2/statement‘
Due to time constraints and per assignment, creation of customer and accounts are not supported by this service, but the database is automatically initialized with records during the boot of the application with the predefined account and customer details.This we can view in the H2 database by below url
http://localhost:8080/h2-console .