Package de.hybris.platform.order
Interface AbstractOrderEntryService<E extends AbstractOrderEntryModel>
-
- All Known Subinterfaces:
CartEntryService,OrderEntryService
- All Known Implementing Classes:
DefaultAbstractOrderEntryService,DefaultCartEntryService,DefaultOrderEntryService
public interface AbstractOrderEntryService<E extends AbstractOrderEntryModel>Generic service that allows creation of order entries of particular type. Concrete implementation should be typed for a particular subtype ofAbstractOrderEntryModel. I.e :-
OrderEntryServiceshould implement the AbstractOrderEntryService forOrderEntryModel, - CartEntryService should implement the AbstractOrderEntryService for
CartEntryModel, - ... etc
The service allows managing taxes and discounts on abstract order entry level.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAllDiscountValues(E entry, java.util.List<DiscountValue> discountValues)Adds a collection of discount values into given entry.voidaddAllTaxValues(E entry, java.util.List<TaxValue> taxValues)Adds a collection of tax values into given entry.voidaddDiscountValue(E entry, DiscountValue discountValue)Adds a new discount value to the given entry.voidaddTaxValue(E entry, TaxValue taxValue)Adds a new tax value into given entry.EcreateEntry(AbstractOrderModel abstractOrder)Creates a new instance of order entry for a given abstract order instance.AbstractOrderEntryModelcreateEntry(ComposedTypeModel entryType, AbstractOrderModel abstractOrder)Creates a new instance of abstract order entry of the specific composed type for a given order instance.DiscountValuegetGlobalDiscountValue(E entry, DiscountValue discountValue)Searches for complete discount value (with calculated applied value) object created using given discountValue.voidremoveDiscountValue(E entry, DiscountValue discountValue)Removes given discount value from the given entry.voidremoveTaxValue(E entry, TaxValue taxValue)Removes given tax value from the given entry.
-
-
-
Method Detail
-
createEntry
E createEntry(AbstractOrderModel abstractOrder)
Creates a new instance of order entry for a given abstract order instance. The entry type is chosen to best suit the order instance. New entry remains not persisted.- Parameters:
abstractOrder- target order- Returns:
- new order entry of the suitable runtime type.
- See Also:
AbstractOrderEntryTypeService.getAbstractOrderEntryType(AbstractOrderModel)
-
createEntry
AbstractOrderEntryModel createEntry(ComposedTypeModel entryType, AbstractOrderModel abstractOrder)
Creates a new instance of abstract order entry of the specific composed type for a given order instance. New entry remains not persisted.- Parameters:
abstractOrder- target orderentryType- create entry of this specific type- Returns:
- new abstract order entry of the specific runtime type.
-
addDiscountValue
void addDiscountValue(E entry, DiscountValue discountValue)
Adds a new discount value to the given entry. Entry remains not persisted. By default, after save operation, the entry will be not calculated. User needs to recalculate order in order to notice the added discount in the total price.- Parameters:
discountValue- discount value to addentry- targetAbstractOrderEntryModel- Throws:
java.lang.IllegalArgumentException- if eitherorderordiscountValueis null.- See Also:
CalculationService.calculate(AbstractOrderModel)
-
addAllDiscountValues
void addAllDiscountValues(E entry, java.util.List<DiscountValue> discountValues)
Adds a collection of discount values into given entry. Entry remains not persisted and not calculated. User needs to recalculate order in order to notice the added discounts in the total price.- Parameters:
discountValues- discount values to addentry- targetAbstractOrderEntryModel- Throws:
java.lang.IllegalArgumentException- if eitherorderordiscountValuesis null.- See Also:
CalculationService.calculate(AbstractOrderModel)
-
removeDiscountValue
void removeDiscountValue(E entry, DiscountValue discountValue)
Removes given discount value from the given entry. Entry remains not persisted and not calculated. User needs to recalculate order in order to notice the removed discount in the total price.- Parameters:
discountValue- discount value to removeentry- targetAbstractOrderEntryModel- Throws:
java.lang.IllegalArgumentException- if eitherorderordiscountValueis null.- See Also:
CalculationService.calculate(AbstractOrderModel)
-
getGlobalDiscountValue
DiscountValue getGlobalDiscountValue(E entry, DiscountValue discountValue)
Searches for complete discount value (with calculated applied value) object created using given discountValue. Returns null when discount value for given parameter can not be found.
-
addTaxValue
void addTaxValue(E entry, TaxValue taxValue)
Adds a new tax value into given entry. Entry remains not persisted. By default, after save operation, the entry will be not calculated. User needs to recalculate entry in order to notice the added tax value in the orders total tax. After recalculation of the order, the newTaxValueshould be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Parameters:
taxValue- tax value to addentry- targetAbstractOrderEntryModel- Throws:
java.lang.IllegalArgumentException- if eitherorderortaxValueis null.- See Also:
CalculationService.calculate(AbstractOrderModel)
-
addAllTaxValues
void addAllTaxValues(E entry, java.util.List<TaxValue> taxValues)
Adds a collection of tax values into given entry. Entry remains not persisted and not calculated. User needs to recalculate entry in order to notice the added tax values in the orders total tax. After recalculation of the order, the newTaxValues should be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Parameters:
taxValues- tax values to addentry- targetAbstractOrderEntryModel- Throws:
java.lang.IllegalArgumentException- if eitherorderortaxValuesis null.- See Also:
CalculationService.calculate(AbstractOrderModel)
-
removeTaxValue
void removeTaxValue(E entry, TaxValue taxValue)
Removes given tax value from the given entry. Entry remains not persisted and not calculated. User needs to recalculate entry in order to see the difference in order's total tax. After recalculation of the order, the removedTaxValueshould be removed from orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Parameters:
taxValue- tax value to removeentry- targetAbstractOrderEntryModel- Throws:
java.lang.IllegalArgumentException- if eitherorderortaxValueis null.- See Also:
CalculationService.calculate(AbstractOrderModel)
-
-