Package de.hybris.platform.b2b.company
Interface B2BCommerceUnitService
- All Known Subinterfaces:
B2BCommerceUnitService
- All Known Implementing Classes:
DefaultB2BCommerceUnitService,DefaultB2BCommerceUnitService
public interface B2BCommerceUnitService
A service for unit management within b2b commerce
-
Method Summary
Modifier and TypeMethodDescriptionvoiddisableUnit(String uid) Disable unit based on the given uidvoideditAddressEntry(B2BUnitModel unitModel, AddressModel addressModel) Save updatedAddressModelobject to a unitvoidenableUnit(String unit) Enable unit based on the given uidgetAddressForCode(B2BUnitModel unit, String id) Gets aAddressModelobject for a given unitCollection<? extends B2BUnitModel>Gets all the allowed parent units for a givenB2BUnitModelCollection<? extends B2BUnitModel>Get all the units of a organization for current logged in userCollection<? extends B2BUnitModel>A branch of business units based on the parent unit of the current session user.Collection<? extends B2BUnitModel>A collection of business units based on root unit of an organization to which the parent business unit of the currently logged in customer belongs togetPagedUsersForUnit(PageableData pageableData, String unit) Gets list ofSearchPageDataB2BCustomerModelfor a given unit for pagination provided with required pagination parameters withPageableData<T extends B2BUnitModel>
TGets a parent unit of the current session user<T extends B2BUnitModel>
TgetParentUnit(B2BUnitModel unit) Gets parent unit based on the given unit<T extends B2BUnitModel>
TGets a Root unit of the organization based on the parent business unit of the session usergetUnitForUid(String unitUid) Gets the unit for uid.voidremoveAddressEntry(String unitUid, String addressId) Removes the address from a given unitvoidsaveAddressEntry(B2BUnitModel unitForUid, AddressModel addressModel) Sets a given address for a unitvoidsetParentUnit(B2BUnitModel unitModel, B2BUnitModel parentUnit) Assign a parent unit to unitModelvoidUpdates the branch collection in the session for the current user.
-
Method Details
-
getOrganization
Collection<? extends B2BUnitModel> getOrganization()A collection of business units based on root unit of an organization to which the parent business unit of the currently logged in customer belongs to- Returns:
- A collection of units where the root unit is the parent business unit of the currently logged in customer.
-
getBranch
Collection<? extends B2BUnitModel> getBranch()A branch of business units based on the parent unit of the current session user.- Returns:
- A collection of units where the root unit is the parent business unit of the currently logged in customer.
-
getRootUnit
Gets a Root unit of the organization based on the parent business unit of the session user- Returns:
- A root unit of an organization a session customer belongs to
- See Also:
-
getParentUnit
Gets a parent unit of the current session user- Returns:
- The business unit assigned to the current session user.
-
setParentUnit
Assign a parent unit to unitModel- Parameters:
unitModel- A unit to assign a parent forB2BUnitModelparentUnit- The parent unitB2BUnitModel
-
getAllUnitsOfOrganization
Collection<? extends B2BUnitModel> getAllUnitsOfOrganization()Get all the units of a organization for current logged in user- Returns:
- Collection of units for the organization of the current user
-
getAllowedParentUnits
Gets all the allowed parent units for a givenB2BUnitModel- Parameters:
unit- A unique identifier for a unit- Returns:
- A collection of
B2BUnitModelfor the given uid
-
updateBranchInSession
void updateBranchInSession()Updates the branch collection in the session for the current user. Should be called after a new unit creation so that its does not get filter out by the unit branch search restriction. -
disableUnit
Disable unit based on the given uid- Parameters:
uid- A unique identifier ofB2BUnitModel
-
enableUnit
Enable unit based on the given uid- Parameters:
unit- A unique identifier ofB2BUnitModel
-
getParentUnit
Gets parent unit based on the given unit- Parameters:
unit- AB2BUnitModelobject- Returns:
- A
B2BUnitModelobject which denotes the parent unit of the given unit
-
removeAddressEntry
Removes the address from a given unit- Parameters:
unitUid- A unique identifier ofB2BUnitModeladdressId- A unique identifier ofAddressModel
-
saveAddressEntry
Sets a given address for a unit- Parameters:
unitForUid- A unique identifier ofB2BUnitModeladdressModel-AddressModelobject which is getting added to unit
-
getAddressForCode
Gets aAddressModelobject for a given unit- Parameters:
unit- A unique identifier ofB2BUnitModelid- A unique identifier ofAddressModel- Returns:
AddressModelobject
-
editAddressEntry
Save updatedAddressModelobject to a unit- Parameters:
unitModel- A unique identifier ofB2BUnitModeladdressModel-AddressModelobject for given unit
-
getPagedUsersForUnit
Gets list ofSearchPageDataB2BCustomerModelfor a given unit for pagination provided with required pagination parameters withPageableData- Parameters:
pageableData- Pagination informationunit- A unique identifier ofB2BUnitModel- Returns:
- Collection of paginated
B2BCostCenterModelobjects
-
getUnitForUid
Gets the unit for uid.- Parameters:
unitUid- the unit uid- Returns:
- the unit for uid
-