Enum Class DefaultInventoryTransactionType

java.lang.Object
java.lang.Enum<DefaultInventoryTransactionType>
com.broadleafcommerce.inventory.domain.DefaultInventoryTransactionType
All Implemented Interfaces:
EnumeratedType, InventoryTransactionType, Serializable, Comparable<DefaultInventoryTransactionType>, Constable

public enum DefaultInventoryTransactionType extends Enum<DefaultInventoryTransactionType> implements InventoryTransactionType
Enumeration for storing different inventory transaction types. This is the default implementation of InventoryTransactionType. Typical CREDIT transaction flows go as follows:

1.
SOFT_RESERVED -> HARD_RESERVED -> FULFILLED

2.
SOFT_RESERVED -> CANCELLED

3.
SOFT_RESERVED -> HARD_RESERVED -> CANCELLED

Typical DEBIT transaction flows go as follows:

1.
ORDERED -> RECEIVED

2.
RETURNED

3.
SHRINKAGE

Author:
Kelly Tisdell (ktisdell)
  • Enum Constant Details

    • SOFT_RESERVED

      public static final DefaultInventoryTransactionType SOFT_RESERVED
      Happens when an order is placed, but where purchase is not finalized (e.g. concert tickets or where a purchase is captured but payment has not been received). This is effectively a temporary reservation and requires a corresponding HARD_RESERVED transaction to make it non-temporary. SOFT_RESERVED transactions may be reversed after a period of time, (i.e. to free inventory that has been soft reserved for a duration, but not hard reserved, indicating that the reservation may have been abandoned). This type of transaction decreases quantity available and increases quantity reserved.
    • HARD_RESERVED

      public static final DefaultInventoryTransactionType HARD_RESERVED
      Happens when an order is placed and finalized, including payment. Happens after a soft reservation. If a corresponding SOFT_RESERVED transaction exists, this does not decrease a quantity because the soft reservation already did this, but provides a marker indicating that the reservation is finalized. If a corresponding soft reservation does not yet exist, then this decrements inventory available and increments inventory reserved.
    • FULFILLED

      public static final DefaultInventoryTransactionType FULFILLED
      Happens when an order is fulfilled. Happens after a hard commit. Decreases quantity on hand.
    • CANCELLED

      public static final DefaultInventoryTransactionType CANCELLED
      Happens when an inventory reservation is cancelled before it is fulfilled.
    • SHRINKAGE

      public static final DefaultInventoryTransactionType SHRINKAGE
      Used to decrement inventory for shrinkage. Happens when an item is marked as damaged, stolen, etc. Decreases quantity on hand.
    • ORDERED

      public static final DefaultInventoryTransactionType ORDERED
      Happens when inventory has been ordered and expected to arrive in the future. Increases quantity expected. Allows for back-ordered inventory tracking and expected inventory tracking.
    • RECEIVED

      public static final DefaultInventoryTransactionType RECEIVED
      Indicates that an ordered item has been received and should increase quantity on hand. Increases quantity on hand. Decreases quantity expected.
    • RETURNED

      public static final DefaultInventoryTransactionType RETURNED
      Happens when inventory that has been fulfilled is returned. Increases quantity on hand.
  • Method Details

    • values

      public static DefaultInventoryTransactionType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DefaultInventoryTransactionType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getAccountingTransactionType

      @Deprecated public AccountingTransactionType getAccountingTransactionType()
      Deprecated.
      Description copied from interface: InventoryTransactionType
      Returns whether this is a debit or a credit.
      Specified by:
      getAccountingTransactionType in interface InventoryTransactionType
      Returns:
      See Also:
    • getValue

      public String getValue()
      Description copied from interface: EnumeratedType
      Returns a non-null, enumerated String value, typically in the form of an enum name (e.g. 'SOME_VALUE'). Often this is an alias for Enum.name().
      Specified by:
      getValue in interface EnumeratedType
      Returns:
    • isSoftReserved

      public static boolean isSoftReserved(String transactionType)
    • isHardReserved

      public static boolean isHardReserved(String transactionType)
    • isFulfilled

      public static boolean isFulfilled(String transactionType)
    • isCancelled

      public static boolean isCancelled(String transactionType)
    • isShrinkage

      public static boolean isShrinkage(String transactionType)
    • isOrdered

      public static boolean isOrdered(String transactionType)
    • isReceived

      public static boolean isReceived(String transactionType)
    • isReturned

      public static boolean isReturned(String transactionType)