160 lines
6.0 KiB
C#
160 lines
6.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Newtonsoft.Json;
|
|
using AyaNova.Biz;
|
|
|
|
namespace AyaNova.Models
|
|
{
|
|
|
|
public class PM : ICoreBizObjectModel
|
|
{
|
|
public long Id { get; set; }
|
|
public uint Concurrency { get; set; }
|
|
|
|
[Required]
|
|
public long Serial { get; set; }
|
|
|
|
public string Notes { get; set; }//WAS "SUMMARY"
|
|
public string Wiki { get; set; }
|
|
public string CustomFields { get; set; }
|
|
public List<string> Tags { get; set; } = new List<string>();
|
|
|
|
//----
|
|
public DateTime? StopGeneratingDate { get; set; }
|
|
public DaysOfWeek ExcludeDaysOfWeek { get; set; }//bit field flags set
|
|
public bool Active { get; set; }
|
|
public DateTime NextServiceDate { get; set; }
|
|
public PMTimeUnit RepeatUnit { get; set; }
|
|
public PMTimeUnit GenerateBeforeUnit { get; set; }
|
|
public int RepeatInterval { get; set; }
|
|
public int GenerateBeforeInterval { get; set; }
|
|
public DateTime? GenerateDate { get; set; }//Internal, not exposed to UI and is the date to do the next generate on that takes into account generatebefore and next service date and is calcd when first created and after that when generate happens for next time see pmbiz top with reference v7 code
|
|
//----
|
|
|
|
[Required]
|
|
public long CustomerId { get; set; }
|
|
[NotMapped]
|
|
public string CustomerViz { get; set; }
|
|
|
|
[NotMapped]
|
|
public string CustomerTechNotesViz { get; set; }
|
|
|
|
public long? ProjectId { get; set; }
|
|
[NotMapped]
|
|
public string ProjectViz { get; set; }
|
|
public string InternalReferenceNumber { get; set; }
|
|
public string CustomerReferenceNumber { get; set; }
|
|
public string CustomerContactName { get; set; }
|
|
|
|
public DateTime CreatedDate { get; set; } = DateTime.UtcNow;
|
|
|
|
public bool Onsite { get; set; }
|
|
public long? ContractId { get; set; }
|
|
[NotMapped]
|
|
public string ContractViz { get; set; }
|
|
|
|
|
|
//POSTAL ADDRESS / "BILLING ADDRESS"
|
|
public string PostAddress { get; set; }
|
|
public string PostCity { get; set; }
|
|
public string PostRegion { get; set; }
|
|
public string PostCountry { get; set; }
|
|
public string PostCode { get; set; }
|
|
|
|
//PHYSICAL ADDRESS / "SERVICE ADDRESS"
|
|
public string Address { get; set; }
|
|
public string City { get; set; }
|
|
public string Region { get; set; }
|
|
public string Country { get; set; }
|
|
public decimal? Latitude { get; set; }
|
|
public decimal? Longitude { get; set; }
|
|
|
|
public List<PMItem> Items { get; set; } = new List<PMItem>();
|
|
|
|
|
|
//UTILITY FIELDS
|
|
|
|
[NotMapped]
|
|
public string AlertViz { get; set; } = null;
|
|
|
|
|
|
[NotMapped]
|
|
public bool IsCompleteRecord { get; set; } = true;//indicates if some items were removed due to user role / type restrictions (i.e. woitems they are not scheduled on)
|
|
|
|
[NotMapped]
|
|
public bool UserIsRestrictedType { get; set; }
|
|
[NotMapped]
|
|
public bool UserIsTechRestricted { get; set; }
|
|
[NotMapped]
|
|
public bool UserIsSubContractorFull { get; set; }
|
|
[NotMapped]
|
|
public bool UserIsSubContractorRestricted { get; set; }
|
|
[NotMapped]
|
|
public bool UserCanViewPartCosts { get; set; }
|
|
[NotMapped]
|
|
public bool UserCanViewLaborOrTravelRateCosts { get; set; }
|
|
[NotMapped]
|
|
public bool UserCanViewLoanerCosts { get; set; }
|
|
|
|
[NotMapped, JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
public AyaTypeId GenCopyAttachmentsFrom { get; set; }//INTERNAL, USED TO SIGNIFY ATTACHMENTS NEED TO BE COPIED ON SAVE
|
|
|
|
[NotMapped, JsonIgnore]
|
|
public AyaType AyaType { get => AyaType.PM; }
|
|
|
|
//workaround for notification
|
|
[NotMapped, JsonIgnore]
|
|
public string Name { get; set; }
|
|
|
|
|
|
}//eoc
|
|
|
|
}//eons
|
|
|
|
|
|
/*
|
|
CREATE TABLE [dbo].[AWORKORDERPREVENTIVEMAINTENANCE](
|
|
[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,
|
|
[ASTOPGENERATINGDATE] [datetime] NULL,
|
|
[ADAYOFTHEWEEK] [smallint] NULL, <---- NO LONGER, now a collection of days of the week to NOT generate on, ISO8601 standard weekday number, from 1 through 7, beginning with Monday and ending with Sunday. make it an array of bools 7 wide for Monday to Sunday
|
|
[AACTIVE] [bit] NOT NULL,
|
|
[APREVENTIVEMAINTENANCENUMBER] [int] IDENTITY(1,1) NOT NULL,
|
|
[ANEXTSERVICEDATE] [datetime] NOT NULL,
|
|
[AGENERATESPANUNIT] [smallint] NOT NULL,
|
|
[ATHRESHOLDSPANUNIT] [smallint] NOT NULL,
|
|
[AGENERATESPAN] [int] NOT NULL,
|
|
[ATHRESHOLDSPAN] [int] NOT NULL,
|
|
[AGENERATEDATE] [datetime] NULL,
|
|
|
|
|
|
|
|
DOESN'T NEED THESE FIELDS
|
|
|
|
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,//## Replaced by workorderstate collection
|
|
[ASERVICEDATE] [datetime] NULL,
|
|
[AINVOICENUMBER] [nvarchar](255) NULL,
|
|
[ASERVICENUMBER] [int] IDENTITY(1,1) NOT NULL,//## replaced by Serial field
|
|
[AQUOTEWORKORDERID] [uniqueidentifier] NULL,
|
|
[ACLIENTREQUESTID] [uniqueidentifier] NULL,//# now FromCSRId
|
|
[APREVENTIVEMAINTENANCEID] [uniqueidentifier] NULL,
|
|
[ACLOSEBYDATE] [datetime] NULL,//## Now CompleteByDate
|
|
[ASIGNATURE] [ntext] NULL,//# now customersignature (more sig types coming)
|
|
[ASIGNED] [datetime] NULL,//# now CustomerSignatureCaptured
|
|
|
|
|
|
*/ |