Class OfferEngineEndpoint
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.web.endpoint.OfferEngineEndpoint
-
@FrameworkRestController @FrameworkMapping("/offer-engine") @DataRouteByExample(Offer.class) public class OfferEngineEndpoint extends Object- Author:
- Chad Harchar (charchar)
-
-
Field Summary
Fields Modifier and Type Field Description protected OfferAuditDetailService<? extends OfferAuditDetail>auditServicestatic StringBASE_URIprotected OfferCandidateService<? extends Offer>offerCandidateServiceprotected OfferCodeUsageValidatorofferCodeUsageValidatorprotected OfferEngineServiceofferEngineServiceprotected OfferService<? extends Offer>offerServiceprotected OfferUsageValidatorofferUsageValidatorprotected OfferUserServiceofferUserServiceprotected com.broadleafcommerce.common.extension.TypeFactorytypeFactoryprotected VoucherOfferUsageValidatorvoucherOfferUsageValidator
-
Constructor Summary
Constructors Constructor Description OfferEngineEndpoint(OfferAuditDetailService<? extends OfferAuditDetail> auditService, OfferService<? extends Offer> offerService, OfferUserService offerUserService, OfferEngineService offerEngineService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, OfferCandidateService<? extends Offer> offerCandidateService, OfferUsageValidator offerUsageValidator, OfferCodeUsageValidator offerCodeUsageValidator, VoucherOfferUsageValidator voucherOfferUsageValidator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.broadleafcommerce.promotion.offer.client.web.context.discounts.OrderResponseapplyOffers(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, EnhancedOrder order)org.springframework.http.ResponseEntity<com.broadleafcommerce.common.error.ApiError>handleBadOrderException(Exception ex, org.springframework.web.context.request.WebRequest request)protected voidlogDebug(Exception ex, org.springframework.web.context.request.WebRequest request)com.broadleafcommerce.promotion.offer.client.web.context.CodeUsabilityInforetrieveCodeUsability(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String code)com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResultvalidateOfferUsage(javax.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, List<String> offerCodes, List<String> offerIds)com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResultvalidateVouchers(javax.servlet.http.HttpServletRequest request, EnhancedOrder order, boolean postCheckout, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
-
-
Field Detail
-
BASE_URI
public static final String BASE_URI
- See Also:
- Constant Field Values
-
auditService
protected final OfferAuditDetailService<? extends OfferAuditDetail> auditService
-
offerService
protected final OfferService<? extends Offer> offerService
-
offerUserService
protected final OfferUserService offerUserService
-
offerEngineService
protected final OfferEngineService offerEngineService
-
typeFactory
protected final com.broadleafcommerce.common.extension.TypeFactory typeFactory
-
offerCandidateService
protected final OfferCandidateService<? extends Offer> offerCandidateService
-
offerUsageValidator
protected final OfferUsageValidator offerUsageValidator
-
offerCodeUsageValidator
protected final OfferCodeUsageValidator offerCodeUsageValidator
-
voucherOfferUsageValidator
protected final VoucherOfferUsageValidator voucherOfferUsageValidator
-
-
Constructor Detail
-
OfferEngineEndpoint
public OfferEngineEndpoint(OfferAuditDetailService<? extends OfferAuditDetail> auditService, OfferService<? extends Offer> offerService, OfferUserService offerUserService, OfferEngineService offerEngineService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, OfferCandidateService<? extends Offer> offerCandidateService, OfferUsageValidator offerUsageValidator, OfferCodeUsageValidator offerCodeUsageValidator, VoucherOfferUsageValidator voucherOfferUsageValidator)
-
-
Method Detail
-
retrieveCodeUsability
@FrameworkGetMapping("/code-use/{code}") public com.broadleafcommerce.promotion.offer.client.web.context.CodeUsabilityInfo retrieveCodeUsability(javax.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("code") String code)
-
validateOfferUsage
@FrameworkGetMapping("/validate-uses") public com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult validateOfferUsage(javax.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, @RequestParam List<String> offerCodes, @RequestParam List<String> offerIds)
-
applyOffers
@FrameworkPostMapping("/apply") public com.broadleafcommerce.promotion.offer.client.web.context.discounts.OrderResponse applyOffers(javax.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody EnhancedOrder order)
-
validateVouchers
@FrameworkPostMapping("/validate-vouchers") public com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult validateVouchers(javax.servlet.http.HttpServletRequest request, @RequestBody EnhancedOrder order, @RequestParam(required=false,defaultValue="true") boolean postCheckout, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
handleBadOrderException
@ExceptionHandler(BadOrderDataException.class) public org.springframework.http.ResponseEntity<com.broadleafcommerce.common.error.ApiError> handleBadOrderException(Exception ex, org.springframework.web.context.request.WebRequest request)
-
logDebug
protected void logDebug(Exception ex, org.springframework.web.context.request.WebRequest request)
-
-