Class DefaultSkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary>
- java.lang.Object
-
- com.broadleafcommerce.inventory.service.DefaultSkuInventorySummaryService<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
SkuInventorySummaryService<T>
public class DefaultSkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary> extends Object implements SkuInventorySummaryService<T>
Provides summary (browsing) data forSkuInventory
.- Author:
- Kelly Tisdell (ktisdell)
-
-
Constructor Summary
Constructors Constructor Description DefaultSkuInventorySummaryService(SkuFieldReferenceTypeUtility skuFieldReferenceTypeUtility, SkuInventoryAvailabilityStrategy<? extends SkuInventory> skuInventoryAvailabilityStrategy, SkuInventoryRepository<com.broadleafcommerce.data.tracking.core.Trackable> skuInventoryRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SkuFieldReferenceTypeUtility
getSkuFieldReferenceTypeUtility()
protected SkuInventoryAvailabilityStrategy<? extends SkuInventory>
getSkuInventoryAvailabilityStrategy(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected SkuInventoryRepository<com.broadleafcommerce.data.tracking.core.Trackable>
getSkuInventoryRepository()
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
List<ConsolidatedInventoryAvailability>
readConsolidatedAvailability(Set<String> skuCodes, int minQuantityAvailable, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Returns the consolidated availability based on what is requested.T
readInventoryAvailability(String skuRefFieldTpe, String skuReference, int minQuantityAvailable, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
List<T>
readInventoryAvailability(String skuRefFieldTpe, Map<String,Integer> skuReferenceQuantities, String inventoryLocationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads inventory summary data, typically for browsing of SKUs or Products by a particular inventory location.List<T>
readInventoryAvailability(String skuRefFieldTpe, Map<String,Integer> skuReferenceQuantities, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads inventory summary data, typically for browsing of SKUs or Products.
-
-
-
Constructor Detail
-
DefaultSkuInventorySummaryService
public DefaultSkuInventorySummaryService(SkuFieldReferenceTypeUtility skuFieldReferenceTypeUtility, SkuInventoryAvailabilityStrategy<? extends SkuInventory> skuInventoryAvailabilityStrategy, SkuInventoryRepository<com.broadleafcommerce.data.tracking.core.Trackable> skuInventoryRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Detail
-
readInventoryAvailability
public List<T> readInventoryAvailability(@NonNull String skuRefFieldTpe, @NonNull Map<String,Integer> skuReferenceQuantities, @NonNull Optional<Boolean> forShip, @NonNull Optional<Boolean> forPickup, @NonNull Optional<Boolean> inStore, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:SkuInventorySummaryService
Reads inventory summary data, typically for browsing of SKUs or Products.- Specified by:
readInventoryAvailability
in interfaceSkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary>
- Returns:
-
readInventoryAvailability
public List<T> readInventoryAvailability(String skuRefFieldTpe, Map<String,Integer> skuReferenceQuantities, String inventoryLocationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:SkuInventorySummaryService
Reads inventory summary data, typically for browsing of SKUs or Products by a particular inventory location.- Specified by:
readInventoryAvailability
in interfaceSkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary>
- Returns:
-
readInventoryAvailability
public T readInventoryAvailability(String skuRefFieldTpe, String skuReference, int minQuantityAvailable, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
- Specified by:
readInventoryAvailability
in interfaceSkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary>
- Returns:
-
readConsolidatedAvailability
public List<ConsolidatedInventoryAvailability> readConsolidatedAvailability(Set<String> skuCodes, int minQuantityAvailable, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:SkuInventorySummaryService
Returns the consolidated availability based on what is requested. This is typically used by other, aggregate services, such as Search Services, to indicate if a SKU is available for search or filtering purposes. Callers will typically setContextInfo.setIgnoreNarrowing(boolean)
to true so that all availability is returned for the tenant and all associated applications.- Specified by:
readConsolidatedAvailability
in interfaceSkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary>
- Parameters:
skuCodes
- A Set of values associated with the skuCode field onSkuRef
minQuantityAvailable
- The minimum quantity requested for all SKUs queriedforShip
- Indicates if the SKU should be available for shippingforPickup
- Indicates if the SKU should be available for pickupinStore
- Indicates if the SKU should be available in storecontextInfo
- The ContextInfo of the request.- Returns:
-
getSkuInventoryAvailabilityStrategy
protected SkuInventoryAvailabilityStrategy<? extends SkuInventory> getSkuInventoryAvailabilityStrategy(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
getSkuFieldReferenceTypeUtility
@NonNull protected SkuFieldReferenceTypeUtility getSkuFieldReferenceTypeUtility()
-
getSkuInventoryRepository
@NonNull protected SkuInventoryRepository<com.broadleafcommerce.data.tracking.core.Trackable> getSkuInventoryRepository()
-
getTypeFactory
@NonNull protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
-