Package de.hybris.platform.b2b.services
Interface B2BApproverService<T>
-
- Type Parameters:
T- the principal (customer)
- All Known Implementing Classes:
DefaultB2BApproverService
public interface B2BApproverService<T>The Interface B2BApproverService. Service is responsible for fetching approvers related to a B2BCustomer.- Spring Bean ID:
- b2bApproverService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description B2BCustomerModeladdApproverToCustomer(java.lang.String user, java.lang.String approver)Add an approver for a given user and return the updatedB2BCustomerModelobject updated with approver detailsB2BCustomerModeladdApproverToUnit(java.lang.String unitId, java.lang.String approverId)Add approver to given unitSearchPageData<B2BCustomerModel>findPagedApproversForUnitByGroupMembership(PageableData pageableData, java.lang.String unitUid, java.lang.String... userGroupUid)Gets list ofSearchPageDataB2BCustomerModelprovided with required pagination parameters withPageableDatajava.util.List<UserModel>getAccountManagerApprovers(PrincipalModel principal)Gets the list of account manager approvers.java.util.List<T>getAllActiveApprovers(B2BCustomerModel principal)Gets all the active approvers for a given customerjava.util.List<T>getAllApprovers(T principal)Gets the approvers assigned to principal(customer) directly or as approver groups including its parent unit and all the units assigned to its parent up to the root unit.booleanisMemberOf(PrincipalGroupModel principal, java.lang.String userGroupUid)Deprecated.Since 4.4.B2BCustomerModelremoveApproverFromCustomer(java.lang.String user, java.lang.String approver)Remove an approver for a given user and return the updatedB2BCustomerModelobject updated with approver detailsB2BCustomerModelremoveApproverFromUnit(java.lang.String unitUid, java.lang.String approverUid)If an approver is a member of the B2BUnit remove b2bapprovergroup role, if the approver is a member of the current branch of units the approver will be removed fromB2BUnitModel.getApprovers()relationship
-
-
-
Method Detail
-
getAllApprovers
java.util.List<T> getAllApprovers(T principal)
Gets the approvers assigned to principal(customer) directly or as approver groups including its parent unit and all the units assigned to its parent up to the root unit.- Parameters:
principal- the principal (customer)- Returns:
- A collection of approvers
-
isMemberOf
@Deprecated(since="4.4") boolean isMemberOf(PrincipalGroupModel principal, java.lang.String userGroupUid)
Deprecated.Checks if the principal is a member of the user group.- Parameters:
principal- the principaluserGroupUid- the uid of the user group to check if the principal is a memeber of.- Returns:
- true, if is member of
-
getAccountManagerApprovers
java.util.List<UserModel> getAccountManagerApprovers(PrincipalModel principal)
Gets the list of account manager approvers.- Parameters:
principal- the principal- Returns:
- the approvers
-
getAllActiveApprovers
java.util.List<T> getAllActiveApprovers(B2BCustomerModel principal)
Gets all the active approvers for a given customer- Parameters:
principal-- Returns:
- list of approvers
-
addApproverToCustomer
B2BCustomerModel addApproverToCustomer(java.lang.String user, java.lang.String approver)
Add an approver for a given user and return the updatedB2BCustomerModelobject updated with approver details- Parameters:
user- A unique identifier forB2BCustomerModelrepresenting a userapprover- A unique identifier forB2BCustomerModelrepresenting a approver- Returns:
- Updated
B2BCustomerModelobject updated with approvers
-
removeApproverFromCustomer
B2BCustomerModel removeApproverFromCustomer(java.lang.String user, java.lang.String approver)
Remove an approver for a given user and return the updatedB2BCustomerModelobject updated with approver details- Parameters:
user- A unique identifier forB2BCustomerModelrepresenting a userapprover- A unique identifier forB2BCustomerModelrepresenting a approver- Returns:
- Updated
B2BCustomerModelobject removed with approver
-
addApproverToUnit
B2BCustomerModel addApproverToUnit(java.lang.String unitId, java.lang.String approverId)
Add approver to given unit- Parameters:
unitId- A unique identifier forB2BUnitModelapproverId- A unique identifier forB2BCustomerModelwho is a approver- Returns:
- Updated
B2BCustomerModelobject after adding approver to customer.
-
removeApproverFromUnit
B2BCustomerModel removeApproverFromUnit(java.lang.String unitUid, java.lang.String approverUid)
If an approver is a member of the B2BUnit remove b2bapprovergroup role, if the approver is a member of the current branch of units the approver will be removed fromB2BUnitModel.getApprovers()relationship- Parameters:
unitUid- A unique identifier ofB2BUnitModelapproverUid- A unique identifier ofB2BCustomerModel- Returns:
- An approver who was removed from a
B2BUnitModel.getApprovers()
-
findPagedApproversForUnitByGroupMembership
SearchPageData<B2BCustomerModel> findPagedApproversForUnitByGroupMembership(PageableData pageableData, java.lang.String unitUid, java.lang.String... userGroupUid)
Gets list ofSearchPageDataB2BCustomerModelprovided with required pagination parameters withPageableData- Parameters:
pageableData- Pagination informationunitUid- A unique identifier ofB2BUnitModeluserGroupUid- A unique identifier ofB2BUserGroupModel- Returns:
- Collection of paginated
B2BCostCenterModelobjects
-
-