Interface AbstractOrderEntryService<E extends AbstractOrderEntryModel>

    • Method Detail

      • 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 order
        entryType - 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 add
        entry - target AbstractOrderEntryModel
        Throws:
        java.lang.IllegalArgumentException - if either order 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 add
        entry - target AbstractOrderEntryModel
        Throws:
        java.lang.IllegalArgumentException - if either order 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 remove
        entry - target AbstractOrderEntryModel
        Throws:
        java.lang.IllegalArgumentException - if either order 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 new TaxValue should be present in orders tax values AbstractOrderModel.TOTALTAXVALUES.
        Parameters:
        taxValue - tax value to add
        entry - target AbstractOrderEntryModel
        Throws:
        java.lang.IllegalArgumentException - if either order 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 new TaxValues should be present in orders tax values AbstractOrderModel.TOTALTAXVALUES.
        Parameters:
        taxValues - tax values to add
        entry - target AbstractOrderEntryModel
        Throws:
        java.lang.IllegalArgumentException - if either order or taxValues is null.
        See Also:
        CalculationService.calculate(AbstractOrderModel)