diff --git a/server/biz/SubscriptionBiz.cs b/server/biz/SubscriptionBiz.cs index a3e7ea0..5c86297 100644 --- a/server/biz/SubscriptionBiz.cs +++ b/server/biz/SubscriptionBiz.cs @@ -312,9 +312,15 @@ namespace Sockeye.Biz { if (!vc.Has("productname", item.ProductId)) { - vc.Add(await ct.Product.AsNoTracking().Where(x => x.Id == item.ProductId).Select(x => x.Name).FirstOrDefaultAsync(), "productname", item.ProductId); + var productInfo = await ct.Product.AsNoTracking().Where(x => x.Id == item.ProductId).FirstOrDefaultAsync(); + vc.Add(productInfo.Name, "productname", item.ProductId); + vc.Add(productInfo.InitialPrice.ToString(), "productinitialprice", item.ProductId); + vc.Add(productInfo.RenewPrice.ToString(), "productrenewprice", item.ProductId); + } item.ProductViz = vc.Get("productname", item.ProductId); + item.RenewPriceViz = vc.GetAsDecimal("productrenewprice", item.ProductId) ?? 0; + item.InitialPriceViz = vc.GetAsDecimal("productinitialprice", item.ProductId) ?? 0; } } diff --git a/server/models/Product.cs b/server/models/Product.cs index 31f1368..04ac012 100644 --- a/server/models/Product.cs +++ b/server/models/Product.cs @@ -15,8 +15,13 @@ namespace Sockeye.Models [Required] public string Name { get; set; } public bool Active { get; set; } + + public decimal InitialPrice { get; set; } = 0; + public decimal RenewPrice { get; set; } = 0; + + [Required] - public ProductGroup PGroup {get;set;} + public ProductGroup PGroup { get; set; } public long VendorId { get; set; } public TimeSpan LicenseInterval { get; set; } public TimeSpan MaintInterval { get; set; } diff --git a/server/models/SubscriptionItem.cs b/server/models/SubscriptionItem.cs index 0de671a..8547e00 100644 --- a/server/models/SubscriptionItem.cs +++ b/server/models/SubscriptionItem.cs @@ -19,8 +19,7 @@ namespace Sockeye.Models public bool Active { get; set; } [Required] public long ProductId { get; set; } - [NotMapped] - public string ProductViz { get; set; } + [Required] public DateTime ExpireDate { get; set; } [Required] @@ -30,6 +29,16 @@ namespace Sockeye.Models [Required] public DateTime OriginalOrderDate { get; set; } + public bool Renewal { get; set; } + + [NotMapped] + public decimal RenewPriceViz { get; set; } = 0; + [NotMapped] + public decimal InitialPriceViz { get; set; } = 0; + + [NotMapped] + public string ProductViz { get; set; } + public List Tags { get; set; } = new List();