Class TransactionService

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

@Service public class TransactionService extends Object
  • Constructor Details

    • TransactionService

      public TransactionService()
  • 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.