diff --git a/Backend/ERPCore/Infra/Persistence/Migrations/20260715093552_InitialCreate.Designer.cs b/Backend/ERPCore/Infra/Persistence/Migrations/20260715093552_InitialCreate.Designer.cs
deleted file mode 100644
index 0406326..0000000
--- a/Backend/ERPCore/Infra/Persistence/Migrations/20260715093552_InitialCreate.Designer.cs
+++ /dev/null
@@ -1,2229 +0,0 @@
-//
-using System;
-using ERPCore.Infra.Persistence;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace ERPCore.Infra.Persistence.Migrations
-{
- [DbContext(typeof(ErpDbContext))]
- [Migration("20260715093552_InitialCreate")]
- partial class InitialCreate
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.9")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("ERPCore.Domain.Entities.AuditLog", b =>
- {
- b.Property("AuditId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("AuditId"));
-
- b.Property("Action")
- .IsRequired()
- .HasMaxLength(10)
- .HasColumnType("character varying(10)");
-
- b.Property("ChangeSet")
- .IsRequired()
- .HasColumnType("jsonb");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("EntityId")
- .HasColumnType("integer");
-
- b.Property("EntityType")
- .IsRequired()
- .HasMaxLength(80)
- .HasColumnType("character varying(80)");
-
- b.Property("UserId")
- .HasColumnType("integer");
-
- b.HasKey("AuditId");
-
- b.HasIndex("CreatedAt");
-
- b.HasIndex("UserId");
-
- b.HasIndex("EntityType", "EntityId");
-
- b.ToTable("audit_logs", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Batch", b =>
- {
- b.Property("BatchId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("BatchId"));
-
- b.Property("BatchNo")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("ExpiryDate")
- .HasColumnType("date");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.HasKey("BatchId");
-
- b.HasIndex("ItemId", "BatchNo")
- .IsUnique();
-
- b.ToTable("batches", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Bin", b =>
- {
- b.Property("BinId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("BinId"));
-
- b.Property("BinType")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("BinId");
-
- b.HasIndex("WarehouseId", "Code")
- .IsUnique();
-
- b.ToTable("bins", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Category", b =>
- {
- b.Property("CategoryId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CategoryId"));
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("ParentId")
- .HasColumnType("integer");
-
- b.HasKey("CategoryId");
-
- b.HasIndex("ParentId");
-
- b.ToTable("categories", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Grn", b =>
- {
- b.Property("GrnId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("GrnId"));
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CreatedBy")
- .HasColumnType("integer");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("PoId")
- .HasColumnType("integer");
-
- b.Property("PostedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("RowVersion")
- .IsConcurrencyToken()
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("xid")
- .HasColumnName("xmin");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("VendorId")
- .HasColumnType("integer");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("GrnId");
-
- b.HasIndex("CreatedBy");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("PoId");
-
- b.HasIndex("Status");
-
- b.HasIndex("VendorId");
-
- b.HasIndex("WarehouseId");
-
- b.ToTable("grns", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.GrnLine", b =>
- {
- b.Property("GrnLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("GrnLineId"));
-
- b.Property("BatchId")
- .HasColumnType("integer");
-
- b.Property("BinId")
- .HasColumnType("integer");
-
- b.Property("GrnId")
- .HasColumnType("integer");
-
- b.Property("HoldStatus")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("PoLineId")
- .HasColumnType("integer");
-
- b.Property("Qty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("ReceivedValue")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("UnitCost")
- .HasPrecision(18, 6)
- .HasColumnType("numeric(18,6)");
-
- b.Property("UomId")
- .HasColumnType("integer");
-
- b.HasKey("GrnLineId");
-
- b.HasIndex("BatchId");
-
- b.HasIndex("BinId");
-
- b.HasIndex("GrnId");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("PoLineId");
-
- b.HasIndex("UomId");
-
- b.ToTable("grn_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Item", b =>
- {
- b.Property("ItemId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ItemId"));
-
- b.Property("BaseUomId")
- .HasColumnType("integer");
-
- b.Property("CategoryId")
- .HasColumnType("integer");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("DefaultVendorId")
- .HasColumnType("integer");
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("ItemType")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("RowVersion")
- .IsConcurrencyToken()
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("xid")
- .HasColumnName("xmin");
-
- b.Property("Sku")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Status")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)")
- .HasDefaultValue("Active");
-
- b.Property("TaxClass")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("TrackingMode")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("ItemId");
-
- b.HasIndex("BaseUomId");
-
- b.HasIndex("CategoryId");
-
- b.HasIndex("DefaultVendorId");
-
- b.HasIndex("Sku")
- .IsUnique();
-
- b.HasIndex("Status");
-
- b.ToTable("items", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.ItemReorder", b =>
- {
- b.Property("ReorderId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ReorderId"));
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("ReorderPoint")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("ReorderQty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("ReorderId");
-
- b.HasIndex("WarehouseId");
-
- b.HasIndex("ItemId", "WarehouseId")
- .IsUnique();
-
- b.ToTable("item_reorders", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.JournalEntryStub", b =>
- {
- b.Property("JournalId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("JournalId"));
-
- b.Property("Amount")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("CreditAccount")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("DebitAccount")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("SourceDocId")
- .HasColumnType("integer");
-
- b.Property("SourceDocType")
- .IsRequired()
- .HasMaxLength(10)
- .HasColumnType("character varying(10)");
-
- b.HasKey("JournalId");
-
- b.HasIndex("SourceDocType", "SourceDocId");
-
- b.ToTable("journal_entry_stubs", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.NumberSequence", b =>
- {
- b.Property("SequenceId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SequenceId"));
-
- b.Property("DocType")
- .IsRequired()
- .HasMaxLength(10)
- .HasColumnType("character varying(10)")
- .HasColumnName("doc_type");
-
- b.Property("LastNumber")
- .HasColumnType("integer")
- .HasColumnName("last_number");
-
- b.Property("Year")
- .HasColumnType("integer")
- .HasColumnName("year");
-
- b.HasKey("SequenceId");
-
- b.HasIndex("DocType", "Year")
- .IsUnique();
-
- b.ToTable("number_sequences", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.PoLine", b =>
- {
- b.Property("PoLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("PoLineId"));
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("PoId")
- .HasColumnType("integer");
-
- b.Property("Qty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("QtyReceived")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("Tax")
- .HasPrecision(9, 4)
- .HasColumnType("numeric(9,4)");
-
- b.Property("UnitPrice")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("UomId")
- .HasColumnType("integer");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("PoLineId");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("PoId");
-
- b.HasIndex("UomId");
-
- b.HasIndex("WarehouseId");
-
- b.ToTable("po_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.PurchaseOrder", b =>
- {
- b.Property("PoId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("PoId"));
-
- b.Property("ApprovalRequired")
- .HasColumnType("boolean");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CreatedBy")
- .HasColumnType("integer");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("RequisitionId")
- .HasColumnType("integer");
-
- b.Property("RowVersion")
- .IsConcurrencyToken()
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("xid")
- .HasColumnName("xmin");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("VendorId")
- .HasColumnType("integer");
-
- b.HasKey("PoId");
-
- b.HasIndex("CreatedBy");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("RequisitionId");
-
- b.HasIndex("Status");
-
- b.HasIndex("VendorId");
-
- b.ToTable("purchase_orders", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.PurchaseReturn", b =>
- {
- b.Property("ReturnId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ReturnId"));
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CreatedBy")
- .HasColumnType("integer");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("ReasonCodeId")
- .HasColumnType("integer");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("VendorId")
- .HasColumnType("integer");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("ReturnId");
-
- b.HasIndex("CreatedBy");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("ReasonCodeId");
-
- b.HasIndex("VendorId");
-
- b.HasIndex("WarehouseId");
-
- b.ToTable("purchase_returns", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.PurchaseReturnLine", b =>
- {
- b.Property("ReturnLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ReturnLineId"));
-
- b.Property("GrnLineId")
- .HasColumnType("integer");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("Qty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("ReturnId")
- .HasColumnType("integer");
-
- b.HasKey("ReturnLineId");
-
- b.HasIndex("GrnLineId");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("ReturnId");
-
- b.ToTable("purchase_return_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.ReasonCode", b =>
- {
- b.Property("ReasonCodeId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ReasonCodeId"));
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("Context")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("Description")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.HasKey("ReasonCodeId");
-
- b.HasIndex("Context", "Code")
- .IsUnique();
-
- b.ToTable("reason_codes", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Requisition", b =>
- {
- b.Property("RequisitionId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("RequisitionId"));
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("RequestedBy")
- .HasColumnType("integer");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("RequisitionId");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("RequestedBy");
-
- b.HasIndex("Status");
-
- b.ToTable("requisitions", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.RequisitionLine", b =>
- {
- b.Property("ReqLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ReqLineId"));
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("Qty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("RequiredBy")
- .HasColumnType("date");
-
- b.Property("RequisitionId")
- .HasColumnType("integer");
-
- b.HasKey("ReqLineId");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("RequisitionId");
-
- b.ToTable("requisition_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Rfq", b =>
- {
- b.Property("RfqId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("RfqId"));
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("RequisitionId")
- .HasColumnType("integer");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("RfqId");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("RequisitionId");
-
- b.ToTable("rfqs", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.RfqLine", b =>
- {
- b.Property("RfqLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("RfqLineId"));
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("Qty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("RfqId")
- .HasColumnType("integer");
-
- b.HasKey("RfqLineId");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("RfqId");
-
- b.ToTable("rfq_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Serial", b =>
- {
- b.Property("SerialId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SerialId"));
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("SerialNo")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("SerialId");
-
- b.HasIndex("ItemId", "SerialNo")
- .IsUnique();
-
- b.ToTable("serials", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockAdjustment", b =>
- {
- b.Property("AdjustmentId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("AdjustmentId"));
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CreatedBy")
- .HasColumnType("integer");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("ReasonCodeId")
- .HasColumnType("integer");
-
- b.Property("RowVersion")
- .IsConcurrencyToken()
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("xid")
- .HasColumnName("xmin");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("AdjustmentId");
-
- b.HasIndex("CreatedBy");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("ReasonCodeId");
-
- b.HasIndex("WarehouseId");
-
- b.ToTable("stock_adjustments", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockAdjustmentLine", b =>
- {
- b.Property("AdjLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("AdjLineId"));
-
- b.Property("AdjustmentId")
- .HasColumnType("integer");
-
- b.Property("BatchId")
- .HasColumnType("integer");
-
- b.Property("BinId")
- .HasColumnType("integer");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("QtyDelta")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("SerialId")
- .HasColumnType("integer");
-
- b.HasKey("AdjLineId");
-
- b.HasIndex("AdjustmentId");
-
- b.HasIndex("BatchId");
-
- b.HasIndex("BinId");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("SerialId");
-
- b.ToTable("stock_adjustment_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockCount", b =>
- {
- b.Property("CountId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CountId"));
-
- b.Property("CountType")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CreatedBy")
- .HasColumnType("integer");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("RowVersion")
- .IsConcurrencyToken()
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("xid")
- .HasColumnName("xmin");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("CountId");
-
- b.HasIndex("CreatedBy");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("Status");
-
- b.HasIndex("WarehouseId");
-
- b.ToTable("stock_counts", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockCountLine", b =>
- {
- b.Property("CountLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CountLineId"));
-
- b.Property("BinId")
- .HasColumnType("integer");
-
- b.Property("CountId")
- .HasColumnType("integer");
-
- b.Property("CountedQty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("SystemQty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("Variance")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.HasKey("CountLineId");
-
- b.HasIndex("BinId");
-
- b.HasIndex("CountId");
-
- b.HasIndex("ItemId");
-
- b.ToTable("stock_count_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockLayer", b =>
- {
- b.Property("LayerId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("LayerId"));
-
- b.Property("BatchId")
- .HasColumnType("integer");
-
- b.Property("GrnLineId")
- .HasColumnType("integer");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("QtyReceived")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("QtyRemaining")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("ReceiptDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("SerialId")
- .HasColumnType("integer");
-
- b.Property("UnitCost")
- .HasPrecision(18, 6)
- .HasColumnType("numeric(18,6)");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("LayerId");
-
- b.HasIndex("BatchId");
-
- b.HasIndex("GrnLineId");
-
- b.HasIndex("SerialId");
-
- b.HasIndex("WarehouseId");
-
- b.HasIndex("ItemId", "WarehouseId", "ReceiptDate", "LayerId");
-
- b.ToTable("stock_layers", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockLedger", b =>
- {
- b.Property("LedgerId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("LedgerId"));
-
- b.Property("BatchId")
- .HasColumnType("integer");
-
- b.Property("BinId")
- .HasColumnType("integer");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Direction")
- .IsRequired()
- .HasMaxLength(5)
- .HasColumnType("character varying(5)");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("QtyBase")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("RunningBalance")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("SerialId")
- .HasColumnType("integer");
-
- b.Property("SourceDocId")
- .HasColumnType("integer");
-
- b.Property("SourceDocType")
- .IsRequired()
- .HasMaxLength(10)
- .HasColumnType("character varying(10)");
-
- b.Property("UnitCost")
- .HasPrecision(18, 6)
- .HasColumnType("numeric(18,6)");
-
- b.Property("UserId")
- .HasColumnType("integer");
-
- b.Property("Value")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("WarehouseId")
- .HasColumnType("integer");
-
- b.HasKey("LedgerId");
-
- b.HasIndex("BatchId");
-
- b.HasIndex("BinId");
-
- b.HasIndex("SerialId");
-
- b.HasIndex("UserId");
-
- b.HasIndex("WarehouseId");
-
- b.HasIndex("SourceDocType", "SourceDocId");
-
- b.HasIndex("ItemId", "WarehouseId", "CreatedAt");
-
- b.HasIndex("ItemId", "WarehouseId", "LedgerId");
-
- b.ToTable("stock_ledger", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockTransfer", b =>
- {
- b.Property("TransferId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("TransferId"));
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("CreatedBy")
- .HasColumnType("integer");
-
- b.Property("DestWarehouseId")
- .HasColumnType("integer");
-
- b.Property("DocNo")
- .IsRequired()
- .HasMaxLength(30)
- .HasColumnType("character varying(30)");
-
- b.Property("RowVersion")
- .IsConcurrencyToken()
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("xid")
- .HasColumnName("xmin");
-
- b.Property("SrcWarehouseId")
- .HasColumnType("integer");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("TransferId");
-
- b.HasIndex("CreatedBy");
-
- b.HasIndex("DestWarehouseId");
-
- b.HasIndex("DocNo")
- .IsUnique();
-
- b.HasIndex("SrcWarehouseId");
-
- b.HasIndex("Status");
-
- b.ToTable("stock_transfers", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.StockTransferLine", b =>
- {
- b.Property("TransferLineId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("TransferLineId"));
-
- b.Property("BatchId")
- .HasColumnType("integer");
-
- b.Property("DestBinId")
- .HasColumnType("integer");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("Qty")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("QtyReceived")
- .HasPrecision(18, 4)
- .HasColumnType("numeric(18,4)");
-
- b.Property("SerialId")
- .HasColumnType("integer");
-
- b.Property("SrcBinId")
- .HasColumnType("integer");
-
- b.Property("TransferId")
- .HasColumnType("integer");
-
- b.Property("UnitCost")
- .HasPrecision(18, 6)
- .HasColumnType("numeric(18,6)");
-
- b.HasKey("TransferLineId");
-
- b.HasIndex("BatchId");
-
- b.HasIndex("DestBinId");
-
- b.HasIndex("ItemId");
-
- b.HasIndex("SerialId");
-
- b.HasIndex("SrcBinId");
-
- b.HasIndex("TransferId");
-
- b.ToTable("stock_transfer_lines", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Uom", b =>
- {
- b.Property("UomId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UomId"));
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("UomId");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("uoms", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.UomConversion", b =>
- {
- b.Property("ConversionId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ConversionId"));
-
- b.Property("Factor")
- .HasPrecision(18, 6)
- .HasColumnType("numeric(18,6)");
-
- b.Property("FromUomId")
- .HasColumnType("integer");
-
- b.Property("ItemId")
- .HasColumnType("integer");
-
- b.Property("ToUomId")
- .HasColumnType("integer");
-
- b.HasKey("ConversionId");
-
- b.HasIndex("FromUomId");
-
- b.HasIndex("ToUomId");
-
- b.HasIndex("ItemId", "FromUomId", "ToUomId")
- .IsUnique();
-
- b.ToTable("uom_conversions", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.User", b =>
- {
- b.Property("UserId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UserId"));
-
- b.Property("AuthUserId")
- .HasColumnType("uuid")
- .HasColumnName("auth_user_id");
-
- b.Property("DisplayName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("Username")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.HasKey("UserId");
-
- b.HasIndex("AuthUserId")
- .IsUnique();
-
- b.HasIndex("Username")
- .IsUnique();
-
- b.ToTable("users", (string)null);
-
- b.HasData(
- new
- {
- UserId = 1,
- DisplayName = "System",
- Status = "Active",
- Username = "system"
- });
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.Vendor", b =>
- {
- b.Property("VendorId")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("VendorId"));
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Currency")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasMaxLength(3)
- .HasColumnType("character varying(3)")
- .HasDefaultValue("LKR");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("RowVersion")
- .IsConcurrencyToken()
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("xid")
- .HasColumnName("xmin");
-
- b.Property("Status")
- .IsRequired()
- .ValueGeneratedOnAdd()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)")
- .HasDefaultValue("Active");
-
- b.Property("TaxReg")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Terms")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("VendorId");
-
- b.HasIndex("Code")
- .IsUnique();
-
- b.HasIndex("Status");
-
- b.ToTable("vendors", (string)null);
- });
-
- modelBuilder.Entity("ERPCore.Domain.Entities.VendorQuotation", b =>
- {
- b.Property