Class RewardDescription

Description object representing the result of a promotion evaluation. Provides information to the caller about reward type, amount and whether the promotion was fulfilled or not.

Inheritance
System.Object
RewardDescription
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0
Syntax
public class RewardDescription

Constructors

RewardDescription(FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionData, Decimal, Decimal, RewardType, String)

Initializes a new instance of the RewardDescription class.

Declaration
public RewardDescription(FulfillmentStatus status, IEnumerable<RedemptionDescription> redemptions, PromotionData promotion, decimal unitDiscount, decimal unitPercentage, RewardType rewardType, string description)
Parameters
Type Name Description
FulfillmentStatus status

The promotion's FulfillmentStatus.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

A collection of RedemptionDescriptions.

PromotionData promotion

The promotion.

System.Decimal unitDiscount

The discount to apply per unit when the discount type is money.

System.Decimal unitPercentage

The discount to apply per unit when the discount type is percentage.

RewardType rewardType

The reward type.

System.String description

The description.

Properties

AppliedCoupon

Gets or sets any coupon code that has been applied to this reward.

Declaration
public string AppliedCoupon { get; set; }
Property Value
Type Description
System.String

Description

Gets or sets a description of the promotion result.

Declaration
public string Description { get; set; }
Property Value
Type Description
System.String
Remarks

The value of this property is intended to be used for logging and debugging purposes. You should not assume that this text is fit for presenting to an end-user.

Percentage

Gets the discount amount when the discount type is percentage.

Declaration
public decimal Percentage { get; }
Property Value
Type Description
System.Decimal

Promotion

Gets the promotion.

Declaration
public PromotionData Promotion { get; }
Property Value
Type Description
PromotionData

Redemptions

Gets the redemptions.

Declaration
public IEnumerable<RedemptionDescription> Redemptions { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<RedemptionDescription>

RewardType

Gets the reward typed, can be percentage, amount or free.

Declaration
public RewardType RewardType { get; }
Property Value
Type Description
RewardType

SavedAmount

Gets the amount of money this reward has given the order.

Declaration
public decimal SavedAmount { get; }
Property Value
Type Description
System.Decimal

Status

Gets the status.

Declaration
public FulfillmentStatus Status { get; }
Property Value
Type Description
FulfillmentStatus

UnitDiscount

Gets the discount amount when the discount type is money.

Declaration
public decimal UnitDiscount { get; }
Property Value
Type Description
System.Decimal

Methods

CreateFreeItemReward(FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionData, String)

Create a new reward of the type Free

Declaration
public static RewardDescription CreateFreeItemReward(FulfillmentStatus status, IEnumerable<RedemptionDescription> redemptions, PromotionData promotion, string description)
Parameters
Type Name Description
FulfillmentStatus status

If the reward is fulfilled or not.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

The items this reward affects.

PromotionData promotion

The promotion that has generated this reward.

System.String description

An optional description of the reward.

Returns
Type Description
RewardDescription

A description of a reward that has a free item discount.

CreateGiftItemsReward(FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionData, String)

Create a new reward of the type Gift

Declaration
public static RewardDescription CreateGiftItemsReward(FulfillmentStatus status, IEnumerable<RedemptionDescription> redemptions, PromotionData promotion, string description)
Parameters
Type Name Description
FulfillmentStatus status

If the reward is fulfilled or not.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

The items this reward affects.

PromotionData promotion

The promotion that has generated this reward.

System.String description

An optional description of the reward.

Returns
Type Description
RewardDescription

A description of a reward that has gift items discount.

CreateMoneyOrPercentageRewardDescription(FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionData, MonetaryReward, Currency, LocalizationService)

Create new percentage or money reward based on MonetaryReward

Declaration
public static RewardDescription CreateMoneyOrPercentageRewardDescription(FulfillmentStatus status, IEnumerable<RedemptionDescription> redemptions, PromotionData promotion, MonetaryReward discount, Currency currency, LocalizationService localizationService)
Parameters
Type Name Description
FulfillmentStatus status

If the reward is fulfilled or not.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

The items this reward affects.

PromotionData promotion

The promotion that has generated this reward.

MonetaryReward discount

The description of the reward.

Currency currency

The currency to use for money reward.

EPiServer.Framework.Localization.LocalizationService localizationService

The localization service

Returns
Type Description
RewardDescription

A description of a reward that is money or percentage based.

CreateMoneyOrPercentageRewardDescription(FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionData, MonetaryReward, Currency, String)

Create new percentage or money reward based on MonetaryReward

Declaration
public static RewardDescription CreateMoneyOrPercentageRewardDescription(FulfillmentStatus status, IEnumerable<RedemptionDescription> redemptions, PromotionData promotion, MonetaryReward discount, Currency currency, string description)
Parameters
Type Name Description
FulfillmentStatus status

If the reward is fulfilled or not.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

The items this reward affects.

PromotionData promotion

The promotion that has generated this reward.

MonetaryReward discount

The description of the reward.

Currency currency

The currency to use for money reward.

System.String description

The description for the reward.

Returns
Type Description
RewardDescription

A description of a reward that is money or percentage based.

CreateMoneyReward(FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionData, Decimal, String)

Create a new reward of the type Money

Declaration
public static RewardDescription CreateMoneyReward(FulfillmentStatus status, IEnumerable<RedemptionDescription> redemptions, PromotionData promotion, decimal unitDiscount, string description)
Parameters
Type Name Description
FulfillmentStatus status

If the reward is fulfilled or not.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

The items this reward affects.

PromotionData promotion

The promotion that has generated this reward.

System.Decimal unitDiscount

The discount to add per unit.

System.String description

An optional description of the reward.

Returns
Type Description
RewardDescription

A description of a reward that has a money discount.

CreateNotFulfilledDescription(PromotionData, FulfillmentStatus)

Creates a new reward for a promotion that was not applied.

Declaration
public static RewardDescription CreateNotFulfilledDescription(PromotionData promotion, FulfillmentStatus reason)
Parameters
Type Name Description
PromotionData promotion

The promotion.

FulfillmentStatus reason

A reason the promotion was not applied. Used when setting Status by masking it onto NotFulfilled.

Returns
Type Description
RewardDescription

CreatePercentageReward(FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionData, Decimal, String)

Create a new reward of the type Percentage

Declaration
public static RewardDescription CreatePercentageReward(FulfillmentStatus status, IEnumerable<RedemptionDescription> redemptions, PromotionData promotion, decimal unitPercentage, string description)
Parameters
Type Name Description
FulfillmentStatus status

If the reward is fulfilled or not.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

The items this reward affects.

PromotionData promotion

The promotion that has generated this reward.

System.Decimal unitPercentage

The discount in percentage to add per unit.

System.String description

An optional description of the reward.

Returns
Type Description
RewardDescription

A description of a reward that has a percentage discount.