Interface SKUService
-
- All Known Implementing Classes:
SKUServiceImpl
public interface SKUService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description SKU
addSKUToProduct(java.lang.String productId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> skuAsMap)
This method does a relationship between entities.java.util.Optional<SKU>
createSKU(SKU sku)
This method creates a database entity.java.util.Optional<SKU>
createSKU(java.util.LinkedHashMap<java.lang.String,java.lang.Object> skuAsMap)
This method creates a database entity.SKU
findById(java.lang.String skuId)
This method does search requests and returns data as list.java.util.List<SKU>
findSKUs()
This method returns database entities as list.java.util.List<Category>
getCategoriesBySkuId(java.lang.String skuId)
This method retrieves a map, which can be processed in a templates.java.util.LinkedHashSet<EmbeddedBean>
getFallIntoProducts(java.lang.String[] productIds)
This method returns data as set.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>
getPaginationFilter(java.lang.String requestJson)
This method does calculation for a pages based on the request.SKURepository
getRepository()
java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getSkusByProductAndFirstLetter(java.lang.String productId, java.lang.String firstLetter)
This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getSortedProductSkus(java.lang.String productId)
This method sorted and retrieves a map, which can be processed in a templates.boolean
isSKUExists(java.lang.String name)
This method checks is exists database entity.SkuDTO
mapSkuToDto(SKU sku, boolean optimal)
This method does map product entity to dto objectvoid
removeSKUAndClean(java.lang.String skuId)
This method removes a database entity and clean all relationships from another entities.void
removeSKUFromAttribute(java.lang.String skuId, java.lang.String attributeId)
This method removes relationship between database entities.void
removeSKUFromAttributes(java.lang.String skuId)
This method removes relationship between database entities.void
removeSKUFromProduct(java.lang.String skuId, java.lang.String productId)
This method removes relationship between database entities.void
removeSKUFromProducts(java.lang.String skuId)
This method removes relationship between database entities.void
removeSKUFromSellerSKU(java.lang.String skuId, java.lang.String sellerSkuId)
This method removes relationship between database entities.void
removeSKUFromSellerSKUs(java.lang.String skuId)
This method removes relationship between database entities.void
removeSKUFromTranslation(java.lang.String skuId, java.lang.String translationId)
This method removes relationship between database entities.void
removeSKUFromTranslations(java.lang.String skuId)
This method removes relationship between database entities.void
removeSkusByIds(java.util.ArrayList<java.lang.String> skusIds)
This method removes a list of database entities.SKU
saveSKU(SKU sku)
This method saves a database entity.SKU
saveSKU(java.util.LinkedHashMap<java.lang.String,java.lang.Object> skuAsMap)
This method save an updates of database entity.java.util.LinkedHashSet<SkuDTO>
searchSKUs(java.lang.String requestJson)
This method does search requests and returns data as list.java.util.List<SkuDTO>
searchSKUs(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.co.mastermindcms.modules.beans.SearchResponse
searchSKUs(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)
This method does search requests and returns data as list.co.mastermindcms.modules.beans.SearchResponse
searchSkusLightweight(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)
Retrieves lightweight skus based on the given request JSON.org.springframework.data.domain.Page<SKU>
searchSkusPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.java.util.List<SkuDTO>
searchWithProductFilter(java.lang.String query, java.lang.String productId, java.lang.String offset, java.lang.String limit)
This method does search requests and returns data as list.SKU
updateMetaInfo(java.lang.String skuId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> metaInfo)
Updates the meta information of a SKU with the given SKU ID.void
uploadSKU(java.io.File file, java.lang.String lang, java.lang.String username)
Uploads a file with SKU information to the system.
-
-
-
Method Detail
-
getRepository
SKURepository getRepository()
-
getPaginationFilter
java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationFilter(java.lang.String requestJson)
This method does calculation for a pages based on the request.- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
searchSKUs
co.mastermindcms.modules.beans.SearchResponse searchSKUs(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)
This method does search requests and returns data as list.- Parameters:
requestJson
- search request- Returns:
- data transport entities as list
-
searchSkusLightweight
co.mastermindcms.modules.beans.SearchResponse searchSkusLightweight(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)
Retrieves lightweight skus based on the given request JSON.- Parameters:
requestJson
- a LinkedHashMap containing the request parameters- Returns:
- a SearchResponse object containing the lightweight skus
-
searchSKUs
java.util.LinkedHashSet<SkuDTO> searchSKUs(java.lang.String requestJson)
This method does search requests and returns data as list.- Parameters:
requestJson
- search request- Returns:
- data transport entities as list
-
searchSkusPaged
org.springframework.data.domain.Page<SKU> searchSkusPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
findById
SKU findById(java.lang.String skuId)
This method does search requests and returns data as list.- Parameters:
skuId
- sku unique id- Returns:
- database entity as object
-
searchSKUs
@Deprecated java.util.List<SkuDTO> searchSKUs(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.This method does search requests and returns data as list.- Parameters:
query
- search queryoffset
- offset for returned itemslimit
- limit for returned items- Returns:
- database entities as list
-
searchWithProductFilter
java.util.List<SkuDTO> searchWithProductFilter(java.lang.String query, java.lang.String productId, java.lang.String offset, java.lang.String limit)
This method does search requests and returns data as list.- Parameters:
query
- search queryproductId
- field "_id" for filter and return itemsoffset
- offset for returned itemslimit
- limit for returned items- Returns:
- database entities as list
-
findSKUs
java.util.List<SKU> findSKUs()
This method returns database entities as list.- Returns:
- database entities as list
-
getCategoriesBySkuId
java.util.List<Category> getCategoriesBySkuId(java.lang.String skuId)
This method retrieves a map, which can be processed in a templates.- Parameters:
skuId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
createSKU
java.util.Optional<SKU> createSKU(java.util.LinkedHashMap<java.lang.String,java.lang.Object> skuAsMap)
This method creates a database entity.- Parameters:
skuAsMap
- map-representation of database entity- Returns:
- database entity
-
createSKU
java.util.Optional<SKU> createSKU(SKU sku)
This method creates a database entity.- Parameters:
sku
- map-representation of database entity- Returns:
- database entity
-
addSKUToProduct
SKU addSKUToProduct(java.lang.String productId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> skuAsMap)
This method does a relationship between entities.- Parameters:
productId
- identification for database entity which will be updatedskuAsMap
- map-representation of database entity- Returns:
- database entity
-
saveSKU
SKU saveSKU(java.util.LinkedHashMap<java.lang.String,java.lang.Object> skuAsMap)
This method save an updates of database entity.- Parameters:
skuAsMap
- map-representation of database entity- Returns:
- saved instance of database entity
-
saveSKU
SKU saveSKU(SKU sku)
This method saves a database entity.- Parameters:
sku
- database entity- Returns:
- saved instance of database entity
-
removeSKUFromAttribute
void removeSKUFromAttribute(java.lang.String skuId, java.lang.String attributeId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removedattributeId
- identification for database entity which will be updated
-
removeSKUFromAttributes
void removeSKUFromAttributes(java.lang.String skuId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removed
-
removeSKUFromSellerSKU
void removeSKUFromSellerSKU(java.lang.String skuId, java.lang.String sellerSkuId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removedsellerSkuId
- identification for database entity which will be updated
-
removeSKUFromSellerSKUs
void removeSKUFromSellerSKUs(java.lang.String skuId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removed
-
removeSKUFromProduct
void removeSKUFromProduct(java.lang.String skuId, java.lang.String productId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removedproductId
- identification for database entity which will be updated
-
removeSKUFromProducts
void removeSKUFromProducts(java.lang.String skuId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removed
-
removeSKUFromTranslation
void removeSKUFromTranslation(java.lang.String skuId, java.lang.String translationId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removedtranslationId
- identification for database entity which will be updated
-
removeSKUFromTranslations
void removeSKUFromTranslations(java.lang.String skuId)
This method removes relationship between database entities.- Parameters:
skuId
- identification for database entity which will be removed
-
removeSKUAndClean
void removeSKUAndClean(java.lang.String skuId)
This method removes a database entity and clean all relationships from another entities.- Parameters:
skuId
- identification for database entity which will be removed
-
removeSkusByIds
void removeSkusByIds(java.util.ArrayList<java.lang.String> skusIds)
This method removes a list of database entities.- Parameters:
skusIds
- the list of database entities which will be removed
-
isSKUExists
boolean isSKUExists(java.lang.String name)
This method checks is exists database entity.- Parameters:
name
- field "name" for database entity which will be checked- Returns:
- value as boolean
-
getSortedProductSkus
java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSortedProductSkus(java.lang.String productId)
This method sorted and retrieves a map, which can be processed in a templates.- Parameters:
productId
- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getSkusByProductAndFirstLetter
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSkusByProductAndFirstLetter(java.lang.String productId, java.lang.String firstLetter)
This method retrieves a map, which can be processed in a templates.- Parameters:
productId
- identification for database entity which will be retrievedfirstLetter
- first letter of the name for the sku- Returns:
- map-representation of data
-
getFallIntoProducts
java.util.LinkedHashSet<EmbeddedBean> getFallIntoProducts(java.lang.String[] productIds)
This method returns data as set.- Parameters:
productIds
- the list of database entities which will be retrieved- Returns:
- database entities as list
-
mapSkuToDto
SkuDTO mapSkuToDto(SKU sku, boolean optimal)
This method does map product entity to dto object- Parameters:
sku
- database entity which be used to map to dtooptimal
- this pointer optimises the data transfer object- Returns:
- data transport object
-
uploadSKU
void uploadSKU(java.io.File file, java.lang.String lang, java.lang.String username)
Uploads a file with SKU information to the system.- Parameters:
file
- the file containing SKU information to be uploadedlang
- the language for SKU informationusername
- the username of the user uploading the SKU information
-
updateMetaInfo
SKU updateMetaInfo(java.lang.String skuId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> metaInfo)
Updates the meta information of a SKU with the given SKU ID.- Parameters:
skuId
- the ID of the SKU to updatemetaInfo
- a LinkedHashMap containing the new meta information for the SKU- Returns:
- the updated SKU object with the new meta information
-
-