diff --git a/server/AyaNova/models/AyContext.cs b/server/AyaNova/models/AyContext.cs index 3e169306..05c69569 100644 --- a/server/AyaNova/models/AyContext.cs +++ b/server/AyaNova/models/AyContext.cs @@ -5,12 +5,11 @@ namespace AyaNova.Models { public partial class AyContext : DbContext { + public virtual DbSet Widget { get; set; } public virtual DbSet GlobalBizSettings { get; set; } public virtual DbSet Event { get; set; } public virtual DbSet SearchDictionary { get; set; } - public virtual DbSet SearchKey { get; set; } - public virtual DbSet UserOptions { get; set; } - public virtual DbSet License { get; set; } + public virtual DbSet SearchKey { get; set; } public virtual DbSet FileAttachment { get; set; } public virtual DbSet OpsJob { get; set; } public virtual DbSet OpsJobLog { get; set; } @@ -20,10 +19,31 @@ namespace AyaNova.Models public virtual DbSet Tag { get; set; } public virtual DbSet FormCustom { get; set; } public virtual DbSet PickListTemplate { get; set; } - - public virtual DbSet Widget { get; set; } public virtual DbSet User { get; set; } + public virtual DbSet UserOptions { get; set; } + public virtual DbSet License { get; set; } public virtual DbSet Customer { get; set; } + public virtual DbSet Contract { get; set; } + public virtual DbSet HeadOffice { get; set; } + public virtual DbSet LoanUnit { get; set; } + public virtual DbSet Part { get; set; } + public virtual DbSet PM { get; set; } + public virtual DbSet PMItem { get; set; } + public virtual DbSet PMTemplate { get; set; } + public virtual DbSet PMTemplateItem { get; set; } + public virtual DbSet Project { get; set; } + public virtual DbSet PurchaseOrder { get; set; } + public virtual DbSet Quote { get; set; } + public virtual DbSet QuoteItem { get; set; } + public virtual DbSet QuoteTemplate { get; set; } + public virtual DbSet QuoteTemplateItem { get; set; } + public virtual DbSet Unit { get; set; } + public virtual DbSet UnitModel { get; set; } + public virtual DbSet Vendor { get; set; } + public virtual DbSet WorkOrder { get; set; } + public virtual DbSet WorkOrderItem { get; set; } + public virtual DbSet WorkOrderTemplate { get; set; } + public virtual DbSet WorkOrderTemplateItem { get; set; } //Note: had to add this constructor to work with the code in startup.cs that gets the connection string from the appsettings.json file diff --git a/server/AyaNova/models/Contract.cs b/server/AyaNova/models/Contract.cs new file mode 100644 index 00000000..985d342a --- /dev/null +++ b/server/AyaNova/models/Contract.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class Contract + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public Contract() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/HeadOffice.cs b/server/AyaNova/models/HeadOffice.cs new file mode 100644 index 00000000..181a6ab1 --- /dev/null +++ b/server/AyaNova/models/HeadOffice.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class HeadOffice + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public HeadOffice() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/LoanUnit.cs b/server/AyaNova/models/LoanUnit.cs new file mode 100644 index 00000000..046b1ca8 --- /dev/null +++ b/server/AyaNova/models/LoanUnit.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class LoanUnit + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public LoanUnit() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/PM.cs b/server/AyaNova/models/PM.cs new file mode 100644 index 00000000..7a54097a --- /dev/null +++ b/server/AyaNova/models/PM.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class PM + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public PM() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/PMItem.cs b/server/AyaNova/models/PMItem.cs new file mode 100644 index 00000000..decc8a6c --- /dev/null +++ b/server/AyaNova/models/PMItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class PMItem + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public PMItem() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/PMTemplate.cs b/server/AyaNova/models/PMTemplate.cs new file mode 100644 index 00000000..8bc4c631 --- /dev/null +++ b/server/AyaNova/models/PMTemplate.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class PMTemplate + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public PMTemplate() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/PMTemplateItem.cs b/server/AyaNova/models/PMTemplateItem.cs new file mode 100644 index 00000000..0c7ce49b --- /dev/null +++ b/server/AyaNova/models/PMTemplateItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class PMTemplateItem + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public PMTemplateItem() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/Part.cs b/server/AyaNova/models/Part.cs new file mode 100644 index 00000000..cd8d121b --- /dev/null +++ b/server/AyaNova/models/Part.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class Part + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public Part() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/Project.cs b/server/AyaNova/models/Project.cs new file mode 100644 index 00000000..3332cc6e --- /dev/null +++ b/server/AyaNova/models/Project.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class Project + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public Project() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/PurchaseOrder.cs b/server/AyaNova/models/PurchaseOrder.cs new file mode 100644 index 00000000..5907ed5c --- /dev/null +++ b/server/AyaNova/models/PurchaseOrder.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class PurchaseOrder + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public PurchaseOrder() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/Quote.cs b/server/AyaNova/models/Quote.cs new file mode 100644 index 00000000..ceab783c --- /dev/null +++ b/server/AyaNova/models/Quote.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class Quote + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public Quote() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/QuoteItem.cs b/server/AyaNova/models/QuoteItem.cs new file mode 100644 index 00000000..758e8047 --- /dev/null +++ b/server/AyaNova/models/QuoteItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class QuoteItem + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public QuoteItem() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/QuoteTemplate.cs b/server/AyaNova/models/QuoteTemplate.cs new file mode 100644 index 00000000..bc20559f --- /dev/null +++ b/server/AyaNova/models/QuoteTemplate.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class QuoteTemplate + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public QuoteTemplate() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/QuoteTemplateItem.cs b/server/AyaNova/models/QuoteTemplateItem.cs new file mode 100644 index 00000000..2bd4d46c --- /dev/null +++ b/server/AyaNova/models/QuoteTemplateItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class QuoteTemplateItem + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public QuoteTemplateItem() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/Unit.cs b/server/AyaNova/models/Unit.cs new file mode 100644 index 00000000..c453a5c1 --- /dev/null +++ b/server/AyaNova/models/Unit.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class Unit + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public Unit() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/UnitModel.cs b/server/AyaNova/models/UnitModel.cs new file mode 100644 index 00000000..4a692dcf --- /dev/null +++ b/server/AyaNova/models/UnitModel.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class UnitModel + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public UnitModel() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/Vendor.cs b/server/AyaNova/models/Vendor.cs new file mode 100644 index 00000000..b089c5b4 --- /dev/null +++ b/server/AyaNova/models/Vendor.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class Vendor + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public Vendor() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/WorkOrder.cs b/server/AyaNova/models/WorkOrder.cs new file mode 100644 index 00000000..c90c7293 --- /dev/null +++ b/server/AyaNova/models/WorkOrder.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class WorkOrder + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public WorkOrder() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/WorkOrderItem.cs b/server/AyaNova/models/WorkOrderItem.cs new file mode 100644 index 00000000..20dd1dc0 --- /dev/null +++ b/server/AyaNova/models/WorkOrderItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class WorkOrderItem + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public WorkOrderItem() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/WorkOrderTemplate.cs b/server/AyaNova/models/WorkOrderTemplate.cs new file mode 100644 index 00000000..0c36ee22 --- /dev/null +++ b/server/AyaNova/models/WorkOrderTemplate.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class WorkOrderTemplate + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public WorkOrderTemplate() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/models/WorkOrderTemplateItem.cs b/server/AyaNova/models/WorkOrderTemplateItem.cs new file mode 100644 index 00000000..80a13f2f --- /dev/null +++ b/server/AyaNova/models/WorkOrderTemplateItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +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 partial class WorkOrderTemplateItem + { + public long Id { get; set; } + public uint ConcurrencyToken { 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; } + + + public WorkOrderTemplateItem() + { + Tags = new List(); + } + + }//eoc + +}//eons diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 043a4e26..562fefa2 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -334,7 +334,6 @@ namespace AyaNova.Util await ExecQueryAsync("CREATE UNIQUE INDEX acontract_name_id_idx ON acontract (id, name);"); await ExecQueryAsync("CREATE INDEX acontract_tags ON acontract using GIN(tags)"); - //HEADOFFICE await ExecQueryAsync("CREATE TABLE aheadoffice (id BIGSERIAL PRIMARY KEY, name varchar(255) not null unique, active bool, " + "notes text NULL, wiki text null, customfields text NULL, tags varchar(255) ARRAY NULL)");