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.CampaignCodeUsabilityInfo
getCodeUsability(String campaignCode, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Checks the usability of the providedcampaignCode
by: 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 providedcampaignCode
by:- 1. Determine any related
CampaignCode
for 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
CampaignCodeUsabilityInfo
which contains a boolean to tell if the code can be used and a detailed structure informing on the code usage.
- 1. Determine any related
-
-