This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
@@ -10,20 +11,24 @@ namespace AyaNova.Models
|
|||||||
|
|
||||||
public class WorkOrderItem : ICoreBizObjectModel
|
public class WorkOrderItem : ICoreBizObjectModel
|
||||||
{
|
{
|
||||||
|
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public uint Concurrency { get; set; }
|
public uint Concurrency { get; set; }
|
||||||
public string Notes { get; set; }//Was Summary
|
public string Notes { get; set; }//Was Summary
|
||||||
public string Wiki { get; set; }
|
public string Wiki { get; set; }
|
||||||
public string CustomFields { get; set; }
|
public string CustomFields { get; set; }
|
||||||
public List<string> Tags { get; set; } = new List<string>();
|
public List<string> Tags { get; set; } = new List<string>();
|
||||||
|
|
||||||
public string TechNotes { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
//Principle
|
|
||||||
[Required]
|
[Required]
|
||||||
public long WorkOrderId { get; set; }
|
public long WorkOrderId { get; set; }
|
||||||
|
public string TechNotes { get; set; }
|
||||||
|
public long WorkorderItemStatusId { get; set; }
|
||||||
|
public long WorkorderItemPriorityId { get; set; }
|
||||||
|
public DateTime RequestDate { get; set; }
|
||||||
|
public bool WarrantyService { get; set; } = false;
|
||||||
|
|
||||||
|
//Principle
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public WorkOrder WorkOrder { get; set; }
|
public WorkOrder WorkOrder { get; set; }
|
||||||
|
|
||||||
@@ -59,9 +64,9 @@ CREATE TABLE [dbo].[AWORKORDERITEM](
|
|||||||
[APRIORITYID] [uniqueidentifier] NULL,
|
[APRIORITYID] [uniqueidentifier] NULL,
|
||||||
[AREQUESTDATE] [datetime] NULL,
|
[AREQUESTDATE] [datetime] NULL,
|
||||||
[ASUMMARY] [nvarchar](255) NULL,//Now Notes
|
[ASUMMARY] [nvarchar](255) NULL,//Now Notes
|
||||||
[ATYPEID] [uniqueidentifier] NULL,
|
[ATYPEID] [uniqueidentifier] NULL,//Now a tag
|
||||||
[AUNITID] [uniqueidentifier] NULL,
|
[AUNITID] [uniqueidentifier] NULL,//MOVED TO WOITEMUNITS COLLECTION
|
||||||
[AWORKORDERITEMUNITSERVICETYPEID] [uniqueidentifier] NULL,
|
[AWORKORDERITEMUNITSERVICETYPEID] [uniqueidentifier] NULL,//MOVE TO WOITEMUNITS COLLECTION?
|
||||||
[AWARRANTYSERVICE] [bit] NOT NULL,
|
[AWARRANTYSERVICE] [bit] NOT NULL,
|
||||||
[ACUSTOM1] [ntext] NULL,
|
[ACUSTOM1] [ntext] NULL,
|
||||||
[ACUSTOM2] [ntext] NULL,
|
[ACUSTOM2] [ntext] NULL,
|
||||||
|
|||||||
34
server/AyaNova/models/WorkOrderItemPriority.cs
Normal file
34
server/AyaNova/models/WorkOrderItemPriority.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
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 class WorkOrderItemPriority
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint Concurrency { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public string Name { get; set; }
|
||||||
|
public bool Active { get; set; }
|
||||||
|
[MaxLength(12)]
|
||||||
|
public string Color { get; set; } = "#ffffff";//white / no color is the default
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
|
||||||
|
}//eons
|
||||||
|
/*
|
||||||
|
[dbo].[APRIORITY](
|
||||||
|
[AID] [uniqueidentifier] NOT NULL,
|
||||||
|
[ACREATED] [datetime] NOT NULL,
|
||||||
|
[ACREATOR] [uniqueidentifier] NOT NULL,
|
||||||
|
[AMODIFIER] [uniqueidentifier] NOT NULL,
|
||||||
|
[ANAME] [nvarchar](255) NOT NULL,
|
||||||
|
[AMODIFIED] [datetime] NOT NULL,
|
||||||
|
[AARGB] [int] NOT NULL,
|
||||||
|
[AACTIVE] [bit] NOT NULL,
|
||||||
|
*/
|
||||||
50
server/AyaNova/models/WorkOrderItemStatus.cs
Normal file
50
server/AyaNova/models/WorkOrderItemStatus.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
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 class WorkOrderItemStatus
|
||||||
|
{
|
||||||
|
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; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
Hexadecimal notation: #RGB[A]
|
||||||
|
R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0–9, A–F). A is optional. The three-digit notation (#RGB) is a shorter version of the six-digit form (#RRGGBB). For example, #f09 is the same color as #ff0099. Likewise, the four-digit RGB notation (#RGBA) is a shorter version of the eight-digit form (#RRGGBBAA). For example, #0f38 is the same color as #00ff3388.
|
||||||
|
*/
|
||||||
|
[MaxLength(12)]
|
||||||
|
public string Color { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public WorkOrderItemStatus()
|
||||||
|
{
|
||||||
|
Color = "#ffffff";//white / no color is the default
|
||||||
|
}
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
|
||||||
|
}//eons
|
||||||
|
/*
|
||||||
|
[dbo].[AWORKORDERSTATUS](
|
||||||
|
[AID] [uniqueidentifier] NOT NULL,
|
||||||
|
[ACREATED] [datetime] NOT NULL,
|
||||||
|
[AMODIFIED] [datetime] NOT NULL,
|
||||||
|
[AACTIVE] [bit] NOT NULL,
|
||||||
|
[ACREATOR] [uniqueidentifier] NOT NULL,
|
||||||
|
[AMODIFIER] [uniqueidentifier] NOT NULL,
|
||||||
|
[ANAME] [nvarchar](255) NOT NULL,
|
||||||
|
[ADESCRIPTION] [nvarchar](255) NULL,
|
||||||
|
[AARGB] [int] NOT NULL
|
||||||
|
|
||||||
|
|
||||||
|
V8: Split from workorder status for v8, for item it's still a single value and migrate should bring over all into both workorderstatus and this workorderitemstatus
|
||||||
|
*/
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace AyaNova.Models
|
namespace AyaNova.Models
|
||||||
|
|||||||
@@ -458,9 +458,9 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
|
|
||||||
//Prime the db with the default SuperUser account
|
//Prime the db with the default SuperUser account
|
||||||
await AyaNova.Biz.PrimeData.PrimeSuperUserAccount(ct);
|
await AyaNova.Biz.PrimeData.PrimeSuperUserAccount(ct);
|
||||||
|
|
||||||
//Add user table
|
//Add user table
|
||||||
await ExecQueryAsync("CREATE TABLE alicense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, dbid TEXT, key TEXT NOT NULL)");
|
await ExecQueryAsync("CREATE TABLE alicense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, dbid TEXT, key TEXT NOT NULL)");
|
||||||
|
|
||||||
//Add widget table
|
//Add widget table
|
||||||
//id, TEXT, longtext, boolean, currency,
|
//id, TEXT, longtext, boolean, currency,
|
||||||
@@ -483,21 +483,21 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
await ExecQueryAsync("CREATE TABLE aopsjob (gid uuid PRIMARY KEY, name TEXT NOT NULL, created TIMESTAMP NOT NULL, exclusive BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE aopsjob (gid uuid PRIMARY KEY, name TEXT NOT NULL, created TIMESTAMP NOT NULL, exclusive BOOL NOT NULL, "
|
||||||
+ "startafter TIMESTAMP NOT NULL, jobtype INTEGER NOT NULL, subtype INTEGER, objectid BIGINT, atype INTEGER, jobstatus INTEGER NOT NULL, jobinfo TEXT)");
|
+ "startafter TIMESTAMP NOT NULL, jobtype INTEGER NOT NULL, subtype INTEGER, objectid BIGINT, atype INTEGER, jobstatus INTEGER NOT NULL, jobinfo TEXT)");
|
||||||
await ExecQueryAsync("CREATE TABLE aopsjoblog (gid uuid PRIMARY KEY, jobid uuid NOT NULL, created TIMESTAMP NOT NULL, statustext TEXT NOT NULL)");
|
await ExecQueryAsync("CREATE TABLE aopsjoblog (gid uuid PRIMARY KEY, jobid uuid NOT NULL, created TIMESTAMP NOT NULL, statustext TEXT NOT NULL)");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE adatalistsavedfilter (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL, name TEXT NOT NULL, public BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE adatalistsavedfilter (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL, name TEXT NOT NULL, public BOOL NOT NULL, "
|
||||||
+ "defaultfilter BOOL NOT NULL, listkey VARCHAR(255) NOT NULL, filter TEXT)");
|
+ "defaultfilter BOOL NOT NULL, listkey VARCHAR(255) NOT NULL, filter TEXT)");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE adatalistcolumnview (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE adatalistcolumnview (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL, "
|
||||||
+ "listkey VARCHAR(255) NOT NULL, columns TEXT, sort TEXT)");
|
+ "listkey VARCHAR(255) NOT NULL, columns TEXT, sort TEXT)");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE atag (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, refcount BIGINT NOT NULL)");
|
await ExecQueryAsync("CREATE TABLE atag (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, refcount BIGINT NOT NULL)");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE aformcustom (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, "
|
await ExecQueryAsync("CREATE TABLE aformcustom (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, "
|
||||||
+ "formkey VARCHAR(255) NOT NULL, template TEXT, UNIQUE(formkey))");
|
+ "formkey VARCHAR(255) NOT NULL, template TEXT, UNIQUE(formkey))");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE apicklisttemplate (id INTEGER NOT NULL PRIMARY KEY, "
|
await ExecQueryAsync("CREATE TABLE apicklisttemplate (id INTEGER NOT NULL PRIMARY KEY, "
|
||||||
+ "template TEXT)");
|
+ "template TEXT)");
|
||||||
|
|
||||||
//SERVICERATE
|
//SERVICERATE
|
||||||
await ExecQueryAsync("CREATE TABLE aservicerate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE aservicerate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
||||||
@@ -727,9 +727,27 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
+ ")");
|
+ ")");
|
||||||
|
|
||||||
//----------
|
//----------
|
||||||
|
|
||||||
|
/*
|
||||||
|
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗
|
||||||
|
██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝ ██╔═══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗
|
||||||
|
██║ █╗ ██║██║ ██║██████╔╝█████╔╝█████╗██║ ██║██████╔╝██║ ██║█████╗ ██████╔╝
|
||||||
|
██║███╗██║██║ ██║██╔══██╗██╔═██╗╚════╝██║ ██║██╔══██╗██║ ██║██╔══╝ ██╔══██╗
|
||||||
|
╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗ ╚██████╔╝██║ ██║██████╔╝███████╗██║ ██║
|
||||||
|
╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
*/
|
||||||
//WORKORDER STATUS
|
//WORKORDER STATUS
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE aworkorderstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000', selectroles INTEGER NOT NULL, removeroles INTEGER NOT NULL, completed BOOL NOT NULL, locked BOOL NOT NULL)");
|
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000', selectroles INTEGER NOT NULL, removeroles INTEGER NOT NULL, completed BOOL NOT NULL, locked BOOL NOT NULL)");
|
||||||
|
|
||||||
|
//WORKORDERITEM STATUS
|
||||||
|
await ExecQueryAsync("CREATE TABLE aworkorderitemstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
|
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000')");
|
||||||
|
|
||||||
|
//WORKORDERITEM PRIORITY
|
||||||
|
await ExecQueryAsync("CREATE TABLE aworkorderitempriority (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
|
+ "color VARCHAR(12) NOT NULL default '#000000')");
|
||||||
|
|
||||||
|
|
||||||
//WORKORDER
|
//WORKORDER
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE aworkorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, active BOOL NOT NULL, "
|
||||||
@@ -743,6 +761,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
+ "workorderstatusid BIGINT NOT NULL REFERENCES aworkorderstatus (id), created TIMESTAMP NOT NULL, userid BIGINT NOT NULL REFERENCES auser (id)"
|
+ "workorderstatusid BIGINT NOT NULL REFERENCES aworkorderstatus (id), created TIMESTAMP NOT NULL, userid BIGINT NOT NULL REFERENCES auser (id)"
|
||||||
+ ")");
|
+ ")");
|
||||||
|
|
||||||
|
here
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderid BIGINT NOT NULL REFERENCES aworkorder (id), "
|
await ExecQueryAsync("CREATE TABLE aworkorderitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderid BIGINT NOT NULL REFERENCES aworkorder (id), "
|
||||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY )");
|
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY )");
|
||||||
|
|
||||||
@@ -895,10 +914,10 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
+ "notes TEXT, roles INTEGER NOT NULL, atype INTEGER NOT NULL, template TEXT, style TEXT, jsprerender TEXT, jshelpers TEXT, rendertype INTEGER NOT NULL, "
|
+ "notes TEXT, roles INTEGER NOT NULL, atype INTEGER NOT NULL, template TEXT, style TEXT, jsprerender TEXT, jshelpers TEXT, rendertype INTEGER NOT NULL, "
|
||||||
+ "headertemplate TEXT, footertemplate TEXT, displayheaderfooter BOOL, paperformat INTEGER NOT NULL, landscape BOOL, marginoptionsbottom TEXT, "
|
+ "headertemplate TEXT, footertemplate TEXT, displayheaderfooter BOOL, paperformat INTEGER NOT NULL, landscape BOOL, marginoptionsbottom TEXT, "
|
||||||
+ "marginoptionsleft TEXT, marginoptionsright TEXT, marginoptionstop TEXT, pageranges TEXT, prefercsspagesize BOOL, printbackground BOOL, scale DECIMAL(8,5) )");
|
+ "marginoptionsleft TEXT, marginoptionsright TEXT, marginoptionstop TEXT, pageranges TEXT, prefercsspagesize BOOL, printbackground BOOL, scale DECIMAL(8,5) )");
|
||||||
|
|
||||||
//Load the stock REPORT TEMPLATES
|
//Load the stock REPORT TEMPLATES
|
||||||
await AyaNova.Biz.PrimeData.PrimeReportTemplates();
|
await AyaNova.Biz.PrimeData.PrimeReportTemplates();
|
||||||
|
|
||||||
//DASHBOARD
|
//DASHBOARD
|
||||||
await ExecQueryAsync("CREATE TABLE adashboardview (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL UNIQUE, view TEXT NOT NULL)");
|
await ExecQueryAsync("CREATE TABLE adashboardview (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL UNIQUE, view TEXT NOT NULL)");
|
||||||
await SetSchemaLevelAsync(++currentSchema);
|
await SetSchemaLevelAsync(++currentSchema);
|
||||||
|
|||||||
Reference in New Issue
Block a user