public class EmptyInventoryProvider extends Object implements InventoryProvider
InventoryProvider
,
ExternalInventoryProvider
Constructor and Description |
---|
EmptyInventoryProvider() |
Modifier and Type | Method and Description |
---|---|
Map<String,Boolean> |
isInventoryAvailable(Map<String,Integer> skuCodesAndQuantity,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Determines whether Inventory is available for a list of SKUs.
|
boolean |
isInventoryAvailable(String skuCode,
int quantity,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Determines whether Inventory is available for a particular SKU.
|
void |
reserveInventory(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Decrement or otherwise "reserve" inventory for a cart during checkout.
|
public void reserveInventory(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
InventoryProvider
reserveInventory
in interface InventoryProvider
cart
- The cart for which to decrement inventory.contextInfo
- Context information around sandbox and multitenant state.public boolean isInventoryAvailable(String skuCode, int quantity, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
InventoryProvider
isInventoryAvailable
in interface InventoryProvider
skuCode
- the sku code for which to check inventory availabilityquantity
- the quantity of the sku code that will be requestedcontextInfo
- context information surrounding sandboxing and multitenant statetrue
if inventory is available for the SKU and quantity, false
otherwisepublic Map<String,Boolean> isInventoryAvailable(Map<String,Integer> skuCodesAndQuantity, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
InventoryProvider
isInventoryAvailable
in interface InventoryProvider
skuCodesAndQuantity
- a map of the sku codes and quantity for which to check inventory
availabilitycontextInfo
- context information surrounding sandboxing and multitenant statetrue
if inventory is available for the SKU and
quantity, and false
otherwiseCopyright © 2021. All rights reserved.