Class FulfillmentItem

java.lang.Object
com.broadleafcommerce.cart.client.domain.FulfillmentItem
All Implemented Interfaces:
Serializable

public class FulfillmentItem extends Object implements Serializable
A cart item designated to a specific FulfillmentGroup for fulfillment.
Author:
Chad Harchar (charchar)
See Also:
  • Constructor Details

    • FulfillmentItem

      public FulfillmentItem()
  • Method Details

    • getReferenceNumber

      public String getReferenceNumber()
      The reference number for this fulfillment item.
      Returns:
      The reference number for this fulfillment item.
    • getCartItemId

      public String getCartItemId()
      A reference id to the CartItem to be represented by this fulfillment item.
      Returns:
      A reference id to the CartItem to be represented by this fulfillment item.
    • getQuantity

      public int getQuantity()
      The quantity to be fulfilled by this item. This isn't necessarily going to equal CartItem.getQuantity() since a CartItem can be split across multiple FulfillmentGroups.
      Returns:
      The quantity to be fulfilled by this item.
    • getMerchandiseTotalAmount

      public javax.money.MonetaryAmount getMerchandiseTotalAmount()
      This represents the subtotal for the fulfillment item. In most cases, this value is determined by multiplying the unit price of the related CartItem by its quantity. In the case of a product bundle, the bundle declares an overall price, which is then prorated down to each bundle item. A fulfillment item is created for each of the bundle's dependent cart items and the prorated price is used to populate this field.

      For example, if the bundle price is $30 and it contains 2 included products with the price $10 and $15, and quantity 2 and 1 accordingly, the first fulfillment item's quantity will be 2 and merchandiseTotalAmount will be $17.14 (i.e. 30 * (10 * 2 / (20 + 15))). The second item's quantity will be 1 and merchandiseTotalAmount will be $12.86 (i.e. 30 * (15 * 1 / (20 + 15))). The sum of 2 fulfillment items should be $30 (i.e. $17.14 + $12.86)

      Returns:
      the subtotal for the fulfillment item.
    • getProratedOrderAdjustments

      public javax.money.MonetaryAmount getProratedOrderAdjustments()
      The amount prorated to this item from order adjustments. This is primarily for calculating merchandiseTotalTax.
      Returns:
      The amount prorated to this item from order adjustments
    • getMerchandiseTaxableAmount

      public javax.money.MonetaryAmount getMerchandiseTaxableAmount()
      The amount that can be taxed based on the CartItem price and usually less any prorated order-adjustments.
      Returns:
      The amount that can be taxed based on the CartItem price
    • getMerchandiseTotalTax

      public javax.money.MonetaryAmount getMerchandiseTotalTax()
      The total tax of the item merchandise based on the price of the related CartItem.
      Returns:
      The total tax for the item merchandise.
    • getFulfillmentPriceBeforeAdjustments

      public javax.money.MonetaryAmount getFulfillmentPriceBeforeAdjustments()
      The fulfillment price of the corresponding CartItem before adjustments are applied.
      Returns:
      The fulfillment price of the corresponding CartItem before adjustments are applied.
    • getFulfillmentAdjustmentsTotal

      public javax.money.MonetaryAmount getFulfillmentAdjustmentsTotal()
      The total fulfillment adjustment amount for this fulfillment item. Used along with getFulfillmentPriceBeforeAdjustments() to determine getFulfillmentTotal().
      Returns:
      The total fulfillment adjustment amount for this fulfillment item.
    • getProratedFulfillmentGroupAdjustments

      public javax.money.MonetaryAmount getProratedFulfillmentGroupAdjustments()
      The amount prorated to this item from group adjustments.
      Returns:
      The amount prorated to this item from group adjustments.
    • getFulfillmentTotal

      public javax.money.MonetaryAmount getFulfillmentTotal()
      The total fulfillment price of this item, including adjustments. This does not include taxes.
      Returns:
      The total fulfillment price of this item, including adjustments.
    • getProratedFulfillmentCharge

      public javax.money.MonetaryAmount getProratedFulfillmentCharge()
      The prorated shipping charge for this fulfillment item before adjustments are applied, derived from the FulfillmentGroup.getGroupFulfillmentPriceBeforeAdjustments(). This does not include additional shipping charges specific to the item.
      Returns:
      The prorated shipping charge for this item, not including adjustments.
    • getFulfillmentAdjustments

      public List<com.broadleafcommerce.order.common.domain.Adjustment> getFulfillmentAdjustments()
      Adjustments to item fulfillment pricing that should be applied to getFulfillmentPriceBeforeAdjustments().
      Returns:
      Adjustments to item fulfillment pricing that should be applied to getFulfillmentPriceBeforeAdjustments().
    • isAvailableOnline

      public boolean isAvailableOnline()
      Whether or not this item is available online - ie inventory is available somewhere to fulfill this item.
      Returns:
      Whether or not this item is available online.
    • getInventoryCheckStrategy

      public String getInventoryCheckStrategy()
      The inventory check strategy of the item. This value helps to determine when an inventory check is required.
      Returns:
      The inventory check strategy of the item.
    • getInventoryReservationStrategy

      public String getInventoryReservationStrategy()
      The reservation strategy of the item. This value helps to determine when an inventory reservation is required.
      Returns:
      The reservation strategy of the item.
    • isCartItemDiscountable

      public boolean isCartItemDiscountable()

      Whether or not any offers or promotions can be applied to the cart item.

      Defaults to true

      Returns:
      whether or not any offers or promotions can be applied to the cart item
    • getFulfillmentItemTaxDetails

      public List<FulfillmentItemTaxDetail> getFulfillmentItemTaxDetails()
      The tax details associated with this item.
      Returns:
      The tax details for this item.
    • getPricedFulfillmentOption

      @Nullable public com.broadleafcommerce.order.common.domain.PricedFulfillmentOption getPricedFulfillmentOption()
    • getAttributes

      public Map<String,Object> getAttributes()
      Miscellaneous attributes for this fulfillment 1tem.
      Returns:
      Miscellaneous attributes for this fulfillment item.
    • getInternalAttributes

      public Map<String,Object> getInternalAttributes()
      Internal attributes for this fulfillment item. Distinguished from getAttributes() in that this map is used for attributes that assist in the internal working of Broadleaf Microservices. For example, attributes to help with returning free gift items.
      Returns:
      Miscellaneous internal attributes for this fulfillment item.
    • setReferenceNumber

      public void setReferenceNumber(String referenceNumber)
      The reference number for this fulfillment item.
    • setCartItemId

      public void setCartItemId(String cartItemId)
      A reference id to the CartItem to be represented by this fulfillment item.
      Parameters:
      cartItemId - A reference id to the CartItem to be represented by this fulfillment item.
    • setQuantity

      public void setQuantity(int quantity)
      The quantity to be fulfilled by this item. This isn't necessarily going to equal CartItem.getQuantity() since a CartItem can be split across multiple FulfillmentGroups.
      Parameters:
      quantity - The quantity to be fulfilled by this item.
    • setMerchandiseTotalAmount

      public void setMerchandiseTotalAmount(javax.money.MonetaryAmount merchandiseTotalAmount)
      This represents the subtotal for the fulfillment item. In most cases, this value is determined by multiplying the unit price of the related CartItem by its quantity. In the case of a product bundle, the bundle declares an overall price, which is then prorated down to each bundle item. A fulfillment item is created for each of the bundle's dependent cart items and the prorated price is used to populate this field.

      For example, if the bundle price is $30 and it contains 2 included products with the price $10 and $15, and quantity 2 and 1 accordingly, the first fulfillment item's quantity will be 2 and merchandiseTotalAmount will be $17.14 (i.e. 30 * (10 * 2 / (20 + 15))). The second item's quantity will be 1 and merchandiseTotalAmount will be $12.86 (i.e. 30 * (15 * 1 / (20 + 15))). The sum of 2 fulfillment items should be $30 (i.e. $17.14 + $12.86)

      Parameters:
      merchandiseTotalAmount - the subtotal for the fulfillment item.
    • setProratedOrderAdjustments

      public void setProratedOrderAdjustments(javax.money.MonetaryAmount proratedOrderAdjustments)
      The amount prorated to this item from order adjustments. This is primarily for calculating merchandiseTotalTax.
      Parameters:
      proratedOrderAdjustments - The amount prorated to this item from order adjustments
    • setMerchandiseTaxableAmount

      public void setMerchandiseTaxableAmount(javax.money.MonetaryAmount merchandiseTaxableAmount)
      The amount that can be taxed based on the CartItem price and usually less any prorated order-adjustments.
      Parameters:
      merchandiseTaxableAmount - The amount that can be taxed based on the CartItem price
    • setMerchandiseTotalTax

      public void setMerchandiseTotalTax(javax.money.MonetaryAmount merchandiseTotalTax)
      The total tax of the item merchandise based on the price of the related CartItem.
      Parameters:
      merchandiseTotalTax - The total tax for the item merchandise.
    • setFulfillmentPriceBeforeAdjustments

      public void setFulfillmentPriceBeforeAdjustments(javax.money.MonetaryAmount fulfillmentPriceBeforeAdjustments)
      The fulfillment price of the corresponding CartItem before adjustments are applied.
      Parameters:
      fulfillmentPriceBeforeAdjustments - The fulfillment price of this CartItem before adjustments are applied.
    • setFulfillmentAdjustmentsTotal

      public void setFulfillmentAdjustmentsTotal(javax.money.MonetaryAmount fulfillmentAdjustmentsTotal)
      The total fulfillment adjustment amount for this fulfillment item. Used along with getFulfillmentPriceBeforeAdjustments() to determine getFulfillmentTotal().
      Parameters:
      fulfillmentAdjustmentsTotal - The total fulfillment adjustment amount for this fulfillment item.
    • setProratedFulfillmentGroupAdjustments

      public void setProratedFulfillmentGroupAdjustments(javax.money.MonetaryAmount proratedFulfillmentGroupAdjustments)
      The amount prorated to this item from group adjustments.
      Parameters:
      proratedFulfillmentGroupAdjustments - The amount prorated to this item from group adjustments.
    • setFulfillmentTotal

      public void setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal)
      The total fulfillment price of this item, including adjustments. This does not include taxes.
      Parameters:
      fulfillmentTotal - The total fulfillment price of this item, including adjustments.
    • setProratedFulfillmentCharge

      public void setProratedFulfillmentCharge(javax.money.MonetaryAmount proratedFulfillmentCharge)
      The prorated shipping charge for this fulfillment item before adjustments are applied, derived from the FulfillmentGroup.getGroupFulfillmentPriceBeforeAdjustments(). This does not include additional shipping charges specific to the item.
      Parameters:
      proratedFulfillmentCharge - The prorated shipping charge for this item, not including adjustments.
    • setFulfillmentAdjustments

      public void setFulfillmentAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> fulfillmentAdjustments)
      Adjustments to item fulfillment pricing that should be applied to getFulfillmentPriceBeforeAdjustments().
      Parameters:
      fulfillmentAdjustments - Adjustments to item fulfillment pricing that should be applied to getFulfillmentPriceBeforeAdjustments().
    • setAvailableOnline

      public void setAvailableOnline(boolean availableOnline)
      Whether or not this item is available online - ie inventory is available somewhere to fulfill this item.
      Parameters:
      availableOnline - Whether or not this item is available online.
    • setInventoryCheckStrategy

      public void setInventoryCheckStrategy(String inventoryCheckStrategy)
      The inventory check strategy of the item. This value helps to determine when an inventory check is required.
      Parameters:
      inventoryCheckStrategy - The inventory check strategy of the item.
    • setInventoryReservationStrategy

      public void setInventoryReservationStrategy(String inventoryReservationStrategy)
      The reservation strategy of the item. This value helps to determine when an inventory reservation is required.
      Parameters:
      inventoryReservationStrategy - The reservation strategy of the item.
    • setCartItemDiscountable

      public void setCartItemDiscountable(boolean isCartItemDiscountable)

      Whether or not any offers or promotions can be applied to the cart item.

      Defaults to true

      Parameters:
      isCartItemDiscountable - whether or not any offers or promotions can be applied to the cart item
    • setFulfillmentItemTaxDetails

      public void setFulfillmentItemTaxDetails(List<FulfillmentItemTaxDetail> fulfillmentItemTaxDetails)
      The tax details associated with this item.
      Parameters:
      taxDetails - The tax details for this item.
    • setPricedFulfillmentOption

      public void setPricedFulfillmentOption(@Nullable com.broadleafcommerce.order.common.domain.PricedFulfillmentOption pricedFulfillmentOption)
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Miscellaneous attributes for this fulfillment 1tem.
      Parameters:
      attributes - Miscellaneous attributes for this fulfillment item.
    • setInternalAttributes

      public void setInternalAttributes(Map<String,Object> internalAttributes)
      Internal attributes for this fulfillment item. Distinguished from getAttributes() in that this map is used for attributes that assist in the internal working of Broadleaf Microservices. For example, attributes to help with returning free gift items.
      Parameters:
      internalAttributes - Miscellaneous internal attributes for this fulfillment item.
    • 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