Class AbstractDefaultPromotionCodeLogic
java.lang.Object
ch.tocco.nice2.optional.order.api.promotioncode.AbstractDefaultPromotionCodeLogic
- All Implemented Interfaces:
PromotionCodeLogic
- Direct Known Subclasses:
MembershipPromotionCodeLogic
,OrderPromotionCodeLogic
,RegistrationPromotionCodeLogic
public abstract class AbstractDefaultPromotionCodeLogic
extends Object
implements PromotionCodeLogic
contains mainly default logic for creating new positions for a promotion code
meaning a new position is created for each promotion article:
- without any intermediate or specially named relations between it and the source entity
- with a quantity of 1
-
Constructor Summary
ConstructorDescriptionAbstractDefaultPromotionCodeLogic
(CommandExecutor commandExecutor, EntityDefaultValueService defaultValueService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createNewPosition
(Entity source, Entity promotionCode) creates a new position and relates the promotion code with with the source and the created positionprotected void
customizePosition
(Entity source, Entity promotionCode, Entity position, Entity article) getCurrentPositions
(Entity source) gets all positions for a source entity that are currently related to the entityprotected abstract String
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.optional.order.api.promotioncode.PromotionCodeLogic
getDefaultPositions, getEntityName
-
Constructor Details
-
AbstractDefaultPromotionCodeLogic
public AbstractDefaultPromotionCodeLogic(CommandExecutor commandExecutor, EntityDefaultValueService defaultValueService)
-
-
Method Details
-
getCurrentPositions
Description copied from interface:PromotionCodeLogic
gets all positions for a source entity that are currently related to the entity- Specified by:
getCurrentPositions
in interfacePromotionCodeLogic
- Parameters:
source
- the entity to get the positions from- Returns:
- a entitylist of positions (might be Billing_position or Order_position entities)
-
createNewPosition
Description copied from interface:PromotionCodeLogic
creates a new position and relates the promotion code with with the source and the created position- Specified by:
createNewPosition
in interfacePromotionCodeLogic
- Parameters:
source
- the source to create the position forpromotionCode
- the promotion code to use
-
customizePosition
-
getPositionEntityName
-