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 :-
OrderEntryService
should 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 void
addAllDiscountValues(E entry, java.util.List<DiscountValue> discountValues)
Adds a collection of discount values into given entry.void
addAllTaxValues(E entry, java.util.List<TaxValue> taxValues)
Adds a collection of tax values into given entry.void
addDiscountValue(E entry, DiscountValue discountValue)
Adds a new discount value to the given entry.void
addTaxValue(E entry, TaxValue taxValue)
Adds a new tax value into given entry.E
createEntry(AbstractOrderModel abstractOrder)
Creates a new instance of order entry for a given abstract order instance.AbstractOrderEntryModel
createEntry(ComposedTypeModel entryType, AbstractOrderModel abstractOrder)
Creates a new instance of abstract order entry of the specific composed type for a given order instance.DiscountValue
getGlobalDiscountValue(E entry, DiscountValue discountValue)
Searches for complete discount value (with calculated applied value) object created using given discountValue.void
removeDiscountValue(E entry, DiscountValue discountValue)
Removes given discount value from the given entry.void
removeTaxValue(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 eitherorder
or
discountValue
is 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 eitherorder
or
discountValues
is 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 eitherorder
or
discountValue
is 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 newTaxValue
should be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES
.- Parameters:
taxValue
- tax value to addentry
- targetAbstractOrderEntryModel
- Throws:
java.lang.IllegalArgumentException
- if eitherorder
or
taxValue
is 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 newTaxValue
s should be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES
.- Parameters:
taxValues
- tax values to addentry
- targetAbstractOrderEntryModel
- Throws:
java.lang.IllegalArgumentException
- if eitherorder
or
taxValues
is 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 removedTaxValue
should be removed from orders tax valuesAbstractOrderModel.TOTALTAXVALUES
.- Parameters:
taxValue
- tax value to removeentry
- targetAbstractOrderEntryModel
- Throws:
java.lang.IllegalArgumentException
- if eitherorder
or
taxValue
is null.
- See Also:
CalculationService.calculate(AbstractOrderModel)
-
-