Class CommerceItemServiceImpl

    • Constructor Detail

      • CommerceItemServiceImpl

        public CommerceItemServiceImpl()
    • Method Detail

      • extractSpecs

        public java.util.Map<java.lang.String,​java.lang.Object> extractSpecs​(SellerSKU sku)
        Description copied from interface: CommerceItemService
        Extracting specs of sku to list of maps.
        Specified by:
        extractSpecs in interface CommerceItemService
        Parameters:
        sku - sellerSKU
        Returns:
        map of specs
      • removeCommerceItem

        public void removeCommerceItem​(java.lang.String id)
        Description copied from interface: CommerceItemService
        Removes a commerce item based on its id.
        Specified by:
        removeCommerceItem in interface CommerceItemService
        Parameters:
        id - the id of the commerce item to be removed
      • removeCommerceItems

        public void removeCommerceItems​(java.util.List<java.lang.String> ids)
        Description copied from interface: CommerceItemService
        Removes multiple commerce items based on an array of ids.
        Specified by:
        removeCommerceItems in interface CommerceItemService
        Parameters:
        ids - an collection of ids of the commerce items to be removed
      • refundCommerceItems

        public void refundCommerceItems​(Order order)
        Description copied from interface: CommerceItemService
        Refunds all commerce items in the given order.
        Specified by:
        refundCommerceItems in interface CommerceItemService
        Parameters:
        order - the order containing the commerce items to be refunded
      • updateInventoriesLockedQuantity

        public boolean updateInventoriesLockedQuantity​(java.util.Map<CommerceItem,​Inventory> map,
                                                       boolean increase)
        Description copied from interface: CommerceItemService
        Updates the locked quantity in the inventories based on the map of commerce items and their corresponding inventory objects. If increase is true, the locked quantity will be increased; if increase is false, the locked quantity will be decreased.
        Specified by:
        updateInventoriesLockedQuantity in interface CommerceItemService
        Parameters:
        map - A map of CommerceItem objects and their corresponding Inventory objects
        increase - A boolean value to indicate whether to increase or decrease the locked quantity
        Returns:
        true if the locked quantity was successfully updated, false otherwise
      • obtainItemToInventoryMap

        public java.util.Map<CommerceItem,​Inventory> obtainItemToInventoryMap​(java.util.List<CommerceItem> items)
        Description copied from interface: CommerceItemService
        This method creates a mapping between each CommerceItem and its corresponding Inventory.
        Specified by:
        obtainItemToInventoryMap in interface CommerceItemService
        Parameters:
        items - the list of CommerceItems for which the mapping needs to be created
        Returns:
        a Map containing the CommerceItem as the key and its corresponding Inventory as the value
      • extractAttributeValues

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> extractAttributeValues​(SellerSKU sku)