Class CommerceItemServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.CommerceItemServiceImpl
-
- All Implemented Interfaces:
CommerceItemService
@Service public class CommerceItemServiceImpl extends java.lang.Object implements CommerceItemService
-
-
Field Summary
Fields Modifier and Type Field Description private SellerSkuRepository
sellerSkuRepository
-
Constructor Summary
Constructors Constructor Description CommerceItemServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimal
calculateTotalPrice(java.util.Collection<CommerceItem> items)
Sums prices of commerce items.private java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
extractAttributeValues(SellerSKU sku)
java.util.Map<java.lang.String,java.lang.Object>
extractSpecs(SellerSKU sku)
Extracting specs of sku to list of maps.java.util.List<CommerceItemDTO>
mapItems(java.util.Collection<CommerceItem> items)
Maps items to DTOs.private SellerSkuDTO
mapSellerSku(SellerSKU sellerSKU)
-
-
-
Field Detail
-
sellerSkuRepository
@Autowired private SellerSkuRepository sellerSkuRepository
-
-
Method Detail
-
calculateTotalPrice
public java.math.BigDecimal calculateTotalPrice(java.util.Collection<CommerceItem> items)
Description copied from interface:CommerceItemService
Sums prices of commerce items.- Specified by:
calculateTotalPrice
in interfaceCommerceItemService
- Parameters:
items
- items- Returns:
- sum.
-
mapItems
public java.util.List<CommerceItemDTO> mapItems(java.util.Collection<CommerceItem> items)
Description copied from interface:CommerceItemService
Maps items to DTOs.- Specified by:
mapItems
in interfaceCommerceItemService
- Parameters:
items
- commerce items- Returns:
- list of dto
-
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 interfaceCommerceItemService
- Parameters:
sku
- sellerSKU- Returns:
- map of specs
-
extractAttributeValues
private java.util.List<java.util.Map<java.lang.String,java.lang.Object>> extractAttributeValues(SellerSKU sku)
-
mapSellerSku
private SellerSkuDTO mapSellerSku(SellerSKU sellerSKU)
-
-