using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; using Sockeye.Biz; namespace Sockeye.Models { public class Purchase : ICoreBizObjectModel { public long Id { get; set; } public uint Concurrency { get; set; } public long? CustomerId { get; set; } [NotMapped] public string CustomerViz { get; set; } [Required] public long VendorId { get; set; } [NotMapped] public string VendorViz { get; set; } [Required] public long ProductId { get; set; } [Required] public ProductGroup PGroup {get;set;} [NotMapped] public string ProductViz { get; set; } public string SalesOrderNumber { get; set; } [Required] public DateTime PurchaseDate { get; set; } public DateTime? ExpireDate { get; set; } public DateTime? CancelDate { get; set; } public string CouponCode { get; set; } public string Notes { get; set; } public bool RenewNoticeSent { get; set; } = false; public int Quantity { get; set; } = 1; public string VendorData { get; set; } public DateTime? ProcessedDate { get; set; } public string Wiki { get; set; } public List Tags { get; set; } //workaround for notification [NotMapped, JsonIgnore] public string Name { get; set; } public Purchase() { Tags = new List(); } [NotMapped, JsonIgnore] public SockType SType { get => SockType.Purchase; } }//eoc }//eons