using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using AyaNova.Biz; using Newtonsoft.Json; using System; namespace AyaNova.Models { public class Contract : 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; } //any optional ones here sb zero to indicate not set (or equivalent to zero) [Required] public TimeSpan ResponseTime { get; set; } [NotMapped] public string ResponseTimeViz { get; set; } [Required] public bool ContractServiceRatesOnly { get; set; } [Required] public bool ContractTravelRatesOnly { get; set; } [Required] public decimal PartsOverridePct { get; set; } [Required] public ContractOverrideType PartsOverrideType { get; set; } [NotMapped] public string PartsOverrideTypeViz { get; set; } [Required] public decimal ServiceRatesOverridePct { get; set; } [Required] public ContractOverrideType ServiceRatesOverrideType { get; set; } [NotMapped] public string ServiceRatesOverrideTypeViz { get; set; } [Required] public decimal TravelRatesOverridePct { get; set; } [Required] public ContractOverrideType TravelRatesOverrideType { get; set; } [NotMapped] public string TravelRatesOverrideTypeViz { get; set; } public string AlertNotes { get; set; }//alert on workorder etc public List ServiceRateItems { get; set; } = new List(); public List TravelRateItems { get; set; } = new List(); public List ContractPartOverrideItems { get; set; } = new List(); public List ContractTravelRateOverrideItems { get; set; } = new List(); public List ContractServiceRateOverrideItems { get; set; } = new List(); public Contract() { Tags = new List(); } [NotMapped, JsonIgnore] public AyaType AyaType { get => AyaType.Contract; } }//eoc }//eons /* CREATE TABLE [dbo].[ACONTRACT]( [AID] [uniqueidentifier] NOT NULL, [ACREATOR] [uniqueidentifier] NULL, [AMODIFIER] [uniqueidentifier] NULL, [ACREATED] [datetime] NULL, [AMODIFIED] [datetime] NULL, [ADISCOUNTPARTS] [decimal](19, 5) NULL,//rename PartsOverride [ANAME] [nvarchar](255) NULL, [AACTIVE] [bit] NOT NULL, [ANOTES] [ntext] NULL, [ACONTRACTRATESONLY] [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, [AREGIONID] [uniqueidentifier] NULL, CHILDREN ContractRate - specific contract rates available to contract holding entities only ContractTravel - specific contract travel rates only '' ContractRateOverride - tags and discount / markup to apply collection ContractTravelOverride - '' ContractPartOverride - '' */