public Incentive(Trader traderAssigned, IncentiveDefinition incentiveDefinition, DateTime expirationDate, int value) { TraderAssigned = traderAssigned; Type = incentiveDefinition; DateExpiring = expirationDate; Value = value; }
public Incentive AssignIncentive(IncentiveDefinition incentiveDefinition, IIncentiveValueCalculator incentiveValueCalculator, ISystemClock systemClock) { var incentiveValue = incentiveValueCalculator.CalculateValue(this, incentiveDefinition); var expirationDate = incentiveDefinition.CalculateExpirationDate(systemClock); var incentive = new Incentive(this, incentiveDefinition, expirationDate, incentiveValue); _assignedIncentives.Add(incentive); return(incentive); }
public override DateTime CalculateExpirationDate(IncentiveDefinition incentiveDefinition, ISystemClock systemClock) { return(_beginDate.AddDays(incentiveDefinition.DaysValid)); }
public abstract DateTime CalculateExpirationDate(IncentiveDefinition incentiveDefinition, ISystemClock systemClock);