Files
raven/server/AyaNova/models/WorkOrder.cs
2021-03-23 23:26:33 +00:00

129 lines
3.9 KiB
C#

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
namespace AyaNova.Models
{
//Data transfer no child collections
public class dtWorkOrder : ICoreBizObjectModel
{
public dtWorkOrder()
{
Tags = new List<string>();
}
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public long Serial { 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; }
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrder; }
}//eoc
/*
todo: Consider adding latitude / longitude to wo, quote, pm objects
can copy over from the unit or customer or set themselves
and can always hide
means wo could be scheduled for ad-hoc locations and serviced that way, i.e. a truck parked on the side of the highway etc
*/
public class WorkOrder : ICoreBizObjectModel
{
public WorkOrder()
{
Tags = new List<string>();
//dependents
Items = new List<WorkOrderItem>();
}
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public long Serial { 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; }
// [Required]
// public long CustomerId {get;set;}
//dependents
public List<WorkOrderItem> Items { get; set; }
// [NotMapped, JsonIgnore]
// public string Name
// {
// //Used by notification processor
// get
// {
// return this.Serial.ToString();
// }
// }
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrder; }
}//eoc
}//eons
/*
CREATE TABLE [dbo].[AWORKORDER](
[AID] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NOT NULL,
[AMODIFIED] [datetime] NOT NULL,
[ACREATOR] [uniqueidentifier] NOT NULL,
[AMODIFIER] [uniqueidentifier] NOT NULL,
[ACLIENTID] [uniqueidentifier] NULL,
[APROJECTID] [uniqueidentifier] NULL,
[AINTERNALREFERENCENUMBER] [nvarchar](255) NULL,
[ACUSTOMERREFERENCENUMBER] [nvarchar](255) NULL,
[AONSITE] [bit] NOT NULL,
[ACUSTOMERCONTACTNAME] [nvarchar](255) NULL,
[AREGIONID] [uniqueidentifier] NULL,
[AWORKORDERTYPE] [smallint] NULL,
[AFORMLAYOUTID] [uniqueidentifier] NULL,//### DROP NOT PORTED
[ASUMMARY] [nvarchar](255) NULL,
[AWORKORDERCATEGORYID] [uniqueidentifier] NULL,
[ACLOSED] [bit] NOT NULL,
[ASERVICECOMPLETED] [bit] NOT NULL,
[AFROMQUOTEID] [uniqueidentifier] NULL,
[AFROMPMID] [uniqueidentifier] NULL,
[ATEMPLATEDESCRIPTION] [nvarchar](255) NULL,
[ATEMPLATEFRESHPRICE] [bit] NOT NULL,//?? DO NOT PORT??
CREATE TABLE [dbo].[AWORKORDERSERVICE](
[AID] [uniqueidentifier] NOT NULL,
[AWORKORDERID] [uniqueidentifier] NOT NULL,
[ACREATOR] [uniqueidentifier] NOT NULL,
[AMODIFIER] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NOT NULL,
[AMODIFIED] [datetime] NOT NULL,
[AWORKORDERSTATUSID] [uniqueidentifier] NULL,
[ASERVICEDATE] [datetime] NULL,
[AINVOICENUMBER] [nvarchar](255) NULL,
[ASERVICENUMBER] [int] IDENTITY(1,1) NOT NULL,
[AQUOTEWORKORDERID] [uniqueidentifier] NULL,
[ACLIENTREQUESTID] [uniqueidentifier] NULL,
[APREVENTIVEMAINTENANCEID] [uniqueidentifier] NULL,
[ACLOSEBYDATE] [datetime] NULL,
[ASIGNATURE] [ntext] NULL,
[ASIGNED] [datetime] NULL,
*/