Interface CustomerAccountService<P extends CustomerAccount>
- All Known Implementing Classes:
DefaultCustomerAccountService
public interface CustomerAccountService<P extends CustomerAccount>
Service for managing
CustomerAccounts
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Delete aCustomerAccount
.getAccountAncestors
(String accountId) Get a list of all parent accounts for the account with the given id.getAccountInheritanceLine
(String accountId) Returns the account and all of its ancestors in order with the given account first.getAllAccountsDescendants
(Collection<String> accountIds) Gets a list of all child accounts/sub-accounts for the accounts with the given ids.readAllByParentAccountIdIn
(Collection<String> parentAccountIds) Find a list ofCustomerAccount
by their parent account ids.readByAccountId
(String accountId) Find aCustomerAccount
by its account id.Save aCustomerAccount
,
-
Method Details
-
readByAccountId
Find aCustomerAccount
by its account id.- Parameters:
accountId
- The account id to look-up theCustomerAccount
.- Returns:
- The
CustomerAccount
for the given account id.
-
readAllByParentAccountIdIn
Find a list ofCustomerAccount
by their parent account ids.- Parameters:
parentAccountIds
- The parent account id to look-up theCustomerAccount
.- Returns:
- The list of
CustomerAccount
for the given parent account id.
-
save
Save aCustomerAccount
,- Parameters:
customerAccount
- TheCustomerAccount
to save.- Returns:
- The persisted
CustomerAccount
.
-
delete
Delete aCustomerAccount
.- Parameters:
customerAccount
- TheCustomerAccount
to delete.
-
getAccountAncestors
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
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
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.
-