|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.offer.service.OfferServiceImpl
@Service(value="blOfferService") public class OfferServiceImpl
The Class OfferServiceImpl.
| Field Summary | |
|---|---|
protected CustomerOfferDao |
customerOfferDao
|
protected OfferServiceExtensionManager |
extensionManager
|
protected FulfillmentGroupOfferProcessor |
fulfillmentGroupOfferProcessor
|
protected ItemOfferProcessor |
itemOfferProcessor
|
protected OfferAuditService |
offerAuditService
|
protected OfferCodeDao |
offerCodeDao
|
protected OfferDao |
offerDao
|
protected OrderOfferProcessor |
orderOfferProcessor
|
protected OrderService |
orderService
|
protected PromotableItemFactory |
promotableItemFactory
|
| Constructor Summary | |
|---|---|
OfferServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
applyFulfillmentGroupOffersToOrder(List<Offer> offers,
Order order)
|
void |
applyOffersToOrder(List<Offer> offers,
Order order)
Apply offers to order. |
List<Offer> |
buildOfferListForOrder(Order order)
Creates 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)
For a given order, give back a map of all Offers that were retrieved from OfferCodes. |
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. |
protected List<Offer> |
lookupAutomaticDeliveryOffers()
Private method used to retrieve all offers with DeliveryType of AUTOMATIC |
Offer |
lookupOfferByCode(String code)
Creates a list of offers that applies to this order. |
OfferCode |
lookupOfferCodeByCode(String code)
Lookup OfferCode by code. |
protected List<CustomerOffer> |
lookupOfferCustomerByCustomer(Customer customer)
Private method used to retrieve all offers assigned to this customer. |
protected List<OfferCode> |
removeOutOfDateOfferCodes(List<OfferCode> offerCodes)
Removes all out of date offerCodes based on the offerCode and its offer's start and end date. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CustomerOfferDao customerOfferDao
protected OfferCodeDao offerCodeDao
protected OfferAuditService offerAuditService
protected OfferDao offerDao
protected OrderOfferProcessor orderOfferProcessor
protected ItemOfferProcessor itemOfferProcessor
protected FulfillmentGroupOfferProcessor fulfillmentGroupOfferProcessor
protected PromotableItemFactory promotableItemFactory
protected OfferServiceExtensionManager extensionManager
protected OrderService orderService
| Constructor Detail |
|---|
public OfferServiceImpl()
| Method Detail |
|---|
public List<Offer> findAllOffers()
OfferService
findAllOffers in interface OfferService@Transactional(value="blTransactionManager") public Offer save(Offer offer)
OfferService
save in interface OfferService@Transactional(value="blTransactionManager") public OfferCode saveOfferCode(OfferCode offerCode)
OfferService
saveOfferCode in interface OfferServicepublic Offer lookupOfferByCode(String code)
lookupOfferByCode in interface OfferServicecode -
public OfferCode lookupOfferCodeByCode(String code)
OfferService
lookupOfferCodeByCode in interface OfferServicecode - the code
public List<Offer> buildOfferListForOrder(Order order)
buildOfferListForOrder in interface OfferServiceorder -
protected List<CustomerOffer> lookupOfferCustomerByCustomer(Customer customer)
customer -
protected List<Offer> lookupAutomaticDeliveryOffers()
protected List<OfferCode> removeOutOfDateOfferCodes(List<OfferCode> offerCodes)
offerCodes -
@Transactional(value="blTransactionManager")
public void applyOffersToOrder(List<Offer> offers,
Order order)
throws PricingException
OfferService
applyOffersToOrder in interface OfferServiceoffers - the offersorder - the order
PricingException
@Transactional(value="blTransactionManager")
public void applyFulfillmentGroupOffersToOrder(List<Offer> offers,
Order order)
throws PricingException
applyFulfillmentGroupOffersToOrder in interface OfferServicePricingException
public boolean verifyMaxCustomerUsageThreshold(Customer customer,
Offer offer)
OfferServiceValidates 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.
verifyMaxCustomerUsageThreshold in interface OfferServicecustomer - the customer attempting to use the offeroffer - the offer to check
public boolean verifyMaxCustomerUsageThreshold(@NotNull
Customer customer,
OfferCode code)
OfferServiceValidates that the given code is underneath the max uses for that code. This method will also delegate to
OfferService.verifyMaxCustomerUsageThreshold(Customer, Offer) for the code's offer and the passed in customer
verifyMaxCustomerUsageThreshold in interface OfferServicecustomer - the customer attempting to use the codecode - the code to check
public Set<Offer> getUniqueOffersFromOrder(Order order)
OfferService
getUniqueOffersFromOrder in interface OfferServicepublic Map<Offer,OfferCode> getOffersRetrievedFromCodes(Order order)
OfferServiceOffers 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().
getOffersRetrievedFromCodes in interface OfferServiceOffer to the OfferCode that was used to obtain it
public Map<Offer,OfferCode> getOffersRetrievedFromCodes(List<OfferCode> codes,
Set<Offer> appliedOffers)
OfferService
getOffersRetrievedFromCodes in interface OfferServicepublic CustomerOfferDao getCustomerOfferDao()
getCustomerOfferDao in interface OfferServicepublic void setCustomerOfferDao(CustomerOfferDao customerOfferDao)
setCustomerOfferDao in interface OfferServicepublic OfferCodeDao getOfferCodeDao()
getOfferCodeDao in interface OfferServicepublic void setOfferCodeDao(OfferCodeDao offerCodeDao)
setOfferCodeDao in interface OfferServicepublic OfferDao getOfferDao()
getOfferDao in interface OfferServicepublic void setOfferDao(OfferDao offerDao)
setOfferDao in interface OfferServicepublic OrderOfferProcessor getOrderOfferProcessor()
getOrderOfferProcessor in interface OfferServicepublic void setOrderOfferProcessor(OrderOfferProcessor orderOfferProcessor)
setOrderOfferProcessor in interface OfferServicepublic ItemOfferProcessor getItemOfferProcessor()
getItemOfferProcessor in interface OfferServicepublic void setItemOfferProcessor(ItemOfferProcessor itemOfferProcessor)
setItemOfferProcessor in interface OfferServicepublic FulfillmentGroupOfferProcessor getFulfillmentGroupOfferProcessor()
getFulfillmentGroupOfferProcessor in interface OfferServicepublic void setFulfillmentGroupOfferProcessor(FulfillmentGroupOfferProcessor fulfillmentGroupOfferProcessor)
setFulfillmentGroupOfferProcessor in interface OfferServicepublic PromotableItemFactory getPromotableItemFactory()
getPromotableItemFactory in interface OfferServicepublic void setPromotableItemFactory(PromotableItemFactory promotableItemFactory)
setPromotableItemFactory in interface OfferServicepublic OfferCode findOfferCodeById(Long id)
OfferService
findOfferCodeById in interface OfferServiceid - the offer id
public OrderService getOrderService()
getOrderService in interface OfferServicepublic void setOrderService(OrderService orderService)
setOrderService in interface OfferService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||