// using System; using Distribution.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace Distribution.Migrations { [DbContext(typeof(AppDBContext))] [Migration("20261021060022_AddExpenseModule")] partial class AddExpenseModule { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "9.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("Distribution.Models.BankAccount", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AccountName") .IsRequired() .HasMaxLength(200) .HasColumnType("varchar(200)"); b.Property("AccountNumber") .HasMaxLength(100) .HasColumnType("varchar(100)"); b.Property("AccountType") .HasColumnType("int"); b.Property("BankName") .HasMaxLength(200) .HasColumnType("varchar(200)"); b.Property("CashAccountTypeName") .HasMaxLength(100) .HasColumnType("varchar(100)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CurrencyCode") .IsRequired() .HasMaxLength(10) .HasColumnType("varchar(10)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IsDefault") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("AccountType", "AccountName") .IsUnique(); b.ToTable("BankAccounts"); b.HasData( new { Id = new Guid("11111111-1111-1111-1111-000000000001"), AccountName = "Petty Cash", AccountType = 0, CashAccountTypeName = "Petty Cash", CreatedAt = new DateTime(2026, 10, 19, 0, 0, 0, 0, DateTimeKind.Unspecified), CurrencyCode = "LKR", IsActive = true, IsDefault = true }); }); modelBuilder.Entity("Distribution.Models.Brand", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("ExternalErpId") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("Brands"); b.HasData( new { Id = new Guid("21000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Coca-Cola" }, new { Id = new Guid("21000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Lays" }); }); modelBuilder.Entity("Distribution.Models.Category", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AllowCustomerReturn") .HasColumnType("tinyint(1)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("ExternalErpId") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("Categories"); b.HasData( new { Id = new Guid("20000000-0000-0000-0000-000000000001"), AllowCustomerReturn = false, CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Beverages" }, new { Id = new Guid("20000000-0000-0000-0000-000000000002"), AllowCustomerReturn = false, CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Snacks" }); }); modelBuilder.Entity("Distribution.Models.ChequeBook", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("BranchId") .HasColumnType("int"); b.Property("ChequeBookNo") .IsRequired() .HasMaxLength(100) .HasColumnType("varchar(100)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CreatedBy") .HasColumnType("longtext"); b.Property("Description") .HasColumnType("longtext"); b.Property("EndChequeNo") .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("FK_BankAccountId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("ReceivedDate") .HasColumnType("datetime(6)"); b.Property("StartChequeNo") .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("Status") .HasColumnType("int"); b.Property("TotalLeaves") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ChequeBookNo") .IsUnique(); b.HasIndex("FK_BankAccountId"); b.ToTable("ChequeBooks"); }); modelBuilder.Entity("Distribution.Models.ChequePage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasColumnType("decimal(65,30)"); b.Property("CancelReason") .HasColumnType("longtext"); b.Property("ChequeNo") .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("ClearedByBank") .HasColumnType("tinyint(1)"); b.Property("ClearedDate") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CurrencyCode") .HasMaxLength(10) .HasColumnType("varchar(10)"); b.Property("FK_ChequeBookId") .HasColumnType("char(36)"); b.Property("IsAccountPayee") .HasColumnType("tinyint(1)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IsCrossCheque") .HasColumnType("tinyint(1)"); b.Property("IsPostDated") .HasColumnType("tinyint(1)"); b.Property("IssueDate") .HasColumnType("datetime(6)"); b.Property("IssueStatus") .HasColumnType("int"); b.Property("Notes") .HasColumnType("longtext"); b.Property("PayeeId") .HasColumnType("int"); b.Property("PayeeName") .HasColumnType("longtext"); b.Property("PayeeType") .HasColumnType("int"); b.Property("PrintedAt") .HasColumnType("datetime(6)"); b.Property("PrintedBy") .HasColumnType("longtext"); b.Property("Purpose") .HasColumnType("longtext"); b.Property("ReferenceNo") .HasColumnType("longtext"); b.Property("VoucherId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ChequeNo") .IsUnique(); b.HasIndex("FK_ChequeBookId"); b.ToTable("ChequePages"); }); modelBuilder.Entity("Distribution.Models.Claim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Details") .IsRequired() .HasColumnType("longtext"); b.Property("FK_AgencyUserId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("SettledAt") .HasColumnType("datetime(6)"); b.Property("SettledByUserId") .HasColumnType("char(36)"); b.Property("SettlementAmount") .HasColumnType("decimal(65,30)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_AgencyUserId"); b.HasIndex("SettledByUserId"); b.ToTable("Claims"); b.HasData( new { Id = new Guid("53000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 27, 0, 0, 0, 0, DateTimeKind.Unspecified), Details = "Distributor margin claim for Q3 promotional shortfall", FK_AgencyUserId = new Guid("70000000-0000-0000-0000-000000000001"), IsActive = true, SettledAt = new DateTime(2026, 8, 28, 0, 0, 0, 0, DateTimeKind.Unspecified), SettledByUserId = new Guid("29000000-0000-0000-0000-000000000006"), SettlementAmount = 15000m, Status = 1 }); }); modelBuilder.Entity("Distribution.Models.CreditNote", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasColumnType("decimal(65,30)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_SaleReturnId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IssuedAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_SaleReturnId"); b.ToTable("CreditNotes"); b.HasData( new { Id = new Guid("54000000-0000-0000-0000-000000000001"), Amount = 300m, CreatedAt = new DateTime(2026, 8, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_SaleReturnId = new Guid("51000000-0000-0000-0000-000000000001"), IsActive = true, IssuedAt = new DateTime(2026, 8, 26, 0, 0, 0, 0, DateTimeKind.Unspecified) }); }); modelBuilder.Entity("Distribution.Models.DeliveryRun", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CancelReason") .HasColumnType("longtext"); b.Property("CancelTypeCode") .HasColumnType("int"); b.Property("ClosedAt") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_DriverProfileId") .HasColumnType("char(36)"); b.Property("FK_VehicleId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Meterend") .HasColumnType("int"); b.Property("Meterstart") .HasColumnType("int"); b.Property("StartedAt") .HasColumnType("datetime(6)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_DriverProfileId"); b.HasIndex("FK_VehicleId"); b.ToTable("DeliveryRuns"); b.HasData( new { Id = new Guid("31000000-0000-0000-0000-000000000001"), ClosedAt = new DateTime(2026, 8, 25, 14, 0, 0, 0, DateTimeKind.Unspecified), CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified), FK_DriverProfileId = new Guid("30000000-0000-0000-0000-000000000001"), FK_VehicleId = new Guid("28000000-0000-0000-0000-000000000001"), IsActive = true, Meterend = 10550, Meterstart = 10500, StartedAt = new DateTime(2026, 8, 25, 8, 0, 0, 0, DateTimeKind.Unspecified), Status = 2 }, new { Id = new Guid("31000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 30, 8, 45, 0, 0, DateTimeKind.Unspecified), FK_DriverProfileId = new Guid("30000000-0000-0000-0000-000000000002"), FK_VehicleId = new Guid("28000000-0000-0000-0000-000000000002"), IsActive = true, Meterend = 0, Meterstart = 20300, StartedAt = new DateTime(2026, 8, 30, 9, 0, 0, 0, DateTimeKind.Unspecified), Status = 0 }); }); modelBuilder.Entity("Distribution.Models.DeliveryTask", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ConfirmedAt") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CustomerConfirmed") .HasColumnType("tinyint(1)"); b.Property("FK_RideId") .HasColumnType("char(36)"); b.Property("FK_ShopPOId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Note") .HasColumnType("longtext"); b.Property("Sequence") .HasColumnType("int"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_RideId"); b.HasIndex("FK_ShopPOId"); b.ToTable("DeliveryTasks"); b.HasData( new { Id = new Guid("37000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 30, 10, 5, 0, 0, DateTimeKind.Unspecified), CustomerConfirmed = false, FK_RideId = new Guid("31000000-0000-0000-0000-000000000002"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000002"), IsActive = true, Sequence = 1, Status = 0 }); }); modelBuilder.Entity("Distribution.Models.DriverComplianceConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("EnforceLicenseExpiry") .HasColumnType("tinyint(1)"); b.Property("EnforceMedicalClearance") .HasColumnType("tinyint(1)"); b.Property("UpdatedAt") .HasColumnType("datetime(6)"); b.Property("UpdatedBy") .HasColumnType("char(36)"); b.HasKey("Id"); b.ToTable("DriverComplianceConfigs"); b.HasData( new { Id = new Guid("64000000-0000-0000-0000-000000000001"), EnforceLicenseExpiry = true, EnforceMedicalClearance = true, UpdatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), UpdatedBy = new Guid("29000000-0000-0000-0000-000000000001") }); }); modelBuilder.Entity("Distribution.Models.DriverProfile", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_UserId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("LicenseExpiry") .HasColumnType("datetime(6)"); b.Property("LicenseNumber") .IsRequired() .HasColumnType("longtext"); b.Property("MedicalClearanceExpiry") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_UserId") .IsUnique(); b.ToTable("DriverProfiles"); b.HasData( new { Id = new Guid("30000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_UserId = new Guid("29000000-0000-0000-0000-000000000004"), IsActive = true, LicenseExpiry = new DateTime(2027, 6, 30, 0, 0, 0, 0, DateTimeKind.Unspecified), LicenseNumber = "B1234567", MedicalClearanceExpiry = new DateTime(2027, 1, 31, 0, 0, 0, 0, DateTimeKind.Unspecified) }, new { Id = new Guid("30000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_UserId = new Guid("29000000-0000-0000-0000-000000000005"), IsActive = true, LicenseExpiry = new DateTime(2027, 9, 30, 0, 0, 0, 0, DateTimeKind.Unspecified), LicenseNumber = "B7654321", MedicalClearanceExpiry = new DateTime(2027, 3, 31, 0, 0, 0, 0, DateTimeKind.Unspecified) }); }); modelBuilder.Entity("Distribution.Models.Expense", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("BillDate") .HasColumnType("datetime(6)"); b.Property("BillRef") .HasMaxLength(100) .HasColumnType("varchar(100)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("longtext"); b.Property("DueDate") .HasColumnType("datetime(6)"); b.Property("FK_BankAccountId") .HasColumnType("char(36)"); b.Property("FK_CategoryId") .HasColumnType("char(36)"); b.Property("FK_ChequePageId") .HasColumnType("char(36)"); b.Property("FK_RecurringTemplateId") .HasColumnType("char(36)"); b.Property("FK_VendorId") .HasColumnType("char(36)"); b.Property("FK_WarehouseId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Method") .HasColumnType("int"); b.Property("PaidAt") .HasColumnType("datetime(6)"); b.Property("PaidByUserId") .HasColumnType("char(36)"); b.Property("Payee") .HasMaxLength(200) .HasColumnType("varchar(200)"); b.Property("PeriodCovered") .HasColumnType("datetime(6)"); b.Property("PostedAt") .HasColumnType("datetime(6)"); b.Property("PostedByUserId") .HasColumnType("char(36)"); b.Property("RecordedByUserId") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.Property("VoidReason") .HasColumnType("longtext"); b.Property("VoidedAt") .HasColumnType("datetime(6)"); b.Property("VoidedByUserId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("FK_BankAccountId"); b.HasIndex("FK_CategoryId"); b.HasIndex("FK_ChequePageId"); b.HasIndex("FK_RecurringTemplateId"); b.HasIndex("FK_VendorId"); b.HasIndex("FK_WarehouseId"); b.HasIndex("Status", "BillDate"); b.ToTable("Expenses"); }); modelBuilder.Entity("Distribution.Models.ExpenseAttachment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ContentType") .IsRequired() .HasMaxLength(100) .HasColumnType("varchar(100)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ExpenseId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("OriginalFileName") .IsRequired() .HasMaxLength(260) .HasColumnType("varchar(260)"); b.Property("SizeBytes") .HasColumnType("bigint"); b.Property("StoredPath") .IsRequired() .HasMaxLength(500) .HasColumnType("varchar(500)"); b.Property("UploadedByUserId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("FK_ExpenseId"); b.ToTable("ExpenseAttachments"); }); modelBuilder.Entity("Distribution.Models.ExpenseCategory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Code") .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ParentCategoryId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("varchar(100)"); b.HasKey("Id"); b.HasIndex("FK_ParentCategoryId", "Name") .IsUnique(); b.ToTable("ExpenseCategories"); b.HasData( new { Id = new Guid("30000000-0000-0000-0000-000000000001"), Code = "SAL", CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Salaries" }, new { Id = new Guid("30000000-0000-0000-0000-000000000002"), Code = "UTL", CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Utilities" }, new { Id = new Guid("30000000-0000-0000-0000-000000000003"), Code = "RNT", CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Rent" }, new { Id = new Guid("30000000-0000-0000-0000-000000000004"), Code = "VEH", CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Vehicle" }, new { Id = new Guid("30000000-0000-0000-0000-000000000005"), Code = "OFF", CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Office" }, new { Id = new Guid("30000000-0000-0000-0000-000000000006"), Code = "BNK", CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Bank Fees" }, new { Id = new Guid("30000000-0000-0000-0000-000000000007"), Code = "MSC", CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Miscellaneous" }, new { Id = new Guid("30000000-0000-0000-0000-000000000101"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000001"), IsActive = true, Name = "Basic Salary" }, new { Id = new Guid("30000000-0000-0000-0000-000000000102"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000001"), IsActive = true, Name = "Bonus" }, new { Id = new Guid("30000000-0000-0000-0000-000000000103"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000001"), IsActive = true, Name = "Overtime" }, new { Id = new Guid("30000000-0000-0000-0000-000000000201"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000002"), IsActive = true, Name = "Electricity" }, new { Id = new Guid("30000000-0000-0000-0000-000000000202"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000002"), IsActive = true, Name = "Water" }, new { Id = new Guid("30000000-0000-0000-0000-000000000203"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000002"), IsActive = true, Name = "Internet" }, new { Id = new Guid("30000000-0000-0000-0000-000000000301"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000003"), IsActive = true, Name = "Warehouse Rent" }, new { Id = new Guid("30000000-0000-0000-0000-000000000302"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000003"), IsActive = true, Name = "Office Rent" }, new { Id = new Guid("30000000-0000-0000-0000-000000000401"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000004"), IsActive = true, Name = "Fuel" }, new { Id = new Guid("30000000-0000-0000-0000-000000000402"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000004"), IsActive = true, Name = "Maintenance" }, new { Id = new Guid("30000000-0000-0000-0000-000000000403"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000004"), IsActive = true, Name = "Insurance" }, new { Id = new Guid("30000000-0000-0000-0000-000000000501"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000005"), IsActive = true, Name = "Stationery" }, new { Id = new Guid("30000000-0000-0000-0000-000000000502"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000005"), IsActive = true, Name = "Cleaning" }, new { Id = new Guid("30000000-0000-0000-0000-000000000601"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000006"), IsActive = true, Name = "Service Charges" }, new { Id = new Guid("30000000-0000-0000-0000-000000000701"), CreatedAt = new DateTime(2026, 10, 21, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ParentCategoryId = new Guid("30000000-0000-0000-0000-000000000007"), IsActive = true, Name = "Other" }); }); modelBuilder.Entity("Distribution.Models.ExpenseVendor", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ContactInfo") .HasColumnType("longtext"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("varchar(200)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("ExpenseVendors"); }); modelBuilder.Entity("Distribution.Models.GoodsReceipt", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DiscountPercent") .HasPrecision(5, 2) .HasColumnType("decimal(5,2)"); b.Property("FK_PurchaseOrderId") .HasColumnType("char(36)"); b.Property("FK_ReceivedByUserId") .HasColumnType("char(36)"); b.Property("FK_SupplierId") .HasColumnType("char(36)"); b.Property("FK_WarehouseId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("NbtPercent") .HasPrecision(5, 2) .HasColumnType("decimal(5,2)"); b.Property("ReceivedAt") .HasColumnType("datetime(6)"); b.Property("VatPercent") .HasPrecision(5, 2) .HasColumnType("decimal(5,2)"); b.HasKey("Id"); b.HasIndex("FK_PurchaseOrderId"); b.HasIndex("FK_SupplierId"); b.HasIndex("FK_WarehouseId"); b.ToTable("GoodsReceipts"); b.HasData( new { Id = new Guid("43000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), DiscountPercent = 0m, FK_PurchaseOrderId = new Guid("41000000-0000-0000-0000-000000000001"), FK_ReceivedByUserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_WarehouseId = new Guid("27000000-0000-0000-0000-000000000001"), IsActive = true, NbtPercent = 0m, ReceivedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), VatPercent = 0m }); }); modelBuilder.Entity("Distribution.Models.GoodsReceiptItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AcceptedQuantity") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DiscountPercent") .HasPrecision(5, 2) .HasColumnType("decimal(5,2)"); b.Property("FK_GoodsReceiptId") .HasColumnType("char(36)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_PurchaseOrderItemId") .HasColumnType("char(36)"); b.Property("FreeQuantity") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("NbtPercent") .HasPrecision(5, 2) .HasColumnType("decimal(5,2)"); b.Property("RejectedQuantity") .HasColumnType("int"); b.Property("UnitCost") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("VatPercent") .HasPrecision(5, 2) .HasColumnType("decimal(5,2)"); b.HasKey("Id"); b.HasIndex("FK_GoodsReceiptId"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_PurchaseOrderItemId"); b.ToTable("GoodsReceiptItems"); b.HasData( new { Id = new Guid("44000000-0000-0000-0000-000000000001"), AcceptedQuantity = 200, CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), DiscountPercent = 0m, FK_GoodsReceiptId = new Guid("43000000-0000-0000-0000-000000000001"), FK_PurchaseOrderItemId = new Guid("42000000-0000-0000-0000-000000000001"), FreeQuantity = 0, IsActive = true, NbtPercent = 0m, RejectedQuantity = 0, UnitCost = 0m, VatPercent = 0m }, new { Id = new Guid("44000000-0000-0000-0000-000000000002"), AcceptedQuantity = 98, CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), DiscountPercent = 0m, FK_GoodsReceiptId = new Guid("43000000-0000-0000-0000-000000000001"), FK_PurchaseOrderItemId = new Guid("42000000-0000-0000-0000-000000000002"), FreeQuantity = 0, IsActive = true, NbtPercent = 0m, RejectedQuantity = 2, UnitCost = 0m, VatPercent = 0m }); }); modelBuilder.Entity("Distribution.Models.GoodsReceiptItemBatch", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_GoodsReceiptItemId") .HasColumnType("char(36)"); b.Property("FK_ItemBatchId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Quantity") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_GoodsReceiptItemId"); b.HasIndex("FK_ItemBatchId"); b.ToTable("GoodsReceiptItemBatches"); }); modelBuilder.Entity("Distribution.Models.GoodsReceiptItemSerial", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_GoodsReceiptItemId") .HasColumnType("char(36)"); b.Property("FK_ItemSerialNumberId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("FK_GoodsReceiptItemId"); b.HasIndex("FK_ItemSerialNumberId"); b.ToTable("GoodsReceiptItemSerials"); }); modelBuilder.Entity("Distribution.Models.Invoice", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CreatedBy") .HasColumnType("char(36)"); b.Property("FK_ShopPOId") .HasColumnType("char(36)"); b.Property("FinalizedAt") .HasColumnType("datetime(6)"); b.Property("FinalizedBy") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("PaymentStatus") .HasColumnType("int"); b.Property("PrintedAt") .HasColumnType("datetime(6)"); b.Property("PrintedBy") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.Property("TotalAmount") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ShopPOId"); b.ToTable("Invoices"); b.HasData( new { Id = new Guid("34500000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 8, 30, 0, 0, DateTimeKind.Unspecified), CreatedBy = new Guid("29000000-0000-0000-0000-000000000002"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000001"), FinalizedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), FinalizedBy = new Guid("29000000-0000-0000-0000-000000000001"), IsActive = true, PaymentStatus = 2, PrintedAt = new DateTime(2026, 8, 25, 8, 45, 0, 0, DateTimeKind.Unspecified), PrintedBy = new Guid("29000000-0000-0000-0000-000000000002"), Status = 2, TotalAmount = 3000m }, new { Id = new Guid("34500000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified), CreatedBy = new Guid("29000000-0000-0000-0000-000000000003"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000003"), IsActive = true, PaymentStatus = 1, PrintedAt = new DateTime(2026, 8, 31, 9, 15, 0, 0, DateTimeKind.Unspecified), PrintedBy = new Guid("29000000-0000-0000-0000-000000000003"), Status = 1, TotalAmount = 2400m }); }); modelBuilder.Entity("Distribution.Models.Item", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AllowCustomWarrantyPeriod") .HasColumnType("tinyint(1)"); b.Property("CostPrice") .HasColumnType("decimal(65,30)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("longtext"); b.Property("ExternalErpItemId") .HasColumnType("int"); b.Property("FK_BaseUomId") .HasColumnType("char(36)"); b.Property("FK_BrandId") .HasColumnType("char(36)"); b.Property("FK_CategoryId") .HasColumnType("char(36)"); b.Property("FK_SubCategoryId") .HasColumnType("char(36)"); b.Property("HasWarranty") .HasColumnType("tinyint(1)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("LastSyncedAt") .HasColumnType("datetime(6)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.Property("ReorderLevel") .HasColumnType("decimal(65,30)"); b.Property("SalePrice") .HasColumnType("decimal(65,30)"); b.Property("Sku") .IsRequired() .HasColumnType("longtext"); b.Property("SyncSource") .HasColumnType("int"); b.Property("TracksBatches") .HasColumnType("tinyint(1)"); b.Property("TracksExpiryDate") .HasColumnType("tinyint(1)"); b.Property("TracksSerialNumbers") .HasColumnType("tinyint(1)"); b.Property("WarrantyPeriodDays") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_BaseUomId"); b.HasIndex("FK_BrandId"); b.HasIndex("FK_CategoryId"); b.HasIndex("FK_SubCategoryId"); b.ToTable("Items"); b.HasData( new { Id = new Guid("23000000-0000-0000-0000-000000000001"), AllowCustomWarrantyPeriod = false, CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Coca-Cola 500ml bottle", FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"), FK_BrandId = new Guid("21000000-0000-0000-0000-000000000001"), FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000001"), HasWarranty = false, IsActive = true, Name = "Coca-Cola 500ml", SalePrice = 60m, Sku = "BEV-COKE-500", SyncSource = 0, TracksBatches = false, TracksExpiryDate = false, TracksSerialNumbers = false }, new { Id = new Guid("23000000-0000-0000-0000-000000000002"), AllowCustomWarrantyPeriod = false, CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Coca-Cola 1.5L bottle", FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"), FK_BrandId = new Guid("21000000-0000-0000-0000-000000000001"), FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000001"), HasWarranty = false, IsActive = true, Name = "Coca-Cola 1.5L", SalePrice = 120m, Sku = "BEV-COKE-1500", SyncSource = 0, TracksBatches = false, TracksExpiryDate = false, TracksSerialNumbers = false }, new { Id = new Guid("23000000-0000-0000-0000-000000000003"), AllowCustomWarrantyPeriod = false, CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Lays Classic Salted 52g pack", FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"), FK_BrandId = new Guid("21000000-0000-0000-0000-000000000002"), FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000002"), HasWarranty = false, IsActive = true, Name = "Lays Classic 52g", SalePrice = 50m, Sku = "SNK-LAYS-52", SyncSource = 0, TracksBatches = false, TracksExpiryDate = false, TracksSerialNumbers = false }, new { Id = new Guid("23000000-0000-0000-0000-000000000004"), AllowCustomWarrantyPeriod = false, CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Lays Family Pack 150g", FK_BaseUomId = new Guid("22000000-0000-0000-0000-000000000001"), FK_BrandId = new Guid("21000000-0000-0000-0000-000000000002"), FK_CategoryId = new Guid("20000000-0000-0000-0000-000000000002"), HasWarranty = false, IsActive = true, Name = "Lays Family Pack 150g", SalePrice = 150m, Sku = "SNK-LAYS-FAM", SyncSource = 0, TracksBatches = false, TracksExpiryDate = false, TracksSerialNumbers = false }); }); modelBuilder.Entity("Distribution.Models.ItemBatch", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("BatchNumber") .HasColumnType("varchar(255)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("ExpiryDate") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("ManufactureDate") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_ItemId", "BatchNumber"); b.ToTable("ItemBatches"); }); modelBuilder.Entity("Distribution.Models.ItemSerialNumber", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CurrentLocationId") .HasColumnType("char(36)"); b.Property("CurrentLocationType") .HasColumnType("int"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("ReceivedAt") .HasColumnType("datetime(6)"); b.Property("SerialNumber") .IsRequired() .HasColumnType("varchar(255)"); b.Property("Status") .HasColumnType("int"); b.Property("WarrantyExpiresAt") .HasColumnType("datetime(6)"); b.Property("WarrantyPeriodDaysOverride") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_ItemId", "SerialNumber") .IsUnique(); b.ToTable("ItemSerialNumbers"); }); modelBuilder.Entity("Distribution.Models.LoadingSheet", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ConfirmedAt") .HasColumnType("datetime(6)"); b.Property("ConfirmedBy") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_RideId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("PopulatedAt") .HasColumnType("datetime(6)"); b.Property("PopulatedBy") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_RideId"); b.ToTable("LoadingSheets"); b.HasData( new { Id = new Guid("35000000-0000-0000-0000-000000000001"), ConfirmedAt = new DateTime(2026, 8, 25, 7, 45, 0, 0, DateTimeKind.Unspecified), ConfirmedBy = new Guid("29000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified), FK_RideId = new Guid("31000000-0000-0000-0000-000000000001"), IsActive = true, PopulatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified), PopulatedBy = new Guid("29000000-0000-0000-0000-000000000001"), Status = 1 }); }); modelBuilder.Entity("Distribution.Models.LoadingSheetItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_LoadingSheetId") .HasColumnType("char(36)"); b.Property("FK_ShopPOItemId") .HasColumnType("char(36)"); b.Property("FK_WarehouseId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("QuantityDispatched") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_LoadingSheetId"); b.HasIndex("FK_ShopPOItemId"); b.HasIndex("FK_WarehouseId"); b.ToTable("LoadingSheetItems"); b.HasData( new { Id = new Guid("36000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_LoadingSheetId = new Guid("35000000-0000-0000-0000-000000000001"), FK_WarehouseId = new Guid("27000000-0000-0000-0000-000000000001"), IsActive = true, QuantityDispatched = 50m }, new { Id = new Guid("36000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), FK_LoadingSheetId = new Guid("35000000-0000-0000-0000-000000000001"), FK_WarehouseId = new Guid("27000000-0000-0000-0000-000000000001"), IsActive = true, QuantityDispatched = 30m }); }); modelBuilder.Entity("Distribution.Models.LoadingSheetOrder", b => { b.Property("FK_LoadingSheetId") .HasColumnType("char(36)"); b.Property("FK_ShopPOId") .HasColumnType("char(36)"); b.HasKey("FK_LoadingSheetId", "FK_ShopPOId"); b.HasIndex("FK_ShopPOId"); b.ToTable("LoadingSheetOrders"); }); modelBuilder.Entity("Distribution.Models.Payment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasColumnType("decimal(65,30)"); b.Property("ChequeDate") .HasColumnType("datetime(6)"); b.Property("ChequeNumber") .HasColumnType("longtext"); b.Property("CollectedAt") .HasColumnType("datetime(6)"); b.Property("CollectedBy") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("EntryMode") .HasColumnType("int"); b.Property("FK_BankAccountId") .HasColumnType("char(36)"); b.Property("FK_InvoiceId") .HasColumnType("char(36)"); b.Property("FK_ReceivedChequeId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Method") .HasColumnType("int"); b.Property("RecordedBy") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("FK_BankAccountId"); b.HasIndex("FK_InvoiceId"); b.HasIndex("FK_ReceivedChequeId"); b.ToTable("Payments"); b.HasData( new { Id = new Guid("47000000-0000-0000-0000-000000000001"), Amount = 3000m, CollectedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified), CollectedBy = new Guid("29000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified), EntryMode = 0, FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000001"), IsActive = true, Method = 0 }, new { Id = new Guid("47000000-0000-0000-0000-000000000002"), Amount = 1000m, CollectedAt = new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified), CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified), EntryMode = 0, FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"), IsActive = true, Method = 0 }, new { Id = new Guid("47000000-0000-0000-0000-000000000003"), Amount = 800m, ChequeDate = new DateTime(2026, 8, 31, 0, 0, 0, 0, DateTimeKind.Unspecified), ChequeNumber = "000456", CollectedAt = new DateTime(2026, 8, 31, 11, 0, 0, 0, DateTimeKind.Unspecified), CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 31, 18, 0, 0, 0, DateTimeKind.Unspecified), EntryMode = 1, FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"), IsActive = true, Method = 1, RecordedBy = new Guid("29000000-0000-0000-0000-000000000001") }, new { Id = new Guid("47000000-0000-0000-0000-000000000004"), Amount = 300m, CollectedAt = new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified), CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified), EntryMode = 0, FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"), IsActive = true, Method = 2 }); }); modelBuilder.Entity("Distribution.Models.Permission", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Code") .IsRequired() .HasColumnType("longtext"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.ToTable("Permissions"); b.HasData( new { Id = new Guid("20000000-0000-0000-0000-000000000001"), Code = "orders.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View shop POs, invoices, payments and returns", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000002"), Code = "rides.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage delivery rides and delivery tasks", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000003"), Code = "loading.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage loading sheets", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000004"), Code = "stores.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View store accounts, credit limits and balances", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000005"), Code = "sales_visits.checkin", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Check in and out of scheduled store visits", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000006"), Code = "items.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage catalogue products", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000007"), Code = "categories.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage product categories and brands", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000008"), Code = "warehouses.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View stock balances, movements, warehouses and reports", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000009"), Code = "purchase_orders.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage purchase orders, GRNs and supplier claims", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000010"), Code = "pricelists.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage regional price lists", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000011"), Code = "schemes.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage pricing schemes and promotions", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000012"), Code = "suppliers.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage supplier accounts", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000013"), Code = "driver_profiles.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage driver profiles and licensing", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000014"), Code = "compliance.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Manage driver compliance rules", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000015"), Code = "users.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage staff user accounts", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000016"), Code = "roles.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage roles and their permission sets", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000017"), Code = "regions.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage regions and region configuration", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000018"), Code = "routes.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage delivery routes", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000019"), Code = "vehicles.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View and manage fleet vehicles", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000020"), Code = "claim.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View agency claims and settlement status", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000021"), Code = "claim.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and settle agency claims", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000022"), Code = "delivery-task.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View delivery tasks within a ride", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000023"), Code = "delivery-task.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Confirm and fail delivery tasks", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000024"), Code = "driver.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View driver profiles and license details", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000025"), Code = "driver.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and update driver profiles", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000026"), Code = "grn.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View goods receipt notes", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000027"), Code = "grn.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and confirm goods receipts", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000028"), Code = "loading-sheet.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View loading sheets and their items", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000029"), Code = "loading-sheet.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create, edit, and confirm loading sheets", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000030"), Code = "price-list.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View regional price lists", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000031"), Code = "price-list.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and manage item price lists", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000032"), Code = "purchase-order.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View purchase orders and line items", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000033"), Code = "purchase-order.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create, confirm, and close purchase orders", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000034"), Code = "purchase-return.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and manage purchase returns to suppliers", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000035"), Code = "region.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View regions and their configuration", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000036"), Code = "region.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and update regions, targets, and budgets", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000037"), Code = "return.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View order returns", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000038"), Code = "return.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and manage order returns", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000039"), Code = "route.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View delivery routes", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000040"), Code = "route.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and manage delivery routes", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000041"), Code = "scheme.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View pricing schemes and promotions", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000042"), Code = "scheme.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and configure pricing schemes", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000043"), Code = "stock.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View stock balances and movements", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000044"), Code = "stock.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Transfer stock and record damage or adjustments", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000045"), Code = "store.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View store accounts and balances", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000046"), Code = "store.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and update store accounts", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000047"), Code = "supplier-claim.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View supplier claims", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000048"), Code = "supplier-claim.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and resolve supplier claims", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000049"), Code = "sys-config.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View system configuration settings", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000050"), Code = "sys-config.manage", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Update system configuration settings", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000051"), Code = "expense.view", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "View expenses, categories, vendors and recurring templates", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000052"), Code = "expense.create", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Create and edit draft expenses", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000053"), Code = "expense.post", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Post a draft expense (approve it)", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000054"), Code = "expense.pay", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Pay a posted expense (debit a bank account or issue a cheque)", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000055"), Code = "expense.void", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Void an expense", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000056"), Code = "expense.manage_categories", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Manage expense categories, titles and vendors", IsActive = true }, new { Id = new Guid("20000000-0000-0000-0000-000000000057"), Code = "expense.manage_recurring", CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Description = "Manage recurring expense templates", IsActive = true }); }); modelBuilder.Entity("Distribution.Models.PriceList", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("EffectiveFrom") .HasColumnType("datetime(6)"); b.Property("EffectiveTo") .HasColumnType("datetime(6)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("FK_RegionId"); b.ToTable("PriceLists"); b.HasData( new { Id = new Guid("39000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EffectiveFrom = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EffectiveTo = new DateTime(2026, 12, 31, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), IsActive = true, Name = "Western Province Price List" }); }); modelBuilder.Entity("Distribution.Models.PriceListItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AgencyMarginPercent") .HasColumnType("decimal(65,30)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_PriceListId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("MinPrice") .HasColumnType("decimal(65,30)"); b.Property("Price") .HasColumnType("decimal(65,30)"); b.Property("RetailPrice") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_PriceListId", "FK_ItemId") .IsUnique(); b.ToTable("PriceListItems"); b.HasData( new { Id = new Guid("40000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_PriceListId = new Guid("39000000-0000-0000-0000-000000000001"), IsActive = true, MinPrice = 55m, Price = 60m }, new { Id = new Guid("40000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), FK_PriceListId = new Guid("39000000-0000-0000-0000-000000000001"), IsActive = true, MinPrice = 45m, Price = 50m }); }); modelBuilder.Entity("Distribution.Models.PurchaseOrder", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CancelReason") .HasColumnType("longtext"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_CreatedByUserId") .HasColumnType("char(36)"); b.Property("FK_SupplierId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_SupplierId"); b.ToTable("PurchaseOrders"); b.HasData( new { Id = new Guid("41000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 14, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_CreatedByUserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_SupplierId = new Guid("38000000-0000-0000-0000-000000000001"), IsActive = true, Status = 2 }, new { Id = new Guid("41000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 14, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_CreatedByUserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_SupplierId = new Guid("38000000-0000-0000-0000-000000000002"), IsActive = true, Status = 2 }); }); modelBuilder.Entity("Distribution.Models.PurchaseOrderItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CancelledQuantity") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_PurchaseOrderId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IsCancelled") .HasColumnType("tinyint(1)"); b.Property("Quantity") .HasColumnType("int"); b.Property("ReceivedQuantity") .HasColumnType("int"); b.Property("UnitCost") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_PurchaseOrderId"); b.ToTable("PurchaseOrderItems"); b.HasData( new { Id = new Guid("42000000-0000-0000-0000-000000000001"), CancelledQuantity = 0, CreatedAt = new DateTime(2026, 8, 14, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_PurchaseOrderId = new Guid("41000000-0000-0000-0000-000000000001"), IsActive = true, IsCancelled = false, Quantity = 200, ReceivedQuantity = 200, UnitCost = 40m }, new { Id = new Guid("42000000-0000-0000-0000-000000000002"), CancelledQuantity = 0, CreatedAt = new DateTime(2026, 8, 14, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000002"), FK_PurchaseOrderId = new Guid("41000000-0000-0000-0000-000000000001"), IsActive = true, IsCancelled = false, Quantity = 100, ReceivedQuantity = 98, UnitCost = 80m }, new { Id = new Guid("42000000-0000-0000-0000-000000000003"), CancelledQuantity = 0, CreatedAt = new DateTime(2026, 8, 14, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), FK_PurchaseOrderId = new Guid("41000000-0000-0000-0000-000000000002"), IsActive = true, IsCancelled = false, Quantity = 150, ReceivedQuantity = 150, UnitCost = 35m }); }); modelBuilder.Entity("Distribution.Models.PurchaseReturn", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_PurchaseOrderId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Reason") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("FK_PurchaseOrderId"); b.ToTable("PurchaseReturns"); b.HasData( new { Id = new Guid("45000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_PurchaseOrderId = new Guid("41000000-0000-0000-0000-000000000002"), IsActive = true, Reason = "Damaged in transit" }); }); modelBuilder.Entity("Distribution.Models.PurchaseReturnItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_PurchaseReturnId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Quantity") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_PurchaseReturnId"); b.ToTable("PurchaseReturnItems"); b.HasData( new { Id = new Guid("46000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), FK_PurchaseReturnId = new Guid("45000000-0000-0000-0000-000000000001"), IsActive = true, Quantity = 10 }); }); modelBuilder.Entity("Distribution.Models.ReceivedCheque", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AccountHolderName") .HasColumnType("longtext"); b.Property("Amount") .HasColumnType("decimal(65,30)"); b.Property("BranchId") .HasColumnType("int"); b.Property("ChequeDate") .HasColumnType("datetime(6)"); b.Property("ChequeNo") .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CreatedBy") .HasColumnType("longtext"); b.Property("DepositDate") .HasColumnType("datetime(6)"); b.Property("DrawerBankBranch") .HasColumnType("longtext"); b.Property("DrawerBankName") .HasColumnType("longtext"); b.Property("FK_DepositBankAccountId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Notes") .HasColumnType("longtext"); b.Property("ReceivedDate") .HasColumnType("datetime(6)"); b.Property("ReceivedFromId") .HasColumnType("int"); b.Property("ReceivedFromName") .IsRequired() .HasMaxLength(200) .HasColumnType("varchar(200)"); b.Property("ReceivedFromType") .HasColumnType("int"); b.Property("ReferenceId") .HasColumnType("int"); b.Property("ReferenceType") .HasColumnType("longtext"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ChequeNo"); b.HasIndex("FK_DepositBankAccountId"); b.ToTable("ReceivedCheques"); }); modelBuilder.Entity("Distribution.Models.RecurringExpenseTemplate", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("AutoPost") .HasColumnType("tinyint(1)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DayOfMonth") .HasColumnType("int"); b.Property("DayOfWeek") .HasColumnType("int"); b.Property("Description") .HasColumnType("longtext"); b.Property("EndDate") .HasColumnType("datetime(6)"); b.Property("FK_CategoryId") .HasColumnType("char(36)"); b.Property("FK_VendorId") .HasColumnType("char(36)"); b.Property("FK_WarehouseId") .HasColumnType("char(36)"); b.Property("Frequency") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IsPaused") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("varchar(200)"); b.Property("NextRunDate") .HasColumnType("datetime(6)"); b.Property("Payee") .HasColumnType("longtext"); b.Property("StartDate") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_CategoryId"); b.HasIndex("FK_VendorId"); b.HasIndex("FK_WarehouseId"); b.HasIndex("IsPaused", "NextRunDate"); b.ToTable("RecurringExpenseTemplates"); }); modelBuilder.Entity("Distribution.Models.Region", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Code") .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("Code") .IsUnique(); b.ToTable("Regions"); b.HasData( new { Id = new Guid("24000000-0000-0000-0000-000000000001"), Code = "REG-0001", CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Western Province" }, new { Id = new Guid("24000000-0000-0000-0000-000000000002"), Code = "REG-0002", CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Central Province" }); }); modelBuilder.Entity("Distribution.Models.RegionAgencyMap", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_AgencyUserId") .HasColumnType("char(36)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("FK_AgencyUserId"); b.HasIndex("FK_RegionId", "FK_AgencyUserId") .IsUnique(); b.ToTable("RegionAgencyMaps"); b.HasData( new { Id = new Guid("57000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_AgencyUserId = new Guid("70000000-0000-0000-0000-000000000001"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), IsActive = true }); }); modelBuilder.Entity("Distribution.Models.RegionalBudget", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("BudgetAmount") .HasColumnType("decimal(65,30)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Period") .IsRequired() .HasColumnType("varchar(255)"); b.HasKey("Id"); b.HasIndex("FK_RegionId", "Period") .IsUnique(); b.ToTable("RegionalBudgets"); b.HasData( new { Id = new Guid("58000000-0000-0000-0000-000000000001"), BudgetAmount = 200000m, CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), IsActive = true, Period = "2026-08" }); }); modelBuilder.Entity("Distribution.Models.RegionalTarget", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Period") .IsRequired() .HasColumnType("varchar(255)"); b.Property("TargetValue") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_RegionId", "Period") .IsUnique(); b.ToTable("RegionalTargets"); b.HasData( new { Id = new Guid("59000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), IsActive = true, Period = "2026-08", TargetValue = 500000m }); }); modelBuilder.Entity("Distribution.Models.RegionalTaxRule", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("RuleConfig") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("FK_RegionId") .IsUnique(); b.ToTable("RegionalTaxRules"); b.HasData( new { Id = new Guid("60000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), IsActive = true, RuleConfig = "{\"rate\": 0.15}" }); }); modelBuilder.Entity("Distribution.Models.Role", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Level") .HasColumnType("int"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("Roles"); b.HasData( new { Id = new Guid("10000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Level = 10, Name = "SalesRep" }, new { Id = new Guid("10000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Level = 20, Name = "Supervisor" }, new { Id = new Guid("10000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Level = 30, Name = "AreaManager" }, new { Id = new Guid("10000000-0000-0000-0000-000000000004"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Level = 40, Name = "AreaSupervisor" }, new { Id = new Guid("10000000-0000-0000-0000-000000000005"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Level = 50, Name = "RegionalManager" }, new { Id = new Guid("10000000-0000-0000-0000-000000000006"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Level = 60, Name = "RegionalAgency" }, new { Id = new Guid("10000000-0000-0000-0000-000000000007"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Level = 100, Name = "SuperAdmin" }); }); modelBuilder.Entity("Distribution.Models.RolePermission", b => { b.Property("FK_RoleId") .HasColumnType("char(36)"); b.Property("FK_PermissionId") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Id") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("FK_RoleId", "FK_PermissionId"); b.HasIndex("FK_PermissionId"); b.ToTable("RolePermissions"); b.HasData( new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("fa88ee94-4387-45a8-8e0b-67a3eb0d9537"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("007f96a6-dbb2-4745-be0f-7566ebab4f72"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("855bb33c-4507-435f-86e7-b86128d61099"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000004"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("86b89230-02bb-42d8-90d4-f93a75d729f8"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000005"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("2dcd53da-35e2-44c5-9fd9-84e5eeecb099"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000006"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("d32844a6-5e5d-4ac8-a56c-4bad70be7ceb"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000007"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("1a49ce67-81e2-4c6f-8e16-e07824964fc8"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000008"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("f4c6729b-5347-4be2-8686-db7347958f35"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000009"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("d35f14b7-34ca-4637-8a22-9ca8e3ac52ad"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000010"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("fcbb69ec-6023-4fb3-8d41-30658666015d"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000011"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("88c5c40c-d211-40d9-8bf5-df11e9995738"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000012"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("0d5c388f-08f1-4ee5-adcd-5e0d8e061128"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000013"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("7e726a5d-f487-4e29-8730-75fd64dc0100"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000014"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("9f6e9256-cb78-4a44-863e-6d31e69ff8d5"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000015"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("8fbdda8b-9eb3-490c-8c21-7a8f51c82404"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000016"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("56f26354-9548-42c2-8b58-30c936db1bcd"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000017"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("69d9de8f-107b-42d0-b345-e215b5cd5ccc"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000018"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("21fa8dd9-596d-4c2c-86de-0a27e4e8cfd4"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000019"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("750380a2-57da-4b98-b26f-2d893055e83f"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000020"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("9a628e80-953f-4b55-8f46-aafb51a2f03a"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000021"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("82e0dcfc-9df0-4135-b1bc-29bafca0e203"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000022"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("40b78431-d5fc-4ff3-b12c-cfd9560b24e4"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000023"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("9b3dfd17-cedd-4d7c-940c-5123f3a41b04"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000024"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("7230884d-f645-4aac-974e-9b4f8b46b9ff"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000025"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("9e688eea-f12f-4e19-aefb-1e19e781dee5"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000026"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("9d6babbb-3775-4780-ab60-740d6d51f228"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000027"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("7386b804-bc20-4c7f-9a83-7de92a554f3d"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000028"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("28228445-b041-46a1-b44f-c6b782bdb306"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000029"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("e8f3a603-3493-41ef-b1fa-a0747c93903e"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000030"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("8157e3d4-f167-47ce-a94c-a13de1ecbbea"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000031"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("9c587621-e2a4-48b6-863e-7b95ba0d4615"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000032"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("b5c889df-6dee-49fc-809f-396711d8eebb"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000033"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("3a892eaf-8fd4-4db0-ada0-619af8e6da11"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000034"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("c1504432-86de-4bdc-bf61-47bbb5e40f19"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000035"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("ea52442b-2106-4ef0-9d99-73ef24620f8d"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000036"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("e5d0003f-4d2e-4d49-9085-7141477d7536"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000037"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("795c1b6a-d2f7-4be1-9ba4-cb9c9015bac1"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000038"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("2c9af086-aec2-43f8-8bd6-bcd03e2acb31"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000039"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("f2b6da6b-c0ca-4674-878b-13609840cf9a"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000040"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("7580af1a-9570-4817-b2da-d0fdd25e6402"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000041"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("1f6e4e53-7821-4c2a-a749-5be09b39e26d"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000042"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("a41c5218-e402-47d1-a0a6-67c0fa0228a8"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000043"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("98ef584e-58fb-462b-9cdf-439228aa3be4"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000044"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("a4a06976-e48c-4cb4-9933-e9c222f6c80d"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000045"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("068494b3-4cc7-4b70-b771-a73035f26ca4"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000046"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("0e54ed62-3450-49af-9c57-b247e5b9a813"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000047"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("80f35776-d931-435c-a02c-eed567593b5b"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000048"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("69e6f0fb-75ef-41ee-a229-40ceef5bbf3e"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000049"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("be136f8c-f847-4881-a723-60cf2cd874e4"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000050"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("b3abf6c8-5317-4688-a5c4-426e843fb93c"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000051"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("756c4a39-7754-4b97-b967-29e7745084f6"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000052"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("0dee3b9c-f54e-4373-a33c-f774ab005787"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000053"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("0132bd0a-4baa-47fb-b2e2-e056dd662b0f"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000054"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("6cfbcfa8-c46e-4d57-8481-b6c695a6d2d8"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000055"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("04bdabea-6f18-4090-b21a-98afb14cc1b9"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000056"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("ae57197c-20f8-40be-9f3b-6a614c02403c"), IsActive = true }, new { FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FK_PermissionId = new Guid("20000000-0000-0000-0000-000000000057"), CreatedAt = new DateTime(2026, 8, 18, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("b27b94e1-1779-40ad-b212-53298735b0f2"), IsActive = true }); }); modelBuilder.Entity("Distribution.Models.Route", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("EndPoint") .HasColumnType("longtext"); b.Property("FK_OwnerUserId") .HasColumnType("char(36)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Length") .HasColumnType("decimal(65,30)"); b.Property("RouteName") .IsRequired() .HasColumnType("longtext"); b.Property("StartPoint") .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("FK_OwnerUserId"); b.HasIndex("FK_RegionId"); b.ToTable("Routes"); b.HasData( new { Id = new Guid("25000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), EndPoint = "Dehiwala", FK_OwnerUserId = new Guid("29000000-0000-0000-0000-000000000002"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), IsActive = true, Length = 18.5m, RouteName = "Colombo City Route", StartPoint = "Colombo Fort" }, new { Id = new Guid("25000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), EndPoint = "Negombo", FK_OwnerUserId = new Guid("29000000-0000-0000-0000-000000000002"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), IsActive = true, Length = 32.0m, RouteName = "Negombo Coastal Route", StartPoint = "Wattala" }, new { Id = new Guid("25000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), EndPoint = "Peradeniya", FK_OwnerUserId = new Guid("29000000-0000-0000-0000-000000000003"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000002"), IsActive = true, Length = 12.0m, RouteName = "Kandy Town Route", StartPoint = "Kandy Lake" }, new { Id = new Guid("25000000-0000-0000-0000-000000000004"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), EndPoint = "Matale", FK_OwnerUserId = new Guid("29000000-0000-0000-0000-000000000003"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000002"), IsActive = true, Length = 26.0m, RouteName = "Matale Route", StartPoint = "Kandy" }); }); modelBuilder.Entity("Distribution.Models.RouteVisitLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CheckInAt") .HasColumnType("datetime(6)"); b.Property("CheckInLatitude") .HasColumnType("decimal(65,30)"); b.Property("CheckInLongitude") .HasColumnType("decimal(65,30)"); b.Property("CheckOutAt") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_RouteId") .HasColumnType("char(36)"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("FK_UserId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IsDeviationFlagged") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("FK_RouteId"); b.HasIndex("FK_StoreId"); b.HasIndex("FK_UserId"); b.ToTable("RouteVisitLogs"); b.HasData( new { Id = new Guid("66000000-0000-0000-0000-000000000001"), CheckInAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), CheckInLatitude = 6.9344m, CheckInLongitude = 79.8428m, CheckOutAt = new DateTime(2026, 8, 25, 9, 25, 0, 0, DateTimeKind.Unspecified), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"), FK_UserId = new Guid("29000000-0000-0000-0000-000000000002"), IsActive = true, IsDeviationFlagged = false }, new { Id = new Guid("66000000-0000-0000-0000-000000000002"), CheckInAt = new DateTime(2026, 8, 25, 10, 0, 0, 0, DateTimeKind.Unspecified), CheckInLatitude = 6.9000m, CheckInLongitude = 79.8654m, CreatedAt = new DateTime(2026, 8, 25, 10, 0, 0, 0, DateTimeKind.Unspecified), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000002"), FK_UserId = new Guid("29000000-0000-0000-0000-000000000002"), IsActive = true, IsDeviationFlagged = true }); }); modelBuilder.Entity("Distribution.Models.SaleReturn", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CreatedByUserId") .HasColumnType("char(36)"); b.Property("FK_ShopPOId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Mode") .HasColumnType("int"); b.Property("TotalCreditAmount") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("CreatedByUserId"); b.HasIndex("FK_ShopPOId"); b.ToTable("SaleReturns"); b.HasData( new { Id = new Guid("51000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), CreatedByUserId = new Guid("29000000-0000-0000-0000-000000000002"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000001"), IsActive = true, Mode = 0, TotalCreditAmount = 300m }); }); modelBuilder.Entity("Distribution.Models.SaleReturnItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_SaleReturnId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Quantity") .HasColumnType("decimal(65,30)"); b.Property("ReasonCode") .HasColumnType("int"); b.Property("UnitPrice") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_SaleReturnId"); b.ToTable("SaleReturnItems"); b.HasData( new { Id = new Guid("52000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_SaleReturnId = new Guid("51000000-0000-0000-0000-000000000001"), IsActive = true, Quantity = 5m, ReasonCode = 1, UnitPrice = 60m }); }); modelBuilder.Entity("Distribution.Models.SaleRoute", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.ToTable("SaleRoutes"); b.HasData( new { Id = new Guid("69000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true }, new { Id = new Guid("69000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true }); }); modelBuilder.Entity("Distribution.Models.Scheme", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AgentLimitExempt") .HasColumnType("tinyint(1)"); b.Property("BaselineExpectedSales") .HasColumnType("decimal(65,30)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DateRangeFrom") .HasColumnType("datetime(6)"); b.Property("DateRangeTo") .HasColumnType("datetime(6)"); b.Property("EligibleSegment") .HasColumnType("longtext"); b.Property("FK_FreeItemId") .HasColumnType("char(36)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("FK_TriggerItemId") .HasColumnType("char(36)"); b.Property("FreeQty") .HasColumnType("decimal(65,30)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.Property("RegionId") .HasColumnType("char(36)"); b.Property("RuleConfig") .HasColumnType("longtext"); b.Property("RuleType") .HasColumnType("int"); b.Property("TriggerQty") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_FreeItemId"); b.HasIndex("FK_TriggerItemId"); b.HasIndex("RegionId"); b.ToTable("Schemes"); b.HasData( new { Id = new Guid("48000000-0000-0000-0000-000000000001"), AgentLimitExempt = false, BaselineExpectedSales = 500000m, CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateRangeFrom = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateRangeTo = new DateTime(2026, 12, 31, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_FreeItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), FK_TriggerItemId = new Guid("23000000-0000-0000-0000-000000000001"), FreeQty = 1m, IsActive = true, Name = "Buy 10 Coke Get 1 Free", RuleType = 0, TriggerQty = 10 }, new { Id = new Guid("48000000-0000-0000-0000-000000000002"), AgentLimitExempt = false, CreatedAt = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateRangeFrom = new DateTime(2026, 8, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateRangeTo = new DateTime(2026, 12, 31, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_FreeItemId = new Guid("23000000-0000-0000-0000-000000000004"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000002"), FreeQty = 1m, IsActive = true, Name = "Snack Combo Bundle", RuleType = 3 }); }); modelBuilder.Entity("Distribution.Models.SchemeBundleComponent", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_SchemeId") .HasColumnType("char(36)"); b.Property("Qty") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_SchemeId", "FK_ItemId") .IsUnique(); b.ToTable("SchemeBundleComponents"); b.HasData( new { Id = new Guid("49000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), FK_SchemeId = new Guid("48000000-0000-0000-0000-000000000002"), Qty = 5 }); }); modelBuilder.Entity("Distribution.Models.SchemeRedemption", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("DiscountAmount") .HasColumnType("decimal(65,30)"); b.Property("FK_FreeItemId") .HasColumnType("char(36)"); b.Property("FK_SchemeId") .HasColumnType("char(36)"); b.Property("FK_ShopPOId") .HasColumnType("char(36)"); b.Property("FieldInvoiceId") .HasColumnType("char(36)"); b.Property("FreeItemCostValue") .HasColumnType("decimal(65,30)"); b.Property("FreeQty") .HasColumnType("decimal(65,30)"); b.Property("RedeemedAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_FreeItemId"); b.HasIndex("FK_SchemeId"); b.HasIndex("FK_ShopPOId"); b.ToTable("SchemeRedemptions"); b.HasData( new { Id = new Guid("50000000-0000-0000-0000-000000000001"), DiscountAmount = 0m, FK_FreeItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_SchemeId = new Guid("48000000-0000-0000-0000-000000000001"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000001"), FreeItemCostValue = 40m, FreeQty = 1m, RedeemedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified) }); }); modelBuilder.Entity("Distribution.Models.ShopPO", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CancelReason") .HasColumnType("longtext"); b.Property("CancelledAt") .HasColumnType("datetime(6)"); b.Property("CancelledBy") .HasColumnType("char(36)"); b.Property("ConfirmedAt") .HasColumnType("datetime(6)"); b.Property("ConfirmedBy") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("FulfilledAt") .HasColumnType("datetime(6)"); b.Property("InvoiceId") .HasColumnType("char(36)") .HasColumnName("InvoiceId"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("RaisedById") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.Property("TotalAmount") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_StoreId"); b.ToTable("ShopPOs"); b.HasData( new { Id = new Guid("33000000-0000-0000-0000-000000000001"), ConfirmedAt = new DateTime(2026, 8, 25, 8, 30, 0, 0, DateTimeKind.Unspecified), ConfirmedBy = new Guid("29000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"), FulfilledAt = new DateTime(2026, 8, 25, 13, 0, 0, 0, DateTimeKind.Unspecified), InvoiceId = new Guid("34500000-0000-0000-0000-000000000001"), IsActive = true, RaisedById = new Guid("29000000-0000-0000-0000-000000000002"), Status = 2, TotalAmount = 3000m }, new { Id = new Guid("33000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 30, 10, 0, 0, 0, DateTimeKind.Unspecified), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000005"), IsActive = true, RaisedById = new Guid("29000000-0000-0000-0000-000000000003"), Status = 0, TotalAmount = 1200m }, new { Id = new Guid("33000000-0000-0000-0000-000000000003"), ConfirmedAt = new DateTime(2026, 8, 31, 8, 30, 0, 0, DateTimeKind.Unspecified), ConfirmedBy = new Guid("29000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000005"), FulfilledAt = new DateTime(2026, 8, 31, 13, 0, 0, 0, DateTimeKind.Unspecified), InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"), IsActive = true, RaisedById = new Guid("29000000-0000-0000-0000-000000000003"), Status = 2, TotalAmount = 2400m }); }); modelBuilder.Entity("Distribution.Models.ShopPOItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_ShopPOId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Quantity") .HasColumnType("int"); b.Property("QuantityFulfilled") .HasColumnType("int"); b.Property("UnitPrice") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_ShopPOId"); b.ToTable("ShopPOItems"); b.HasData( new { Id = new Guid("34000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000001"), IsActive = true, Quantity = 30, QuantityFulfilled = 30, UnitPrice = 60m }, new { Id = new Guid("34000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000001"), IsActive = true, Quantity = 24, QuantityFulfilled = 24, UnitPrice = 50m }, new { Id = new Guid("34000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 30, 10, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000002"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000002"), IsActive = true, Quantity = 10, QuantityFulfilled = 0, UnitPrice = 120m }, new { Id = new Guid("34000000-0000-0000-0000-000000000004"), CreatedAt = new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000002"), FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000003"), IsActive = true, Quantity = 20, QuantityFulfilled = 20, UnitPrice = 120m }); }); modelBuilder.Entity("Distribution.Models.StockBalance", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("FK_ItemBatchId") .HasColumnType("char(36)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_ItemSerialNumberId") .HasColumnType("char(36)"); b.Property("LocationId") .HasColumnType("char(36)"); b.Property("LocationType") .HasColumnType("int"); b.Property("Quantity") .HasColumnType("decimal(65,30)"); b.Property("UpdatedAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_ItemBatchId"); b.HasIndex("FK_ItemSerialNumberId"); b.HasIndex("FK_ItemId", "LocationId", "FK_ItemBatchId", "FK_ItemSerialNumberId") .IsUnique(); b.ToTable("StockBalances"); b.HasData( new { Id = new Guid("61000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), LocationId = new Guid("27000000-0000-0000-0000-000000000001"), LocationType = 0, Quantity = 150m, UpdatedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified) }, new { Id = new Guid("61000000-0000-0000-0000-000000000002"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), LocationId = new Guid("27000000-0000-0000-0000-000000000001"), LocationType = 0, Quantity = 90m, UpdatedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified) }, new { Id = new Guid("61000000-0000-0000-0000-000000000003"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), LocationId = new Guid("28000000-0000-0000-0000-000000000001"), LocationType = 1, Quantity = 20m, UpdatedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified) }); }); modelBuilder.Entity("Distribution.Models.StockMovement", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CreatedBy") .HasColumnType("char(36)"); b.Property("FK_ItemBatchId") .HasColumnType("char(36)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_ItemSerialNumberId") .HasColumnType("char(36)"); b.Property("FromLocationId") .HasColumnType("char(36)"); b.Property("FromLocationType") .HasColumnType("int"); b.Property("Quantity") .HasColumnType("decimal(65,30)"); b.Property("ReasonCode") .HasColumnType("longtext"); b.Property("ReferenceId") .HasColumnType("char(36)"); b.Property("ToLocationId") .HasColumnType("char(36)"); b.Property("ToLocationType") .HasColumnType("int"); b.Property("Type") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_ItemBatchId"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_ItemSerialNumberId"); b.ToTable("StockMovements"); b.HasData( new { Id = new Guid("62000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), CreatedBy = new Guid("29000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FromLocationId = new Guid("00000000-0000-0000-0000-000000000000"), FromLocationType = 2, Quantity = 200m, ReferenceId = new Guid("43000000-0000-0000-0000-000000000001"), ToLocationId = new Guid("27000000-0000-0000-0000-000000000001"), ToLocationType = 0, Type = 6 }, new { Id = new Guid("62000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified), CreatedBy = new Guid("29000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FromLocationId = new Guid("27000000-0000-0000-0000-000000000001"), FromLocationType = 0, Quantity = 50m, ReferenceId = new Guid("35000000-0000-0000-0000-000000000001"), ToLocationId = new Guid("28000000-0000-0000-0000-000000000001"), ToLocationType = 1, Type = 5 }, new { Id = new Guid("62000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified), CreatedBy = new Guid("29000000-0000-0000-0000-000000000002"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FromLocationId = new Guid("28000000-0000-0000-0000-000000000001"), FromLocationType = 1, Quantity = 30m, ReferenceId = new Guid("32000000-0000-0000-0000-000000000001"), ToLocationId = new Guid("00000000-0000-0000-0000-000000000000"), ToLocationType = 2, Type = 0 }); }); modelBuilder.Entity("Distribution.Models.Store", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ContactNumber") .HasColumnType("longtext"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CreditAmount") .HasColumnType("decimal(65,30)"); b.Property("CreditLimit") .HasColumnType("decimal(65,30)"); b.Property("FK_RouteId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Latitude") .HasColumnType("decimal(65,30)"); b.Property("Longitude") .HasColumnType("decimal(65,30)"); b.Property("OneTimeAmount") .HasColumnType("decimal(65,30)"); b.Property("OutstandingBalance") .HasColumnType("decimal(65,30)"); b.Property("OwnerName") .HasColumnType("longtext"); b.Property("Segment") .HasColumnType("longtext"); b.Property("StoreAddress") .IsRequired() .HasColumnType("longtext"); b.Property("StoreName") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("FK_RouteId"); b.ToTable("Stores"); b.HasData( new { Id = new Guid("26000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), CreditAmount = 0m, CreditLimit = 50000m, FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), IsActive = true, Latitude = 6.9344m, Longitude = 79.8428m, OneTimeAmount = 0m, OutstandingBalance = 0m, OwnerName = "Saman Kumara", Segment = "Gold", StoreAddress = "12 York Street, Colombo Fort", StoreName = "Fort Mini Mart" }, new { Id = new Guid("26000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), CreditAmount = 0m, CreditLimit = 30000m, FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), IsActive = true, Latitude = 6.8508m, Longitude = 79.8654m, OneTimeAmount = 0m, OutstandingBalance = 5000m, OwnerName = "Nadeesha Silva", Segment = "Silver", StoreAddress = "45 Galle Road, Dehiwala", StoreName = "Dehiwala Grocery" }, new { Id = new Guid("26000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), CreditAmount = 0m, CreditLimit = 40000m, FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"), IsActive = true, Latitude = 6.9890m, Longitude = 79.8912m, OneTimeAmount = 0m, OutstandingBalance = 1200m, OwnerName = "Ruwan Gunasekara", Segment = "Gold", StoreAddress = "88 Negombo Road, Wattala", StoreName = "Wattala Supermarket" }, new { Id = new Guid("26000000-0000-0000-0000-000000000004"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), CreditAmount = 0m, CreditLimit = 25000m, FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"), IsActive = true, Latitude = 7.2094m, Longitude = 79.8380m, OneTimeAmount = 0m, OutstandingBalance = 0m, OwnerName = "Chamari Peiris", StoreAddress = "5 Beach Road, Negombo", StoreName = "Negombo Beach Store" }, new { Id = new Guid("26000000-0000-0000-0000-000000000005"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), CreditAmount = 0m, CreditLimit = 35000m, FK_RouteId = new Guid("25000000-0000-0000-0000-000000000003"), IsActive = true, Latitude = 7.2906m, Longitude = 80.6337m, OneTimeAmount = 0m, OutstandingBalance = 0m, OwnerName = "Dinesh Wickramasinghe", Segment = "Key Account", StoreAddress = "3 Lake Road, Kandy", StoreName = "Kandy Lake View Store" }, new { Id = new Guid("26000000-0000-0000-0000-000000000006"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), CreditAmount = 0m, CreditLimit = 20000m, FK_RouteId = new Guid("25000000-0000-0000-0000-000000000004"), IsActive = true, Latitude = 7.4675m, Longitude = 80.6234m, OneTimeAmount = 0m, OutstandingBalance = 0m, OwnerName = "Ishara Bandara", StoreAddress = "20 Main Street, Matale", StoreName = "Matale Central Store" }); }); modelBuilder.Entity("Distribution.Models.StoreCreditMovement", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Direction") .HasColumnType("int"); b.Property("FK_InvoiceId") .HasColumnType("char(36)"); b.Property("FK_PaymentId") .HasColumnType("char(36)"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Notes") .HasColumnType("longtext"); b.Property("OccurredAt") .HasColumnType("datetime(6)"); b.Property("RecordedBy") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("FK_InvoiceId"); b.HasIndex("FK_PaymentId"); b.HasIndex("FK_StoreId", "OccurredAt"); b.ToTable("StoreCreditMovements"); }); modelBuilder.Entity("Distribution.Models.SubCategory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("ExternalErpId") .HasColumnType("int"); b.Property("FK_CategoryId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("FK_CategoryId"); b.ToTable("SubCategories"); }); modelBuilder.Entity("Distribution.Models.Supplier", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ContactInfo") .HasColumnType("longtext"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.Property("PerformanceScore") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.ToTable("Suppliers"); b.HasData( new { Id = new Guid("38000000-0000-0000-0000-000000000001"), ContactInfo = "+94 11 234 5678", CreatedAt = new DateTime(2026, 8, 14, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Ceylon Beverages Ltd", PerformanceScore = 4.2m }, new { Id = new Guid("38000000-0000-0000-0000-000000000002"), ContactInfo = "+94 11 876 5432", CreatedAt = new DateTime(2026, 8, 14, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Snack Foods (Pvt) Ltd" }); }); modelBuilder.Entity("Distribution.Models.SupplierClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Details") .IsRequired() .HasColumnType("longtext"); b.Property("EvidenceUrl") .HasColumnType("longtext"); b.Property("FK_GoodsReceiptId") .HasColumnType("char(36)"); b.Property("FK_PurchaseOrderId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("RaisedByUserId") .HasColumnType("char(36)"); b.Property("ResolutionAmount") .HasColumnType("decimal(65,30)"); b.Property("ResolutionNotes") .HasColumnType("longtext"); b.Property("ResolutionType") .HasColumnType("int"); b.Property("ResolvedAt") .HasColumnType("datetime(6)"); b.Property("ResolvedByUserId") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_GoodsReceiptId"); b.HasIndex("FK_PurchaseOrderId"); b.HasIndex("RaisedByUserId"); b.HasIndex("ResolvedByUserId"); b.ToTable("SupplierClaims"); b.HasData( new { Id = new Guid("55000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), Details = "2 units of Coke 1.5L received damaged", FK_GoodsReceiptId = new Guid("43000000-0000-0000-0000-000000000001"), FK_PurchaseOrderId = new Guid("41000000-0000-0000-0000-000000000001"), IsActive = true, RaisedByUserId = new Guid("29000000-0000-0000-0000-000000000001"), ResolutionAmount = 160m, ResolutionNotes = "Credited against next invoice", ResolutionType = 1, ResolvedAt = new DateTime(2026, 8, 16, 0, 0, 0, 0, DateTimeKind.Unspecified), ResolvedByUserId = new Guid("29000000-0000-0000-0000-000000000006"), Status = 1 }); }); modelBuilder.Entity("Distribution.Models.SupplierClaimItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_SupplierClaimId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("IssueType") .HasColumnType("int"); b.Property("Quantity") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_SupplierClaimId"); b.ToTable("SupplierClaimItems"); b.HasData( new { Id = new Guid("56000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000002"), FK_SupplierClaimId = new Guid("55000000-0000-0000-0000-000000000001"), IsActive = true, IssueType = 0, Quantity = 2m }); }); modelBuilder.Entity("Distribution.Models.SupplierPayment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_BankAccountId") .HasColumnType("char(36)"); b.Property("FK_ChequePageId") .HasColumnType("char(36)"); b.Property("FK_SupplierId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Method") .HasColumnType("int"); b.Property("Notes") .HasColumnType("longtext"); b.Property("PaidAt") .HasColumnType("datetime(6)"); b.Property("PaidByUserId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("FK_BankAccountId"); b.HasIndex("FK_ChequePageId"); b.HasIndex("FK_SupplierId"); b.ToTable("SupplierPayments"); }); modelBuilder.Entity("Distribution.Models.SupplierPaymentGRN", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AllocatedAmount") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_GoodsReceiptId") .HasColumnType("char(36)"); b.Property("FK_SupplierPaymentId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("FK_GoodsReceiptId"); b.HasIndex("FK_SupplierPaymentId"); b.ToTable("SupplierPaymentGRNs"); }); modelBuilder.Entity("Distribution.Models.SysConfig", b => { b.Property("Key") .HasMaxLength(100) .HasColumnType("varchar(100)"); b.Property("UpdatedAt") .HasColumnType("datetime(6)"); b.Property("UpdatedBy") .HasColumnType("char(36)"); b.Property("Value") .IsRequired() .HasColumnType("longtext"); b.HasKey("Key"); b.ToTable("SysConfigs"); b.HasData( new { Key = "InvoiceCreationMode", UpdatedAt = new DateTime(2026, 9, 17, 0, 0, 0, 0, DateTimeKind.Unspecified), Value = "ModeB" }, new { Key = "Feature.SerialNumberTracking", UpdatedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Value = "false" }, new { Key = "Feature.BatchTracking", UpdatedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Value = "false" }, new { Key = "Feature.ExpiryDateTracking", UpdatedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Value = "false" }, new { Key = "Feature.WarrantyTracking", UpdatedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Value = "false" }, new { Key = "Feature.CustomWarrantyOverride", UpdatedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Value = "false" }, new { Key = "Feature.DefaultWarrantyPeriodDays", UpdatedAt = new DateTime(2026, 10, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Value = "0" }); }); modelBuilder.Entity("Distribution.Models.Uom", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("ExternalErpId") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("Uoms"); b.HasData( new { Id = new Guid("22000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Piece" }, new { Id = new Guid("67000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Name = "Case" }); }); modelBuilder.Entity("Distribution.Models.UomConversion", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("FK_FromUomId") .HasColumnType("char(36)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_ToUomId") .HasColumnType("char(36)"); b.Property("Factor") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_FromUomId"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_ToUomId"); b.ToTable("UomConversions"); b.HasData( new { Id = new Guid("67000000-0000-0000-0000-000000000002"), FK_FromUomId = new Guid("67000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_ToUomId = new Guid("22000000-0000-0000-0000-000000000001"), Factor = 24m }); }); modelBuilder.Entity("Distribution.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_ReportsToUserId") .HasColumnType("char(36)"); b.Property("FK_RoleId") .HasColumnType("char(36)"); b.Property("FullName") .IsRequired() .HasColumnType("longtext"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("UpdatedAt") .HasColumnType("datetime(6)"); b.Property("Username") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("FK_ReportsToUserId"); b.HasIndex("FK_RoleId"); b.ToTable("Users"); b.HasData( new { Id = new Guid("29000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000002"), FullName = "Sunil Fernando", IsActive = true, Username = "sunil.fernando" }, new { Id = new Guid("29000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ReportsToUserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000001"), FullName = "Nimal Perera", IsActive = true, Username = "nimal.perera" }, new { Id = new Guid("29000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ReportsToUserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000001"), FullName = "Kamal Silva", IsActive = true, Username = "kamal.silva" }, new { Id = new Guid("29000000-0000-0000-0000-000000000004"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ReportsToUserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000001"), FullName = "Ruwan Jayasuriya", IsActive = true, Username = "ruwan.jayasuriya" }, new { Id = new Guid("29000000-0000-0000-0000-000000000005"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_ReportsToUserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000001"), FullName = "Priyantha Kumara", IsActive = true, Username = "priyantha.kumara" }, new { Id = new Guid("29000000-0000-0000-0000-000000000006"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000005"), FullName = "Priya Rajapaksa", IsActive = true, Username = "priya.rajapaksa" }, new { Id = new Guid("70000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000006"), FullName = "Channa De Silva", IsActive = true, Username = "channa.desilva" }, new { Id = new Guid("00000001-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 10, 13, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_RoleId = new Guid("10000000-0000-0000-0000-000000000007"), FullName = "Super Admin", IsActive = true, Username = "superadmin" }); }); modelBuilder.Entity("Distribution.Models.UserRegionScope", b => { b.Property("FK_UserId") .HasColumnType("char(36)"); b.Property("FK_RegionId") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Id") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("FK_UserId", "FK_RegionId"); b.HasIndex("FK_RegionId"); b.ToTable("UserRegionScopes"); b.HasData( new { FK_UserId = new Guid("29000000-0000-0000-0000-000000000006"), FK_RegionId = new Guid("24000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("68000000-0000-0000-0000-000000000001"), IsActive = true }); }); modelBuilder.Entity("Distribution.Models.UserRouteScope", b => { b.Property("FK_UserId") .HasColumnType("char(36)"); b.Property("FK_RouteId") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Id") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("FK_UserId", "FK_RouteId"); b.HasIndex("FK_RouteId"); b.ToTable("UserRouteScopes"); b.HasData( new { FK_UserId = new Guid("29000000-0000-0000-0000-000000000001"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("68000000-0000-0000-0000-000000000002"), IsActive = true }); }); modelBuilder.Entity("Distribution.Models.UserStoreScope", b => { b.Property("FK_UserId") .HasColumnType("char(36)"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Id") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.HasKey("FK_UserId", "FK_StoreId"); b.HasIndex("FK_StoreId"); b.ToTable("UserStoreScopes"); b.HasData( new { FK_UserId = new Guid("29000000-0000-0000-0000-000000000003"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000005"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("68000000-0000-0000-0000-000000000003"), IsActive = true }); }); modelBuilder.Entity("Distribution.Models.Vehicle", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DefaultWarehouseId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("NumberPlate") .IsRequired() .HasColumnType("longtext"); b.Property("RegNumber") .IsRequired() .HasColumnType("longtext"); b.Property("Type") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("DefaultWarehouseId"); b.ToTable("Vehicles"); b.HasData( new { Id = new Guid("28000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), DefaultWarehouseId = new Guid("27000000-0000-0000-0000-000000000001"), IsActive = true, NumberPlate = "CAB-1234", RegNumber = "WP-CAB-1234", Type = 2 }, new { Id = new Guid("28000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), DefaultWarehouseId = new Guid("27000000-0000-0000-0000-000000000002"), IsActive = true, NumberPlate = "KY-5678", RegNumber = "CP-KY-5678", Type = 1 }); }); modelBuilder.Entity("Distribution.Models.Warehouse", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Location") .IsRequired() .HasColumnType("longtext"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.Property("Type") .HasColumnType("int"); b.Property("VehicleId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("VehicleId"); b.ToTable("Warehouses"); b.HasData( new { Id = new Guid("27000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Location = "Peliyagoda, Colombo", Name = "Colombo Distribution Center", Type = 0 }, new { Id = new Guid("27000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 20, 0, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, Location = "Katugastota, Kandy", Name = "Kandy Fulfillment Center", Type = 1 }); }); modelBuilder.Entity("Distribution.Models.ChequeBook", b => { b.HasOne("Distribution.Models.BankAccount", "BankAccount") .WithMany() .HasForeignKey("FK_BankAccountId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("BankAccount"); }); modelBuilder.Entity("Distribution.Models.ChequePage", b => { b.HasOne("Distribution.Models.ChequeBook", "ChequeBook") .WithMany("Pages") .HasForeignKey("FK_ChequeBookId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ChequeBook"); }); modelBuilder.Entity("Distribution.Models.Claim", b => { b.HasOne("Distribution.Models.User", "AgencyUser") .WithMany() .HasForeignKey("FK_AgencyUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.User", "SettledByUser") .WithMany() .HasForeignKey("SettledByUserId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("AgencyUser"); b.Navigation("SettledByUser"); }); modelBuilder.Entity("Distribution.Models.CreditNote", b => { b.HasOne("Distribution.Models.SaleReturn", "SaleReturn") .WithMany() .HasForeignKey("FK_SaleReturnId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("SaleReturn"); }); modelBuilder.Entity("Distribution.Models.DeliveryRun", b => { b.HasOne("Distribution.Models.DriverProfile", "DriverProfile") .WithMany() .HasForeignKey("FK_DriverProfileId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Vehicle", "Vehicle") .WithMany() .HasForeignKey("FK_VehicleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("DriverProfile"); b.Navigation("Vehicle"); }); modelBuilder.Entity("Distribution.Models.DeliveryTask", b => { b.HasOne("Distribution.Models.DeliveryRun", "Ride") .WithMany() .HasForeignKey("FK_RideId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ShopPO", "ShopPO") .WithMany() .HasForeignKey("FK_ShopPOId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Ride"); b.Navigation("ShopPO"); }); modelBuilder.Entity("Distribution.Models.DriverProfile", b => { b.HasOne("Distribution.Models.User", "User") .WithMany() .HasForeignKey("FK_UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("Distribution.Models.Expense", b => { b.HasOne("Distribution.Models.BankAccount", "BankAccount") .WithMany() .HasForeignKey("FK_BankAccountId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.ExpenseCategory", "Category") .WithMany() .HasForeignKey("FK_CategoryId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ChequePage", "ChequePage") .WithMany() .HasForeignKey("FK_ChequePageId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.RecurringExpenseTemplate", "RecurringTemplate") .WithMany() .HasForeignKey("FK_RecurringTemplateId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("Distribution.Models.ExpenseVendor", "Vendor") .WithMany() .HasForeignKey("FK_VendorId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Warehouse", "Warehouse") .WithMany() .HasForeignKey("FK_WarehouseId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("BankAccount"); b.Navigation("Category"); b.Navigation("ChequePage"); b.Navigation("RecurringTemplate"); b.Navigation("Vendor"); b.Navigation("Warehouse"); }); modelBuilder.Entity("Distribution.Models.ExpenseAttachment", b => { b.HasOne("Distribution.Models.Expense", "Expense") .WithMany("Attachments") .HasForeignKey("FK_ExpenseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Expense"); }); modelBuilder.Entity("Distribution.Models.ExpenseCategory", b => { b.HasOne("Distribution.Models.ExpenseCategory", "Parent") .WithMany() .HasForeignKey("FK_ParentCategoryId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("Parent"); }); modelBuilder.Entity("Distribution.Models.GoodsReceipt", b => { b.HasOne("Distribution.Models.PurchaseOrder", "PurchaseOrder") .WithMany() .HasForeignKey("FK_PurchaseOrderId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Supplier", "Supplier") .WithMany() .HasForeignKey("FK_SupplierId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Warehouse", "Warehouse") .WithMany() .HasForeignKey("FK_WarehouseId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("PurchaseOrder"); b.Navigation("Supplier"); b.Navigation("Warehouse"); }); modelBuilder.Entity("Distribution.Models.GoodsReceiptItem", b => { b.HasOne("Distribution.Models.GoodsReceipt", "GoodsReceipt") .WithMany("Items") .HasForeignKey("FK_GoodsReceiptId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.PurchaseOrderItem", "PurchaseOrderItem") .WithMany() .HasForeignKey("FK_PurchaseOrderItemId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("GoodsReceipt"); b.Navigation("Item"); b.Navigation("PurchaseOrderItem"); }); modelBuilder.Entity("Distribution.Models.GoodsReceiptItemBatch", b => { b.HasOne("Distribution.Models.GoodsReceiptItem", "GoodsReceiptItem") .WithMany("Batches") .HasForeignKey("FK_GoodsReceiptItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ItemBatch", "ItemBatch") .WithMany() .HasForeignKey("FK_ItemBatchId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("GoodsReceiptItem"); b.Navigation("ItemBatch"); }); modelBuilder.Entity("Distribution.Models.GoodsReceiptItemSerial", b => { b.HasOne("Distribution.Models.GoodsReceiptItem", "GoodsReceiptItem") .WithMany("Serials") .HasForeignKey("FK_GoodsReceiptItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ItemSerialNumber", "ItemSerialNumber") .WithMany() .HasForeignKey("FK_ItemSerialNumberId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("GoodsReceiptItem"); b.Navigation("ItemSerialNumber"); }); modelBuilder.Entity("Distribution.Models.Invoice", b => { b.HasOne("Distribution.Models.ShopPO", "ShopPO") .WithMany() .HasForeignKey("FK_ShopPOId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("ShopPO"); }); modelBuilder.Entity("Distribution.Models.Item", b => { b.HasOne("Distribution.Models.Uom", "BaseUom") .WithMany() .HasForeignKey("FK_BaseUomId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Brand", "Brand") .WithMany() .HasForeignKey("FK_BrandId"); b.HasOne("Distribution.Models.Category", "Category") .WithMany() .HasForeignKey("FK_CategoryId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.SubCategory", "SubCategory") .WithMany() .HasForeignKey("FK_SubCategoryId"); b.Navigation("BaseUom"); b.Navigation("Brand"); b.Navigation("Category"); b.Navigation("SubCategory"); }); modelBuilder.Entity("Distribution.Models.ItemBatch", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); }); modelBuilder.Entity("Distribution.Models.ItemSerialNumber", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); }); modelBuilder.Entity("Distribution.Models.LoadingSheet", b => { b.HasOne("Distribution.Models.DeliveryRun", "Ride") .WithMany() .HasForeignKey("FK_RideId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Ride"); }); modelBuilder.Entity("Distribution.Models.LoadingSheetItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.LoadingSheet", "LoadingSheet") .WithMany("Items") .HasForeignKey("FK_LoadingSheetId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ShopPOItem", "ShopPOItem") .WithMany() .HasForeignKey("FK_ShopPOItemId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("Distribution.Models.Warehouse", "Warehouse") .WithMany() .HasForeignKey("FK_WarehouseId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); b.Navigation("LoadingSheet"); b.Navigation("ShopPOItem"); b.Navigation("Warehouse"); }); modelBuilder.Entity("Distribution.Models.LoadingSheetOrder", b => { b.HasOne("Distribution.Models.LoadingSheet", "LoadingSheet") .WithMany("Orders") .HasForeignKey("FK_LoadingSheetId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ShopPO", "ShopPO") .WithMany() .HasForeignKey("FK_ShopPOId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("LoadingSheet"); b.Navigation("ShopPO"); }); modelBuilder.Entity("Distribution.Models.Payment", b => { b.HasOne("Distribution.Models.BankAccount", "BankAccount") .WithMany() .HasForeignKey("FK_BankAccountId"); b.HasOne("Distribution.Models.Invoice", "Invoice") .WithMany("Payments") .HasForeignKey("FK_InvoiceId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ReceivedCheque", "ReceivedCheque") .WithMany() .HasForeignKey("FK_ReceivedChequeId"); b.Navigation("BankAccount"); b.Navigation("Invoice"); b.Navigation("ReceivedCheque"); }); modelBuilder.Entity("Distribution.Models.PriceList", b => { b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("FK_RegionId"); b.Navigation("Region"); }); modelBuilder.Entity("Distribution.Models.PriceListItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.PriceList", "PriceList") .WithMany("Items") .HasForeignKey("FK_PriceListId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Item"); b.Navigation("PriceList"); }); modelBuilder.Entity("Distribution.Models.PurchaseOrder", b => { b.HasOne("Distribution.Models.Supplier", "Supplier") .WithMany() .HasForeignKey("FK_SupplierId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Supplier"); }); modelBuilder.Entity("Distribution.Models.PurchaseOrderItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.PurchaseOrder", "PurchaseOrder") .WithMany("Items") .HasForeignKey("FK_PurchaseOrderId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); b.Navigation("PurchaseOrder"); }); modelBuilder.Entity("Distribution.Models.PurchaseReturn", b => { b.HasOne("Distribution.Models.PurchaseOrder", "PurchaseOrder") .WithMany() .HasForeignKey("FK_PurchaseOrderId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("PurchaseOrder"); }); modelBuilder.Entity("Distribution.Models.PurchaseReturnItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.PurchaseReturn", "PurchaseReturn") .WithMany("Items") .HasForeignKey("FK_PurchaseReturnId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); b.Navigation("PurchaseReturn"); }); modelBuilder.Entity("Distribution.Models.ReceivedCheque", b => { b.HasOne("Distribution.Models.BankAccount", "DepositBankAccount") .WithMany() .HasForeignKey("FK_DepositBankAccountId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("DepositBankAccount"); }); modelBuilder.Entity("Distribution.Models.RecurringExpenseTemplate", b => { b.HasOne("Distribution.Models.ExpenseCategory", "Category") .WithMany() .HasForeignKey("FK_CategoryId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ExpenseVendor", "Vendor") .WithMany() .HasForeignKey("FK_VendorId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Warehouse", "Warehouse") .WithMany() .HasForeignKey("FK_WarehouseId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("Category"); b.Navigation("Vendor"); b.Navigation("Warehouse"); }); modelBuilder.Entity("Distribution.Models.RegionAgencyMap", b => { b.HasOne("Distribution.Models.User", "AgencyUser") .WithMany() .HasForeignKey("FK_AgencyUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("FK_RegionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("AgencyUser"); b.Navigation("Region"); }); modelBuilder.Entity("Distribution.Models.RegionalBudget", b => { b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("FK_RegionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Region"); }); modelBuilder.Entity("Distribution.Models.RegionalTarget", b => { b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("FK_RegionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Region"); }); modelBuilder.Entity("Distribution.Models.RegionalTaxRule", b => { b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("FK_RegionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Region"); }); modelBuilder.Entity("Distribution.Models.RolePermission", b => { b.HasOne("Distribution.Models.Permission", "Permission") .WithMany() .HasForeignKey("FK_PermissionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Role", "Role") .WithMany() .HasForeignKey("FK_RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Permission"); b.Navigation("Role"); }); modelBuilder.Entity("Distribution.Models.Route", b => { b.HasOne("Distribution.Models.User", "OwnerUser") .WithMany() .HasForeignKey("FK_OwnerUserId"); b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("FK_RegionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("OwnerUser"); b.Navigation("Region"); }); modelBuilder.Entity("Distribution.Models.RouteVisitLog", b => { b.HasOne("Distribution.Models.Route", "Route") .WithMany() .HasForeignKey("FK_RouteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.User", "User") .WithMany() .HasForeignKey("FK_UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Route"); b.Navigation("Store"); b.Navigation("User"); }); modelBuilder.Entity("Distribution.Models.SaleReturn", b => { b.HasOne("Distribution.Models.User", "CreatedByUser") .WithMany() .HasForeignKey("CreatedByUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ShopPO", "ShopPO") .WithMany() .HasForeignKey("FK_ShopPOId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("CreatedByUser"); b.Navigation("ShopPO"); }); modelBuilder.Entity("Distribution.Models.SaleReturnItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.SaleReturn", "SaleReturn") .WithMany("Items") .HasForeignKey("FK_SaleReturnId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); b.Navigation("SaleReturn"); }); modelBuilder.Entity("Distribution.Models.Scheme", b => { b.HasOne("Distribution.Models.Item", "FreeItem") .WithMany() .HasForeignKey("FK_FreeItemId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Item", "TriggerItem") .WithMany() .HasForeignKey("FK_TriggerItemId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("RegionId"); b.Navigation("FreeItem"); b.Navigation("Region"); b.Navigation("TriggerItem"); }); modelBuilder.Entity("Distribution.Models.SchemeBundleComponent", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Scheme", "Scheme") .WithMany("BundleComponents") .HasForeignKey("FK_SchemeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Item"); b.Navigation("Scheme"); }); modelBuilder.Entity("Distribution.Models.SchemeRedemption", b => { b.HasOne("Distribution.Models.Item", "FreeItem") .WithMany() .HasForeignKey("FK_FreeItemId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Scheme", "Scheme") .WithMany("Redemptions") .HasForeignKey("FK_SchemeId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ShopPO", "ShopPO") .WithMany() .HasForeignKey("FK_ShopPOId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("FreeItem"); b.Navigation("Scheme"); b.Navigation("ShopPO"); }); modelBuilder.Entity("Distribution.Models.ShopPO", b => { b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Store"); }); modelBuilder.Entity("Distribution.Models.ShopPOItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.ShopPO", "ShopPO") .WithMany("Items") .HasForeignKey("FK_ShopPOId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); b.Navigation("ShopPO"); }); modelBuilder.Entity("Distribution.Models.StockBalance", b => { b.HasOne("Distribution.Models.ItemBatch", "ItemBatch") .WithMany() .HasForeignKey("FK_ItemBatchId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.ItemSerialNumber", "ItemSerialNumber") .WithMany() .HasForeignKey("FK_ItemSerialNumberId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("Item"); b.Navigation("ItemBatch"); b.Navigation("ItemSerialNumber"); }); modelBuilder.Entity("Distribution.Models.StockMovement", b => { b.HasOne("Distribution.Models.ItemBatch", "ItemBatch") .WithMany() .HasForeignKey("FK_ItemBatchId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.ItemSerialNumber", "ItemSerialNumber") .WithMany() .HasForeignKey("FK_ItemSerialNumberId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("Item"); b.Navigation("ItemBatch"); b.Navigation("ItemSerialNumber"); }); modelBuilder.Entity("Distribution.Models.Store", b => { b.HasOne("Distribution.Models.Route", "Route") .WithMany() .HasForeignKey("FK_RouteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Route"); }); modelBuilder.Entity("Distribution.Models.StoreCreditMovement", b => { b.HasOne("Distribution.Models.Invoice", "Invoice") .WithMany() .HasForeignKey("FK_InvoiceId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Payment", "Payment") .WithMany() .HasForeignKey("FK_PaymentId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Invoice"); b.Navigation("Payment"); b.Navigation("Store"); }); modelBuilder.Entity("Distribution.Models.SubCategory", b => { b.HasOne("Distribution.Models.Category", "Category") .WithMany() .HasForeignKey("FK_CategoryId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Category"); }); modelBuilder.Entity("Distribution.Models.SupplierClaim", b => { b.HasOne("Distribution.Models.GoodsReceipt", "GoodsReceipt") .WithMany() .HasForeignKey("FK_GoodsReceiptId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.PurchaseOrder", "PurchaseOrder") .WithMany() .HasForeignKey("FK_PurchaseOrderId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.User", "RaisedByUser") .WithMany() .HasForeignKey("RaisedByUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.User", "ResolvedByUser") .WithMany() .HasForeignKey("ResolvedByUserId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("GoodsReceipt"); b.Navigation("PurchaseOrder"); b.Navigation("RaisedByUser"); b.Navigation("ResolvedByUser"); }); modelBuilder.Entity("Distribution.Models.SupplierClaimItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.SupplierClaim", "SupplierClaim") .WithMany("Items") .HasForeignKey("FK_SupplierClaimId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Item"); b.Navigation("SupplierClaim"); }); modelBuilder.Entity("Distribution.Models.SupplierPayment", b => { b.HasOne("Distribution.Models.BankAccount", "BankAccount") .WithMany() .HasForeignKey("FK_BankAccountId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.ChequePage", "ChequePage") .WithMany() .HasForeignKey("FK_ChequePageId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Supplier", "Supplier") .WithMany() .HasForeignKey("FK_SupplierId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("BankAccount"); b.Navigation("ChequePage"); b.Navigation("Supplier"); }); modelBuilder.Entity("Distribution.Models.SupplierPaymentGRN", b => { b.HasOne("Distribution.Models.GoodsReceipt", "GoodsReceipt") .WithMany() .HasForeignKey("FK_GoodsReceiptId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.SupplierPayment", "SupplierPayment") .WithMany("Allocations") .HasForeignKey("FK_SupplierPaymentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("GoodsReceipt"); b.Navigation("SupplierPayment"); }); modelBuilder.Entity("Distribution.Models.UomConversion", b => { b.HasOne("Distribution.Models.Uom", "FromUom") .WithMany() .HasForeignKey("FK_FromUomId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Item", "Item") .WithMany("Conversions") .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Uom", "ToUom") .WithMany() .HasForeignKey("FK_ToUomId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("FromUom"); b.Navigation("Item"); b.Navigation("ToUom"); }); modelBuilder.Entity("Distribution.Models.User", b => { b.HasOne("Distribution.Models.User", "ReportsTo") .WithMany() .HasForeignKey("FK_ReportsToUserId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Role", "Role") .WithMany() .HasForeignKey("FK_RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ReportsTo"); b.Navigation("Role"); }); modelBuilder.Entity("Distribution.Models.UserRegionScope", b => { b.HasOne("Distribution.Models.Region", "Region") .WithMany() .HasForeignKey("FK_RegionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.User", "User") .WithMany() .HasForeignKey("FK_UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Region"); b.Navigation("User"); }); modelBuilder.Entity("Distribution.Models.UserRouteScope", b => { b.HasOne("Distribution.Models.Route", "Route") .WithMany() .HasForeignKey("FK_RouteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.User", "User") .WithMany() .HasForeignKey("FK_UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Route"); b.Navigation("User"); }); modelBuilder.Entity("Distribution.Models.UserStoreScope", b => { b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.User", "User") .WithMany() .HasForeignKey("FK_UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Store"); b.Navigation("User"); }); modelBuilder.Entity("Distribution.Models.Vehicle", b => { b.HasOne("Distribution.Models.Warehouse", null) .WithMany() .HasForeignKey("DefaultWarehouseId") .OnDelete(DeleteBehavior.Restrict); }); modelBuilder.Entity("Distribution.Models.Warehouse", b => { b.HasOne("Distribution.Models.Vehicle", "Vehicle") .WithMany() .HasForeignKey("VehicleId"); b.Navigation("Vehicle"); }); modelBuilder.Entity("Distribution.Models.ChequeBook", b => { b.Navigation("Pages"); }); modelBuilder.Entity("Distribution.Models.Expense", b => { b.Navigation("Attachments"); }); modelBuilder.Entity("Distribution.Models.GoodsReceipt", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.GoodsReceiptItem", b => { b.Navigation("Batches"); b.Navigation("Serials"); }); modelBuilder.Entity("Distribution.Models.Invoice", b => { b.Navigation("Payments"); }); modelBuilder.Entity("Distribution.Models.Item", b => { b.Navigation("Conversions"); }); modelBuilder.Entity("Distribution.Models.LoadingSheet", b => { b.Navigation("Items"); b.Navigation("Orders"); }); modelBuilder.Entity("Distribution.Models.PriceList", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.PurchaseOrder", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.PurchaseReturn", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.SaleReturn", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.Scheme", b => { b.Navigation("BundleComponents"); b.Navigation("Redemptions"); }); modelBuilder.Entity("Distribution.Models.ShopPO", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.SupplierClaim", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.SupplierPayment", b => { b.Navigation("Allocations"); }); #pragma warning restore 612, 618 } } }