Interface B2BUnitFacade
- All Known Subinterfaces:
B2BCommerceUnitFacade
- All Known Implementing Classes:
DefaultB2BCommerceUnitFacade,DefaultB2BUnitFacade,DefaultChineseB2BUnitFacade
public interface B2BUnitFacade
Facade to handle operations over B2BUnit and related types.
- Since:
- 6.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAddressToUnit(AddressData newAddress, String unitUid) Associates an address to a business unitvoiddisableUnit(String unitUid) Disables a unit based on a uid of aB2BUnitModelvoideditAddressOfUnit(AddressData newAddress, String unitUid) Edit address of a unitvoidenableUnit(String unitUid) Enable a Business Unit that is not activeGet All units of organization which are enabled.getAllowedParentUnits(String unitUid) A list of parent units for which the unit with uid can be assigned as a siblingGets a list ofB2BUnitNodeDatarepresenting each unit in the branch based on the session customergetPagedAdministratorsForUnit(PageableData pageableData, String unitUid) Get a list of administrators associated with a give unit.getPagedCustomersForUnit(PageableData pageableData, String unitUid) Get a list of customers associated with a give unit.getPagedManagersForUnit(PageableData pageableData, String unitUid) Get a list of managers associated with a give unit.getPagedUserDataForUnit(PageableData pageableData, String unitUid) Get a list of customers directly associated to the unit plus all the customers who are members of given list of usergroups with the visible branch for the current session user.Gets the business unit assigned to the current session user with all the children retrieved viaB2BUnitData.getChildren().Gets a business unit as a B2BUnitNodeData assigned to the current session user with all the children retrieved viaB2BUnitNodeData.getChildren()which only has enough data to construct a tree view.getUnitForUid(String unitUid) Gets aB2BUnitDatagiven its uid.voidremoveAddressFromUnit(String unitUid, String addressId) Remove an address from a unitvoidupdateOrCreateBusinessUnit(String originalUid, B2BUnitData unit) UpdatesB2BUnitModelbased on unit data if param originalUid is null the new unit is created
-
Method Details
-
getPagedCustomersForUnit
Get a list of customers associated with a give unit.- Parameters:
pageableData-unitUid- A uid of aB2BUnitModel- Returns:
- A paginated list of customers.
-
getPagedAdministratorsForUnit
SearchPageData<CustomerData> getPagedAdministratorsForUnit(PageableData pageableData, String unitUid) Get a list of administrators associated with a give unit.- Parameters:
pageableData-unitUid- A uid of aB2BUnitModel- Returns:
- A paginated list of customers.
-
getPagedManagersForUnit
Get a list of managers associated with a give unit.- Parameters:
pageableData-unitUid- A uid of aB2BUnitModel- Returns:
- A paginated list of customers.
-
disableUnit
Disables a unit based on a uid of aB2BUnitModel- Parameters:
unitUid-
-
enableUnit
Enable a Business Unit that is not active- Parameters:
unitUid- A unitUid uid
-
getParentUnit
B2BUnitData getParentUnit()Gets the business unit assigned to the current session user with all the children retrieved viaB2BUnitData.getChildren().- Returns:
- the business unit assigned to the session customer
-
getParentUnitNode
B2BUnitNodeData getParentUnitNode()Gets a business unit as a B2BUnitNodeData assigned to the current session user with all the children retrieved viaB2BUnitNodeData.getChildren()which only has enough data to construct a tree view.- Returns:
- A business unit assigned to the session customer
-
getAllowedParentUnits
A list of parent units for which the unit with uid can be assigned as a sibling- Parameters:
unitUid- An id of aB2BUnitModel- Returns:
- A list of parent units that a given unit can be a child of
-
getAllActiveUnitsOfOrganization
Get All units of organization which are enabled.- Returns:
- A collection of B2BUnit uids.
-
getPagedUserDataForUnit
Get a list of customers directly associated to the unit plus all the customers who are members of given list of usergroups with the visible branch for the current session user. A list ofPrincipalModel.getUid()- Parameters:
pageableData- Pagination dataunitUid- A unit UID- Returns:
- A paginated list of
CustomerData
-
addAddressToUnit
Associates an address to a business unit- Parameters:
newAddress- Address data objectunitUid- A unit uid
-
removeAddressFromUnit
Remove an address from a unit- Parameters:
unitUid-addressId-
-
editAddressOfUnit
Edit address of a unit- Parameters:
newAddress- Address dataunitUid- A unit UID
-
updateOrCreateBusinessUnit
UpdatesB2BUnitModelbased on unit data if param originalUid is null the new unit is created- Parameters:
originalUid- the uid ofB2BUnitModelto update.unit- A unit data object
-
getBranchNodes
List<B2BUnitNodeData> getBranchNodes()Gets a list ofB2BUnitNodeDatarepresenting each unit in the branch based on the session customer- Returns:
- A list of units in the branch.
-
getUnitForUid
Gets aB2BUnitDatagiven its uid.- Parameters:
unitUid-- Returns:
- The unit.
-