// using System; using Distribution.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace Distribution.Migrations { [DbContext(typeof(AppDBContext))] partial class AppDBContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "9.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); 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.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("ActivatedAt") .HasColumnType("datetime(6)"); b.Property("ClosedAt") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_DriverProfileId") .HasColumnType("char(36)"); b.Property("FK_RouteId") .HasColumnType("char(36)"); b.Property("FK_SourceWarehouseId") .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("RideType") .HasColumnType("int"); b.Property("StartedAt") .HasColumnType("datetime(6)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_DriverProfileId"); b.HasIndex("FK_RouteId"); b.HasIndex("FK_SourceWarehouseId"); b.HasIndex("FK_VehicleId"); b.ToTable("DeliveryRuns"); b.HasData( new { Id = new Guid("31000000-0000-0000-0000-000000000001"), ActivatedAt = new DateTime(2026, 8, 25, 8, 15, 0, 0, DateTimeKind.Unspecified), 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_RouteId = new Guid("25000000-0000-0000-0000-000000000001"), FK_SourceWarehouseId = new Guid("27000000-0000-0000-0000-000000000001"), FK_VehicleId = new Guid("28000000-0000-0000-0000-000000000001"), IsActive = true, Meterend = 10550, Meterstart = 10500, RideType = 1, StartedAt = new DateTime(2026, 8, 25, 8, 0, 0, 0, DateTimeKind.Unspecified), Status = 5 }, new { Id = new Guid("31000000-0000-0000-0000-000000000002"), ActivatedAt = new DateTime(2026, 8, 30, 9, 20, 0, 0, DateTimeKind.Unspecified), CreatedAt = new DateTime(2026, 8, 30, 8, 45, 0, 0, DateTimeKind.Unspecified), FK_DriverProfileId = new Guid("30000000-0000-0000-0000-000000000002"), FK_RouteId = new Guid("25000000-0000-0000-0000-000000000003"), FK_SourceWarehouseId = new Guid("27000000-0000-0000-0000-000000000002"), FK_VehicleId = new Guid("28000000-0000-0000-0000-000000000002"), IsActive = true, Meterend = 0, Meterstart = 20300, RideType = 0, StartedAt = new DateTime(2026, 8, 30, 9, 0, 0, 0, DateTimeKind.Unspecified), Status = 2 }); }); 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_OrderId") .HasColumnType("char(36)"); b.Property("FK_RideId") .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_OrderId"); b.HasIndex("FK_RideId"); 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_OrderId = new Guid("33000000-0000-0000-0000-000000000002"), FK_RideId = new Guid("31000000-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.GoodsReceipt", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_PurchaseOrderId") .HasColumnType("char(36)"); b.Property("FK_ReceivedByUserId") .HasColumnType("char(36)"); b.Property("FK_WarehouseId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("ReceivedAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_PurchaseOrderId"); 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), 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, ReceivedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified) }); }); 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("FK_GoodsReceiptId") .HasColumnType("char(36)"); b.Property("FK_PurchaseOrderItemId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("RejectedQuantity") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_GoodsReceiptId"); 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), FK_GoodsReceiptId = new Guid("43000000-0000-0000-0000-000000000001"), FK_PurchaseOrderItemId = new Guid("42000000-0000-0000-0000-000000000001"), IsActive = true, RejectedQuantity = 0 }, new { Id = new Guid("44000000-0000-0000-0000-000000000002"), AcceptedQuantity = 98, CreatedAt = new DateTime(2026, 8, 15, 0, 0, 0, 0, DateTimeKind.Unspecified), FK_GoodsReceiptId = new Guid("43000000-0000-0000-0000-000000000001"), FK_PurchaseOrderItemId = new Guid("42000000-0000-0000-0000-000000000002"), IsActive = true, RejectedQuantity = 2 }); }); modelBuilder.Entity("Distribution.Models.Item", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); 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("IsActive") .HasColumnType("tinyint(1)"); b.Property("LastSyncedAt") .HasColumnType("datetime(6)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.Property("SalePrice") .HasColumnType("decimal(65,30)"); b.Property("Sku") .IsRequired() .HasColumnType("longtext"); b.Property("SyncSource") .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"), 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"), IsActive = true, Name = "Coca-Cola 500ml", SalePrice = 60m, Sku = "BEV-COKE-500", SyncSource = 0 }, new { Id = new Guid("23000000-0000-0000-0000-000000000002"), 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"), IsActive = true, Name = "Coca-Cola 1.5L", SalePrice = 120m, Sku = "BEV-COKE-1500", SyncSource = 0 }, new { Id = new Guid("23000000-0000-0000-0000-000000000003"), 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"), IsActive = true, Name = "Lays Classic 52g", SalePrice = 50m, Sku = "SNK-LAYS-52", SyncSource = 0 }, new { Id = new Guid("23000000-0000-0000-0000-000000000004"), 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"), IsActive = true, Name = "Lays Family Pack 150g", SalePrice = 150m, Sku = "SNK-LAYS-FAM", SyncSource = 0 }); }); modelBuilder.Entity("Distribution.Models.LoadingSheet", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DispatchConfirmedAt") .HasColumnType("datetime(6)"); b.Property("DispatchConfirmedBy") .HasColumnType("char(36)"); b.Property("FK_RideId") .HasColumnType("char(36)"); b.Property("FK_SourceWarehouseId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("ReceiptConfirmedAt") .HasColumnType("datetime(6)"); b.Property("ReceiptConfirmedBy") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_RideId"); b.HasIndex("FK_SourceWarehouseId"); b.ToTable("LoadingSheets"); b.HasData( new { Id = new Guid("35000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 7, 30, 0, 0, DateTimeKind.Unspecified), DispatchConfirmedAt = new DateTime(2026, 8, 25, 7, 45, 0, 0, DateTimeKind.Unspecified), DispatchConfirmedBy = new Guid("29000000-0000-0000-0000-000000000001"), FK_RideId = new Guid("31000000-0000-0000-0000-000000000001"), FK_SourceWarehouseId = new Guid("27000000-0000-0000-0000-000000000001"), IsActive = true, ReceiptConfirmedAt = new DateTime(2026, 8, 25, 14, 5, 0, 0, DateTimeKind.Unspecified), ReceiptConfirmedBy = new Guid("29000000-0000-0000-0000-000000000004"), Status = 2 }); }); modelBuilder.Entity("Distribution.Models.LoadingSheetItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("FK_LoadingSheetId") .HasColumnType("char(36)"); b.Property("QuantityDispatched") .HasColumnType("decimal(65,30)"); b.Property("QuantityReceived") .HasColumnType("decimal(65,30)"); b.Property("QuantityResolved") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_ItemId"); b.HasIndex("FK_LoadingSheetId"); b.ToTable("LoadingSheetItems"); b.HasData( new { Id = new Guid("36000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), FK_LoadingSheetId = new Guid("35000000-0000-0000-0000-000000000001"), QuantityDispatched = 50m, QuantityReceived = 50m }, new { Id = new Guid("36000000-0000-0000-0000-000000000002"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), FK_LoadingSheetId = new Guid("35000000-0000-0000-0000-000000000001"), QuantityDispatched = 30m, QuantityReceived = 30m }); }); modelBuilder.Entity("Distribution.Models.Order", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_SaleId") .HasColumnType("char(36)"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("FulfilledAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("OrderDate") .HasColumnType("datetime(6)"); b.Property("Status") .HasColumnType("int"); b.Property("TotalAmount") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("FK_SaleId") .IsUnique(); b.HasIndex("FK_StoreId"); b.ToTable("Orders"); b.HasData( new { Id = new Guid("33000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), FK_SaleId = new Guid("32000000-0000-0000-0000-000000000001"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"), FulfilledAt = new DateTime(2026, 8, 25, 13, 0, 0, 0, DateTimeKind.Unspecified), IsActive = true, OrderDate = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), 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_SaleId = new Guid("32000000-0000-0000-0000-000000000002"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000005"), IsActive = true, OrderDate = new DateTime(2026, 8, 30, 10, 0, 0, 0, DateTimeKind.Unspecified), Status = 0, TotalAmount = 1200m }); }); modelBuilder.Entity("Distribution.Models.OrderItem", b => { b.Property("FK_OrderId") .HasColumnType("char(36)"); b.Property("FK_ItemId") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Id") .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("FK_OrderId", "FK_ItemId"); b.HasIndex("FK_ItemId"); b.ToTable("OrderItems"); b.HasData( new { FK_OrderId = new Guid("33000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("34000000-0000-0000-0000-000000000001"), IsActive = true, Quantity = 30, QuantityFulfilled = 30, UnitPrice = 60m }, new { FK_OrderId = new Guid("33000000-0000-0000-0000-000000000001"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000003"), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("34000000-0000-0000-0000-000000000002"), IsActive = true, Quantity = 24, QuantityFulfilled = 24, UnitPrice = 50m }, new { FK_OrderId = new Guid("33000000-0000-0000-0000-000000000002"), FK_ItemId = new Guid("23000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 30, 10, 0, 0, 0, DateTimeKind.Unspecified), Id = new Guid("34000000-0000-0000-0000-000000000003"), IsActive = true, Quantity = 10, QuantityFulfilled = 0, UnitPrice = 120m }); }); modelBuilder.Entity("Distribution.Models.Payment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Amount") .HasColumnType("decimal(65,30)"); b.Property("CollectedAt") .HasColumnType("datetime(6)"); b.Property("CollectedBy") .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("FK_SaleId") .HasColumnType("char(36)"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Method") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_SaleId"); b.HasIndex("FK_StoreId"); 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), FK_SaleId = new Guid("32000000-0000-0000-0000-000000000001"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"), IsActive = true, Method = 0 }); }); 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"); }); 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("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.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.Region", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("Regions"); b.HasData( new { Id = new Guid("24000000-0000-0000-0000-000000000001"), 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"), 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.RideCancelRequest", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ApprovedAt") .HasColumnType("datetime(6)"); b.Property("ApprovedBy") .HasColumnType("char(36)"); b.Property("FK_RideId") .HasColumnType("char(36)"); b.Property("Reason") .IsRequired() .HasColumnType("longtext"); b.Property("RequestedAt") .HasColumnType("datetime(6)"); b.Property("RequestedBy") .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("int"); b.Property("TypeCode") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("FK_RideId"); b.ToTable("RideCancelRequests"); b.HasData( new { Id = new Guid("65000000-0000-0000-0000-000000000001"), ApprovedAt = new DateTime(2026, 8, 30, 9, 15, 0, 0, DateTimeKind.Unspecified), ApprovedBy = new Guid("29000000-0000-0000-0000-000000000001"), FK_RideId = new Guid("31000000-0000-0000-0000-000000000002"), Reason = "Reported minor engine issue, resolved after inspection", RequestedAt = new DateTime(2026, 8, 30, 9, 10, 0, 0, DateTimeKind.Unspecified), RequestedBy = new Guid("29000000-0000-0000-0000-000000000005"), Status = 2, TypeCode = 0 }); }); 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" }); }); 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"); }); modelBuilder.Entity("Distribution.Models.Route", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("EndPoint") .IsRequired() .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") .IsRequired() .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.Sale", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CompletedAt") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("CreatedByUserId") .HasColumnType("char(36)"); b.Property("FK_RideId") .HasColumnType("char(36)"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("FulfillImmediately") .HasColumnType("tinyint(1)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("PaymentStatus") .HasColumnType("int"); b.Property("SaleDate") .HasColumnType("datetime(6)"); b.Property("Status") .HasColumnType("int"); b.Property("TotalAmount") .HasColumnType("decimal(65,30)"); b.HasKey("Id"); b.HasIndex("CreatedByUserId"); b.HasIndex("FK_RideId"); b.HasIndex("FK_StoreId"); b.ToTable("Sales"); b.HasData( new { Id = new Guid("32000000-0000-0000-0000-000000000001"), CompletedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified), CreatedAt = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), CreatedByUserId = new Guid("29000000-0000-0000-0000-000000000002"), FK_RideId = new Guid("31000000-0000-0000-0000-000000000001"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"), FulfillImmediately = false, IsActive = true, PaymentStatus = 2, SaleDate = new DateTime(2026, 8, 25, 9, 0, 0, 0, DateTimeKind.Unspecified), Status = 1, TotalAmount = 3000m }, new { Id = new Guid("32000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 30, 10, 0, 0, 0, DateTimeKind.Unspecified), CreatedByUserId = new Guid("29000000-0000-0000-0000-000000000003"), FK_RideId = new Guid("31000000-0000-0000-0000-000000000002"), FK_StoreId = new Guid("26000000-0000-0000-0000-000000000005"), FulfillImmediately = false, IsActive = true, PaymentStatus = 0, SaleDate = new DateTime(2026, 8, 30, 10, 0, 0, 0, DateTimeKind.Unspecified), Status = 0, TotalAmount = 1200m }); }); 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_OrderId") .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_OrderId"); 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_OrderId = 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_OrderId") .HasColumnType("char(36)"); b.Property("FK_SchemeId") .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_OrderId"); b.HasIndex("FK_SchemeId"); 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_OrderId = new Guid("33000000-0000-0000-0000-000000000001"), FK_SchemeId = new Guid("48000000-0000-0000-0000-000000000001"), FreeItemCostValue = 40m, FreeQty = 1m, RedeemedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified) }); }); modelBuilder.Entity("Distribution.Models.StockBalance", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("FK_ItemId") .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_ItemId", "LocationId") .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_ItemId") .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_ItemId"); 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("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("KycStatus") .HasColumnType("int"); 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") .IsRequired() .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, KycStatus = 1, 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, KycStatus = 1, 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, KycStatus = 0, 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, KycStatus = 0, 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, KycStatus = 1, 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, KycStatus = 0, 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.StoreKycDocument", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DocumentType") .IsRequired() .HasColumnType("longtext"); b.Property("FK_StoreId") .HasColumnType("char(36)"); b.Property("FileReference") .IsRequired() .HasColumnType("longtext"); b.Property("IsActive") .HasColumnType("tinyint(1)"); b.Property("UploadedAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("FK_StoreId"); b.ToTable("StoreKycDocuments"); b.HasData( new { Id = new Guid("63000000-0000-0000-0000-000000000001"), CreatedAt = new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified), DocumentType = "Business Registration", FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"), FileReference = "seed/kyc/fort-mini-mart-brc.pdf", IsActive = true, UploadedAt = new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified) }, new { Id = new Guid("63000000-0000-0000-0000-000000000002"), CreatedAt = new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified), DocumentType = "NIC", FK_StoreId = new Guid("26000000-0000-0000-0000-000000000003"), FileReference = "seed/kyc/wattala-owner-nic.pdf", IsActive = true, UploadedAt = new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified) }); }); 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.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("PasswordHash") .IsRequired() .HasColumnType("longtext"); 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, PasswordHash = "AQAAAAIAAYagAAAAEKGnq/U4j6uM9g5mFkxbUE8WU/AhnSNiwrKCiPAqGnzNcaMgZAF5Zal/rJUUYPZPpg==", 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, PasswordHash = "AQAAAAIAAYagAAAAEKGnq/U4j6uM9g5mFkxbUE8WU/AhnSNiwrKCiPAqGnzNcaMgZAF5Zal/rJUUYPZPpg==", 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, PasswordHash = "AQAAAAIAAYagAAAAEKGnq/U4j6uM9g5mFkxbUE8WU/AhnSNiwrKCiPAqGnzNcaMgZAF5Zal/rJUUYPZPpg==", 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, PasswordHash = "AQAAAAIAAYagAAAAEKGnq/U4j6uM9g5mFkxbUE8WU/AhnSNiwrKCiPAqGnzNcaMgZAF5Zal/rJUUYPZPpg==", 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, PasswordHash = "AQAAAAIAAYagAAAAEKGnq/U4j6uM9g5mFkxbUE8WU/AhnSNiwrKCiPAqGnzNcaMgZAF5Zal/rJUUYPZPpg==", 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, PasswordHash = "AQAAAAIAAYagAAAAEKGnq/U4j6uM9g5mFkxbUE8WU/AhnSNiwrKCiPAqGnzNcaMgZAF5Zal/rJUUYPZPpg==", 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, PasswordHash = "AQAAAAIAAYagAAAAEKGnq/U4j6uM9g5mFkxbUE8WU/AhnSNiwrKCiPAqGnzNcaMgZAF5Zal/rJUUYPZPpg==", Username = "channa.desilva" }); }); 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.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.Route", "Route") .WithMany() .HasForeignKey("FK_RouteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Warehouse", "SourceWarehouse") .WithMany() .HasForeignKey("FK_SourceWarehouseId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Vehicle", "Vehicle") .WithMany() .HasForeignKey("FK_VehicleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("DriverProfile"); b.Navigation("Route"); b.Navigation("SourceWarehouse"); b.Navigation("Vehicle"); }); modelBuilder.Entity("Distribution.Models.DeliveryTask", b => { b.HasOne("Distribution.Models.Order", "Order") .WithMany() .HasForeignKey("FK_OrderId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.DeliveryRun", "Ride") .WithMany() .HasForeignKey("FK_RideId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Order"); b.Navigation("Ride"); }); 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.GoodsReceipt", b => { b.HasOne("Distribution.Models.PurchaseOrder", "PurchaseOrder") .WithMany() .HasForeignKey("FK_PurchaseOrderId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Warehouse", "Warehouse") .WithMany() .HasForeignKey("FK_WarehouseId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("PurchaseOrder"); 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.PurchaseOrderItem", "PurchaseOrderItem") .WithMany() .HasForeignKey("FK_PurchaseOrderItemId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("GoodsReceipt"); b.Navigation("PurchaseOrderItem"); }); 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.LoadingSheet", b => { b.HasOne("Distribution.Models.DeliveryRun", "Ride") .WithMany() .HasForeignKey("FK_RideId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Warehouse", "SourceWarehouse") .WithMany() .HasForeignKey("FK_SourceWarehouseId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Ride"); b.Navigation("SourceWarehouse"); }); 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.Cascade) .IsRequired(); b.Navigation("Item"); b.Navigation("LoadingSheet"); }); modelBuilder.Entity("Distribution.Models.Order", b => { b.HasOne("Distribution.Models.Sale", "Sale") .WithMany() .HasForeignKey("FK_SaleId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Sale"); b.Navigation("Store"); }); modelBuilder.Entity("Distribution.Models.OrderItem", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Order", "Order") .WithMany("OrderItems") .HasForeignKey("FK_OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Item"); b.Navigation("Order"); }); modelBuilder.Entity("Distribution.Models.Payment", b => { b.HasOne("Distribution.Models.Sale", "Sale") .WithMany() .HasForeignKey("FK_SaleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Sale"); b.Navigation("Store"); }); 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.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.RideCancelRequest", b => { b.HasOne("Distribution.Models.DeliveryRun", "Ride") .WithMany() .HasForeignKey("FK_RideId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Ride"); }); 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.Sale", b => { b.HasOne("Distribution.Models.User", "CreatedByUser") .WithMany() .HasForeignKey("CreatedByUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.DeliveryRun", "Ride") .WithMany() .HasForeignKey("FK_RideId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("CreatedByUser"); b.Navigation("Ride"); b.Navigation("Store"); }); modelBuilder.Entity("Distribution.Models.SaleReturn", b => { b.HasOne("Distribution.Models.User", "CreatedByUser") .WithMany() .HasForeignKey("CreatedByUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Distribution.Models.Order", "Order") .WithMany() .HasForeignKey("FK_OrderId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("CreatedByUser"); b.Navigation("Order"); }); 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.Order", "Order") .WithMany() .HasForeignKey("FK_OrderId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("Distribution.Models.Scheme", "Scheme") .WithMany("Redemptions") .HasForeignKey("FK_SchemeId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("FreeItem"); b.Navigation("Order"); b.Navigation("Scheme"); }); modelBuilder.Entity("Distribution.Models.StockBalance", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Item"); }); modelBuilder.Entity("Distribution.Models.StockMovement", b => { b.HasOne("Distribution.Models.Item", "Item") .WithMany() .HasForeignKey("FK_ItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Item"); }); 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.StoreKycDocument", b => { b.HasOne("Distribution.Models.Store", "Store") .WithMany() .HasForeignKey("FK_StoreId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); 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.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.GoodsReceipt", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.Item", b => { b.Navigation("Conversions"); }); modelBuilder.Entity("Distribution.Models.LoadingSheet", b => { b.Navigation("Items"); }); modelBuilder.Entity("Distribution.Models.Order", b => { b.Navigation("OrderItems"); }); 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.SupplierClaim", b => { b.Navigation("Items"); }); #pragma warning restore 612, 618 } } }