Class AccountHolderService
java.lang.Object
com.dada.banking_project.services.impl.AccountHolderService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAccountHolder
(AccountHolder accountHolder) checkBalanceAccounts
(Integer accountHolderId) transaction
(TransactionDTO transactionDTO) Performs a transaction between two accounts based on the information provided in the TransactionDTO.
-
Constructor Details
-
AccountHolderService
public AccountHolderService()
-
-
Method Details
-
transaction
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
-
findAllAccountHolder
-
checkBalanceAccounts
-