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;
 }
Ejemplo n.º 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()));
        }
Ejemplo n.º 4
0
 public static DateTime CalculateForNew(SubscriptionPeriod period)
 {
     return(SystemClock.Now.AddMonths(period.GetMonthsNumber()));
 }