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 Details

    • getPagedCustomersForUnit

      SearchPageData<CustomerData> getPagedCustomersForUnit(PageableData pageableData, String unitUid)
      Get a list of customers associated with a give unit.
      Parameters:
      pageableData -
      unitUid - A uid of a B2BUnitModel
      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 a B2BUnitModel
      Returns:
      A paginated list of customers.
    • getPagedManagersForUnit

      SearchPageData<CustomerData> getPagedManagersForUnit(PageableData pageableData, String unitUid)
      Get a list of managers associated with a give unit.
      Parameters:
      pageableData -
      unitUid - A uid of a B2BUnitModel
      Returns:
      A paginated list of customers.
    • disableUnit

      void disableUnit(String unitUid)
      Disables a unit based on a uid of a B2BUnitModel
      Parameters:
      unitUid -
    • enableUnit

      void enableUnit(String unitUid)
      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 via B2BUnitData.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 via B2BUnitNodeData.getChildren() which only has enough data to construct a tree view.
      Returns:
      A business unit assigned to the session customer
    • getAllowedParentUnits

      List<B2BUnitNodeData> getAllowedParentUnits(String unitUid)
      A list of parent units for which the unit with uid can be assigned as a sibling
      Parameters:
      unitUid - An id of a B2BUnitModel
      Returns:
      A list of parent units that a given unit can be a child of
    • getAllActiveUnitsOfOrganization

      List<String> getAllActiveUnitsOfOrganization()
      Get All units of organization which are enabled.
      Returns:
      A collection of B2BUnit uids.
    • getPagedUserDataForUnit

      SearchPageData<CustomerData> 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. A list of PrincipalModel.getUid()
      Parameters:
      pageableData - Pagination data
      unitUid - A unit UID
      Returns:
      A paginated list of CustomerData
    • addAddressToUnit

      void addAddressToUnit(AddressData newAddress, String unitUid)
      Associates an address to a business unit
      Parameters:
      newAddress - Address data object
      unitUid - A unit uid
    • removeAddressFromUnit

      void removeAddressFromUnit(String unitUid, String addressId)
      Remove an address from a unit
      Parameters:
      unitUid -
      addressId -
    • editAddressOfUnit

      void editAddressOfUnit(AddressData newAddress, String unitUid)
      Edit address of a unit
      Parameters:
      newAddress - Address data
      unitUid - A unit UID
    • updateOrCreateBusinessUnit

      void updateOrCreateBusinessUnit(String originalUid, B2BUnitData unit)
      Updates B2BUnitModel based on unit data if param originalUid is null the new unit is created
      Parameters:
      originalUid - the uid of B2BUnitModel to update.
      unit - A unit data object
    • getBranchNodes

      List<B2BUnitNodeData> getBranchNodes()
      Gets a list of B2BUnitNodeData representing each unit in the branch based on the session customer
      Returns:
      A list of units in the branch.
    • getUnitForUid

      B2BUnitData getUnitForUid(String unitUid)
      Gets a B2BUnitData given its uid.
      Parameters:
      unitUid -
      Returns:
      The unit.