private void When(SubscriptionRenewedDomainEvent @event)
 {
     this.Id             = @event.SubscriptionId;
     _subscriptionPeriod = SubscriptionPeriod.Of(@event.SubscriptionPeriodCode);
     _status             = SubscriptionStatus.Of(@event.Status);
     _expirationDate     = @event.ExpirationDate;
 }
 private void When(SubscriptionCreatedDomainEvent @event)
 {
     this.Id             = @event.SubscriptionId;
     _subscriberId       = new SubscriberId(@event.PayerId);
     _subscriptionPeriod = SubscriptionPeriod.Of(@event.SubscriptionPeriodCode);
     _countryCode        = @event.CountryCode;
     _status             = SubscriptionStatus.Of(@event.Status);
     _expirationDate     = @event.ExpirationDate;
 }
예제 #3
0
        public static DateTime CalculateForRenewal(DateTime expirationDate, SubscriptionPeriod period)
        {
            if (expirationDate > SystemClock.Now)
            {
                return(expirationDate.AddMonths(period.GetMonthsNumber()));
            }

            return(SystemClock.Now.AddMonths(period.GetMonthsNumber()));
        }
예제 #4
0
 public static DateTime CalculateForNew(SubscriptionPeriod period)
 {
     return(SystemClock.Now.AddMonths(period.GetMonthsNumber()));
 }