Material Entity ve Seeder
This commit is contained in:
parent
fe38608bc7
commit
5e8ca56af1
11 changed files with 867 additions and 51 deletions
|
|
@ -146,5 +146,7 @@ public enum TableNameEnum
|
|||
PartnerBank,
|
||||
PartnerCertificate,
|
||||
PartnerContact,
|
||||
DynamicService
|
||||
DynamicService,
|
||||
Material,
|
||||
MaterialSpecification,
|
||||
}
|
||||
|
|
@ -166,6 +166,8 @@ public static class TableNameResolver
|
|||
//Supply Chain
|
||||
{ nameof(TableNameEnum.MaterialType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) },
|
||||
{ nameof(TableNameEnum.MaterialGroup), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) },
|
||||
{ nameof(TableNameEnum.Material), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) },
|
||||
{ nameof(TableNameEnum.MaterialSpecification), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) },
|
||||
{ nameof(TableNameEnum.PaymentTerm), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) },
|
||||
{ nameof(TableNameEnum.SupplyType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) },
|
||||
{ nameof(TableNameEnum.SupplyCardType), (TablePrefix.TenantByName, MenuPrefix.SupplyChain) },
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
|
||||
|
|
@ -8,6 +10,7 @@ public class Uom : FullAuditedEntity<Guid>, IMultiTenant
|
|||
{
|
||||
public Guid? TenantId { get; set; }
|
||||
public Guid UomCategoryId { get; set; }
|
||||
public UomCategory UomCategory { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Type { get; set; }
|
||||
|
|
@ -17,6 +20,7 @@ public class Uom : FullAuditedEntity<Guid>, IMultiTenant
|
|||
|
||||
Guid? IMultiTenant.TenantId => TenantId;
|
||||
|
||||
public UomCategory UomCategory { get; set; }
|
||||
public ICollection<Material> Materials { get; set; }
|
||||
public ICollection<MaterialSpecification> MaterialSpecifications { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
// Domain/Entities/MmMaterial.cs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
|
||||
namespace Kurs.Platform.Entities;
|
||||
|
||||
public class Material : FullAuditedEntity<Guid>, IMultiTenant
|
||||
{
|
||||
public Guid? TenantId { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Barcode { get; set; }
|
||||
public string Description { get; set; }
|
||||
public Guid? MaterialTypeId { get; set; }
|
||||
public MaterialType? MaterialType { get; set; }
|
||||
public Guid? MaterialGroupId { get; set; }
|
||||
public MaterialGroup? MaterialGroup { get; set; }
|
||||
public Guid? UomId { get; set; }
|
||||
public Uom? Uom { get; set; }
|
||||
public decimal CostPrice { get; set; }
|
||||
public decimal SalesPrice { get; set; }
|
||||
public Guid? CurrencyId { get; set; }
|
||||
public Currency? Currency { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public decimal TotalStock { get; set; }
|
||||
public string TrackingType { get; set; } //'Quantity' | 'Lot' | 'Serial'
|
||||
|
||||
// Relations
|
||||
public List<Uom> AlternativeUoms { get; set; }
|
||||
public List<MaterialSpecification> Specifications { get; set; }
|
||||
public List<Partner> Suppliers { get; set; }
|
||||
// public List<MmStockLevel> StockLevels { get; set; }
|
||||
}
|
||||
|
|
@ -18,4 +18,6 @@ public class MaterialGroup : FullAuditedEntity<Guid>, IMultiTenant
|
|||
|
||||
public string Description { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public ICollection<Material> Materials { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
// Domain/Entities/MmMaterialSpecification.cs
|
||||
using System;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
|
||||
namespace Kurs.Platform.Entities;
|
||||
|
||||
public class MaterialSpecification : FullAuditedEntity<Guid>, IMultiTenant
|
||||
{
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
public Guid MaterialId { get; set; }
|
||||
public Material Material { get; set; }
|
||||
public string SpecificationName { get; set; }
|
||||
public string SpecificationValue { get; set; }
|
||||
public Guid UnitId { get; set; }
|
||||
public Uom Unit { get; set; }
|
||||
public bool IsRequired { get; set; }
|
||||
}
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
|
||||
|
|
@ -12,4 +14,6 @@ public class MaterialType : FullAuditedEntity<Guid>, IMultiTenant
|
|||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public ICollection<Material> Materials { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,8 @@ public class PlatformDbContext :
|
|||
#region Supply Chain
|
||||
public DbSet<MaterialType> MaterialTypes { get; set; }
|
||||
public DbSet<MaterialGroup> MaterialGroups { get; set; }
|
||||
public DbSet<Material> Materials { get; set; }
|
||||
public DbSet<MaterialSpecification> MaterialSpecifications { get; set; }
|
||||
public DbSet<PaymentTerm> PaymentTerms { get; set; }
|
||||
|
||||
public DbSet<Partner> Partners { get; set; }
|
||||
|
|
@ -252,8 +254,6 @@ public class PlatformDbContext :
|
|||
builder.ConfigureMailQueue();
|
||||
builder.ConfigureNotification();
|
||||
|
||||
/* Configure your own tables/entities inside here */
|
||||
|
||||
//Saas
|
||||
builder.Entity<AiBot>(b =>
|
||||
{
|
||||
|
|
@ -2467,5 +2467,56 @@ public class PlatformDbContext :
|
|||
b.Property(x => x.PrimaryEntityType).HasMaxLength(256);
|
||||
b.Property(x => x.ControllerName).HasMaxLength(256);
|
||||
});
|
||||
|
||||
builder.Entity<Material>(b =>
|
||||
{
|
||||
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Material)), Prefix.DbSchema);
|
||||
b.ConfigureByConvention();
|
||||
|
||||
b.Property(x => x.Code).IsRequired().HasMaxLength(50);
|
||||
b.Property(x => x.Name).IsRequired().HasMaxLength(200);
|
||||
b.Property(x => x.Barcode).HasMaxLength(50);
|
||||
b.Property(x => x.Description).HasMaxLength(500);
|
||||
b.Property(x => x.TrackingType).HasMaxLength(50);
|
||||
b.Property(x => x.CostPrice).HasPrecision(18, 2).HasDefaultValue(0);
|
||||
b.Property(x => x.SalesPrice).HasPrecision(18, 2).HasDefaultValue(0);
|
||||
b.Property(x => x.TotalStock).HasPrecision(18, 2).HasDefaultValue(0);
|
||||
b.Property(x => x.IsActive).HasDefaultValue(true);
|
||||
|
||||
b.HasOne(x => x.MaterialType)
|
||||
.WithMany(x => x.Materials)
|
||||
.HasForeignKey(x => x.MaterialTypeId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne(x => x.MaterialGroup)
|
||||
.WithMany(x => x.Materials)
|
||||
.HasForeignKey(x => x.MaterialGroupId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne(x => x.Uom)
|
||||
.WithMany(x => x.Materials)
|
||||
.HasForeignKey(x => x.UomId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
builder.Entity<MaterialSpecification>(b =>
|
||||
{
|
||||
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.MaterialSpecification)), Prefix.DbSchema);
|
||||
b.ConfigureByConvention();
|
||||
|
||||
b.Property(x => x.SpecificationName).IsRequired().HasMaxLength(100);
|
||||
b.Property(x => x.SpecificationValue).IsRequired().HasMaxLength(200);
|
||||
b.Property(x => x.IsRequired).HasDefaultValue(false);
|
||||
|
||||
b.HasOne(x => x.Material)
|
||||
.WithMany(x => x.Specifications)
|
||||
.HasForeignKey(x => x.MaterialId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne(x => x.Unit)
|
||||
.WithMany(x => x.MaterialSpecifications)
|
||||
.HasForeignKey(x => x.UnitId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
|||
namespace Kurs.Platform.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlatformDbContext))]
|
||||
[Migration("20251106171552_Initial")]
|
||||
[Migration("20251106192916_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -5631,6 +5631,115 @@ namespace Kurs.Platform.Migrations
|
|||
b.ToTable("Plat_H_LogEntry", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Material", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Barcode")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<decimal>("CostPrice")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("CurrencyId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid?>("MaterialGroupId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("MaterialTypeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<decimal>("SalesPrice")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<Guid?>("TenantId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("TenantId");
|
||||
|
||||
b.Property<decimal>("TotalStock")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<string>("TrackingType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<Guid?>("UomId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CurrencyId");
|
||||
|
||||
b.HasIndex("MaterialGroupId");
|
||||
|
||||
b.HasIndex("MaterialTypeId");
|
||||
|
||||
b.HasIndex("UomId");
|
||||
|
||||
b.ToTable("Scp_T_Material", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -5699,6 +5808,75 @@ namespace Kurs.Platform.Migrations
|
|||
b.ToTable("Scp_T_MaterialGroup", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialSpecification", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<bool>("IsRequired")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid>("MaterialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("SpecificationName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("SpecificationValue")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid?>("TenantId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("TenantId");
|
||||
|
||||
b.Property<Guid>("UnitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MaterialId");
|
||||
|
||||
b.HasIndex("UnitId");
|
||||
|
||||
b.ToTable("Scp_T_MaterialSpecification", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialType", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -6493,6 +6671,9 @@ namespace Kurs.Platform.Migrations
|
|||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<Guid?>("MaterialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<long>("MobileNumber")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("bigint");
|
||||
|
|
@ -6576,6 +6757,8 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasIndex("CustomerTypeId");
|
||||
|
||||
b.HasIndex("MaterialId");
|
||||
|
||||
b.HasIndex("PaymentTermId");
|
||||
|
||||
b.HasIndex("SectorId");
|
||||
|
|
@ -9840,6 +10023,9 @@ namespace Kurs.Platform.Migrations
|
|||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid?>("MaterialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
|
|
@ -9867,6 +10053,8 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MaterialId");
|
||||
|
||||
b.HasIndex("UomCategoryId");
|
||||
|
||||
b.ToTable("Adm_T_Uom", (string)null);
|
||||
|
|
@ -12894,6 +13082,36 @@ namespace Kurs.Platform.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Material", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
|
||||
.WithMany()
|
||||
.HasForeignKey("CurrencyId");
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.MaterialGroup", "MaterialGroup")
|
||||
.WithMany("Materials")
|
||||
.HasForeignKey("MaterialGroupId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.MaterialType", "MaterialType")
|
||||
.WithMany("Materials")
|
||||
.HasForeignKey("MaterialTypeId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.Uom", "Uom")
|
||||
.WithMany("Materials")
|
||||
.HasForeignKey("UomId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("Currency");
|
||||
|
||||
b.Navigation("MaterialGroup");
|
||||
|
||||
b.Navigation("MaterialType");
|
||||
|
||||
b.Navigation("Uom");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.MaterialGroup", "ParentGroup")
|
||||
|
|
@ -12904,6 +13122,25 @@ namespace Kurs.Platform.Migrations
|
|||
b.Navigation("ParentGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialSpecification", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Material", "Material")
|
||||
.WithMany("Specifications")
|
||||
.HasForeignKey("MaterialId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.Uom", "Unit")
|
||||
.WithMany("MaterialSpecifications")
|
||||
.HasForeignKey("UnitId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Material");
|
||||
|
||||
b.Navigation("Unit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Meal", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Branch", "Branch")
|
||||
|
|
@ -12957,6 +13194,10 @@ namespace Kurs.Platform.Migrations
|
|||
.HasForeignKey("CustomerTypeId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.Material", null)
|
||||
.WithMany("Suppliers")
|
||||
.HasForeignKey("MaterialId");
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.PaymentTerm", "PaymentTerm")
|
||||
.WithMany()
|
||||
.HasForeignKey("PaymentTermId");
|
||||
|
|
@ -13332,6 +13573,10 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Material", null)
|
||||
.WithMany("AlternativeUoms")
|
||||
.HasForeignKey("MaterialId");
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.UomCategory", "UomCategory")
|
||||
.WithMany("Uoms")
|
||||
.HasForeignKey("UomCategoryId")
|
||||
|
|
@ -13661,11 +13906,27 @@ namespace Kurs.Platform.Migrations
|
|||
b.Navigation("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Material", b =>
|
||||
{
|
||||
b.Navigation("AlternativeUoms");
|
||||
|
||||
b.Navigation("Specifications");
|
||||
|
||||
b.Navigation("Suppliers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b =>
|
||||
{
|
||||
b.Navigation("Materials");
|
||||
|
||||
b.Navigation("SubGroups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialType", b =>
|
||||
{
|
||||
b.Navigation("Materials");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Order", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
|
|
@ -13779,6 +14040,13 @@ namespace Kurs.Platform.Migrations
|
|||
b.Navigation("Certificates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
|
||||
{
|
||||
b.Navigation("MaterialSpecifications");
|
||||
|
||||
b.Navigation("Materials");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b =>
|
||||
{
|
||||
b.Navigation("Uoms");
|
||||
|
|
@ -2736,37 +2736,6 @@ namespace Kurs.Platform.Migrations
|
|||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Adm_T_Uom",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UomCategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
Type = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
|
||||
Ratio = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
||||
Rounding = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Adm_T_Uom", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Adm_T_Uom_Adm_T_UomCategory_UomCategoryId",
|
||||
column: x => x.UomCategoryId,
|
||||
principalTable: "Adm_T_UomCategory",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Crd_T_ClassroomAttandance",
|
||||
columns: table => new
|
||||
|
|
@ -4156,6 +4125,7 @@ namespace Kurs.Platform.Migrations
|
|||
CurrentBalance = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||
DiscountRate = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||
PerformanceMetricsJson = table.Column<string>(type: "text", nullable: true),
|
||||
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
|
|
@ -4316,6 +4286,129 @@ namespace Kurs.Platform.Migrations
|
|||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Adm_T_Uom",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UomCategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
Type = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
|
||||
Ratio = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
||||
Rounding = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
|
||||
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Adm_T_Uom", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Adm_T_Uom_Adm_T_UomCategory_UomCategoryId",
|
||||
column: x => x.UomCategoryId,
|
||||
principalTable: "Adm_T_UomCategory",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Scp_T_Material",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
Barcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
MaterialTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
MaterialGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UomId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
CostPrice = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||
SalesPrice = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||
CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
|
||||
TotalStock = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, defaultValue: 0m),
|
||||
TrackingType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Scp_T_Material", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Scp_T_Material_Adm_T_Uom_UomId",
|
||||
column: x => x.UomId,
|
||||
principalTable: "Adm_T_Uom",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Scp_T_Material_Sas_H_Currency_CurrencyId",
|
||||
column: x => x.CurrencyId,
|
||||
principalTable: "Sas_H_Currency",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Scp_T_Material_Scp_T_MaterialGroup_MaterialGroupId",
|
||||
column: x => x.MaterialGroupId,
|
||||
principalTable: "Scp_T_MaterialGroup",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Scp_T_Material_Scp_T_MaterialType_MaterialTypeId",
|
||||
column: x => x.MaterialTypeId,
|
||||
principalTable: "Scp_T_MaterialType",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Scp_T_MaterialSpecification",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
MaterialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SpecificationName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
SpecificationValue = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
UnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
IsRequired = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Scp_T_MaterialSpecification", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Scp_T_MaterialSpecification_Adm_T_Uom_UnitId",
|
||||
column: x => x.UnitId,
|
||||
principalTable: "Adm_T_Uom",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Scp_T_MaterialSpecification_Scp_T_Material_MaterialId",
|
||||
column: x => x.MaterialId,
|
||||
principalTable: "Scp_T_Material",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Hr_T_CostCenter",
|
||||
columns: table => new
|
||||
|
|
@ -5448,6 +5541,11 @@ namespace Kurs.Platform.Migrations
|
|||
table: "Adm_T_Partner",
|
||||
column: "CustomerTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Adm_T_Partner_MaterialId",
|
||||
table: "Adm_T_Partner",
|
||||
column: "MaterialId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Adm_T_Partner_PaymentTermId",
|
||||
table: "Adm_T_Partner",
|
||||
|
|
@ -5498,6 +5596,11 @@ namespace Kurs.Platform.Migrations
|
|||
table: "Adm_T_SkillLevel",
|
||||
column: "SkillTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Adm_T_Uom_MaterialId",
|
||||
table: "Adm_T_Uom",
|
||||
column: "MaterialId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Adm_T_Uom_UomCategoryId",
|
||||
table: "Adm_T_Uom",
|
||||
|
|
@ -6056,11 +6159,41 @@ namespace Kurs.Platform.Migrations
|
|||
table: "Sas_T_ReportTemplate",
|
||||
column: "CategoryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Scp_T_Material_CurrencyId",
|
||||
table: "Scp_T_Material",
|
||||
column: "CurrencyId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Scp_T_Material_MaterialGroupId",
|
||||
table: "Scp_T_Material",
|
||||
column: "MaterialGroupId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Scp_T_Material_MaterialTypeId",
|
||||
table: "Scp_T_Material",
|
||||
column: "MaterialTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Scp_T_Material_UomId",
|
||||
table: "Scp_T_Material",
|
||||
column: "UomId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Scp_T_MaterialGroup_ParentGroupId",
|
||||
table: "Scp_T_MaterialGroup",
|
||||
column: "ParentGroupId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Scp_T_MaterialSpecification_MaterialId",
|
||||
table: "Scp_T_MaterialSpecification",
|
||||
column: "MaterialId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Scp_T_MaterialSpecification_UnitId",
|
||||
table: "Scp_T_MaterialSpecification",
|
||||
column: "UnitId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Adm_T_BlogPost_Hr_T_Employee_EmployeeId",
|
||||
table: "Adm_T_BlogPost",
|
||||
|
|
@ -6077,6 +6210,20 @@ namespace Kurs.Platform.Migrations
|
|||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Adm_T_Partner_Scp_T_Material_MaterialId",
|
||||
table: "Adm_T_Partner",
|
||||
column: "MaterialId",
|
||||
principalTable: "Scp_T_Material",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Adm_T_Uom_Scp_T_Material_MaterialId",
|
||||
table: "Adm_T_Uom",
|
||||
column: "MaterialId",
|
||||
principalTable: "Scp_T_Material",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Hr_T_CostCenter_Hr_T_Department_DepartmentId",
|
||||
table: "Hr_T_CostCenter",
|
||||
|
|
@ -6115,6 +6262,14 @@ namespace Kurs.Platform.Migrations
|
|||
name: "FK_Hr_T_Department_Hr_T_Employee_ManagerId",
|
||||
table: "Hr_T_Department");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Scp_T_Material_Sas_H_Currency_CurrencyId",
|
||||
table: "Scp_T_Material");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Adm_T_Uom_Scp_T_Material_MaterialId",
|
||||
table: "Adm_T_Uom");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Hr_T_CostCenter_Hr_T_Department_DepartmentId",
|
||||
table: "Hr_T_CostCenter");
|
||||
|
|
@ -6251,9 +6406,6 @@ namespace Kurs.Platform.Migrations
|
|||
migrationBuilder.DropTable(
|
||||
name: "Adm_T_SkillLevel");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Adm_T_Uom");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Adm_T_Vaccine");
|
||||
|
||||
|
|
@ -6468,10 +6620,7 @@ namespace Kurs.Platform.Migrations
|
|||
name: "Sas_T_ReportParameter");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Scp_T_MaterialGroup");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Scp_T_MaterialType");
|
||||
name: "Scp_T_MaterialSpecification");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AbpEntityChanges");
|
||||
|
|
@ -6500,9 +6649,6 @@ namespace Kurs.Platform.Migrations
|
|||
migrationBuilder.DropTable(
|
||||
name: "Adm_T_SkillType");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Adm_T_UomCategory");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Crd_B_ClassType");
|
||||
|
||||
|
|
@ -6575,9 +6721,6 @@ namespace Kurs.Platform.Migrations
|
|||
migrationBuilder.DropTable(
|
||||
name: "Crm_T_CustomerType");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sas_H_Currency");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sas_T_Sector");
|
||||
|
||||
|
|
@ -6650,6 +6793,24 @@ namespace Kurs.Platform.Migrations
|
|||
migrationBuilder.DropTable(
|
||||
name: "Hr_T_JobPosition");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sas_H_Currency");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Scp_T_Material");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Adm_T_Uom");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Scp_T_MaterialGroup");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Scp_T_MaterialType");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Adm_T_UomCategory");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Hr_T_Department");
|
||||
|
||||
|
|
@ -5628,6 +5628,115 @@ namespace Kurs.Platform.Migrations
|
|||
b.ToTable("Plat_H_LogEntry", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Material", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Barcode")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<decimal>("CostPrice")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("CurrencyId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid?>("MaterialGroupId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("MaterialTypeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<decimal>("SalesPrice")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<Guid?>("TenantId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("TenantId");
|
||||
|
||||
b.Property<decimal>("TotalStock")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<string>("TrackingType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<Guid?>("UomId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CurrencyId");
|
||||
|
||||
b.HasIndex("MaterialGroupId");
|
||||
|
||||
b.HasIndex("MaterialTypeId");
|
||||
|
||||
b.HasIndex("UomId");
|
||||
|
||||
b.ToTable("Scp_T_Material", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -5696,6 +5805,75 @@ namespace Kurs.Platform.Migrations
|
|||
b.ToTable("Scp_T_MaterialGroup", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialSpecification", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<bool>("IsRequired")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid>("MaterialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("SpecificationName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("SpecificationValue")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid?>("TenantId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("TenantId");
|
||||
|
||||
b.Property<Guid>("UnitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MaterialId");
|
||||
|
||||
b.HasIndex("UnitId");
|
||||
|
||||
b.ToTable("Scp_T_MaterialSpecification", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialType", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -6490,6 +6668,9 @@ namespace Kurs.Platform.Migrations
|
|||
.HasColumnType("decimal(18,2)")
|
||||
.HasDefaultValue(0m);
|
||||
|
||||
b.Property<Guid?>("MaterialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<long>("MobileNumber")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("bigint");
|
||||
|
|
@ -6573,6 +6754,8 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasIndex("CustomerTypeId");
|
||||
|
||||
b.HasIndex("MaterialId");
|
||||
|
||||
b.HasIndex("PaymentTermId");
|
||||
|
||||
b.HasIndex("SectorId");
|
||||
|
|
@ -9837,6 +10020,9 @@ namespace Kurs.Platform.Migrations
|
|||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid?>("MaterialId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
|
|
@ -9864,6 +10050,8 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MaterialId");
|
||||
|
||||
b.HasIndex("UomCategoryId");
|
||||
|
||||
b.ToTable("Adm_T_Uom", (string)null);
|
||||
|
|
@ -12891,6 +13079,36 @@ namespace Kurs.Platform.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Material", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
|
||||
.WithMany()
|
||||
.HasForeignKey("CurrencyId");
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.MaterialGroup", "MaterialGroup")
|
||||
.WithMany("Materials")
|
||||
.HasForeignKey("MaterialGroupId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.MaterialType", "MaterialType")
|
||||
.WithMany("Materials")
|
||||
.HasForeignKey("MaterialTypeId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.Uom", "Uom")
|
||||
.WithMany("Materials")
|
||||
.HasForeignKey("UomId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("Currency");
|
||||
|
||||
b.Navigation("MaterialGroup");
|
||||
|
||||
b.Navigation("MaterialType");
|
||||
|
||||
b.Navigation("Uom");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.MaterialGroup", "ParentGroup")
|
||||
|
|
@ -12901,6 +13119,25 @@ namespace Kurs.Platform.Migrations
|
|||
b.Navigation("ParentGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialSpecification", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Material", "Material")
|
||||
.WithMany("Specifications")
|
||||
.HasForeignKey("MaterialId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.Uom", "Unit")
|
||||
.WithMany("MaterialSpecifications")
|
||||
.HasForeignKey("UnitId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Material");
|
||||
|
||||
b.Navigation("Unit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Meal", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Branch", "Branch")
|
||||
|
|
@ -12954,6 +13191,10 @@ namespace Kurs.Platform.Migrations
|
|||
.HasForeignKey("CustomerTypeId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.Material", null)
|
||||
.WithMany("Suppliers")
|
||||
.HasForeignKey("MaterialId");
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.PaymentTerm", "PaymentTerm")
|
||||
.WithMany()
|
||||
.HasForeignKey("PaymentTermId");
|
||||
|
|
@ -13329,6 +13570,10 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
|
||||
{
|
||||
b.HasOne("Kurs.Platform.Entities.Material", null)
|
||||
.WithMany("AlternativeUoms")
|
||||
.HasForeignKey("MaterialId");
|
||||
|
||||
b.HasOne("Kurs.Platform.Entities.UomCategory", "UomCategory")
|
||||
.WithMany("Uoms")
|
||||
.HasForeignKey("UomCategoryId")
|
||||
|
|
@ -13658,11 +13903,27 @@ namespace Kurs.Platform.Migrations
|
|||
b.Navigation("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Material", b =>
|
||||
{
|
||||
b.Navigation("AlternativeUoms");
|
||||
|
||||
b.Navigation("Specifications");
|
||||
|
||||
b.Navigation("Suppliers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b =>
|
||||
{
|
||||
b.Navigation("Materials");
|
||||
|
||||
b.Navigation("SubGroups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.MaterialType", b =>
|
||||
{
|
||||
b.Navigation("Materials");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Order", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
|
|
@ -13776,6 +14037,13 @@ namespace Kurs.Platform.Migrations
|
|||
b.Navigation("Certificates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
|
||||
{
|
||||
b.Navigation("MaterialSpecifications");
|
||||
|
||||
b.Navigation("Materials");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b =>
|
||||
{
|
||||
b.Navigation("Uoms");
|
||||
|
|
|
|||
Loading…
Reference in a new issue