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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
disableUnit(java.lang.String uid)
Disable unit based on the given uidvoid
editAddressEntry(B2BUnitModel unitModel, AddressModel addressModel)
Save updatedAddressModel
object to a unitvoid
enableUnit(java.lang.String unit)
Enable unit based on the given uidAddressModel
getAddressForCode(B2BUnitModel unit, java.lang.String id)
Gets aAddressModel
object for a given unitjava.util.Collection<? extends B2BUnitModel>
getAllowedParentUnits(B2BUnitModel unit)
Gets all the allowed parent units for a givenB2BUnitModel
java.util.Collection<? extends B2BUnitModel>
getAllUnitsOfOrganization()
Get all the units of a organization for current logged in userjava.util.Collection<? extends B2BUnitModel>
getBranch()
A branch of business units based on the parent unit of the current session user.java.util.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 toSearchPageData<B2BCustomerModel>
getPagedUsersForUnit(PageableData pageableData, java.lang.String unit)
Gets list ofSearchPageData
B2BCustomerModel
for a given unit for pagination provided with required pagination parameters withPageableData
<T extends B2BUnitModel>
TgetParentUnit()
Gets 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>
TgetRootUnit()
Gets a Root unit of the organization based on the parent business unit of the session userB2BUnitModel
getUnitForUid(java.lang.String unitUid)
Gets the unit for uid.void
removeAddressEntry(java.lang.String unitUid, java.lang.String addressId)
Removes the address from a given unitvoid
saveAddressEntry(B2BUnitModel unitForUid, AddressModel addressModel)
Sets a given address for a unitvoid
setParentUnit(B2BUnitModel unitModel, B2BUnitModel parentUnit)
Assign a parent unit to unitModelvoid
updateBranchInSession()
Updates the branch collection in the session for the current user.
-
-
-
Method Detail
-
getOrganization
java.util.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
java.util.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
<T extends B2BUnitModel> T 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()
-
getParentUnit
<T extends B2BUnitModel> T getParentUnit()
Gets a parent unit of the current session user- Returns:
- The business unit assigned to the current session user.
-
setParentUnit
void setParentUnit(B2BUnitModel unitModel, B2BUnitModel parentUnit)
Assign a parent unit to unitModel- Parameters:
unitModel
- A unit to assign a parent forB2BUnitModel
parentUnit
- The parent unitB2BUnitModel
-
getAllUnitsOfOrganization
java.util.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
java.util.Collection<? extends B2BUnitModel> getAllowedParentUnits(B2BUnitModel unit)
Gets all the allowed parent units for a givenB2BUnitModel
- Parameters:
unit
- A unique identifier for a unit- Returns:
- A collection of
B2BUnitModel
for 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
void disableUnit(java.lang.String uid)
Disable unit based on the given uid- Parameters:
uid
- A unique identifier ofB2BUnitModel
-
enableUnit
void enableUnit(java.lang.String unit)
Enable unit based on the given uid- Parameters:
unit
- A unique identifier ofB2BUnitModel
-
getParentUnit
<T extends B2BUnitModel> T getParentUnit(B2BUnitModel unit)
Gets parent unit based on the given unit- Parameters:
unit
- AB2BUnitModel
object- Returns:
- A
B2BUnitModel
object which denotes the parent unit of the given unit
-
removeAddressEntry
void removeAddressEntry(java.lang.String unitUid, java.lang.String addressId)
Removes the address from a given unit- Parameters:
unitUid
- A unique identifier ofB2BUnitModel
addressId
- A unique identifier ofAddressModel
-
saveAddressEntry
void saveAddressEntry(B2BUnitModel unitForUid, AddressModel addressModel)
Sets a given address for a unit- Parameters:
unitForUid
- A unique identifier ofB2BUnitModel
addressModel
-AddressModel
object which is getting added to unit
-
getAddressForCode
AddressModel getAddressForCode(B2BUnitModel unit, java.lang.String id)
Gets aAddressModel
object for a given unit- Parameters:
unit
- A unique identifier ofB2BUnitModel
id
- A unique identifier ofAddressModel
- Returns:
AddressModel
object
-
editAddressEntry
void editAddressEntry(B2BUnitModel unitModel, AddressModel addressModel)
Save updatedAddressModel
object to a unit- Parameters:
unitModel
- A unique identifier ofB2BUnitModel
addressModel
-AddressModel
object for given unit
-
getPagedUsersForUnit
SearchPageData<B2BCustomerModel> getPagedUsersForUnit(PageableData pageableData, java.lang.String unit)
Gets list ofSearchPageData
B2BCustomerModel
for a given unit for pagination provided with required pagination parameters withPageableData
- Parameters:
pageableData
- Pagination informationunit
- A unique identifier ofB2BUnitModel
- Returns:
- Collection of paginated
B2BCostCenterModel
objects
-
getUnitForUid
B2BUnitModel getUnitForUid(java.lang.String unitUid)
Gets the unit for uid.- Parameters:
unitUid
- the unit uid- Returns:
- the unit for uid
-
-