Interface AccountMemberService<M extends AccountMember>
-
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<M>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<M>
- All Known Implementing Classes:
DefaultAccountMemberService
public interface AccountMemberService<M extends AccountMember> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<M>
Service API forAccountMembers
. Supported byAccountMemberRepository
.- Author:
- Chris Kittrell (ckittrell)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.springframework.data.domain.Page<M>
readAllByAccountId(String accountId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads all of the AccountMember relationships in the database associated with the given account context ID.M
readByIdAndAccountId(String id, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Finds theAccountMember
which has the given ID and parent account ID.M
registerAccountMember(String accountId, RegisterAccountMemberRequest registerAccountMemberRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
M
updateAccountMember(String accountId, String accountMemberId, UpdateAccountMemberRequest updateRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
-
-
-
Method Detail
-
readAllByAccountId
org.springframework.data.domain.Page<M> readAllByAccountId(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)
Reads all of the AccountMember relationships in the database associated with the given account context ID.- Parameters:
accountId
- the account context ID to find the relationships forfilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.page
- the requested page of results from the databasecontextInfo
- the context to query within- Returns:
- the AccountMember relationships in the database that match the given account context ID
-
registerAccountMember
M registerAccountMember(String accountId, RegisterAccountMemberRequest registerAccountMemberRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Relates aCustomer
with theAccount
identified by theaccountId
. If the customer cannot be found, then one is created.- Parameters:
accountId
- Id of theAccount
that theRegisterAccountMemberRequest.customerRef
should be related toregisterAccountMemberRequest
- The payload that describes the requested relationship between the customer & the accountcontext
- The context of the user's request- Returns:
- The registered AccountMember
- Throws:
com.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the relatedAccount
,Customer
, orAccountRole
are not found
-
readByIdAndAccountId
M readByIdAndAccountId(String id, String accountId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Finds theAccountMember
which has the given ID and parent account ID.- Parameters:
id
- the context ID of theAccountMember
accountId
- the context ID of the owningAccount
contextInfo
- context surrounding customer and multitenant state- Returns:
- the account member that has the given ID and owning account ID
- Throws:
com.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if no suchAccountMember
was found
-
updateAccountMember
M updateAccountMember(String accountId, String accountMemberId, UpdateAccountMemberRequest updateRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
- Parameters:
accountId
- Id of theAccount
in the relationshipaccountMemberId
- Id of theAccountMember
that is to be updatedupdateRequest
- The payload that describes the requested changescontext
- The context of the user's request- Returns:
-
-