Class SoldOutService

java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.ext.dispense.service.soldout.SoldOutService
All Implemented Interfaces:
com.tccc.kos.commons.core.context.CtxEventListener, com.tccc.kos.commons.core.service.handle.ContextHandleAware, com.tccc.kos.commons.core.service.handle.HandleAware, com.tccc.kos.commons.util.ready.Ready, com.tccc.kos.commons.util.ready.ReadyListener

public class SoldOutService extends com.tccc.kos.commons.core.service.AbstractService
Service that persists sold out containers and marks them sold out when reinserted. This updates the soldOut flag in the associated container object. This service has a configuration setting to make sold out sticky or not. Sold outs are always persisted, but if not sticky, the sold out will not be flagged during insertion. This allows containers to be "tried again" by removing them and inserting them again. Many typical container types don't support sold out as it typically requires external sensors. If available, this service can be used to leverage those sensors.
Version:
2023-10-25
  • Field Details

  • Method Details

    • isContainerSoldOut

      public boolean isContainerSoldOut(Container container)
      Return true if the specified containerId is sold out.
      Parameters:
      container - the container to check
    • isSliceSoldOut

      public boolean isSliceSoldOut(ContainerSlice slice)
      Return true if the specified slice is sold out.
      Parameters:
      slice - the slice to check
    • soldOut

      public SliceSoldOutTrouble soldOut(ContainerSlice slice, String reason)
      Called to record a slice sold out. This will also set the soldOut flag in the slice and create a SliceSoldOutTrouble .
      Parameters:
      slice - the container slice that is sold out
      reason - the sold out reason for the trouble
    • soldOutSlice

      public SliceSoldOutTrouble soldOutSlice(Holder holder, String reason)
      Called to record a slice sold out. This will also set the soldOut flag in the slice and create a SliceSoldOutTrouble .
      Parameters:
      holder - associated slice will be sold out
      reason - the sold out reason for the trouble
    • soldOut

      public ContainerSoldOutTrouble soldOut(Container container, String reason)
      Called to record a container sold out. This will also set the soldOut flag in the container and create a ContainerSoldOutTrouble for the container.
      Parameters:
      container - the container that is sold out
      reason - the sold out reason for the trouble
    • soldOutContainer

      public ContainerSoldOutTrouble soldOutContainer(Holder holder, String reason)
      Called to record a container sold out. This will also set the soldOut flag in the container and create a ContainerSoldOutTrouble for the container.
      Parameters:
      holder - the holder associated with the container
      reason - the sold out reason for the trouble