Interface CodeUsabilityService
-
- All Known Implementing Classes:
DefaultCodeUsabilityService
public interface CodeUsabilityService- Author:
- Chad Harchar (charchar)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.broadleafcommerce.promotion.campaign.client.web.context.CampaignCodeUsabilityInfogetCodeUsability(String campaignCode, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Checks the usability of the providedcampaignCodeby: 1.
-
-
-
Method Detail
-
getCodeUsability
@NonNull com.broadleafcommerce.promotion.campaign.client.web.context.CampaignCodeUsabilityInfo getCodeUsability(@NonNull String campaignCode, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Checks the usability of the providedcampaignCodeby:- 1. Determine any related
CampaignCodefor the provided string. - 2. Count the number of times that campaign code has been used by querying against related
CampaignCodeAuditDetail. - 3. Add the corresponding
Campaign#getTrackingIdentifier()for the campaign code to the structure. - 4. If there are any usable codes, set
CampaignCodeUsabilityType.USABLE.
- Parameters:
campaignCode- The code to check usability against.contextInfo- context information around sandboxing and multitenant state- Returns:
- a
CampaignCodeUsabilityInfowhich contains a boolean to tell if the code can be used and a detailed structure informing on the code usage.
- 1. Determine any related
-
-