public interface OfferService
| Modifier and Type | Method and Description |
|---|---|
Order |
applyAndSaveFulfillmentGroupOffersToOrder(List<Offer> offers,
Order order) |
Order |
applyAndSaveOffersToOrder(List<Offer> offers,
Order order)
Apply offers to order.
|
void |
applyFulfillmentGroupOffersToOrder(List<Offer> offers,
Order order)
Deprecated.
|
void |
applyOffersToOrder(List<Offer> offers,
Order order)
Deprecated.
|
List<OfferCode> |
buildOfferCodeListForCustomer(Customer customer)
Attempts to resolve a list of offer codes associated explicitly with the customer.
|
List<Offer> |
buildOfferListForOrder(Order order)
Create a list of offers that applies to this order
|
List<Offer> |
findAllOffers()
Returns all offers
|
OfferCode |
findOfferCodeById(Long id)
Lookup an OfferCode by its id
|
CustomerOfferDao |
getCustomerOfferDao() |
FulfillmentGroupOfferProcessor |
getFulfillmentGroupOfferProcessor() |
ItemOfferProcessor |
getItemOfferProcessor() |
OfferCodeDao |
getOfferCodeDao() |
OfferDao |
getOfferDao() |
Map<Offer,OfferCode> |
getOffersRetrievedFromCodes(List<OfferCode> codes,
Set<Offer> appliedOffers)
Given a list of offer codes and a set of offers, return a map of of offer codes that are keyed by the offer that was
applied to the order
|
Map<Offer,OfferCode> |
getOffersRetrievedFromCodes(Order order)
|
OrderOfferProcessor |
getOrderOfferProcessor() |
OrderService |
getOrderService() |
PromotableItemFactory |
getPromotableItemFactory() |
Set<Offer> |
getUniqueOffersFromOrder(Order order)
Returns a set of offers that have been used for this order by checking adjustments on the different levels like
FulfillmentGroups and OrderItems.
|
Offer |
lookupOfferByCode(String code)
Lookup offer by code.
|
OfferCode |
lookupOfferCodeByCode(String code)
Lookup OfferCode by code.
|
Offer |
save(Offer offer)
Save a new offer or updates an existing offer
|
OfferCode |
saveOfferCode(OfferCode offerCode)
Saves a new Offer or updates an existing Offer that belongs to an OfferCode, then saves or updates the OfferCode
|
void |
setCustomerOfferDao(CustomerOfferDao customerOfferDao) |
void |
setFulfillmentGroupOfferProcessor(FulfillmentGroupOfferProcessor fulfillmentGroupOfferProcessor) |
void |
setItemOfferProcessor(ItemOfferProcessor itemOfferProcessor) |
void |
setOfferCodeDao(OfferCodeDao offerCodeDao) |
void |
setOfferDao(OfferDao offerDao) |
void |
setOrderOfferProcessor(OrderOfferProcessor orderOfferProcessor) |
void |
setOrderService(OrderService orderService) |
void |
setPromotableItemFactory(PromotableItemFactory promotableItemFactory) |
boolean |
verifyMaxCustomerUsageThreshold(Customer customer,
Offer offer)
Validates that the passed in customer has not exceeded the max uses for the
passed in offer.
|
boolean |
verifyMaxCustomerUsageThreshold(Customer customer,
OfferCode code)
Validates that the given code is underneath the max uses for that code.
|
Offer save(Offer offer)
offer - OfferCode saveOfferCode(OfferCode offerCode)
offerCode - Offer lookupOfferByCode(String code)
code - the codeOfferCode findOfferCodeById(Long id)
id - the offer idOfferCode lookupOfferCodeByCode(String code)
code - the codeOrder applyAndSaveOffersToOrder(List<Offer> offers, Order order) throws PricingException
offers - the offersorder - the orderPricingException@Deprecated void applyOffersToOrder(List<Offer> offers, Order order) throws PricingException
offers - order - PricingExceptionList<Offer> buildOfferListForOrder(Order order)
order - List<OfferCode> buildOfferCodeListForCustomer(Customer customer)
customer - CustomerOfferDao getCustomerOfferDao()
void setCustomerOfferDao(CustomerOfferDao customerOfferDao)
OfferCodeDao getOfferCodeDao()
void setOfferCodeDao(OfferCodeDao offerCodeDao)
OfferDao getOfferDao()
void setOfferDao(OfferDao offerDao)
OrderOfferProcessor getOrderOfferProcessor()
void setOrderOfferProcessor(OrderOfferProcessor orderOfferProcessor)
ItemOfferProcessor getItemOfferProcessor()
void setItemOfferProcessor(ItemOfferProcessor itemOfferProcessor)
FulfillmentGroupOfferProcessor getFulfillmentGroupOfferProcessor()
void setFulfillmentGroupOfferProcessor(FulfillmentGroupOfferProcessor fulfillmentGroupOfferProcessor)
Order applyAndSaveFulfillmentGroupOffersToOrder(List<Offer> offers, Order order) throws PricingException
PricingException@Deprecated void applyFulfillmentGroupOffersToOrder(List<Offer> offers, Order order) throws PricingException
PricingExceptionPromotableItemFactory getPromotableItemFactory()
void setPromotableItemFactory(PromotableItemFactory promotableItemFactory)
boolean verifyMaxCustomerUsageThreshold(@Nonnull Customer customer, @Nonnull Offer offer)
Validates that the passed in customer has not exceeded the max uses for the passed in offer.
This condition could pass if the system allows two concurrent carts for the same customer.
The condition will fail at order submission time when the VerifyCustomerMaxOfferUsesActivity
runs (if that activity is configured as part of the checkout workflow.)
This method only checks offers who have a max_customer_uses value that is greater than zero. By default offers can be used as many times as the customer's order qualifies.
This method offers no protection against systems that allow customers to create multiple ids in the system.
customer - the customer attempting to use the offeroffer - the offer to checkboolean verifyMaxCustomerUsageThreshold(@Nonnull Customer customer, @Nonnull OfferCode code)
Validates that the given code is underneath the max uses for that code. This method will also delegate to
verifyMaxCustomerUsageThreshold(Customer, Offer) for the code's offer and the passed in customer
customer - the customer attempting to use the codecode - the code to checkSet<Offer> getUniqueOffersFromOrder(Order order)
order - Map<Offer,OfferCode> getOffersRetrievedFromCodes(List<OfferCode> codes, Set<Offer> appliedOffers)
codes - appliedOffers - Map<Offer,OfferCode> getOffersRetrievedFromCodes(Order order)
Offers that were retrieved from OfferCodes. More explicitly,
this will look at all of the offers that have been used by looking at a given Order's adjustments and then
match those up with the codes from Order.getAddedOfferCodes().OrderService getOrderService()
void setOrderService(OrderService orderService)
Copyright © 2015. All Rights Reserved.