Interface StagedOrderSetDirectDiscountsAction

All Superinterfaces:
ResourceUpdateAction<StagedOrderUpdateAction>, StagedOrderUpdateAction

public interface StagedOrderSetDirectDiscountsAction extends StagedOrderUpdateAction

Adds a DirectDiscount, but only if no DiscountCode has been added to the Order. Either a Discount Code or a Direct Discount can exist on a Order at the same time.


Example to create an instance using the builder pattern

     StagedOrderSetDirectDiscountsAction stagedOrderSetDirectDiscountsAction = StagedOrderSetDirectDiscountsAction.builder()
             .plusDiscounts(discountsBuilder -> discountsBuilder)
             .build()
 
  • Field Details

    • SET_DIRECT_DISCOUNTS

      static final String SET_DIRECT_DISCOUNTS
      discriminator value for StagedOrderSetDirectDiscountsAction
      See Also:
  • Method Details

    • getDiscounts

      @NotNull @Valid @NotNull @Valid List<DirectDiscountDraft> getDiscounts()
      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Order are recalculated.
      Returns:
      discounts
    • setDiscounts

      void setDiscounts(DirectDiscountDraft... discounts)
      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Order are recalculated.
      Parameters:
      discounts - values to be set
    • setDiscounts

      void setDiscounts(List<DirectDiscountDraft> discounts)
      • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
      • If empty, all existing Direct Discounts are removed and all affected prices on the Order are recalculated.
      Parameters:
      discounts - values to be set
    • of

      factory method
      Returns:
      instance of StagedOrderSetDirectDiscountsAction
    • of

      factory method to create a shallow copy StagedOrderSetDirectDiscountsAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of StagedOrderSetDirectDiscountsAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for StagedOrderSetDirectDiscountsAction
      Returns:
      builder
    • builder

      create builder for StagedOrderSetDirectDiscountsAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withStagedOrderSetDirectDiscountsAction

      default <T> T withStagedOrderSetDirectDiscountsAction(Function<StagedOrderSetDirectDiscountsAction,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<StagedOrderSetDirectDiscountsAction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference