Skip to content

mathewsrcs/BalanceAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BalanceAPI

A REST API for managing bank account operations built with .NET 9.0 and ASP.NET Core.

What It Does

Manage account balances with three simple operations:

  • Deposit - Add money to an account
  • Withdraw - Remove money from an account
  • Transfer - Move money between accounts

Technologies

  • .NET 9.0
  • ASP.NET Core
  • xUnit (testing)
  • In-memory data storage

Getting Started

  1. Install .NET 9.0 SDK

  2. Run the API:

cd src/BalanceApi.Api
dotnet run
  1. Access at: http://localhost:5140

API Endpoints

GET /balance

Get account balance.

curl "http://localhost:5140/balance?account_id=100"

POST /event

Process a financial event.

Deposit:

{
  "type": "deposit",
  "destination": "100",
  "amount": 10
}

Withdraw:

{
  "type": "withdraw",
  "origin": "100",
  "amount": 5
}

Transfer:

{
  "type": "transfer",
  "origin": "100",
  "destination": "200",
  "amount": 15
}

POST /reset

Clear all data.

Running Tests

dotnet test

Architecture

  • Clean architecture with layered separation
  • Repository pattern for data access
  • Dependency injection
  • Comprehensive unit testing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages