Interface CustomerAccountService<A extends Account,M extends AccountMember>

All Known Implementing Classes:
DefaultCustomerAccountService

public interface CustomerAccountService<A extends Account,M extends AccountMember>
Service for customer facing interactions involving reading account members and accounts. Additional validation is performed in this service to ensure account related data may only be read if the user is a member of that account.
  • Method Details

    • readAccountMembers

      org.springframework.data.domain.Page<M> readAccountMembers(String accountId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read the AccountMembers for a specific Account by id.
      Parameters:
      accountId - Id of the parent account
      filters - RSQL filters
      page - Pagination info
      contextInfo - Additional multitenant and sandbox info
      Returns:
      The AccountMembers for a specific Account by id.
    • readAccountMember

      M readAccountMember(String accountId, String memberId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • updateAccountMember

      M updateAccountMember(String accountId, String memberId, UpdateAccountMemberRequest accountMember, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • createAccountUser

      CreateAccountUserResponse createAccountUser(String accountId, CreateAccountUserRequest createRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates a net-new account user.

      This method creates a net new Customer and assigns it to an account at the same time by also creating an AccountMember.

      Parameters:
      accountId - the id of the account to create the user in
      createRequest - the CreateAccountUserRequest containing the details
      contextInfo - Additional multitenant and sandbox info
      Returns:
      the CreateAccountUserResponse representing the result of the creation
      Since:
      Customer Services 2.1.0, Release Train 2.3.0
    • deleteAccountMember

      void deleteAccountMember(String accountId, String memberId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • readMyAccounts

      List<A> readMyAccounts(int childAccountDepth, boolean filterParents, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads the currently logged in user's Accounts. Set excludeAccountsWithInactiveParent to true to filter out accounts that have a disabled parent account.
      Parameters:
      childAccountDepth - How many levels deep of the account hierarchy of the accounts matching ids to include in the results, e.g., how many levels of child accounts to include. -1 indicates no limit. 0 indicates no child accounts.

      Default is 0.

      filterParents - If true, the returned list will include only accounts with active parent accounts.
      filters - An RSQL filter used to narrow query results. May be EmptyNode if no filters should be applied.
      contextInfo - Additional multitenant and sandbox info
      Returns:
      The currently logged in user's Accounts.