using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; using AyaNova.Biz; namespace AyaNova.Models { public class WorkOrderItemLoan : ICoreBizObjectModel { public long Id { get; set; } public uint Concurrency { get; set; } public string Notes { get; set; } public DateTime? OutDate { get; set; } public DateTime? DueDate { get; set; } public DateTime? ReturnDate { get; set; } [Required] public decimal Charges { get; set; } public long? TaxCodeId { get; set; } [Required] public long LoanUnitId { get; set; } [Required] public decimal Quantity { get; set; } [Required] public LoanUnitRateUnit Rate { get; set; } //UTILITY FIELDS [NotMapped] public bool IsDirty { get; set; } = false;//never dirty coming from the server [Required] public long WorkOrderItemId { get; set; } [JsonIgnore] public WorkOrderItem WorkOrderItem { get; set; } [NotMapped, JsonIgnore] public AyaType AyaType { get => AyaType.WorkOrderItemLoan; } }//eoc }//eons /* CREATE TABLE [dbo].[AWORKORDERITEMLOAN]( [AID] [uniqueidentifier] NOT NULL, [AWORKORDERITEMID] [uniqueidentifier] NOT NULL, [ACREATED] [datetime] NULL, [AMODIFIED] [datetime] NULL, [ACREATOR] [uniqueidentifier] NULL, [AMODIFIER] [uniqueidentifier] NULL, [ANOTES] [ntext] NULL, [AOUTDATE] [datetime] NULL, [ADUEDATE] [datetime] NULL, [ARETURNDATE] [datetime] NULL, [ACHARGES] [decimal](19, 5) NOT NULL, [ATAXCODEID] [uniqueidentifier] NULL, [ALOANITEMID] [uniqueidentifier] NOT NULL, [AQUANTITY] [decimal](19, 5) NOT NULL, [ARATE] [smallint] NOT NULL */