Interface SkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary>
- All Known Implementing Classes:
DefaultSkuInventorySummaryService
public interface SkuInventorySummaryService<T extends SkuInventoryAvailabilitySummary>
Service to find
SkuInventory
summary data (e.g. available).- Author:
- Kelly Tisdell (ktisdell)
-
Method Summary
Modifier and TypeMethodDescriptionreadConsolidatedAvailability
(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.readConsolidatedInventoryQuantities
(Set<String> skuCodes, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns aMap
of quantities available.readInventoryAvailability
(String skuRefFieldTpe, String skuReference, int minQuantityAvailable, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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.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.readInventoryAvailability
(List<SkuInventoryAvailabilityRequest> availabilityRequests, String skuRefFieldTpe, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads inventory summary data based on the givenSkuInventoryAvailabilityRequests
.
-
Method Details
-
readInventoryAvailability
List<T> readInventoryAvailability(@NonNull String skuRefFieldTpe, @NonNull Map<String, Integer> skuReferenceQuantities, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads inventory summary data, typically for browsing of SKUs or Products.- Parameters:
skuRefFieldTpe
-skuReferenceQuantities
-forShip
-forPickup
-inStore
-contextInfo
-- Returns:
-
readInventoryAvailability
List<T> readInventoryAvailability(List<SkuInventoryAvailabilityRequest> availabilityRequests, String skuRefFieldTpe, Optional<Boolean> forShip, Optional<Boolean> forPickup, Optional<Boolean> inStore, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads inventory summary data based on the givenSkuInventoryAvailabilityRequests
.Existing soft reservations are excluded if
SkuInventoryAvailabilityRequest.getReferenceNumber()
is passed in. For example, if a SKU has total of 2 available and 1 is reserved for userA, and userA checks inventory availability for a quantity of 2 for the same SKU. The existing soft reservation is excluded from the check in this case, effectively making this request to check for an additional quantity of 1 to be available. However, if userB sends the same request to check availability for a quantity of 2 for the same SKU, it would return unavailable since only 1 is available as the other one is reserved for userA.- Parameters:
availabilityRequests
- the list ofSkuInventoryAvailabilityRequests
to processskuRefFieldTpe
- the type of the sku ref fieldforShip
- 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:
-
readInventoryAvailability
List<T> readInventoryAvailability(@NonNull String skuRefFieldTpe, @NonNull Map<String, Integer> skuReferenceQuantities, @NonNull String inventoryLocationId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads inventory summary data, typically for browsing of SKUs or Products by a particular inventory location.- Parameters:
skuRefFieldTpe
-skuReferenceQuantities
-inventoryLocationId
-contextInfo
-- Returns:
-
readInventoryAvailability
T readInventoryAvailability(@NonNull String skuRefFieldTpe, @NonNull String skuReference, int minQuantityAvailable, @NonNull Optional<Boolean> forShip, @NonNull Optional<Boolean> forPickup, @NonNull Optional<Boolean> inStore, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Parameters:
skuRefFieldTpe
-skuReference
-minQuantityAvailable
-forShip
-forPickup
-inStore
-contextInfo
-- Returns:
-
readConsolidatedAvailability
List<ConsolidatedInventoryAvailability> readConsolidatedAvailability(@NonNull Set<String> skuCodes, int minQuantityAvailable, @NonNull Optional<Boolean> forShip, @NonNull Optional<Boolean> forPickup, @NonNull Optional<Boolean> inStore, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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.- 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:
-
readConsolidatedInventoryQuantities
Map<String,Long> readConsolidatedInventoryQuantities(@NonNull Set<String> skuCodes, @NonNull Optional<Boolean> forShip, @NonNull Optional<Boolean> forPickup, @NonNull Optional<Boolean> inStore, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns aMap
of quantities available. The Map has a key that represents the SKU with a value that represents the quantity available for that SKU.- Parameters:
skuCodes
- the sku codesforShip
- whether this inventory can be shippedforPickup
- whether this inventory can be picked upinStore
- whether this inventory is for in storecontextInfo
-- Returns:
-