Interface ProductService

All Known Implementing Classes:
ProductServiceImpl

public interface ProductService
Interface providing methods to work with products
  • Method Details

    • isBaseProduct

      boolean isBaseProduct(TypedObject item)
      Checks if item is a base product
      Parameters:
      item - item to be checked
      Returns:
      true if item provided is a base product
    • hasVariants

      boolean hasVariants(TypedObject item)
      Checks if item is a product that has at least one variant existing
      Parameters:
      item - item to be checked
      Returns:
      true if there is at least one variant defined for provided item
    • getVariants

      List<TypedObject> getVariants(TypedObject base)
      Gets all variants of provided item that are defined in the system
      Parameters:
      base - base item
      Returns:
      list of variants defined
    • getVariantTypecode

      String getVariantTypecode(TypedObject base)
      Gets a type code of variants for provided item.

      Provided item needs to be a base product.

      Parameters:
      base - base product
      Returns:
      type code for variats of provided product
      Throws:
      IllegalArgumentException - if provided item is not a base product
      See Also:
    • getApprovalStatusCode

      String getApprovalStatusCode(TypedObject item)
      Gets approval status code for provided item
      Parameters:
      item - product to be checked
      Returns:
      approval status code or null if provided item is not a product
      See Also:
    • setApprovalStatus

      void setApprovalStatus(TypedObject item, String code)
      Sets new approval status code for prodcut
      Parameters:
      item - product to change an approval status
      code - new approval status code
      See Also:
    • getApprovalStatusName

      String getApprovalStatusName(String code)
      Gets an enum value name of provided approval status code
      Parameters:
      code - approval status code
      Returns:
      enum value name for approval status
      See Also:
    • getAllApprovalStatusCodes

      List<String> getAllApprovalStatusCodes()
      Gets all available approval status codes
      Returns:
      list approval status codes
    • getPdfDatasheetDocuments

      List<TypedObject> getPdfDatasheetDocuments(TypedObject product)
      Gets all PDF documents attached to product.
      Parameters:
      product - product which attachments are required
      Returns:
      list of pdfs attached
    • createPdfDatasheetDocument

      boolean createPdfDatasheetDocument(TypedObject product)
      Creates new pdf attachment for product
      Parameters:
      product - product to which new pdf should be attached
      Returns:
      true if attachment has been successfully created
    • deletePdfDatasheetDocument

      void deletePdfDatasheetDocument(TypedObject document)
      Deletes provided PDF document
      Parameters:
      document - document to be deleted