Interface ProductService
- All Known Implementing Classes:
ProductServiceImpl
public interface ProductService
Interface providing methods to work with products
-
Method Summary
Modifier and TypeMethodDescriptionbooleancreatePdfDatasheetDocument(TypedObject product) Creates new pdf attachment for productvoiddeletePdfDatasheetDocument(TypedObject document) Deletes provided PDF documentGets all available approval status codesGets approval status code for provided itemgetApprovalStatusName(String code) Gets an enum value name of provided approval status codegetPdfDatasheetDocuments(TypedObject product) Gets all PDF documents attached to product.getVariants(TypedObject base) Gets all variants of provided item that are defined in the systemGets a type code of variants for provided item.booleanhasVariants(TypedObject item) Checks if item is a product that has at least one variant existingbooleanisBaseProduct(TypedObject item) Checks if item is a base productvoidsetApprovalStatus(TypedObject item, String code) Sets new approval status code for prodcut
-
Method Details
-
isBaseProduct
Checks if item is a base product- Parameters:
item- item to be checked- Returns:
trueif item provided is a base product
-
hasVariants
Checks if item is a product that has at least one variant existing- Parameters:
item- item to be checked- Returns:
trueif there is at least one variant defined for provided item
-
getVariants
Gets all variants of provided item that are defined in the system- Parameters:
base- base item- Returns:
- list of variants defined
-
getVariantTypecode
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
Gets approval status code for provided item- Parameters:
item- product to be checked- Returns:
- approval status code or
nullif provided item is not a product - See Also:
-
setApprovalStatus
Sets new approval status code for prodcut- Parameters:
item- product to change an approval statuscode- new approval status code- See Also:
-
getApprovalStatusName
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
Gets all available approval status codes- Returns:
- list approval status codes
-
getPdfDatasheetDocuments
Gets all PDF documents attached to product.- Parameters:
product- product which attachments are required- Returns:
- list of pdfs attached
-
createPdfDatasheetDocument
Creates new pdf attachment for product- Parameters:
product- product to which new pdf should be attached- Returns:
trueif attachment has been successfully created
-
deletePdfDatasheetDocument
Deletes provided PDF document- Parameters:
document- document to be deleted
-