This commit is contained in:
Binary file not shown.
@@ -128,7 +128,10 @@ namespace AyaNova.Biz
|
|||||||
[CoreBizObject]
|
[CoreBizObject]
|
||||||
TravelRate = 63,
|
TravelRate = 63,
|
||||||
[CoreBizObject]
|
[CoreBizObject]
|
||||||
TaxCode = 64
|
TaxCode = 64,
|
||||||
|
[CoreBizObject]
|
||||||
|
PartAssembly = 65
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ namespace AyaNova.Biz
|
|||||||
return await ct.Memo.AnyAsync(z => z.Id == id);
|
return await ct.Memo.AnyAsync(z => z.Id == id);
|
||||||
case AyaType.Part:
|
case AyaType.Part:
|
||||||
return await ct.Part.AnyAsync(z => z.Id == id);
|
return await ct.Part.AnyAsync(z => z.Id == id);
|
||||||
|
case AyaType.PartAssembly:
|
||||||
|
return await ct.PartAssembly.AnyAsync(z => z.Id == id);
|
||||||
case AyaType.PM:
|
case AyaType.PM:
|
||||||
return await ct.PM.AnyAsync(z => z.Id == id);
|
return await ct.PM.AnyAsync(z => z.Id == id);
|
||||||
case AyaType.PMItem:
|
case AyaType.PMItem:
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ namespace AyaNova.Biz
|
|||||||
return new LoanUnitBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
return new LoanUnitBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
||||||
case AyaType.Part:
|
case AyaType.Part:
|
||||||
return new PartBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
return new PartBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
||||||
|
case AyaType.PartAssembly:
|
||||||
|
return new PartAssemblyBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
||||||
case AyaType.PM:
|
case AyaType.PM:
|
||||||
return new PMBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
return new PMBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,22 @@ namespace AyaNova.Biz
|
|||||||
Select = AuthorizationRoles.All
|
Select = AuthorizationRoles.All
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//Part assembly
|
||||||
|
//
|
||||||
|
roles.Add(AyaType.PartAssembly, new BizRoleSet()
|
||||||
|
{
|
||||||
|
Change = AuthorizationRoles.InventoryFull
|
||||||
|
| AuthorizationRoles.BizAdminFull
|
||||||
|
| AuthorizationRoles.AccountingFull,
|
||||||
|
ReadFullRecord = AuthorizationRoles.DispatchFull
|
||||||
|
| AuthorizationRoles.InventoryLimited
|
||||||
|
| AuthorizationRoles.BizAdminLimited
|
||||||
|
| AuthorizationRoles.DispatchLimited,
|
||||||
|
Select = AuthorizationRoles.All
|
||||||
|
});
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
//PurchaseOrder
|
//PurchaseOrder
|
||||||
// this is also effectively part warehouse inventory control
|
// this is also effectively part warehouse inventory control
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ 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<PartAssembly> PartAssembly { get; set; }
|
||||||
|
public virtual DbSet<PartAssemblyItem> PartAssemblyItem { get; set; }
|
||||||
public virtual DbSet<PM> PM { get; set; }
|
public virtual DbSet<PM> PM { get; set; }
|
||||||
public virtual DbSet<PMItem> PMItem { get; set; }
|
public virtual DbSet<PMItem> PMItem { get; set; }
|
||||||
public virtual DbSet<PMTemplate> PMTemplate { get; set; }
|
public virtual DbSet<PMTemplate> PMTemplate { get; set; }
|
||||||
|
|||||||
47
server/AyaNova/models/PartAssembly.cs
Normal file
47
server/AyaNova/models/PartAssembly.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
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 PartAssembly : 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 PartAssembly()
|
||||||
|
{
|
||||||
|
Tags = new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[NotMapped, JsonIgnore]
|
||||||
|
public AyaType AyaType { get => AyaType.PartAssembly; }
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
|
||||||
|
}//eons
|
||||||
|
|
||||||
|
|
||||||
|
// CREATE TABLE [dbo].[APARTASSEMBLY](
|
||||||
|
// [AID] [uniqueidentifier] NOT NULL,
|
||||||
|
// [ACREATED] [datetime] NULL,
|
||||||
|
// [AMODIFIED] [datetime] NULL,
|
||||||
|
// [AACTIVE] [bit] NOT NULL,
|
||||||
|
// [ACREATOR] [uniqueidentifier] NULL,
|
||||||
|
// [AMODIFIER] [uniqueidentifier] NULL,
|
||||||
|
// [ANAME] [nvarchar](255) NULL,
|
||||||
|
// [ADESCRIPTION] [nvarchar](255) NULL,
|
||||||
35
server/AyaNova/models/PartAssemblyItem.cs
Normal file
35
server/AyaNova/models/PartAssemblyItem.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
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 PartAssemblyItem
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint Concurrency { get; set; }
|
||||||
|
|
||||||
|
//Principle
|
||||||
|
[Required]
|
||||||
|
public long PartAssemblyId { get; set; }//fk
|
||||||
|
// public PartAssembly PartAssembly { get; set; } //FOR NOW COMMENTINGH OUT THESE CONVENIENCE REFERENCES UNCOMMENT IF NEED LATER COULD BE YAGNI
|
||||||
|
|
||||||
|
public long PartId { get; set; }//fk
|
||||||
|
//public Part Part { get; set; }
|
||||||
|
|
||||||
|
public PartAssemblyItem()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
|
||||||
|
}//eons
|
||||||
@@ -392,6 +392,7 @@ BEGIN
|
|||||||
when 62 then aytable = 'aservicerate';
|
when 62 then aytable = 'aservicerate';
|
||||||
when 63 then aytable = 'atravelrate';
|
when 63 then aytable = 'atravelrate';
|
||||||
when 64 then aytable = 'ataxcode';
|
when 64 then aytable = 'ataxcode';
|
||||||
|
when 65 then aytable = 'apartassembly';
|
||||||
else
|
else
|
||||||
RETURN format('??PUBLIC.AYGETNAME-UNKNOWN_TYPE:%S',ayobjecttype);-- This should not happen unless dev forgot to update this
|
RETURN format('??PUBLIC.AYGETNAME-UNKNOWN_TYPE:%S',ayobjecttype);-- This should not happen unless dev forgot to update this
|
||||||
end case;
|
end case;
|
||||||
@@ -684,6 +685,18 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
await ExecQueryAsync("CREATE UNIQUE INDEX apart_name_id_idx ON apart (id, name);");
|
await ExecQueryAsync("CREATE UNIQUE INDEX apart_name_id_idx ON apart (id, name);");
|
||||||
await ExecQueryAsync("CREATE INDEX apart_tags ON apart using GIN(tags)");
|
await ExecQueryAsync("CREATE INDEX apart_tags ON apart using GIN(tags)");
|
||||||
|
|
||||||
|
//PARTASSEMBLY
|
||||||
|
await ExecQueryAsync("CREATE TABLE apart (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("CREATE UNIQUE INDEX apart_name_id_idx ON apart (id, name);");
|
||||||
|
await ExecQueryAsync("CREATE INDEX apart_tags ON apart using GIN(tags)");
|
||||||
|
|
||||||
|
//PARTASSEMBLYITEM
|
||||||
|
await ExecQueryAsync("CREATE TABLE apartassemblyitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, partassemblyid bigint not null REFERENCES apartassembly, " +
|
||||||
|
"key text not null, display text not null)");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//PROJECT
|
//PROJECT
|
||||||
await ExecQueryAsync("CREATE TABLE aproject (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool not null, " +
|
await ExecQueryAsync("CREATE TABLE aproject (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, " +
|
||||||
|
|||||||
Reference in New Issue
Block a user