public class DefaultFulfillmentPricingService extends Object implements FulfillmentPricingService
Constructor and Description |
---|
DefaultFulfillmentPricingService(com.fasterxml.jackson.databind.ObjectMapper mapper,
com.broadleafcommerce.common.extension.TypeFactory typeFactory,
List<com.broadleafcommerce.shipping.FulfillmentPricingProvider> fulfillmentPricingProviders,
CartOperationServiceProperties cartOperationServiceProperties) |
Modifier and Type | Method and Description |
---|---|
void |
applyFulfillmentPricing(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Service for calculating and applying fulfillment pricing to a
Cart , typically by
integrating with one or more FulfillmentPricingProviders . |
protected void |
applyFulfillmentPricingForGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
Sends a pricing request to the
FulfillmentPricingProvider that can calculate the cost
for the FulfillmentGroup's set
FulfillmentOption and sets the group's pricing fields based on the response. |
protected void |
applyProductVariantAttributes(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem,
@NonNull com.broadleafcommerce.shipping.domain.FulfillmentPricingItem fulfillmentPricingItem,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) |
protected com.broadleafcommerce.shipping.domain.FulfillmentPricingItem |
buildFulfillmentPricingItem(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem) |
protected com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest |
buildFulfillmentPricingRequest(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String fulfillmentGroupId) |
boolean |
canCalculateFulfillmentPricing(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Whether the cart contains the information required to calculate fulfillment pricing.
|
protected com.broadleafcommerce.cart.client.domain.CartItem |
getCartItemForFulfillmentItem(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fi) |
protected CartOperationServiceProperties |
getCartOperationServiceProperties() |
protected List<com.broadleafcommerce.shipping.FulfillmentPricingProvider> |
getFulfillmentPricingProviders() |
protected com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
List<com.broadleafcommerce.shipping.domain.FulfillmentOptionPricedResponse> |
getOptions(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String referenceNumber)
A list of all potential fulfillment options for the specified cart and fulfillment group.
|
protected com.broadleafcommerce.shipping.domain.ShippingAddress |
getShippingAddress(com.broadleafcommerce.order.common.domain.Address fgAddress) |
protected com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
public DefaultFulfillmentPricingService(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, List<com.broadleafcommerce.shipping.FulfillmentPricingProvider> fulfillmentPricingProviders, CartOperationServiceProperties cartOperationServiceProperties)
public void applyFulfillmentPricing(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
FulfillmentPricingService
Cart
, typically by
integrating with one or more FulfillmentPricingProviders
.
Options are expected to be unique across all providers, once a provider is found that can
handle an option, it will be the one used for calculation.applyFulfillmentPricing
in interface FulfillmentPricingService
cart
- The cart to apply fulfillment pricing against.public boolean canCalculateFulfillmentPricing(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
FulfillmentPricingService
canCalculateFulfillmentPricing
in interface FulfillmentPricingService
cart
- The cart to determine whether fulfillment pricing can be calculated for.public List<com.broadleafcommerce.shipping.domain.FulfillmentOptionPricedResponse> getOptions(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String referenceNumber)
FulfillmentPricingService
getOptions
in interface FulfillmentPricingService
cart
- The cart to determine which fulfillment options can be chosen.referenceNumber
- The id of the fulfillment group we are retrieving options for.protected void applyFulfillmentPricingForGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
FulfillmentPricingProvider
that can calculate the cost
for the FulfillmentGroup's set
FulfillmentOption
and sets the group's pricing fields based on the response.cart
- The Cart
that owns the fulfillmentGroup
fulfillmentGroup
- The FulfillmentGroup
to be pricedprotected com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest buildFulfillmentPricingRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String fulfillmentGroupId)
protected com.broadleafcommerce.shipping.domain.FulfillmentPricingItem buildFulfillmentPricingItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem)
protected void applyProductVariantAttributes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, @NonNull @NonNull com.broadleafcommerce.shipping.domain.FulfillmentPricingItem fulfillmentPricingItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
protected com.broadleafcommerce.cart.client.domain.CartItem getCartItemForFulfillmentItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fi)
@Nullable protected com.broadleafcommerce.shipping.domain.ShippingAddress getShippingAddress(@Nullable com.broadleafcommerce.order.common.domain.Address fgAddress)
protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
protected List<com.broadleafcommerce.shipping.FulfillmentPricingProvider> getFulfillmentPricingProviders()
protected CartOperationServiceProperties getCartOperationServiceProperties()
Copyright © 2021. All rights reserved.