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
ConstructorsConstructorDescriptionAbstractDefaultPromotionCodeLogic(CommandExecutor commandExecutor, EntityDefaultValueService defaultValueService) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateNewPosition(Entity source, Entity promotionCode) creates a new position and relates the promotion code with with the source and the created positionprotected voidcustomizePosition(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 StringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PromotionCodeLogic
getDefaultPositions, getEntityName
-
Constructor Details
-
AbstractDefaultPromotionCodeLogic
public AbstractDefaultPromotionCodeLogic(CommandExecutor commandExecutor, EntityDefaultValueService defaultValueService)
-
-
Method Details
-
getCurrentPositions
Description copied from interface:PromotionCodeLogicgets all positions for a source entity that are currently related to the entity- Specified by:
getCurrentPositionsin 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:PromotionCodeLogiccreates a new position and relates the promotion code with with the source and the created position- Specified by:
createNewPositionin interfacePromotionCodeLogic- Parameters:
source- the source to create the position forpromotionCode- the promotion code to use
-
customizePosition
-
getPositionEntityName
-