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 Details

  • Method Details

    • getCurrentPositions

      public EntityList getCurrentPositions(Entity source)
      Description copied from interface: PromotionCodeLogic
      gets all positions for a source entity that are currently related to the entity
      Specified by:
      getCurrentPositions in interface PromotionCodeLogic
      Parameters:
      source - the entity to get the positions from
      Returns:
      a entitylist of positions (might be Billing_position or Order_position entities)
    • createNewPosition

      public void createNewPosition(Entity source, Entity promotionCode)
      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 interface PromotionCodeLogic
      Parameters:
      source - the source to create the position for
      promotionCode - the promotion code to use
    • customizePosition

      protected void customizePosition(Entity source, Entity promotionCode, Entity position, Entity article)
    • getPositionEntityName

      protected abstract String getPositionEntityName()