Class OrderValidationServiceImpl
java.lang.Object
ch.tocco.nice2.optional.debitor.impl.action.order.OrderValidationServiceImpl
- All Implemented Interfaces:
OrderValidationService
-
Constructor Summary
Constructors -
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.voidsetErrorsContributions(List<OrderErrorContribution> errorContributions)
-
Constructor Details
-
OrderValidationServiceImpl
public OrderValidationServiceImpl()
-
-
Method Details
-
isOrderReadyFor
public List<OrderError> isOrderReadyFor(Entity order, OrderErrorContribution.OrderErrorAction action) throws PersistException Description copied from interface:OrderValidationServicecheck 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.- Specified by:
isOrderReadyForin interfaceOrderValidationService- 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
public com.google.common.collect.Multimap<Entity, OrderError> areOrdersReadyFor(EntityList orders, OrderErrorContribution.OrderErrorAction action) throws PersistException Description copied from interface:OrderValidationServicecallsOrderValidationService.isOrderReadyForfor every entity inorders- Specified by:
areOrdersReadyForin interfaceOrderValidationService- 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
-
setErrorsContributions
-