Interface AlternateLifecycleOfferAuditSummaryRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>

Type Parameters:
D - The repository entity type
All Known Subinterfaces:
JpaOfferAuditSummaryRepository<D>, OfferAuditSummaryRepository<D>
All Known Implementing Classes:
JpaAlternateLifecycleOfferAuditSummaryRepository

public interface AlternateLifecycleOfferAuditSummaryRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
Provides an alternate path for handling persistence for OfferAuditSummary. Implementations should safely handle creation and update with guaranteed accurate count incrementing under load.
  • Method Summary

    Modifier and Type
    Method
    Description
    createOrUpdateAndIncrement(String offerId, javax.money.MonetaryAmount totalSavings, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Create an instance of OfferAuditSummary, or atomically update an existing one.
  • Method Details

    • createOrUpdateAndIncrement

      @Policy(operationTypes={CREATE,UPDATE}) D createOrUpdateAndIncrement(String offerId, @Nullable javax.money.MonetaryAmount totalSavings, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Create an instance of OfferAuditSummary, or atomically update an existing one. This flow also will not end up creating duplicate summaries for the same offer.
      Parameters:
      offerId - The id of the related offer
      totalSavings - The total savings applied to record for this offer
      contextInfo - Any tenant related information for the request context
      Returns:
      The created or updated summary