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

org.broadleafcommerce.core.order.fulfillment.domain.FulfillmentPriceBand Maven / Gradle / Ivy

There is a newer version: 3.1.15-GA
Show newest version
/*
 * #%L
 * BroadleafCommerce Framework
 * %%
 * Copyright (C) 2009 - 2013 Broadleaf Commerce
 * %%
 * 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.
 * #L%
 */
package org.broadleafcommerce.core.order.fulfillment.domain;

import org.broadleafcommerce.core.order.domain.FulfillmentGroup;
import org.broadleafcommerce.core.order.domain.FulfillmentGroupItem;
import org.broadleafcommerce.core.order.domain.OrderItem;
import org.broadleafcommerce.core.order.service.type.FulfillmentBandResultAmountType;

import java.math.BigDecimal;

/**
 * 

This entity defines the bands that can be specified for {@link BandedPriceFulfillmentOption}. Bands * work on the retail price of an {@link Order} and should be calculated as follows:

*
    *
  1. The prices of all of the {@link OrderItems} in a {@link FulfillmentGroup} (which * is obtained through their relationship with {@link FulfillmentGroupItem} are summed together
  2. *
  3. The {@link FulfillmentPriceBand} should be looked up by getting the closest band less * than the sum of the price
  4. *
  5. If {@link #getResultAmountType()} returns {@link FulfillmentBandResultAmountType#RATE}, then * the cost for the fulfillment group is whatever is defined in {@link #getResultAmount()}
  6. *
  7. If {@link #getResultAmountType()} returns {@link FulfillmentBandResultAmountType#PERCENTAGE}, then * the fulfillment cost is the percentage obtained by {@link #getResultAmount()} * retailPriceTotal
  8. *
  9. If two bands have the same retail price minimum amount, the cheapest resulting amount is used
  10. *
* * @author Phillip Verheyden * @see {@link BandedPriceFulfillmentOption} */ public interface FulfillmentPriceBand extends FulfillmentBand { /** * Gets the minimum amount that this band is valid for. If the addition * of all of the retail prices on all the {@link OrderItem}s in a {@link FulfillmentGroup} * comes to at least this amount, this band result amount will be applied to the * fulfillment cost. * * @return the minimum retail price amount of the sum of the {@link OrderItem}s in a * {@link FulfillmentGroup} that this band qualifies for */ public BigDecimal getRetailPriceMinimumAmount(); /** * Set the minimum amount that this band is valid for. If the addition * of all of the retail prices on all the {@link OrderItem}s in a {@link FulfillmentGroup} * comes to at least this amount, this band result amount will be applied to the * fulfillment cost. * * @param minimumRetailPriceAmount - the minimum retail price amount from adding up * the {@link OrderItem}s in a {@link FulfillmentGroup} */ public void setRetailPriceMinimumAmount(BigDecimal retailPriceMinimumAmount); /** * Gets the {@link BandedPriceFulfillmentOption} that this band is associated to * * @return the associated {@link BandedPriceFulfillmentOption} */ public BandedPriceFulfillmentOption getOption(); /** * Sets the {@link BandedPriceFulfillmentOption} to associate with this band * * @param option */ public void setOption(BandedPriceFulfillmentOption option); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy