com.elasticpath.domain.catalog
Interface Inventory

All Superinterfaces:
EpDomain, Persistence, java.io.Serializable, ValueObject
All Known Implementing Classes:
InventoryImpl

public interface Inventory
extends ValueObject

Represents inventory information about a ProductSku. It is separted from ProductSku to allow only caching ProductSku without Inventory. Currently, it is a one-to-one relationship between ProductSku and Inventory. In the future, it may be changed to one-to-many to allow multi-stores.


Method Summary
 void decrementInventory(int quantity)
          Decrement inventory by the given quanity.
 int getAvailableQuantity()
          Get the available quantity.
 int getQuantityOnHand()
          Get the quantity on hand.
 int getReorderMinimum()
          Get the reorder minimum quantity.
 int getReservedQuantity()
          Get the reserved quantity.
 java.util.Date getRestockDate()
          Get the expected date when this inventory item will be restocked.
 boolean hasSufficientInventory(int quantity)
          Returns true if there is sufficient stock of this Inventory to sell the specified quantity of items.
 boolean isInfiniteQuantityOnHand()
          Returns true if the quantity on hand is presumed to allways be infinite.
 boolean isVisibleWhenOutOfStock()
          True if this Inventory is visible in the when out of stock.
 void setInfiniteQuantityOnHand(boolean isInfiniteQuantityOnHand)
          Set if the quantity on hand is presumed to be infinite.
 void setQuantityOnHand(int quantityOnHand)
          Set the quantity on hand.
 void setReorderMinimum(int reorderMinimum)
          Set the reorder minimum quantity.
 void setReservedQuantity(int reservedQuantity)
          Set the reserved quantity.
 void setRestockDate(java.util.Date restockDate)
          Set the restock date.
 void setVisibleWhenOutOfStock(boolean isVisibleWhenOutOfStock)
          Set to true if this Inventory is visible in the when out of stock.
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Method Detail

decrementInventory

void decrementInventory(int quantity)
Decrement inventory by the given quanity.

Parameters:
quantity - the quantity by which the inventory is to be decremented
Throws:
InsufficientInventoryException - if there is insufficient inventory

getAvailableQuantity

int getAvailableQuantity()
Get the available quantity.

Returns:
the available quantity on hand

getQuantityOnHand

int getQuantityOnHand()
Get the quantity on hand.

Returns:
the quantity on hand

getReorderMinimum

int getReorderMinimum()
Get the reorder minimum quantity. This inventory item should be reported as below minimum quantity if the quantity on hand is below this value.

Returns:
the reorder minimum quantity

getReservedQuantity

int getReservedQuantity()
Get the reserved quantity. Skus should not be sold if the quantity is below the reserved quantity.

Returns:
the reserved quantity

getRestockDate

java.util.Date getRestockDate()
Get the expected date when this inventory item will be restocked.

Returns:
the restock date

hasSufficientInventory

boolean hasSufficientInventory(int quantity)
Returns true if there is sufficient stock of this Inventory to sell the specified quantity of items.

Parameters:
quantity - the quantity of items to check for availability
Returns:
true if quantity items can be sold

isInfiniteQuantityOnHand

boolean isInfiniteQuantityOnHand()
Returns true if the quantity on hand is presumed to allways be infinite.

Returns:
true if QuantityOnHand is presumed to be infinite

isVisibleWhenOutOfStock

boolean isVisibleWhenOutOfStock()
True if this Inventory is visible in the when out of stock.

Returns:
true if this SKU is visible in the when out of stock

setInfiniteQuantityOnHand

void setInfiniteQuantityOnHand(boolean isInfiniteQuantityOnHand)
Set if the quantity on hand is presumed to be infinite.

Parameters:
isInfiniteQuantityOnHand - set to true if infinite on hand quantity is required

setQuantityOnHand

void setQuantityOnHand(int quantityOnHand)
Set the quantity on hand.

Parameters:
quantityOnHand - the quantity on hand

setReorderMinimum

void setReorderMinimum(int reorderMinimum)
Set the reorder minimum quantity.

Parameters:
reorderMinimum - the reorder minimum

setReservedQuantity

void setReservedQuantity(int reservedQuantity)
Set the reserved quantity.

Parameters:
reservedQuantity - the reserved quantity

setRestockDate

void setRestockDate(java.util.Date restockDate)
Set the restock date.

Parameters:
restockDate - the restock date

setVisibleWhenOutOfStock

void setVisibleWhenOutOfStock(boolean isVisibleWhenOutOfStock)
Set to true if this Inventory is visible in the when out of stock.

Parameters:
isVisibleWhenOutOfStock - true if visible