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;
|
||||||
@@ -18,12 +19,16 @@ namespace AyaNova.Models
|
|||||||
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
|
||||||
|
|||||||
@@ -727,10 +727,28 @@ $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, "
|
||||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT NOT NULL REFERENCES acustomer (id), "
|
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT NOT NULL REFERENCES acustomer (id), "
|
||||||
@@ -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 )");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user