Class AccountServiceImp

java.lang.Object
com.bank.payment.services.impl.AccountServiceImp
All Implemented Interfaces:
AccountService

@Service public class AccountServiceImp extends Object implements AccountService
  • Constructor Details

    • AccountServiceImp

      public AccountServiceImp()
  • Method Details

    • save

      public AccountModel save(AccountModel accountModel)
      Description copied from interface: AccountService
      Saves an AccountModel to the database.
      Specified by:
      save in interface AccountService
      Parameters:
      accountModel - the AccountModel to be saved
      Returns:
      the saved AccountModel
    • findById

      public Optional<AccountModel> findById(Long idAccount)
      Description copied from interface: AccountService
      Finds an AccountModel by its ID.
      Specified by:
      findById in interface AccountService
      Parameters:
      idAccount - the ID of the account to search for
      Returns:
      an Optional containing the AccountModel if found, or empty if not found
    • findByPixKey

      public Optional<AccountModel> findByPixKey(String pixKey)
      Description copied from interface: AccountService
      Finds an AccountModel by its Pix key.
      Specified by:
      findByPixKey in interface AccountService
      Parameters:
      pixKey - the Pix key to search for
      Returns:
      an Optional containing the AccountModel if found, or empty if not found
    • delete

      public void delete(Long idAccount)
      Description copied from interface: AccountService
      Deletes an AccountModel by its ID.
      Specified by:
      delete in interface AccountService
      Parameters:
      idAccount - the ID of the account to be deleted
    • updateBalanceSender

      public AccountModel updateBalanceSender(AccountModel accountModel)
      Description copied from interface: AccountService
      Updates the balance of the account sending a payment.
      Specified by:
      updateBalanceSender in interface AccountService
      Parameters:
      accountModel - the AccountModel with updated balance information
      Returns:
      the updated AccountModel
    • updateBalanceReceive

      public AccountModel updateBalanceReceive(AccountModel accountModel)
      Description copied from interface: AccountService
      Updates the balance of the account receiving a payment.
      Specified by:
      updateBalanceReceive in interface AccountService
      Parameters:
      accountModel - the AccountModel with updated balance information
      Returns:
      the updated AccountModel