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.
- 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.
- 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.
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
}
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
}
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
}
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
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
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."
}