Class 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:
    Serialized Form
    • Constructor Detail

      • OfferRef

        public OfferRef()
    • Method Detail

      • 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:
        DefaultOfferProrationType
      • 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:
        DefaultOfferProrationType
      • 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
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object