Class CandidateFulfillmentGroupOffer

java.lang.Object
com.broadleafcommerce.promotion.offer.service.dto.BaseCandidateOffer
com.broadleafcommerce.promotion.offer.service.dto.CandidateFulfillmentGroupOffer
All Implemented Interfaces:
Serializable

public class CandidateFulfillmentGroupOffer extends BaseCandidateOffer implements Serializable
DTO containing information necessary for determining if an Offer that can apply to one or more EnhancedFulfillmentGroups is part of the best permutation of all offers applicable to that group.
Author:
Nathan Moore (nathanmoore).
See Also:
  • Field Details

    • ONE_HUNDRED

      public static final BigDecimal ONE_HUNDRED
  • Constructor Details

    • CandidateFulfillmentGroupOffer

      public CandidateFulfillmentGroupOffer()
  • Method Details

    • incrementTotalSavings

      public void incrementTotalSavings(javax.money.MonetaryAmount incrementAmount)
    • getPriority

      public Long getPriority()
      The priority of the BaseCandidateOffer.offer.
      Returns:
      The priority of the BaseCandidateOffer.offer.
    • priceGroups

      public void priceGroups()
      Price each of the CandidateFulfillmentGroups according to the BaseCandidateOffer.offer.
    • sortGroups

      public void sortGroups()
      Sort the CandidateFulfillmentGroups according to best discount.
    • getBaseTotal

      protected javax.money.MonetaryAmount getBaseTotal(CandidateFulfillmentGroup candidateFulfillmentGroup)
      Get the total cost of the provided fulfillment group before any adjustments are made.
      Parameters:
      candidateFulfillmentGroup - the fulfillment group to find the total cost for
      Returns:
      the total cost of the fulfillment before adjustments
    • getDiscountedAmount

      protected javax.money.MonetaryAmount getDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup)
    • computeDiscountedAmount

      protected javax.money.MonetaryAmount computeDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup)
      Computes the potential savings that can be applied for a CandidateFulfillmentGroup. The calculated amount is not finalized discount value, this only tells the group how much it can be discounted. See CandidateFulfillmentGroup.discountedAmount
      Parameters:
      candidateFulfillmentGroup - the fulfillment group to calculate potential discounts for
      Returns:
      The monetary value of the total potential discounts
    • getCandidateFulfillmentGroups

      public List<CandidateFulfillmentGroup> getCandidateFulfillmentGroups()
      The CandidateFulfillmentGroups that can be targeted by BaseCandidateOffer.offer, each one representing a decorated EnhancedFulfillmentGroup with savings information.
      Returns:
      The EnhancedFulfillmentGroup(s) that can be targeted by BaseCandidateOffer.offer.
    • getTotalSavings

      public javax.money.MonetaryAmount getTotalSavings()
      Total savings across all candidateFulfillmentGroups for the BaseCandidateOffer.offer.
      Returns:
      Total savings across all candidateFulfillmentGroups for the BaseCandidateOffer.offer.
    • setCandidateFulfillmentGroups

      public void setCandidateFulfillmentGroups(List<CandidateFulfillmentGroup> candidateFulfillmentGroups)
      The CandidateFulfillmentGroups that can be targeted by BaseCandidateOffer.offer, each one representing a decorated EnhancedFulfillmentGroup with savings information.
      Parameters:
      candidateFulfillmentGroups - The EnhancedFulfillmentGroup(s) that can be targeted by BaseCandidateOffer.offer.
    • setTotalSavings

      public void setTotalSavings(javax.money.MonetaryAmount totalSavings)
      Total savings across all candidateFulfillmentGroups for the BaseCandidateOffer.offer.
      Parameters:
      totalSavings - Total savings across all candidateFulfillmentGroups for the BaseCandidateOffer.offer.
    • equals

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

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class BaseCandidateOffer
    • hashCode

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

      public String toString()
      Overrides:
      toString in class BaseCandidateOffer