Class SkuInventory

java.lang.Object
com.broadleafcommerce.inventory.domain.SkuInventory
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable

public class SkuInventory extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware
See Also:
  • Constructor Details

    • SkuInventory

      public SkuInventory()
  • Method Details

    • hasChildren

      public boolean hasChildren()
      Additional getter for hasChildren for readability.

      Intentionally not using Accessors.fluent() to follow JavaBeans Specification.

    • updateQuantityAvailable

      public void updateQuantityAvailable()
      Calculates the quantity available by subtracting quantityOnHand and quantityReserved from safetyStock, 0 is returned if the result is negative, which can happen since safetyStock is an indicator of the desired amount of the item that is not for sale and therefore can be greater than the actual quantity on hand.

      The system will only consider an item available if the "quantity on hand - quantity reserved" is greater than the safety stock.

    • getId

      public String getId()
      This is the contextId of the Sku Inventory record.
    • getQuantityAvailable

      public Integer getQuantityAvailable()
      Summary field to indicate how many are available at this location. This is a calculated field (quantityOnHand - quantityReserved - safetyStock) set upon creation and update, this should not be manually set.
      See Also:
    • getQuantityReserved

      public Integer getQuantityReserved()
      Number of items that have been reserved but that have not been fulfilled.
      See Also:
    • getQuantityOnHand

      public Integer getQuantityOnHand()
      Number of physical items that are expected to be available if an inventory count was done.
      See Also:
    • getQuantityOnOrder

      public Integer getQuantityOnOrder()
      Number of items that have been ordered and are expected to arrive in the warehouse.
    • getSafetyStock

      public Integer getSafetyStock()
      A value that indicates a desired amount of the item that is not for sale.
      See Also:
    • getInventoryLocationContextId

      public String getInventoryLocationContextId()
      The ID of the InventoryLocation associated with this SkuInventory record.
    • getSkuRef

      public SkuRef getSkuRef()
      A soft reference to the SKU for which this inventory is managed.
    • isSerialized

      public boolean isSerialized()
      Informs the system that this is a serialized (aka detail) record.

      Consider stadium suites at a football game, there may be 10 gold suites, represented with SKU FOOTBALL-GM1-GOLD-SUITE. Serialized sku inventories are used to represent each individual suite (suite 1-10), in which case the getSerializationValue() would be 1, 2, and so on.

    • isHasChildren

      public boolean isHasChildren()
      Informs the system that this sku inventory is a parent.

      Consider stadium suites at a football game, there may be 10 gold suites, represented with SKU FOOTBALL-GM1-GOLD-SUITE. A parent sku inventory is used to represent the inventory for all the gold suites, without specifying any suite number. This is useful when selling suites without assigning a specific suite number to a given order, defers the suite assignment till closer to the event date.

    • getParentSkuInventoryId

      public String getParentSkuInventoryId()
      The parent sku inventory id.

      Serialized records must have a parent representing a non-serialized SkuInventory.

      See Also:
      • serialized
    • getSerializationValue

      public String getSerializationValue()
      The value of the serialized sku inventory.

      For example, this can be "100" when representing inventory for suite 100 in a stadium.

      This value is required for records where isSerialized() is true.

      See Also:
      • serialized
    • getVendorRef

      @Nullable public String getVendorRef()
      Soft reference to the vendor associated with this sku inventory. This value can be null, in which case, no vendor is associated.
      Returns:
      Soft reference to the vendor associated with this location.
    • getArchivalReason

      public String getArchivalReason()
      Stores the reason why a particular sku_inventory was deleted/archived. Used to identify the records that have been deleted/archived as a result of their inventory_location being archived. For such records, the archivalReason would be DefaultSkuInventoryArchivalReasons.LOCATION_ARCHIVED. In other cases, it would be null by default.
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • setId

      public void setId(String id)
      This is the contextId of the Sku Inventory record.
    • setQuantityAvailable

      public void setQuantityAvailable(Integer quantityAvailable)
      Summary field to indicate how many are available at this location. This is a calculated field (quantityOnHand - quantityReserved - safetyStock) set upon creation and update, this should not be manually set.
      See Also:
    • setQuantityReserved

      public void setQuantityReserved(Integer quantityReserved)
      Number of items that have been reserved but that have not been fulfilled.
      See Also:
    • setQuantityOnHand

      public void setQuantityOnHand(Integer quantityOnHand)
      Number of physical items that are expected to be available if an inventory count was done.
      See Also:
    • setQuantityOnOrder

      public void setQuantityOnOrder(Integer quantityOnOrder)
      Number of items that have been ordered and are expected to arrive in the warehouse.
    • setSafetyStock

      public void setSafetyStock(Integer safetyStock)
      A value that indicates a desired amount of the item that is not for sale.
      See Also:
    • setInventoryLocationContextId

      public void setInventoryLocationContextId(String inventoryLocationContextId)
      The ID of the InventoryLocation associated with this SkuInventory record.
    • setSkuRef

      public void setSkuRef(SkuRef skuRef)
      A soft reference to the SKU for which this inventory is managed.
    • setSerialized

      public void setSerialized(boolean serialized)
      Informs the system that this is a serialized (aka detail) record.

      Consider stadium suites at a football game, there may be 10 gold suites, represented with SKU FOOTBALL-GM1-GOLD-SUITE. Serialized sku inventories are used to represent each individual suite (suite 1-10), in which case the getSerializationValue() would be 1, 2, and so on.

    • setHasChildren

      public void setHasChildren(boolean hasChildren)
      Informs the system that this sku inventory is a parent.

      Consider stadium suites at a football game, there may be 10 gold suites, represented with SKU FOOTBALL-GM1-GOLD-SUITE. A parent sku inventory is used to represent the inventory for all the gold suites, without specifying any suite number. This is useful when selling suites without assigning a specific suite number to a given order, defers the suite assignment till closer to the event date.

    • setParentSkuInventoryId

      public void setParentSkuInventoryId(String parentSkuInventoryId)
      The parent sku inventory id.

      Serialized records must have a parent representing a non-serialized SkuInventory.

      See Also:
      • serialized
    • setSerializationValue

      public void setSerializationValue(String serializationValue)
      The value of the serialized sku inventory.

      For example, this can be "100" when representing inventory for suite 100 in a stadium.

      This value is required for records where isSerialized() is true.

      See Also:
      • serialized
    • setVendorRef

      public void setVendorRef(@Nullable String vendorRef)
      Soft reference to the vendor associated with this sku inventory. This value can be null, in which case, no vendor is associated.
      Parameters:
      vendorRef - Soft reference to the vendor associated with this location.
    • setArchivalReason

      public void setArchivalReason(String archivalReason)
      Stores the reason why a particular sku_inventory was deleted/archived. Used to identify the records that have been deleted/archived as a result of their inventory_location being archived. For such records, the archivalReason would be DefaultSkuInventoryArchivalReasons.LOCATION_ARCHIVED. In other cases, it would be null by default.
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object