//
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
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");
});
modelBuilder.Entity("Distribution.Models.RideCloseSummary", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("ActualCash")
.HasColumnType("decimal(65,30)");
b.Property("CashVariance")
.HasColumnType("decimal(65,30)");
b.Property("ClosedAt")
.HasColumnType("datetime(6)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("ExpectedCash")
.HasColumnType("decimal(65,30)");
b.Property("FK_ClosedByUserId")
.HasColumnType("char(36)");
b.Property("FK_RideId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.HasKey("Id");
b.HasIndex("FK_ClosedByUserId");
b.HasIndex("FK_RideId")
.IsUnique();
b.ToTable("RideCloseSummaries");
});
modelBuilder.Entity("Distribution.Models.RideItemCount", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("FK_ItemId")
.HasColumnType("char(36)");
b.Property("FK_RideId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("PhysicalQuantity")
.HasColumnType("decimal(65,30)");
b.HasKey("Id");
b.HasIndex("FK_ItemId");
b.HasIndex("FK_RideId");
b.ToTable("RideItemCounts");
});
modelBuilder.Entity("Distribution.Models.RideVariance", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("ActualQuantity")
.HasColumnType("decimal(65,30)");
b.Property("CreatedAt")
.HasColumnType("datetime(6)");
b.Property("ExpectedQuantity")
.HasColumnType("decimal(65,30)");
b.Property("FK_ItemId")
.HasColumnType("char(36)");
b.Property("FK_ResolvedByUserId")
.HasColumnType("char(36)");
b.Property("FK_RideId")
.HasColumnType("char(36)");
b.Property("IsActive")
.HasColumnType("tinyint(1)");
b.Property("IsCash")
.HasColumnType("tinyint(1)");
b.Property("ReasonCode")
.HasColumnType("longtext");
b.Property("ResolvedAt")
.HasColumnType("datetime(6)");
b.Property("Status")
.HasColumnType("int");
b.Property("VarianceQuantity")
.HasColumnType("decimal(65,30)");
b.HasKey("Id");
b.HasIndex("FK_ItemId");
b.HasIndex("FK_ResolvedByUserId");
b.HasIndex("FK_RideId");
b.ToTable("RideVariances");
});
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