Interface BankAccountService

All Known Implementing Classes:
BankAccountServiceImpl

public interface BankAccountService
This interface represents the service for managing bank accounts.
  • Method Summary

    Modifier and Type
    Method
    Description
    addAccount(jakarta.servlet.http.HttpServletRequest request, String bankName)
    Adds a new bank account for the user in the specified bank.
    void
    Connects a bank account to a user's bank identity.
    getAccountById(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId, String type)
    Retrieves a specific bank account by its ID.
    getTotalBalance(jakarta.servlet.http.HttpServletRequest request)
    Calculates the total balance for all bank accounts associated with the user.
    getUserAccounts(jakarta.servlet.http.HttpServletRequest request, String bankName)
    Retrieves a list of bank accounts associated with the specified bank for the user.
    void
    removeAccount(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId)
    Removes a specific bank account for the user.
    void
    removeAllAccounts(jakarta.servlet.http.HttpServletRequest request, String bankName)
    Removes all bank accounts associated with the specified bank for the user.
  • Method Details

    • getUserAccounts

      List<BankAccount> getUserAccounts(jakarta.servlet.http.HttpServletRequest request, String bankName)
      Retrieves a list of bank accounts associated with the specified bank for the user.
      Parameters:
      request - the HTTP request containing user information
      bankName - the name of the bank to filter accounts
      Returns:
      a list of BankAccount objects associated with the user and specified bank
    • getAccountById

      BankAccount getAccountById(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId, String type)
      Retrieves a specific bank account by its ID.
      Parameters:
      request - the HTTP request containing user information
      bankName - the name of the bank to which the account belongs
      accountId - the UUID of the account to retrieve
      type - the type of the bank account
      Returns:
      the BankAccount associated with the given ID
    • getTotalBalance

      Map<String,BigDecimal> getTotalBalance(jakarta.servlet.http.HttpServletRequest request)
      Calculates the total balance for all bank accounts associated with the user.
      Parameters:
      request - the HTTP request containing user information
      Returns:
      a map where the keys are bank names and the values are the total balances for each bank
    • addAccount

      BankAccount addAccount(jakarta.servlet.http.HttpServletRequest request, String bankName) throws Exception
      Adds a new bank account for the user in the specified bank.
      Parameters:
      request - the HTTP request containing user information
      bankName - the name of the bank where the account will be created
      Returns:
      the newly created BankAccount
      Throws:
      Exception - if an error occurs during the account creation process
    • connectAccounts

      void connectAccounts(BankIdentity bankIdentity) throws Exception
      Connects a bank account to a user's bank identity.
      Parameters:
      bankIdentity - the bank identity object containing information to connect accounts
      Throws:
      Exception - if an error occurs during the account connection process
    • removeAccount

      void removeAccount(jakarta.servlet.http.HttpServletRequest request, String bankName, UUID accountId)
      Removes a specific bank account for the user.
      Parameters:
      request - the HTTP request containing user information
      bankName - the name of the bank from which the account will be removed
      accountId - the UUID of the account to be removed
    • removeAllAccounts

      void removeAllAccounts(jakarta.servlet.http.HttpServletRequest request, String bankName)
      Removes all bank accounts associated with the specified bank for the user.
      Parameters:
      request - the HTTP request containing user information
      bankName - the name of the bank whose accounts will be removed