Interface OrderValidationService

All Known Implementing Classes:
OrderValidationServiceImpl

public interface OrderValidationService
  • Method Details

    • isOrderReadyFor

      check if the given action may be executed on the given order.
      May be used to verify that a order can be booked/cancelled/etc.
      If the action is not valid on the given entity, a list of the errors is returned.
      Parameters:
      order - the order to check
      action - action to verify is valid for order in its current state
      Returns:
      a list of OrderError, which describe the things wrong with . List is empty when order can be cancelled
      Throws:
      PersistException
    • areOrdersReadyFor

      com.google.common.collect.Multimap<Entity,OrderError> areOrdersReadyFor(EntityList orders, OrderErrorContribution.OrderErrorAction action) throws PersistException
      calls OrderValidationService.isOrderReadyFor for every entity in orders
      Parameters:
      orders - entity list with orders to check
      action - action to verify is valid for orders in their current state
      Returns:
      a map, containing a failing order entity as key and a list of errors as value. Entity does not appear in map, if it can be cancelled
      Throws:
      PersistException