Interface CartOrderFulfillmentGenerationService<C extends com.broadleafcommerce.cart.client.domain.Cart,O extends com.broadleafcommerce.order.client.domain.Order,F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Type Parameters:
C
-Cart
, or a subtypeO
-Order
, or a subtypeF
-OrderFulfillment
, or a subtype
- All Known Implementing Classes:
DefaultCartOrderFulfillmentGenerationService
public interface CartOrderFulfillmentGenerationService<C extends com.broadleafcommerce.cart.client.domain.Cart,O extends com.broadleafcommerce.order.client.domain.Order,F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
Handles generating
OrderFulfillments
from a Cart
.- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptiongenerateFulfillmentsFromCart
(C cart, O order, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) GeneratesOrderFulfillments
(and correspondingOrderFulfillmentItems
) from the givenCart
, and inserts them into the data store.
-
Method Details
-
generateFulfillmentsFromCart
List<F> generateFulfillmentsFromCart(C cart, O order, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) GeneratesOrderFulfillments
(and correspondingOrderFulfillmentItems
) from the givenCart
, and inserts them into the data store.This method does not need to concern itself with concurrency or idempotence, as by default,
CheckoutCompletionListener
will only invoke it after an order was newly created as defined by the contract ofCartOrderGenerationService.generateOrderFromCart(Cart, ContextInfo)
.The
default implementation
will generate oneOrderFulfillment
perFulfillmentGroup
inCart.getFulfillmentGroups()
.- Parameters:
cart
- the cart to create order fulfillments fromorder
- the order the fulfillments should be associated with. Should be a fully fleshed-out instance from the data store with its fields populated.contextInfo
- the context around sandboxing and multitenant state- Returns:
- a list of the newly created order fulfillments. Guaranteed non-null, but may be empty
depending on
Cart.getFulfillmentGroups()
. - See Also:
-