From 6bdbdf4969d3e8ecd0364a8461999b06105d670b Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sat, 1 Aug 2026 11:04:11 -0400 Subject: [PATCH] feat: drop QuantityOnHand column and StockTransactions table Final step of removing inventory quantity tracking - see docs/superpowers/specs/2026-08-01-remove-inventory-quantity-tracking-design.md. Destructive to any existing on-hand/transaction data; confirmed acceptable since nothing read it automatically. --- CutList.Web/Data/ApplicationDbContext.cs | 19 - CutList.Web/Data/Entities/StockItem.cs | 2 - CutList.Web/Data/Entities/StockTransaction.cs | 24 - ...emoveInventoryQuantityTracking.Designer.cs | 620 ++++++++++++++++++ ...1145943_RemoveInventoryQuantityTracking.cs | 73 +++ .../ApplicationDbContextModelSnapshot.cs | 64 -- 6 files changed, 693 insertions(+), 109 deletions(-) delete mode 100644 CutList.Web/Data/Entities/StockTransaction.cs create mode 100644 CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.Designer.cs create mode 100644 CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.cs diff --git a/CutList.Web/Data/ApplicationDbContext.cs b/CutList.Web/Data/ApplicationDbContext.cs index 947dffc..ef68c1d 100644 --- a/CutList.Web/Data/ApplicationDbContext.cs +++ b/CutList.Web/Data/ApplicationDbContext.cs @@ -13,7 +13,6 @@ public class ApplicationDbContext : DbContext public DbSet Materials => Set(); public DbSet MaterialDimensions => Set(); public DbSet StockItems => Set(); - public DbSet StockTransactions => Set(); public DbSet CuttingTools => Set(); public DbSet Jobs => Set(); public DbSet JobParts => Set(); @@ -157,24 +156,6 @@ public class ApplicationDbContext : DbContext entity.HasIndex(e => new { e.MaterialId, e.LengthInches }).IsUnique(); }); - // StockTransaction - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.Id); - entity.Property(e => e.Notes).HasMaxLength(500); - entity.Property(e => e.CreatedAt).HasDefaultValueSql("GETUTCDATE()"); - - entity.HasOne(e => e.StockItem) - .WithMany(s => s.Transactions) - .HasForeignKey(e => e.StockItemId) - .OnDelete(DeleteBehavior.Cascade); - - entity.HasOne(e => e.Job) - .WithMany() - .HasForeignKey(e => e.JobId) - .OnDelete(DeleteBehavior.SetNull); - }); - // CuttingTool modelBuilder.Entity(entity => { diff --git a/CutList.Web/Data/Entities/StockItem.cs b/CutList.Web/Data/Entities/StockItem.cs index 293054c..fc7d558 100644 --- a/CutList.Web/Data/Entities/StockItem.cs +++ b/CutList.Web/Data/Entities/StockItem.cs @@ -6,12 +6,10 @@ public class StockItem public int MaterialId { get; set; } public decimal LengthInches { get; set; } public string? Name { get; set; } - public int QuantityOnHand { get; set; } = 0; public string? Notes { get; set; } public bool IsActive { get; set; } = true; public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime? UpdatedAt { get; set; } public Material Material { get; set; } = null!; - public ICollection Transactions { get; set; } = new List(); } diff --git a/CutList.Web/Data/Entities/StockTransaction.cs b/CutList.Web/Data/Entities/StockTransaction.cs deleted file mode 100644 index 176583c..0000000 --- a/CutList.Web/Data/Entities/StockTransaction.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace CutList.Web.Data.Entities; - -public class StockTransaction -{ - public int Id { get; set; } - public int StockItemId { get; set; } - public int Quantity { get; set; } - public StockTransactionType Type { get; set; } - public int? JobId { get; set; } - public string? Notes { get; set; } - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; - - public StockItem StockItem { get; set; } = null!; - public Job? Job { get; set; } -} - -public enum StockTransactionType -{ - Received, - Used, - Adjustment, - Scrapped, - Returned -} diff --git a/CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.Designer.cs b/CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.Designer.cs new file mode 100644 index 0000000..dd51d5c --- /dev/null +++ b/CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.Designer.cs @@ -0,0 +1,620 @@ +// +using System; +using CutList.Web.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace CutList.Web.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20260801145943_RemoveInventoryQuantityTracking")] + partial class RemoveInventoryQuantityTracking + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.HasSequence("MaterialDimensionsSequence"); + + modelBuilder.Entity("CutList.Web.Data.Entities.CuttingTool", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("KerfInches") + .HasPrecision(6, 4) + .HasColumnType("decimal(6,4)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("CuttingTools"); + + b.HasData( + new + { + Id = 1, + IsActive = true, + IsDefault = true, + KerfInches = 0.0625m, + Name = "Bandsaw" + }, + new + { + Id = 2, + IsActive = true, + IsDefault = false, + KerfInches = 0.125m, + Name = "Chop Saw" + }, + new + { + Id = 3, + IsActive = true, + IsDefault = false, + KerfInches = 0.0625m, + Name = "Cold Cut Saw" + }, + new + { + Id = 4, + IsActive = true, + IsDefault = false, + KerfInches = 0.0625m, + Name = "Hacksaw" + }); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.Job", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETUTCDATE()"); + + b.Property("Customer") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CuttingToolId") + .HasColumnType("int"); + + b.Property("JobNumber") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("LockedAt") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Notes") + .HasColumnType("nvarchar(max)"); + + b.Property("OptimizationResultJson") + .HasColumnType("nvarchar(max)"); + + b.Property("OptimizedAt") + .HasColumnType("datetime2"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("CuttingToolId"); + + b.HasIndex("JobNumber") + .IsUnique(); + + b.ToTable("Jobs"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.JobPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("JobId") + .HasColumnType("int"); + + b.Property("LengthInches") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("MaterialId") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.HasIndex("MaterialId"); + + b.ToTable("JobParts"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.JobStock", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("IsCustomLength") + .HasColumnType("bit"); + + b.Property("JobId") + .HasColumnType("int"); + + b.Property("LengthInches") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("MaterialId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.Property("StockItemId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.HasIndex("MaterialId"); + + b.HasIndex("StockItemId"); + + b.ToTable("JobStocks"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.Material", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETUTCDATE()"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Grade") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("Shape") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Size") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("Materials"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.MaterialDimensions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValueSql("NEXT VALUE FOR [MaterialDimensionsSequence]"); + + SqlServerPropertyBuilderExtensions.UseSequence(b.Property("Id")); + + b.Property("MaterialId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId") + .IsUnique(); + + b.ToTable((string)null); + + b.UseTpcMappingStrategy(); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.StockItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETUTCDATE()"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("LengthInches") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("MaterialId") + .HasColumnType("int"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Notes") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("MaterialId", "LengthInches") + .IsUnique(); + + b.ToTable("StockItems"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.AngleDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Leg1") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Leg2") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Thickness") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Leg1"); + + b.ToTable("DimAngle", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.ChannelDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Flange") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Height") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Web") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Height"); + + b.ToTable("DimChannel", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.FlatBarDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Thickness") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Width") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Width"); + + b.ToTable("DimFlatBar", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.IBeamDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Height") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("WeightPerFoot") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Height"); + + b.ToTable("DimIBeam", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.PipeDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("NominalSize") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Schedule") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Wall") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("NominalSize"); + + b.ToTable("DimPipe", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.RectangularTubeDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Height") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Wall") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Width") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Width"); + + b.ToTable("DimRectangularTube", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.RoundBarDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Diameter") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Diameter"); + + b.ToTable("DimRoundBar", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.RoundTubeDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("OuterDiameter") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Wall") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("OuterDiameter"); + + b.ToTable("DimRoundTube", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.SquareBarDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Size") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Size"); + + b.ToTable("DimSquareBar", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.SquareTubeDimensions", b => + { + b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); + + b.Property("Size") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.Property("Wall") + .HasPrecision(10, 4) + .HasColumnType("decimal(10,4)"); + + b.HasIndex("Size"); + + b.ToTable("DimSquareTube", (string)null); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.Job", b => + { + b.HasOne("CutList.Web.Data.Entities.CuttingTool", "CuttingTool") + .WithMany("Jobs") + .HasForeignKey("CuttingToolId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("CuttingTool"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.JobPart", b => + { + b.HasOne("CutList.Web.Data.Entities.Job", "Job") + .WithMany("Parts") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CutList.Web.Data.Entities.Material", "Material") + .WithMany("JobParts") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Job"); + + b.Navigation("Material"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.JobStock", b => + { + b.HasOne("CutList.Web.Data.Entities.Job", "Job") + .WithMany("Stock") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CutList.Web.Data.Entities.Material", "Material") + .WithMany() + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("CutList.Web.Data.Entities.StockItem", "StockItem") + .WithMany() + .HasForeignKey("StockItemId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Job"); + + b.Navigation("Material"); + + b.Navigation("StockItem"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.MaterialDimensions", b => + { + b.HasOne("CutList.Web.Data.Entities.Material", "Material") + .WithOne("Dimensions") + .HasForeignKey("CutList.Web.Data.Entities.MaterialDimensions", "MaterialId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.StockItem", b => + { + b.HasOne("CutList.Web.Data.Entities.Material", "Material") + .WithMany("StockItems") + .HasForeignKey("MaterialId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Material"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.CuttingTool", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.Job", b => + { + b.Navigation("Parts"); + + b.Navigation("Stock"); + }); + + modelBuilder.Entity("CutList.Web.Data.Entities.Material", b => + { + b.Navigation("Dimensions"); + + b.Navigation("JobParts"); + + b.Navigation("StockItems"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.cs b/CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.cs new file mode 100644 index 0000000..78562fb --- /dev/null +++ b/CutList.Web/Migrations/20260801145943_RemoveInventoryQuantityTracking.cs @@ -0,0 +1,73 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace CutList.Web.Migrations +{ + /// + public partial class RemoveInventoryQuantityTracking : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "StockTransactions"); + + migrationBuilder.DropColumn( + name: "QuantityOnHand", + table: "StockItems"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "QuantityOnHand", + table: "StockItems", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "StockTransactions", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + JobId = table.Column(type: "int", nullable: true), + StockItemId = table.Column(type: "int", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"), + Notes = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), + Quantity = table.Column(type: "int", nullable: false), + Type = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_StockTransactions", x => x.Id); + table.ForeignKey( + name: "FK_StockTransactions_Jobs_JobId", + column: x => x.JobId, + principalTable: "Jobs", + principalColumn: "Id", + onDelete: ReferentialAction.SetNull); + table.ForeignKey( + name: "FK_StockTransactions_StockItems_StockItemId", + column: x => x.StockItemId, + principalTable: "StockItems", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_StockTransactions_JobId", + table: "StockTransactions", + column: "JobId"); + + migrationBuilder.CreateIndex( + name: "IX_StockTransactions_StockItemId", + table: "StockTransactions", + column: "StockItemId"); + } + } +} diff --git a/CutList.Web/Migrations/ApplicationDbContextModelSnapshot.cs b/CutList.Web/Migrations/ApplicationDbContextModelSnapshot.cs index df24b30..51df39c 100644 --- a/CutList.Web/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/CutList.Web/Migrations/ApplicationDbContextModelSnapshot.cs @@ -325,9 +325,6 @@ namespace CutList.Web.Migrations .HasMaxLength(255) .HasColumnType("nvarchar(255)"); - b.Property("QuantityOnHand") - .HasColumnType("int"); - b.Property("UpdatedAt") .HasColumnType("datetime2"); @@ -339,44 +336,6 @@ namespace CutList.Web.Migrations b.ToTable("StockItems"); }); - modelBuilder.Entity("CutList.Web.Data.Entities.StockTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime2") - .HasDefaultValueSql("GETUTCDATE()"); - - b.Property("JobId") - .HasColumnType("int"); - - b.Property("Notes") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("StockItemId") - .HasColumnType("int"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("JobId"); - - b.HasIndex("StockItemId"); - - b.ToTable("StockTransactions"); - }); - modelBuilder.Entity("CutList.Web.Data.Entities.AngleDimensions", b => { b.HasBaseType("CutList.Web.Data.Entities.MaterialDimensions"); @@ -632,24 +591,6 @@ namespace CutList.Web.Migrations b.Navigation("Material"); }); - modelBuilder.Entity("CutList.Web.Data.Entities.StockTransaction", b => - { - b.HasOne("CutList.Web.Data.Entities.Job", "Job") - .WithMany() - .HasForeignKey("JobId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("CutList.Web.Data.Entities.StockItem", "StockItem") - .WithMany("Transactions") - .HasForeignKey("StockItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Job"); - - b.Navigation("StockItem"); - }); - modelBuilder.Entity("CutList.Web.Data.Entities.CuttingTool", b => { b.Navigation("Jobs"); @@ -670,11 +611,6 @@ namespace CutList.Web.Migrations b.Navigation("StockItems"); }); - - modelBuilder.Entity("CutList.Web.Data.Entities.StockItem", b => - { - b.Navigation("Transactions"); - }); #pragma warning restore 612, 618 } }