Interface AccountService

All Known Implementing Classes:
AccountServiceImp

public interface AccountService
Interface for AccountService that defines methods for handling account operations. It includes methods for saving, finding, deleting accounts, and updating account balances.
Since:
1.0.0
Version:
1.0.0, 06/26/2025
Author:
Fernando Cruz Cavina
See Also:
  • Method Details

    • save

      AccountModel save(AccountModel accountModel)
      Saves an AccountModel to the database.
      Parameters:
      accountModel - the AccountModel to be saved
      Returns:
      the saved AccountModel
    • findById

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

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

      void delete(Long idAccount)
      Deletes an AccountModel by its ID.
      Parameters:
      idAccount - the ID of the account to be deleted
    • updateBalanceReceive

      AccountModel updateBalanceReceive(AccountModel accountModel)
      Updates the balance of the account receiving a payment.
      Parameters:
      accountModel - the AccountModel with updated balance information
      Returns:
      the updated AccountModel
    • updateBalanceSender

      AccountModel updateBalanceSender(AccountModel accountModel)
      Updates the balance of the account sending a payment.
      Parameters:
      accountModel - the AccountModel with updated balance information
      Returns:
      the updated AccountModel