Interface CustomerAccountService<P extends CustomerAccount>

All Known Implementing Classes:
DefaultCustomerAccountService

public interface CustomerAccountService<P extends CustomerAccount>
Service for managing CustomerAccounts.
  • Method Details

    • readByAccountId

      Optional<P> readByAccountId(String accountId)
      Find a CustomerAccount by its account id.
      Parameters:
      accountId - The account id to look-up the CustomerAccount.
      Returns:
      The CustomerAccount for the given account id.
    • readAllByParentAccountIdIn

      List<P> readAllByParentAccountIdIn(Collection<String> parentAccountIds)
      Find a list of CustomerAccount by their parent account ids.
      Parameters:
      parentAccountIds - The parent account id to look-up the CustomerAccount.
      Returns:
      The list of CustomerAccount for the given parent account id.
    • save

      P save(P customerAccount)
      Parameters:
      customerAccount - The CustomerAccount to save.
      Returns:
      The persisted CustomerAccount.
    • delete

      void delete(P customerAccount)
      Delete a CustomerAccount.
      Parameters:
      customerAccount - The CustomerAccount to delete.
    • getAccountAncestors

      List<String> getAccountAncestors(String accountId)
      Get a list of all parent accounts for the account with the given id. The returned list does not include the given account id.
      Parameters:
      accountId - The id of the account for which to lookup ancestors
      Returns:
      A list of ids of ancestors to the given account id.
    • getAccountInheritanceLine

      List<P> getAccountInheritanceLine(String accountId)
      Returns the account and all of its ancestors in order with the given account first.
      Parameters:
      accountId - The account whose inheritance line to build.
      Returns:
      The account and all of its ancestors in order with the given account first.
    • getAllAccountsDescendants

      List<String> getAllAccountsDescendants(Collection<String> accountIds)
      Gets a list of all child accounts/sub-accounts for the accounts with the given ids. The returned list does not include the given account ids.
      Parameters:
      accountIds - The id of the account for which to lookup descendants
      Returns:
      A list of ids of descendants for the given account ids.