java.lang.Object
com.broadleafcommerce.order.common.domain.OfferRef
All Implemented Interfaces:
Serializable

public class OfferRef extends Object implements Serializable
A reference to some external offer. Offers can be associated to carts, orders, fulfillment, or their items. This reference could come from Broadleaf's Offer Microservice or some other source entirely.
Author:
Chad Harchar (charchar)
See Also:
  • Constructor Details

    • OfferRef

      public OfferRef()
  • Method Details

    • getId

      public String getId()
      The ID of the offer.
      Returns:
      The ID of the offer.
    • getName

      public String getName()
      The name of the offer. Often used to indicate to a customer what offers are applied to their cart.
      Returns:
      The name of the offer.
    • getDescription

      public String getDescription()
      A description of what benefits the offer provides to a customer.
      Returns:
      A description of benefits what the offer provides to a customer.
    • getCartLabel

      public String getCartLabel()
      A label for this offer typically used by the storefront.
      Returns:
      A label for this offer typically used by the storefront.
    • getProrationType

      public String getProrationType()
      Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.

      This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.

      Returns:
      The type of order items that this discount is prorated across.
      See Also:
    • getAttributes

      public Map<String,Object> getAttributes()
      Dynamic attributes that are a part of the offer.
      Returns:
      dynamic attributes that are a part of the offer
    • setId

      public void setId(String id)
      The ID of the offer.
      Parameters:
      id - The ID of the offer.
    • setName

      public void setName(String name)
      The name of the offer. Often used to indicate to a customer what offers are applied to their cart.
      Parameters:
      name - The name of the offer.
    • setDescription

      public void setDescription(String description)
      A description of what benefits the offer provides to a customer.
      Parameters:
      description - A description of what benefits the offer provides to a customer.
    • setCartLabel

      public void setCartLabel(String cartLabel)
      A label for this offer typically used by the storefront.
      Parameters:
      cartLabel - A label for this offer typically used by the storefront.
    • setProrationType

      public void setProrationType(String prorationType)
      Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.

      This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.

      Parameters:
      prorationType - The type of order items that this discount is prorated across.
      See Also:
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Dynamic attributes that are a part of the offer.
      Parameters:
      attributes - dynamic attributes that are a part of the offer
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object