Skip to content

OrestKlymko/rest-api-bank

Repository files navigation

REST API

This is a REST API, where you can find operation with bank account. It's small bank ecosystem with registration new customers, transactions and other features.

Installation

  1. Download the source code of the project from the GitHub repository.
  2. Install dependencies, if any, using your programming language's package manager.
  3. Run the project on your web server or cloud hosting, if necessary.

Usage

  1. Copy of this repository on your computer
  2. Just start Spring

Tech Stack

Server: Spring Boot, Spring MVC, Spring Data, Java 11, MySQL, Flyway, Hibernate, Lombok, JDBC, JPA, Spring Security (Encoder), Mockito, JUnit

Authors

List the names of the authors who have contributed to the project and its maintenance.

Feedback

If you have issues, questions, or suggestions, please create a new issue on GitHub, and we will do our best to assist you.

Structure of block

 {
        "id": 1,
        "cardNumber": "1111222233334444",
        "code": "1234",
        "account": {
            "id": 1,
            "balance": 1.0,
            "accountHistory": [
                {
                    "id": 6,
                    "value": 999.0,
                    "transaction_history": "2023-08-04",
                    "transactionType": "Spend"
                }
            ]
        }
    },

API Reference

Get information about customers account

  GET /api/v1/account/{id}/info 

Get information about the account and transaction history of the user by ID.

Get history of account

  GET /api/v1/account/{id}/history

Get transaction history for a user account by their ID.

Create transaction between customers

  POST /api/v1/user/transaction

Create a transaction, where you need to provide the sender's card data, receiver's information, and the amount in the request body. Example body:

{
    "fromCard":1111222233334444,
    "toCard":5555666677778888,
    "balance":999
}

login user with returns of boolean

  POST /api/v1/user/login

User login endpoint, returns true or false. Example body:

{
    "card_number":"3111222233334443",
    "code":1233
}

login user with returns of client info

  POST /api/v1/user/login/client

User login endpoint, returns client information if the login is successful. Example body:

{
    "card_number":"3111222233334443",
    "code":1233
}

You will get this body
{
    "id": 7,
    "cardNumer": "3111222233334443",
    "account": {
        "id": 7,
        "balance": 0,
        "accountHistory": []
    }
}

Register a new user

  POST /api/v1/user/registration

Register a new user. Example body:

{
    "name":"Orest",
    "code":"1235"
}

Get information about customer

  GET /api/v1/user/client/{id}

Get all data about a user by their identifier.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages