All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.broadleafcommerce.core.catalog.service.dynamic.DynamicSkuPricingService Maven / Gradle / Ivy

There is a newer version: 3.1.15-GA
Show newest version
/*
 * Copyright 2008-2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.broadleafcommerce.core.catalog.service.dynamic;

import org.broadleafcommerce.common.money.Money;
import org.broadleafcommerce.core.catalog.domain.ProductOptionValueImpl;
import org.broadleafcommerce.core.catalog.domain.Sku;
import org.broadleafcommerce.core.catalog.domain.SkuBundleItem;

import javax.annotation.Nonnull;
import java.util.HashMap;

/**
 * 

Interface for calculating dynamic pricing for a {@link Sku}. This should be hooked up via a custom subclass of * {@link org.broadleafcommerce.core.web.catalog.DefaultDynamicSkuPricingFilter} where an implementation of this class * should be injected and returned in the getPricing() method.

* *

Rather than implementing this interface directly, consider subclassing the {@link DefaultDynamicSkuPricingServiceImpl} * and providing overrides to methods there.

* * @author jfischer * @see {@link DefaultDynamicSkuPricingServiceImpl} * @see {@link org.broadleafcommerce.core.web.catalog.DefaultDynamicSkuPricingFilter} * @see {@link SkuPricingConsiderationContext} */ public interface DynamicSkuPricingService { /** * While this method should return a {@link DynamicSkuPrices} (and not just null) the members of the result can all * be null; they do not have to be set * * @param sku * @param skuPricingConsiderations * @return */ @Nonnull @SuppressWarnings("rawtypes") public DynamicSkuPrices getSkuPrices(Sku sku, HashMap skuPricingConsiderations); /** * Used for t * * @param sku * @param skuPricingConsiderations * @return */ @SuppressWarnings("rawtypes") public DynamicSkuPrices getSkuBundleItemPrice(SkuBundleItem sku, HashMap skuPricingConsiderations); /** * Execute dynamic pricing on the price of a product option value. * @param productOptionValueImpl * @param priceAdjustment * @param skuPricingConsiderationContext * @return */ @SuppressWarnings("rawtypes") public DynamicSkuPrices getPriceAdjustment(ProductOptionValueImpl productOptionValueImpl, Money priceAdjustment, HashMap skuPricingConsiderationContext); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy