Skip to content

Wallet, Account & Virtual Account

Overview

The Wallet Service is a Java-based microservice designed to manage wallets, transactions, payouts, and virtual accounts. It is built using Spring Boot and follows a modular architecture to ensure scalability and maintainability.


Features

Feature Description
πŸ‘œ Wallet Management Create, update, and retrieve wallet details.
πŸ’³ Transaction Management Handle user transactions with support for pagination and filtering.
πŸ’Έ Payouts Initiate and manage payouts.
🏦 Virtual Accounts Manage virtual accounts for users.
πŸ“– OpenAPI Documentation Integrated API documentation using SpringDoc OpenAPI.
πŸ” Observability Includes logging and tracing with Loki and OpenTelemetry.

Technologies Used

Technology Purpose
β˜• Java 17 Programming language
🌱 Spring Boot 3.2.4 Framework for building microservices
🐘 PostgreSQL Database
πŸ› οΈ Flyway Database migrations
βœ‚οΈ Lombok Reducing boilerplate code
πŸ”„ MapStruct Object mapping
πŸ›‘οΈ Resilience4j Fault tolerance
πŸ“œ OpenAPI API documentation
πŸ“Š Micrometer Observability

Getting Started

Prerequisites

  • β˜• Java 17 or higher
  • 🐘 PostgreSQL database
  • πŸ› οΈ Gradle build tool

Setup Instructions

  1. Clone the repository:
    git clone https://github.com/Olanna-tech/wallet-service-java.git
    cd wallet-service-java
    
  2. Configure the database in src/main/resources/application.yml:
    spring:
      datasource:
        url: jdbc:postgresql://<DB_HOST>:<DB_PORT>/<DB_NAME>
        username: <DB_USERNAME>
        password: <DB_PASSWORD>
    
  3. Build the project:
    ./gradlew build
    
  4. Run the application:
    ./gradlew bootRun
    

Running Tests

To execute the test suite, run:

./gradlew test


API Endpoints

Wallets

Endpoint Method Description
/api/v1/wallets POST βž• Create a new wallet
/api/v1/wallets/{walletId} GET πŸ” Retrieve wallet details
/api/v1/wallets/{userId}/user GET πŸ” Retrieve wallets for a user
/api/v1/wallets/{walletId}/status PATCH ✏️ Update wallet status
/api/v1/wallets/{walletId}/balance GET πŸ’° Retrieve wallet balance

Payouts

Endpoint Method Description
/api/v1/payouts POST βž• Initiate a payout
/api/v1/payouts/{payoutId} GET πŸ” Retrieve payout details
/api/v1/payouts GET πŸ” Retrieve all payouts
/api/v1/payouts/{payoutId}/status PATCH ✏️ Update payout status

Transactions

Endpoint Method Description
/api/v1/transactions POST βž• Create a transaction
/api/v1/transactions/{transactionId} GET πŸ” Retrieve transaction details
/api/v1/transactions GET πŸ” Retrieve all transactions

Virtual Accounts

Endpoint Method Description
/api/v1/virtual-accounts POST βž• Create a virtual account
/api/v1/virtual-accounts/{accountId} GET πŸ” Retrieve virtual account details

Observability

Feature Description
πŸ“œ Logging Configured with Loki for centralized logging.
πŸ“‘ Tracing Integrated with OpenTelemetry for distributed tracing.

License

This project is licensed under the πŸ“ Apache 2.0 License. See the LICENSE file for details.


Contributing

Contributions are welcome! Please fork the repository and submit a pull request.


Contact

For inquiries, please contact πŸ“§ support@Olanna-tech.com.