java.lang.Object
com.broadleafcommerce.promotion.offer.web.endpoint.OffersEndpoint

@FrameworkRestController @FrameworkMapping("/offers") @DataRouteByExample(Offer.class) public class OffersEndpoint extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    OffersEndpoint(OfferService<Offer> service, OfferCodeService<OfferCode> offerCodeService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createOffer(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, Offer req)
     
    createOfferCode(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, OfferCode req)
     
    void
    deleteOffer(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id)
     
    void
    deleteOfferCode(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, String codeId)
     
    protected Offer
    ensureOfferExistsAndReturn(@NonNull String offerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
     
    protected OfferService<Offer>
     
    protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation>
     
    org.springframework.data.domain.Page<Offer>
    readAllOffers(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String query, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
     
    readOfferById(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String offerId)
     
    readOfferByIds(jakarta.servlet.http.HttpServletRequest request, List<String> offerIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    readOfferCodeById(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, String codeId)
     
    org.springframework.data.domain.Page<OfferCode>
    readOfferCodesByOffer(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
     
    com.broadleafcommerce.translation.service.dto.TranslationsPayload
    replaceAllOfferTranslations(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Locale locale, com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest)
     
    replaceOffer(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Offer req)
     
    replaceOfferCode(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, String codeId, OfferCode req)
     
    updateOffer(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Offer req)
     
    updateOfferCode(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, String codeId, OfferCode req)
     
    protected void
    validateOfferCodeForOffer(@NonNull String offerId, @NonNull String codeId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • OffersEndpoint

      public OffersEndpoint(OfferService<Offer> service, OfferCodeService<OfferCode> offerCodeService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
  • Method Details

    • readAllOffers

      @FrameworkGetMapping @Policy(permissionRoots="OFFER") public org.springframework.data.domain.Page<Offer> readAllOffers(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestParam(value="q",required=false) String query, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
    • readOfferById

      @FrameworkGetMapping("/{id}") @Policy(permissionRoots="OFFER") public Offer readOfferById(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String offerId)
    • readOfferByIds

      @FrameworkGetMapping(params="offerIds") @Policy(permissionRoots="OFFER") public List<Offer> readOfferByIds(jakarta.servlet.http.HttpServletRequest request, @RequestParam(value="offerIds",required=true) List<String> offerIds, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • updateOffer

      @FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="OFFER") public Offer updateOffer(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Offer req)
    • replaceOffer

      @FrameworkPutMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="OFFER") public Offer replaceOffer(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Offer req)
    • replaceAllOfferTranslations

      @FrameworkPutMapping(value="/{id}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="OFFER") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllOfferTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest)
    • createOffer

      @FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="OFFER") public Offer createOffer(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody Offer req)
    • deleteOffer

      @FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="OFFER") public void deleteOffer(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
    • readOfferCodeById

      @FrameworkGetMapping("/{id}/offer-codes/{codeId}") @Policy(permissionRoots={"OFFER","OFFER_CODE"}) public OfferCode readOfferCodeById(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PathVariable("codeId") String codeId)
    • readOfferCodesByOffer

      @FrameworkGetMapping("/{id}/offer-codes") @Policy(permissionRoots={"OFFER","OFFER_CODE"}) public org.springframework.data.domain.Page<OfferCode> readOfferCodesByOffer(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
    • updateOfferCode

      @FrameworkPatchMapping(value="/{id}/offer-codes/{codeId}", consumes="application/json") @Policy(permissionRoots={"OFFER","OFFER_CODE"}) public OfferCode updateOfferCode(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PathVariable("codeId") String codeId, @RequestBody OfferCode req)
    • replaceOfferCode

      @FrameworkPutMapping(value="/{id}/offer-codes/{codeId}", consumes="application/json") @Policy(permissionRoots={"OFFER","OFFER_CODE"}) public OfferCode replaceOfferCode(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PathVariable("codeId") String codeId, @RequestBody OfferCode req)
    • createOfferCode

      @FrameworkPostMapping(value="/{id}/offer-codes", consumes="application/json") @Policy(permissionRoots={"OFFER","OFFER_CODE"}) public OfferCode createOfferCode(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody OfferCode req)
    • deleteOfferCode

      @FrameworkDeleteMapping("/{id}/offer-codes/{codeId}") @Policy(permissionRoots={"OFFER","OFFER_CODE"}) public void deleteOfferCode(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @PathVariable("codeId") String codeId)
    • validateOfferCodeForOffer

      protected void validateOfferCodeForOffer(@NonNull @NonNull String offerId, @NonNull @NonNull String codeId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • ensureOfferExistsAndReturn

      protected Offer ensureOfferExistsAndReturn(@NonNull @NonNull String offerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • getService

      protected OfferService<Offer> getService()
    • getOfferCodeService

      protected OfferCodeService<OfferCode> getOfferCodeService()
    • getTranslationEntityService

      protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()