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
Modifier and TypeFieldDescriptionprotected final OfferAuditDetailService<? extends OfferAuditDetail>
static final String
protected final OfferAndOfferCodeUsabilityService
protected final OfferAndOfferCodeUsageValidator
protected final OfferCandidateService<? extends Offer>
protected final OfferEngineService
protected final OfferService<? extends Offer>
protected final OfferUserService
protected final com.broadleafcommerce.common.extension.TypeFactory
protected final VoucherOfferUsageValidator
-
Constructor Summary
ConstructorDescriptionOfferEngineEndpoint
(OfferAuditDetailService<? extends OfferAuditDetail> auditService, OfferService<? extends Offer> offerService, OfferUserService offerUserService, OfferEngineService offerEngineService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, OfferCandidateService<? extends Offer> offerCandidateService, OfferAndOfferCodeUsageValidator offerandOfferCodeUsageValidator, VoucherOfferUsageValidator voucherOfferUsageValidator, OfferAndOfferCodeUsabilityService offerAndOfferCodeUsabilityService, AuditVerficationProperties auditVerificationProperties) -
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.promotion.offer.client.web.context.discounts.OrderResponse
applyOffers
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, EnhancedOrder order) com.broadleafcommerce.promotion.offer.client.web.context.discounts.OrderResponse
evaluateOffers
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, EnhancedOrder order) protected AuditVerficationProperties
org.springframework.http.ResponseEntity<com.broadleafcommerce.common.error.ApiError>
handleBadOrderException
(Exception ex, org.springframework.web.context.request.WebRequest request) protected void
retrieveCodeUsability
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, List<String> codes) void
updateAuditVerificationProperties
(String flow, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, boolean skipChecksByDefault) com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult
validateOfferUsage
(jakarta.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.OfferAndOfferCodeUsageValidationResult
validateVouchers
(jakarta.servlet.http.HttpServletRequest request, EnhancedOrder order, boolean postCheckout, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
-
Field Details
-
BASE_URI
- See Also:
-
auditService
-
offerService
-
offerUserService
-
offerEngineService
-
typeFactory
protected final com.broadleafcommerce.common.extension.TypeFactory typeFactory -
offerCandidateService
-
offerandOfferCodeUsageValidator
-
voucherOfferUsageValidator
-
offerAndOfferCodeUsabilityService
-
-
Constructor Details
-
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, OfferAndOfferCodeUsageValidator offerandOfferCodeUsageValidator, VoucherOfferUsageValidator voucherOfferUsageValidator, OfferAndOfferCodeUsabilityService offerAndOfferCodeUsabilityService, AuditVerficationProperties auditVerificationProperties)
-
-
Method Details
-
retrieveCodeUsability
@FrameworkGetMapping("/code-use/{codes}") public Map<String,com.broadleafcommerce.promotion.offer.client.web.context.CodeUsabilityInfo> retrieveCodeUsability(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestHeader(value="X-Customer-Context",required=false) com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext customerContext, @PathVariable("codes") List<String> codes) -
validateOfferUsage
@FrameworkGetMapping("/validate-uses") public com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult validateOfferUsage(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestHeader(value="X-Customer-Context",required=false) 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(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody EnhancedOrder order) -
evaluateOffers
@FrameworkPostMapping("/evaluate-offers") public com.broadleafcommerce.promotion.offer.client.web.context.discounts.OrderResponse evaluateOffers(jakarta.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(jakarta.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
-
updateAuditVerificationProperties
public void updateAuditVerificationProperties(String flow, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, boolean skipChecksByDefault) -
getAuditVerificationProperties
-