using System; using System.Collections.Generic; using AyaNova.Biz; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; namespace AyaNova.Models { //NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal, //otherwise the server will call it an invalid record if the field isn't sent from client public class UnitModel : ICoreBizObjectModel { public long Id { get; set; } public uint Concurrency { get; set; } [Required] public string Name { get; set; } public bool Active { get; set; } public string Notes { get; set; } public string Wiki { get; set; } public string CustomFields { get; set; } public List Tags { get; set; } public long? VendorId { get; set; } [NotMapped] public string VendorViz { get; set; } public string UPC { get; set; } public bool LifeTimeWarranty { get; set; } public DateTime? IntroducedDate { get; set; } public bool Discontinued { get; set; } public DateTime? DiscontinuedDate { get; set; } public int? WarrantyLength { get; set; }//MONTHS public string WarrantyTerms { get; set; } public UnitModel() { Tags = new List(); } [NotMapped, JsonIgnore] public AyaType AyaType { get => AyaType.UnitModel; } [JsonIgnore]//hide from being returned (as null anyway) with User object in routes public Vendor Vendor { get; set; } }//eoc }//eons /* CREATE TABLE [dbo].[AUNITMODEL]( [AID] [uniqueidentifier] NOT NULL, [ANOTES] [ntext] NULL, [ACREATED] [datetime] NOT NULL, [AMODIFIED] [datetime] NOT NULL, [AACTIVE] [bit] NOT NULL, [ACREATOR] [uniqueidentifier] NOT NULL, [AMODIFIER] [uniqueidentifier] NOT NULL, [ANAME] [nvarchar](255) NULL, [AMODELNUMBER] [nvarchar](255) NULL, [AVENDORID] [uniqueidentifier] NULL, [AUPC] [nvarchar](255) NULL, [AUNITMODELCATEGORYID] [uniqueidentifier] NULL,//TAG [ALIFETIMEWARRANTY] [bit] NOT NULL, [AINTRODUCEDDATE] [datetime] NULL, [ADISCONTINUED] [bit] NOT NULL, [ADISCONTINUEDDATE] [datetime] NULL, [AWARRANTYLENGTH] [int] NULL, [AWARRANTYTERMS] [nvarchar](255) NULL, [ACUSTOM1] [ntext] NULL, [ACUSTOM2] [ntext] NULL, [ACUSTOM3] [ntext] NULL, [ACUSTOM4] [ntext] NULL, [ACUSTOM5] [ntext] NULL, [ACUSTOM6] [ntext] NULL, [ACUSTOM7] [ntext] NULL, [ACUSTOM8] [ntext] NULL, [ACUSTOM9] [ntext] NULL, [ACUSTOM0] [ntext] NULL, */