using gehGassiApp.Domain.Common; namespace gehGassiApp.Domain.Subscriptions { /// /// Repräsentiert ein Abonnement /// public class Subscription { /// /// Eindeutige Id /// public string Id { get; set; } /// /// Code des Abonnements /// public string Code { get; set; } /// /// Länge des Abonnements /// public SubscriptionLength Length { get; set; } /// /// Preis des Abonnements /// public decimal Price { get; set; } /// /// Art des Abonnements - für welchen Benutzer-Typ? /// public AppMode AppMode { get; set; } /// /// Zeit in Tagen die als Toleranz bei Ablauf akzeptiert wird /// public int GracePeriodInDays { get; set; } /// /// Ist das Abonnement ausgeblendet? /// public bool Hidden { get; set; } /// /// Optional: the Max registered date of the app user to see this subscription /// public DateTimeOffset? MaxRegisteredDate { get; set; } /// /// Name des Abonnements - übersetzt /// public string Name { get; set; } /// /// Beschreibung des Abonnements - übersetzt /// public string Description { get; set; } /// /// Helper to calculate the current expiration date for Android /// /// DateTime /// DateTime public DateTime AddLenght(DateTime date) { switch (Length) { case SubscriptionLength.OneWeek: return date.AddDays(7); case SubscriptionLength.OneMonth: return date.AddMonths(1); case SubscriptionLength.ThreeMonths: return date.AddMonths(3); case SubscriptionLength.SixMonths: return date.AddMonths(6); case SubscriptionLength.OneYear: return date.AddYears(1); default: return date; } } } }