Interface InventoryMode

All Superinterfaces:
JsonEnum
All Known Implementing Classes:
InventoryMode.InventoryModeEnum

public interface InventoryMode extends JsonEnum

Indicates how Line Items in a Cart are tracked.

  • Field Details

    • NONE

      static final InventoryMode NONE

      Adding and ordering items from a Cart are independent of the Inventory with no inventory checks or modifications.

      This is the default mode.

    • TRACK_ONLY

      static final InventoryMode TRACK_ONLY

      Orders are tracked on the Inventory, and ordering a LineItem deducts the available quantity on the respective InventoryEntry.

      An Order can be created even if the Line Item quantity is zero or negative, but if no matching Inventory Entry exists for the Line Item, an OutOfStock error is returned.

    • RESERVE_ON_ORDER

      static final InventoryMode RESERVE_ON_ORDER

      Line Items in a Cart are only reserved for the duration of the ordering transaction. If a Line Item is not available when creating an Order, an OutOfStock error is returned. This is because the InventoryEntry availableQuantity is insufficient (but is still updated) for the ordered Line Item quantity.

      However, an Order can be created if the InventoryEntry restockableInDays is set (including 0).

  • Method Details

    • getJsonName

      String getJsonName()
      the JSON value
      Specified by:
      getJsonName in interface JsonEnum
      Returns:
      json value
    • name

      String name()
      the enum value
      Specified by:
      name in interface JsonEnum
      Returns:
      name
    • toString

      String toString()
      convert value to string
      Specified by:
      toString in interface JsonEnum
      Overrides:
      toString in class Object
      Returns:
      string representation
    • findEnum

      static InventoryMode findEnum(String value)
      factory method for a enum value of InventoryMode if no enum has been found an anonymous instance will be created
      Parameters:
      value - the enum value to be wrapped
      Returns:
      enum instance
    • findEnumViaJsonName

      static Optional<InventoryMode> findEnumViaJsonName(String jsonName)
      method to find enum using the JSON value
      Parameters:
      jsonName - the json value to be wrapped
      Returns:
      optional of enum instance
    • values

      static InventoryMode[] values()
      possible enum values
      Returns:
      array of possible enum values
    • defaultValue

      static InventoryMode defaultValue()