public interface OrderService extends AbstractOrderService<OrderModel,OrderEntryModel>
| Modifier and Type | Method and Description |
|---|---|
AbstractOrderEntryModel |
addNewEntry(ComposedTypeModel entryType,
OrderModel order,
ProductModel product,
long qty,
UnitModel unit,
int number,
boolean addToPresent)
Adds a new entry of the given
ComposedTypeModel to the given order. |
OrderEntryModel |
addNewEntry(OrderModel order,
ProductModel product,
long qty,
UnitModel unit,
int number,
boolean addToPresent)
Adds a new order entry to the given order on the required entry number.
|
boolean |
calculateOrder(AbstractOrderModel order)
Deprecated.
since ages - Use
CalculationService to calculate orders. |
OrderModel |
createOrderFromCart(CartModel cart)
Create the order for the given
cart. |
OrderModel |
placeOrder(CartModel cart,
AddressModel deliveryAddress,
AddressModel paymentAddress,
PaymentInfoModel paymentInfo)
Deprecated.
since ages - Use lightweight
createOrderFromCart(CartModel) instead or your own implementation of order
placement flow. |
void |
submitOrder(OrderModel order)
Submits an order.
|
addAllGlobalDiscountValues, addAllTotalTaxValues, addGlobalDiscountValue, addNewEntry, addTotalTaxValue, clone, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getGlobalDiscountValue, removeGlobalDiscountValue, removeTotalTaxValue, saveOrderOrderModel createOrderFromCart(CartModel cart) throws InvalidCartException
cart. This method focuses on creating an OrderModel instance
from the given CartModel instance. The order instance remains unsaved and not calculated. This method
does nothing with the cart member attributes (addresses, paymentInfo). It also leaves the target cart untouched.
If you want to calculate cart or order, use CalculationService.cart - the target CartModelOrderModelInvalidCartException - if the cart is invalid according to the used CartValidator.void submitOrder(OrderModel order)
EventPublishingSubmitOrderStrategy fires SubmitOrderEvent.order - Order to submit.@Deprecated OrderModel placeOrder(CartModel cart, AddressModel deliveryAddress, AddressModel paymentAddress, PaymentInfoModel paymentInfo) throws InvalidCartException
createOrderFromCart(CartModel) instead or your own implementation of order
placement flow.cart. This means: first the cart is calculated (see
calculateOrder(AbstractOrderModel) than (if not null) the
deliveryAddress and paymentAddress and paymentInfo are stored for the
current session user and also to the cart. After this from the cart an OrderModel is created
and the cart is removed from the session.cart - the CartModeldeliveryAddress - the delivery AddressModel for the current session user. Can be null.paymentAddress - the payment AddressModel for the current session user. Can be null.paymentInfo - the PaymentInfoModel for the current session user. Can be null.OrderModelInvalidCartException@Deprecated boolean calculateOrder(AbstractOrderModel order)
CalculationService to calculate orders.order and returns true if each entry and after this the
AbstractOrderModel was calculated. Thereby any invalid entry will be automatically removed.
The default implementation delegates to the OrderCalculation.calculate(AbstractOrderModel) strategy.
Please check the API doc of your current calculation strategy.order - the AbstractOrderModelfalse if the order was already calculated.OrderEntryModel addNewEntry(OrderModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent)
AmbiguousIdentifierException will be
thrown.addNewEntry in interface AbstractOrderService<OrderModel,OrderEntryModel>order - - target orderproduct - -product to add, must not be nullqty - - quantityunit - - must not be nullnumber - - entry number of the new entry in the order. Entries are indexed starting from 0. Set number to -1 if
you want to append the entry as the last one. You can request any non-negative, that is not already
occupied by existing order entry.addToPresent - - if true an existing entry with matching product and unit will get its quantity increased;
otherwise a new entry is createdAbstractOrderEntryModel - newly created order entryjava.lang.IllegalArgumentException - if either order or product is null or quantity is negative.AmbiguousIdentifierException - if there is already entry with the requested number.AbstractOrderEntryTypeService.getAbstractOrderEntryType(AbstractOrderModel)AbstractOrderEntryModel addNewEntry(ComposedTypeModel entryType, OrderModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent)
ComposedTypeModel to the given order. The new entry is neither saved nor
calculated. If requested entryNumber collide with existing entry, an AmbiguousIdentifierException will be
thrown.addNewEntry in interface AbstractOrderService<OrderModel,OrderEntryModel>entryType - - the requested sub-type AbstractOrderEntryorder - - target orderproduct - -product to add, must not be nullqty - - quantityunit - - must not be nullnumber - - entry number of the new entry in the order. Entries are indexed starting from 0. Set number to -1 if
you want to append the entry as the last one. You can request any non-negative, that is not already
occupied by existing order entry.addToPresent - - if true an existing entry with matching product and unit will get its quantity increased;
otherwise a new entry is createdAbstractOrderEntryModel - newly created order entryjava.lang.IllegalArgumentException - if either entryType or order or product is null or quantity is negative.AmbiguousIdentifierException - if there is already entry with the requested number.Copyright © 2018 SAP SE. All Rights Reserved.