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 //about to make major changes commit trigger here //MIRRORED IN QBI !!!! public class Part : ICoreBizObjectModel { public long Id { get; set; } public uint Concurrency { get; set; } [Required] public string Name { get; set; }//was partnumber in v7 [Required] public bool Active { get; set; } public string Description { get; set; }//was "name" in v7 public string Notes { get; set; } public string Wiki { get; set; } public string CustomFields { get; set; } public List Tags { get; set; } public long? ManufacturerId { get; set; } [NotMapped] public string ManufacturerViz { get; set; } public string ManufacturerNumber { get; set; } public long? WholeSalerId { get; set; } [NotMapped] public string WholeSalerViz { get; set; } public string WholeSalerNumber { get; set; } public long? AlternativeWholeSalerId { get; set; } [NotMapped] public string AlternativeWholeSalerViz { get; set; } public string AlternativeWholeSalerNumber { get; set; } [Required] public decimal Cost { get; set; } [Required] public decimal Retail { get; set; } public string UnitOfMeasure { get; set; } public string UPC { get; set; } [NotMapped] public string PartSerialsViz { get; set; } public Part() { Tags = new List(); Active = true; Cost = 0m; Retail = 0m; } [NotMapped, JsonIgnore] public AyaType AyaType { get => AyaType.Part; } }//eoc }//eons /* CREATE TABLE [dbo].[APART]( [AID] [uniqueidentifier] NOT NULL, [ACREATED] [datetime] NULL, [AMODIFIED] [datetime] NULL, [AACTIVE] [bit] NOT NULL, [ACREATOR] [uniqueidentifier] NULL, [AMODIFIER] [uniqueidentifier] NULL, [ANAME] [nvarchar](255) NULL, [AALERT] [ntext] NULL,//DROP was deprecated and unusued in v7 [ANOTES] [ntext] NULL, [APARTNUMBER] [nvarchar](255) NOT NULL, [APARTCATEGORYID] [uniqueidentifier] NULL,//DROP now a tag [AMANUFACTURERID] [uniqueidentifier] NULL, [AWHOLESALERID] [uniqueidentifier] NULL, [AMANUFACTURERNUMBER] [nvarchar](255) NULL, [AWHOLESALERNUMBER] [nvarchar](255) NULL, [AALTERNATIVEWHOLESALERID] [uniqueidentifier] NULL, [AALTERNATIVEWHOLESALERNUMBER] [nvarchar](255) NULL, [ACOST] [decimal](19, 5) NULL, [ARETAIL] [decimal](19, 5) NULL, [AUNITOFMEASUREID] [uniqueidentifier] NULL,//convert to text and store inside the part instead of in another table to reduce join dependencies [APARTASSEMBLYID] [uniqueidentifier] NULL,//DROP, Migrate into new partassemblyitem [AUPC] [nvarchar](255) NULL, [ATRACKSERIALNUMBER] [bit] NOT 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, */