Interface OrderValidationService
- All Known Implementing Classes:
OrderValidationServiceImpl
public interface OrderValidationService
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.Multimap<Entity, OrderError> areOrdersReadyFor(EntityList orders, OrderErrorContribution.OrderErrorAction action) callsOrderValidationService.isOrderReadyForfor every entity inordersisOrderReadyFor(Entity order, OrderErrorContribution.OrderErrorAction action) check if the givenactionmay be executed on the givenorder.
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.
-
Method Details
-
isOrderReadyFor
List<OrderError> isOrderReadyFor(Entity order, OrderErrorContribution.OrderErrorAction action) throws PersistException check if the givenactionmay be executed on the givenorder.
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 checkaction- action to verify is valid fororderin 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 callsOrderValidationService.isOrderReadyForfor every entity inorders- Parameters:
orders- entity list with orders to checkaction- action to verify is valid forordersin 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
-