Skip to content

hilmiugurpolat/Bank-Account-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Bank Account Management System

This project is a simple system to manage bank accounts. It allows you to create, update, delete accounts, manage balances, and perform deposit/withdrawal operations.

Features

  • Account Management: You can create, update, delete, and query bank accounts.
  • Transaction Management: You can deposit money into accounts and withdraw money from accounts.
  • Balance Management: Balance is updated with each transaction. The balance cannot go below zero and cannot exceed 9,999,999.

Technologies Used

  • Java 17: Used as the core programming language.
  • Spring Boot 3.4.2: Used as the application framework.
  • Swagger: Used for API documentation and testing.
  • Lombok: Used to reduce boilerplate code in Java.
  • JpaRepository, CrudRepository: Used for database operations.
  • Mapstruct: Used for converting between DTOs and entities.
  • MySQL: Database options.
  • Liquibase: Used for database migrations.
  • Maven: Used for project management and build processes.
  • Unit Testing & Integration Testing: Used to ensure the correctness of the system.

API Endpoints

1. Create Account

To create an account, a POST request is sent. This operation creates a new bank account.

Endpoint: POST /accounts

Request Example (JSON)::

{
    "accountOwnerIdentityNo": 12345678910,
    "accountOwnerFirstName": "hilmi uğur",
    "accountOwnerLastName": "polat",
    "accountType": "TL",
    "balance": 2000.00
}

Response Example:

{
    "id": "c356ce6c-3e4b-40d4-af75-78330ca32d7e",
    "accountOwnerIdentityNo": 12345678910,
    "accountOwnerFirstName": "hilmi uğur",
    "accountOwnerLastName": "polat",
    "accountType": "TL",
    "balance": 2000.00
}

image

2. Update Account

To update an existing account, a PUT request is sent with the updated account details.

Endpoint: PUT /accounts/{accountId}

Request Example (JSON):

{
    "accountOwnerIdentityNo": 12345678910,
    "accountOwnerFirstName": "hilmi uğur",
    "accountOwnerLastName": "polat",
    "accountType": "USD",
    "balance": 3000.00
}

Response Example:

{
    "id": "c356ce6c-3e4b-40d4-af75-78330ca32d7e",
    "accountOwnerIdentityNo": 12345678910,
    "accountOwnerFirstName": "hilmi uğur",
    "accountOwnerLastName": "polat",
    "accountType": "USD",
    "balance": 3000.00
}

image

3. Get Account by ID

To retrieve an account's details by its ID, a GET request is sent.

Endpoint: GET /accounts/{accountId}

Response Example (JSON):

{
    "id": "c356ce6c-3e4b-40d4-af75-78330ca32d7e",
    "accountOwnerIdentityNo": 12345678910,
    "accountOwnerFirstName": "hilmi uğur",
    "accountOwnerLastName": "polat",
    "accountType": "USD",
    "balance": 3000.00
}

image

4. Deposit Money

To deposit money into an account, a POST request is sent with the amount to be deposited.

Endpoint: POST /accounts/{accountId}/deposit

Request Example:

URL parameter: accountId (e.g., c356ce6c-3e4b-40d4-af75-78330ca32d7e)

Request parameter: amount=500.00

Response Example:

Money deposited successfully. Transaction ID: 2025-02-09T18:25:19.396502600

image

5. Withdraw Money

To withdraw money from an account, a POST request is sent with the amount to be withdrawn.

Endpoint: POST /accounts/{accountId}/withdraw

Request Example:

URL parameter: accountId (e.g., c356ce6c-3e4b-40d4-af75-78330ca32d7e)

Request parameter: amount=300.00

Response Example:

Money withdrawn successfully. Transaction ID: 2025-02-09T18:28:37.340209300

image

6. Delete Account

To delete an existing account, a DELETE request is sent with the account ID.

Endpoint: DELETE /accounts/{accountId}

Response Example (JSON):

{
    "message": "Account deleted successfully."
}

image

Releases

No releases published

Packages

No packages published

Languages