The application represents API for processing accounts' money. No authentication, so anyone can see any account's balance. Real application should grant balance access only to account's owner.
For local run follow these steps:
- ./gradlew assemble check stage
- java -jar build/libs/money-transfer-api-all-*.jar
- SparkJava web framework.
- Google Guice DI framework.
- Sql2o for data access layer.
- HSQLDB in-memory database.
- Continuous integration: Travis-CI
- Continuous delivery: Heroku (github integration). App is deployed from master branch after successful CI build.
- Code quality: SonarCloud (used inside CI pipeline)
Consider dockerizing of CI/CD pipeline.
Redirects to /api
Returns all implemented API methods
Returns info for all accounts (id, real id, amount).
Returns info for account with specific id.
Body payload:
{
"action":
- action: String (WITHDRAW, DEPOSIT)
- id: long, id of existing account
- amount: amount of money with dot as scale delimiter
Returns account info after processing. Returns InsufficientFundsException if account has not enough money.
Body payload:
{
"fromAccountId":
- fromAccountId: long, id of existing account to withdraw money from
- toAccountId: long, id of existing account to deposit money to
- amount: amount of money with dot as scale delimiter
Returns empty string in case of success. Returns InsufficientFundsException if from-account has not enough money.