Interface B2BUnitFacade

    • Method Detail

      • getPagedCustomersForUnit

        SearchPageData<CustomerData> getPagedCustomersForUnit​(PageableData pageableData,
                                                              java.lang.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,
                                                                   java.lang.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,
                                                             java.lang.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​(java.lang.String unitUid)
        Disables a unit based on a uid of a B2BUnitModel
        Parameters:
        unitUid -
      • enableUnit

        void enableUnit​(java.lang.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

        java.util.List<B2BUnitNodeData> getAllowedParentUnits​(java.lang.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

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

        SearchPageData<CustomerData> getPagedUserDataForUnit​(PageableData pageableData,
                                                             java.lang.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,
                              java.lang.String unitUid)
        Associates an address to a business unit
        Parameters:
        newAddress - Address data object
        unitUid - A unit uid
      • removeAddressFromUnit

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

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

        void updateOrCreateBusinessUnit​(java.lang.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

        java.util.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​(java.lang.String unitUid)
        Gets a B2BUnitData given its uid.
        Parameters:
        unitUid -
        Returns:
        The unit.