This commit is contained in:
@@ -1,43 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using AyaNova.Biz;
|
||||
|
||||
|
||||
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 QuoteItem : 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<string> Tags { get; set; }
|
||||
|
||||
//Principle
|
||||
[Required]//this required annotation should cause a cascade delete to happen automatically when wo is deleted, need to test that
|
||||
public long QuoteId { get; set; }//fk
|
||||
public Quote Quote { get; set; }
|
||||
|
||||
//Dependents
|
||||
|
||||
public QuoteItem()
|
||||
{
|
||||
Tags = new List<string>();
|
||||
}
|
||||
|
||||
[NotMapped, JsonIgnore]
|
||||
[NotMapped, JsonIgnore]
|
||||
public AyaType AyaType { get => AyaType.QuoteItem; }
|
||||
|
||||
|
||||
public long Id { get; set; }
|
||||
public uint Concurrency { get; set; }
|
||||
public string Notes { get; set; }//"Summary" field
|
||||
public string Wiki { get; set; }
|
||||
public string CustomFields { get; set; }
|
||||
public List<string> Tags { get; set; } = new List<string>();
|
||||
|
||||
[Required]
|
||||
public long QuoteId { get; set; }
|
||||
public string TechNotes { get; set; }
|
||||
public long? QuoteItemStatusId { get; set; }
|
||||
public long? QuoteItemPriorityId { get; set; }
|
||||
public DateTime? RequestDate { get; set; }
|
||||
public bool WarrantyService { get; set; } = false;
|
||||
public int Sequence { get; set; }
|
||||
|
||||
//workaround for notification
|
||||
[NotMapped, JsonIgnore]
|
||||
public string Name { get; set; }
|
||||
|
||||
//Principle
|
||||
[JsonIgnore]
|
||||
public Quote Quote { get; set; }
|
||||
//dependents
|
||||
public List<QuoteItemExpense> Expenses { get; set; } = new List<QuoteItemExpense>();
|
||||
public List<QuoteItemLabor> Labors { get; set; } = new List<QuoteItemLabor>();
|
||||
public List<QuoteItemLoan> Loans { get; set; } = new List<QuoteItemLoan>();
|
||||
public List<QuoteItemPart> Parts { get; set; } = new List<QuoteItemPart>();
|
||||
public List<QuoteItemScheduledUser> ScheduledUsers { get; set; } = new List<QuoteItemScheduledUser>();
|
||||
public List<QuoteItemTask> Tasks { get; set; } = new List<QuoteItemTask>();
|
||||
public List<QuoteItemTravel> Travels { get; set; } = new List<QuoteItemTravel>();
|
||||
public List<QuoteItemUnit> Units { get; set; } = new List<QuoteItemUnit>();
|
||||
public List<QuoteItemOutsideService> OutsideServices { get; set; } = new List<QuoteItemOutsideService>();
|
||||
|
||||
}//eoc
|
||||
|
||||
}//eons
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CREATE TABLE [dbo].[AQuoteITEM](
|
||||
[AID] [uniqueidentifier] NOT NULL,
|
||||
[AQuoteID] [uniqueidentifier] NOT NULL,
|
||||
[ACREATOR] [uniqueidentifier] NOT NULL,
|
||||
[AMODIFIER] [uniqueidentifier] NOT NULL,
|
||||
[ACREATED] [datetime] NOT NULL,
|
||||
[AMODIFIED] [datetime] NOT NULL,
|
||||
[ATECHNOTES] [ntext] NULL,
|
||||
[AQuoteSTATUSID] [uniqueidentifier] NULL,
|
||||
[APRIORITYID] [uniqueidentifier] NULL,
|
||||
[AREQUESTDATE] [datetime] NULL,
|
||||
[ASUMMARY] [nvarchar](255) NULL,//Now Notes
|
||||
[ATYPEID] [uniqueidentifier] NULL,//Now a tag
|
||||
[AUNITID] [uniqueidentifier] NULL,//MOVED TO WOITEMUNITS COLLECTION
|
||||
[AQuoteITEMUNITSERVICETYPEID] [uniqueidentifier] NULL,//MOVE TO WOITEMUNITS COLLECTION?
|
||||
[AWARRANTYSERVICE] [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
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user