A .NET 9 Web API for aggregating customer transactions from multiple bank sources. Supports fetching transactions, querying by customer, and aggregating totals by category, source, and direction (money in/out).
- Features
- Technologies
- Getting Started
- Running the API
- API Endpoints
- Docker
- Future Enhancements
- Author
- Retrieve all customers
- Retrieve all transactions
- Retrieve transactions by customer
- Aggregate transactions by category, source, and money direction (in/out)
- Swagger UI for interactive testing
- Dockerized for easy deployment
- .NET 9 Web API
- C#
- Dependency Injection
- Docker
- Swagger (OpenAPI)
git clone https://github.com/Yoda-Mag/transaction-aggregation-api-dotnet.git
cd transaction-aggregation-api-dotnet/ProjectsTransactionAggregation/TransactionAggregationApi- Build the project
dotnet build- Run the application
dotnet run-
Access the API
- HTTPS →
https://localhost:5139 - HTTP →
http://localhost:5138
- HTTPS →
-
Swagger UI
- Visit:
https://localhost:5139/swagger/index.html
- Visit:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/customers |
Get all customers |
| GET | /api/transactions/all |
Get all transactions |
| GET | /api/transactions/customer/{customerId} |
Get transactions for a specific customer |
| GET | /api/transactions/aggregate/category |
Get total and count of transactions per category |
| GET | /api/transactions/aggregate/source-by-month |
Get totals per source, grouped by month |
| GET | /api/transactions/aggregate/moneyIn |
Get total amount and count of all incoming funds |
| GET | /api/transactions/aggregate/moneyOut |
Get total amount and count of all outgoing funds |
curl -X GET "https://localhost:5139/api/transactions/all"curl -X GET "https://localhost:5139/api/transactions/customer/{customerId}"curl -X GET "https://localhost:5139/api/transactions/aggregate/category"docker build -t transaction-aggregation-api .docker run -d -p 8081:8080 transaction-aggregation-apiAPI will be available at:
-> http://localhost:8081
Swagger (inside Docker):
-> http://localhost:8081/swagger/index.html
Build and Run:
docker-compose up -d --buildStop Services:
docker-compose downAccess via Docker Compose:
-> http://localhost:8081
- Add unit and integration tests
- Introduce global exception handling middleware
- Add structured logging and request monitoring
- Enable filtering/sorting by date range or amount
- Integrate with a SQL or NoSQL database
- Add authentication & authorization (JWT or OAuth)
- Introduce caching for performance
- Add CI/CD pipeline (GitHub Actions)
Letlhogonolo Magano
Final Year IT Student | Backend & Data Enthusiast