Files
sockeye/server/models/Subscription.cs
2023-04-15 19:12:20 +00:00

46 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using Sockeye.Biz;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace Sockeye.Models
{
//https://stackoverflow.com/questions/46517584/how-to-add-a-parent-record-with-its-children-records-in-ef-core#46615455
public class Subscription : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public string Subsite { get; set; } = "main";
public bool Active { get; set; }
[Required]
public ProductGroup PGroup { get; set; }
public long CustomerId { get; set; }
[NotMapped]
public string CustomerViz { get; set; }
public string RegTo { get; set; }
public string FetchEmail { get; set; }//v7 && v8 uses for notification, v7 uses for fetching manually in UI
public string DbId { get; set; }//v8 uses
public string Notes { get; set; }
public List<string> Tags { get; set; }
public List<SubscriptionItem> Items { get; set; } = new List<SubscriptionItem>();
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
[NotMapped, JsonIgnore]
public SockType SType { get => SockType.Subscription; }
}//eoc
}//eons