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.isOrderReadyFor
for every entity inorders
isOrderReadyFor
(Entity order, OrderErrorContribution.OrderErrorAction action) check if the givenaction
may 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 givenaction
may 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 fororder
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 callsOrderValidationService.isOrderReadyFor
for every entity inorders
- Parameters:
orders
- entity list with orders to checkaction
- action to verify is valid fororders
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
-