This commit is contained in:
@@ -130,7 +130,9 @@ namespace AyaNova.Biz
|
|||||||
[CoreBizObject]
|
[CoreBizObject]
|
||||||
TaxCode = 64,
|
TaxCode = 64,
|
||||||
[CoreBizObject]
|
[CoreBizObject]
|
||||||
PartAssembly = 65
|
PartAssembly = 65,
|
||||||
|
[CoreBizObject]
|
||||||
|
PartWarehouse = 66
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ namespace AyaNova.Models
|
|||||||
public virtual DbSet<Notification> Notification { get; set; }
|
public virtual DbSet<Notification> Notification { get; set; }
|
||||||
public virtual DbSet<NotifyDeliveryLog> NotifyDeliveryLog { get; set; }
|
public virtual DbSet<NotifyDeliveryLog> NotifyDeliveryLog { get; set; }
|
||||||
public virtual DbSet<Part> Part { get; set; }
|
public virtual DbSet<Part> Part { get; set; }
|
||||||
|
public virtual DbSet<PartWarehouse> PartWarehouse { get; set; }
|
||||||
public virtual DbSet<PartSerial> PartSerial { get; set; }
|
public virtual DbSet<PartSerial> PartSerial { get; set; }
|
||||||
public virtual DbSet<PartAssembly> PartAssembly { get; set; }
|
public virtual DbSet<PartAssembly> PartAssembly { get; set; }
|
||||||
public virtual DbSet<PartAssemblyItem> PartAssemblyItem { get; set; }
|
public virtual DbSet<PartAssemblyItem> PartAssemblyItem { get; set; }
|
||||||
|
|||||||
49
server/AyaNova/models/PartWarehouse.cs
Normal file
49
server/AyaNova/models/PartWarehouse.cs
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
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 PartWarehouse : ICoreBizObjectModel
|
||||||
|
{
|
||||||
|
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; }
|
||||||
|
public string Wiki { get; set; }
|
||||||
|
public string CustomFields { get; set; }
|
||||||
|
public List<string> Tags { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public PartWarehouse()
|
||||||
|
{
|
||||||
|
Tags = new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[NotMapped, JsonIgnore]
|
||||||
|
public AyaType AyaType { get => AyaType.PartWarehouse; }
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
|
||||||
|
}//eons
|
||||||
|
/*
|
||||||
|
CREATE TABLE [dbo].[APARTWAREHOUSE](
|
||||||
|
[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,
|
||||||
|
[AREGIONID] [uniqueidentifier] NULL,//tagify
|
||||||
|
*/
|
||||||
@@ -22,8 +22,8 @@ namespace AyaNova.Util
|
|||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
private const int DESIRED_SCHEMA_LEVEL = 15;
|
private const int DESIRED_SCHEMA_LEVEL = 15;
|
||||||
|
|
||||||
internal const long EXPECTED_COLUMN_COUNT = 669;
|
internal const long EXPECTED_COLUMN_COUNT = 676;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 117;
|
internal const long EXPECTED_INDEX_COUNT = 119;
|
||||||
|
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
|
|
||||||
@@ -665,8 +665,13 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
"cost decimal(19,4) not null, retail decimal(19,4) not null, unitofmeasure text, upc text " +
|
"cost decimal(19,4) not null, retail decimal(19,4) not null, unitofmeasure text, upc text " +
|
||||||
" )");
|
" )");
|
||||||
|
|
||||||
|
//PARTWAREHOUSE
|
||||||
|
await ExecQueryAsync("CREATE TABLE apartwarehouse (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)");
|
||||||
|
await ExecQueryAsync("INSERT INTO apartwarehouse(name, active) VALUES ('#1', true);");
|
||||||
|
|
||||||
//PARTSERIAL
|
//PARTSERIAL
|
||||||
await ExecQueryAsync("CREATE TABLE apartserial (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial text not null, "+
|
await ExecQueryAsync("CREATE TABLE apartserial (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial text not null, " +
|
||||||
"partid bigint not null REFERENCES apart on delete cascade, CONSTRAINT UNQ_PartSerialPart UNIQUE (partid, serial) )");//ensure not duplicate partid/serial combo
|
"partid bigint not null REFERENCES apart on delete cascade, CONSTRAINT UNQ_PartSerialPart UNIQUE (partid, serial) )");//ensure not duplicate partid/serial combo
|
||||||
|
|
||||||
//PARTASSEMBLY
|
//PARTASSEMBLY
|
||||||
|
|||||||
Reference in New Issue
Block a user