org.broadleafcommerce.core.offer.service
Interface OfferService

All Known Implementing Classes:
OfferServiceImpl

public interface OfferService

The Interface OfferService.


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)
          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()
           
 OrderOfferProcessor getOrderOfferProcessor()
           
 OrderService getOrderService()
           
 PromotableItemFactory getPromotableItemFactory()
           
 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.
 

Method Detail

findAllOffers

List<Offer> findAllOffers()
Returns all offers

Returns:
all offers

save

Offer save(Offer offer)
Save a new offer or updates an existing offer

Parameters:
offer -
Returns:
the offer

saveOfferCode

OfferCode saveOfferCode(OfferCode offerCode)
Saves a new Offer or updates an existing Offer that belongs to an OfferCode, then saves or updates the OfferCode

Parameters:
offerCode -
Returns:
the offerCode

lookupOfferByCode

Offer lookupOfferByCode(String code)
Lookup offer by code.

Parameters:
code - the code
Returns:
the offer

findOfferCodeById

OfferCode findOfferCodeById(Long id)
Lookup an OfferCode by its id

Parameters:
id - the offer id
Returns:
the offer

lookupOfferCodeByCode

OfferCode lookupOfferCodeByCode(String code)
Lookup OfferCode by code.

Parameters:
code - the code
Returns:
the offer

applyOffersToOrder

void applyOffersToOrder(List<Offer> offers,
                        Order order)
                        throws PricingException
Apply offers to order.

Parameters:
offers - the offers
order - the order
Throws:
PricingException

buildOfferListForOrder

List<Offer> buildOfferListForOrder(Order order)
Create a list of offers that applies to this order

Parameters:
order -
Returns:

getCustomerOfferDao

CustomerOfferDao getCustomerOfferDao()

setCustomerOfferDao

void setCustomerOfferDao(CustomerOfferDao customerOfferDao)

getOfferCodeDao

OfferCodeDao getOfferCodeDao()

setOfferCodeDao

void setOfferCodeDao(OfferCodeDao offerCodeDao)

getOfferDao

OfferDao getOfferDao()

setOfferDao

void setOfferDao(OfferDao offerDao)

getOrderOfferProcessor

OrderOfferProcessor getOrderOfferProcessor()

setOrderOfferProcessor

void setOrderOfferProcessor(OrderOfferProcessor orderOfferProcessor)

getItemOfferProcessor

ItemOfferProcessor getItemOfferProcessor()

setItemOfferProcessor

void setItemOfferProcessor(ItemOfferProcessor itemOfferProcessor)

getFulfillmentGroupOfferProcessor

FulfillmentGroupOfferProcessor getFulfillmentGroupOfferProcessor()

setFulfillmentGroupOfferProcessor

void setFulfillmentGroupOfferProcessor(FulfillmentGroupOfferProcessor fulfillmentGroupOfferProcessor)

applyFulfillmentGroupOffersToOrder

void applyFulfillmentGroupOffersToOrder(List<Offer> offers,
                                        Order order)
                                        throws PricingException
Throws:
PricingException

getPromotableItemFactory

PromotableItemFactory getPromotableItemFactory()

setPromotableItemFactory

void setPromotableItemFactory(PromotableItemFactory promotableItemFactory)

verifyMaxCustomerUsageThreshold

boolean verifyMaxCustomerUsageThreshold(Customer customer,
                                        Offer offer)
Validates that the passed in customer has not exceeded the max uses for the passed in offer. Returns true if it is ok for the customer to use this offer with their current order. Returns false if it is not ok for the customer to use this offer with their current order. This condition could pass if the system allows two concurrent carts for the same customer. The condition will fail at order submisstion time when the VerfiyCustomerMaxOfferUsesActivity 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.

Parameters:
offer - The offer to check
customer - The customer to check
Returns:

getOrderService

OrderService getOrderService()

setOrderService

void setOrderService(OrderService orderService)


Copyright © 2013. All Rights Reserved.