Class AccountHolderService

java.lang.Object
com.dada.banking_project.services.impl.AccountHolderService

@Service public class AccountHolderService extends Object
  • Constructor Details

    • AccountHolderService

      public AccountHolderService()
  • Method Details

    • transaction

      public Transaction transaction(TransactionDTO transactionDTO)
      Performs a transaction between two accounts based on the information provided in the TransactionDTO.
      Parameters:
      transactionDTO - the information about the transaction, including sender account ID, receiver account ID, amount, primary or secondary owner name, and transaction date.
      Returns:
      the transaction object that represents this transaction.
      Throws:
      jakarta.persistence.EntityNotFoundException - if either the sender or the receiver account is not found in the database.
      org.springframework.web.server.ResponseStatusException - if the sender does not have enough balance or if the owner name of the receiver account is not valid.
    • addAccountHolder

      public AccountHolder addAccountHolder(AccountHolder accountHolder)
    • findAllAccountHolder

      public List<AccountHolder> findAllAccountHolder()
    • checkBalanceAccounts

      public List<Account> checkBalanceAccounts(Integer accountHolderId)