// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using PowderCoating.Infrastructure.Data; #nullable disable namespace PowderCoating.Infrastructure.Migrations { [DbContext(typeof(ApplicationDbContext))] [Migration("20260213135057_RemoveUnusedFields")] partial class RemoveUnusedFields { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "8.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") .HasColumnType("nvarchar(450)"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(max)"); b.Property("Name") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("NormalizedName") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasDatabaseName("RoleNameIndex") .HasFilter("[NormalizedName] IS NOT NULL"); b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("nvarchar(max)"); b.Property("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property("RoleId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("nvarchar(max)"); b.Property("ClaimValue") .HasColumnType("nvarchar(max)"); b.Property("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("nvarchar(450)"); b.Property("ProviderKey") .HasColumnType("nvarchar(450)"); b.Property("ProviderDisplayName") .HasColumnType("nvarchar(max)"); b.Property("UserId") .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("nvarchar(450)"); b.Property("RoleId") .HasColumnType("nvarchar(450)"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("nvarchar(450)"); b.Property("LoginProvider") .HasColumnType("nvarchar(450)"); b.Property("Name") .HasColumnType("nvarchar(450)"); b.Property("Value") .HasColumnType("nvarchar(max)"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b => { b.Property("Id") .HasColumnType("nvarchar(450)"); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("Address") .HasColumnType("nvarchar(max)"); b.Property("CanApproveQuotes") .HasColumnType("bit"); b.Property("CanCreateQuotes") .HasColumnType("bit"); b.Property("CanManageCustomers") .HasColumnType("bit"); b.Property("CanManageInventory") .HasColumnType("bit"); b.Property("CanManageJobs") .HasColumnType("bit"); b.Property("CanViewShopFloor") .HasColumnType("bit"); b.Property("City") .HasColumnType("nvarchar(max)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CompanyRole") .HasColumnType("nvarchar(max)"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("DashboardLayout") .HasColumnType("int"); b.Property("DateFormat") .HasColumnType("nvarchar(max)"); b.Property("DateOfBirth") .HasColumnType("datetime2"); b.Property("Department") .HasColumnType("nvarchar(max)"); b.Property("Email") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("EmailConfirmed") .HasColumnType("bit"); b.Property("EmployeeNumber") .HasColumnType("nvarchar(max)"); b.Property("FirstName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("HireDate") .HasColumnType("datetime2"); b.Property("HourlyRate") .HasColumnType("decimal(18,2)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("LastLoginDate") .HasColumnType("datetime2"); b.Property("LastName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("LockoutEnabled") .HasColumnType("bit"); b.Property("LockoutEnd") .HasColumnType("datetimeoffset"); b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PasswordHash") .HasColumnType("nvarchar(max)"); b.Property("PhoneNumber") .HasColumnType("nvarchar(max)"); b.Property("PhoneNumberConfirmed") .HasColumnType("bit"); b.Property("Position") .HasColumnType("nvarchar(max)"); b.Property("ProfilePictureContentType") .HasColumnType("nvarchar(max)"); b.Property("ProfilePictureData") .HasColumnType("varbinary(max)"); b.Property("ProfilePictureFilePath") .HasColumnType("nvarchar(max)"); b.Property("SecurityStamp") .HasColumnType("nvarchar(max)"); b.Property("SidebarColor") .HasColumnType("nvarchar(max)"); b.Property("State") .HasColumnType("nvarchar(max)"); b.Property("TerminationDate") .HasColumnType("datetime2"); b.Property("Theme") .HasColumnType("nvarchar(max)"); b.Property("TimeZone") .HasColumnType("nvarchar(max)"); b.Property("TwoFactorEnabled") .HasColumnType("bit"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UserName") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); b.Property("ZipCode") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("NormalizedEmail") .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasDatabaseName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("ParentCategoryId") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("ParentCategoryId"); b.ToTable("CatalogCategories"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CatalogItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CategoryId") .HasColumnType("int"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DefaultEstimatedMinutes") .HasColumnType("int"); b.Property("DefaultPrice") .HasColumnType("decimal(18,2)"); b.Property("DefaultRequiresMasking") .HasColumnType("bit"); b.Property("DefaultRequiresSandblasting") .HasColumnType("bit"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("SKU") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CategoryId"); b.HasIndex("CompanyId"); b.ToTable("CatalogItems"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Company", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Address") .HasColumnType("nvarchar(max)"); b.Property("City") .HasColumnType("nvarchar(max)"); b.Property("CompanyCode") .HasColumnType("nvarchar(450)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CompanyName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("LogoContentType") .HasColumnType("nvarchar(max)"); b.Property("LogoData") .HasColumnType("varbinary(max)"); b.Property("LogoFilePath") .HasColumnType("nvarchar(max)"); b.Property("Phone") .HasColumnType("nvarchar(max)"); b.Property("PrimaryContactEmail") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("PrimaryContactName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Settings") .HasColumnType("nvarchar(max)"); b.Property("State") .HasColumnType("nvarchar(max)"); b.Property("SubscriptionEndDate") .HasColumnType("datetime2"); b.Property("SubscriptionPlan") .HasColumnType("nvarchar(max)"); b.Property("SubscriptionStartDate") .HasColumnType("datetime2"); b.Property("TimeZone") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.Property("ZipCode") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyCode") .IsUnique() .HasFilter("[CompanyCode] IS NOT NULL"); b.ToTable("Companies"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CompanyOperatingCosts", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CoatingBoothCostPerHour") .HasColumnType("decimal(18,2)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("GeneralMarkupPercentage") .HasColumnType("decimal(18,2)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("OvenOperatingCostPerHour") .HasColumnType("decimal(18,2)"); b.Property("PowderCoatingCostPerSqFt") .HasColumnType("decimal(18,2)"); b.Property("RushChargeFixedAmount") .HasColumnType("decimal(18,2)"); b.Property("RushChargePercentage") .HasColumnType("decimal(18,2)"); b.Property("RushChargeType") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("SandblasterCostPerHour") .HasColumnType("decimal(18,2)"); b.Property("ShopMinimumCharge") .HasColumnType("decimal(18,2)"); b.Property("StandardLaborRate") .HasColumnType("decimal(18,2)"); b.Property("TaxPercent") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId") .IsUnique(); b.ToTable("CompanyOperatingCosts"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CompanyPreferences", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AllowCustomerApproval") .HasColumnType("bit"); b.Property("AutoArchiveJobsDays") .HasColumnType("int"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DefaultCurrency") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DefaultDateFormat") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DefaultJobPriority") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DefaultPaymentTerms") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DefaultQuoteValidityDays") .HasColumnType("int"); b.Property("DefaultTimeFormat") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DefaultTurnaroundDays") .HasColumnType("int"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedRecordRetentionDays") .HasColumnType("int"); b.Property("DueDateWarningDays") .HasColumnType("int"); b.Property("EmailNotificationsEnabled") .HasColumnType("bit"); b.Property("EnableMaskingStep") .HasColumnType("bit"); b.Property("EnableSandblastingStep") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobNumberPrefix") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("JobRetentionYears") .HasColumnType("int"); b.Property("LogRetentionDays") .HasColumnType("int"); b.Property("MaintenanceAlertDays") .HasColumnType("int"); b.Property("NotifyOnJobStatusChange") .HasColumnType("bit"); b.Property("NotifyOnNewJob") .HasColumnType("bit"); b.Property("NotifyOnPaymentReceived") .HasColumnType("bit"); b.Property("NotifyOnQuoteApproval") .HasColumnType("bit"); b.Property("QuoteExpiryWarningDays") .HasColumnType("int"); b.Property("QuoteNumberPrefix") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("QuoteRetentionYears") .HasColumnType("int"); b.Property("RequireCustomerPO") .HasColumnType("bit"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId") .IsUnique(); b.ToTable("CompanyPreferences"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Address") .HasColumnType("nvarchar(max)"); b.Property("City") .HasColumnType("nvarchar(max)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CompanyName") .HasColumnType("nvarchar(450)"); b.Property("ContactFirstName") .HasColumnType("nvarchar(max)"); b.Property("ContactLastName") .HasColumnType("nvarchar(max)"); b.Property("Country") .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("CreditLimit") .HasColumnType("decimal(18,2)"); b.Property("CurrentBalance") .HasColumnType("decimal(18,2)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Email") .HasColumnType("nvarchar(450)"); b.Property("GeneralNotes") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsCommercial") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsTaxExempt") .HasColumnType("bit"); b.Property("LastContactDate") .HasColumnType("datetime2"); b.Property("MobilePhone") .HasColumnType("nvarchar(max)"); b.Property("PaymentTerms") .HasColumnType("nvarchar(max)"); b.Property("Phone") .HasColumnType("nvarchar(max)"); b.Property("PricingTierId") .HasColumnType("int"); b.Property("State") .HasColumnType("nvarchar(max)"); b.Property("TaxExemptCertificateContentType") .HasColumnType("nvarchar(max)"); b.Property("TaxExemptCertificateData") .HasColumnType("varbinary(max)"); b.Property("TaxExemptCertificateFileName") .HasColumnType("nvarchar(max)"); b.Property("TaxId") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.Property("ZipCode") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("CompanyName"); b.HasIndex("Email") .IsUnique() .HasFilter("[Email] IS NOT NULL"); b.HasIndex("PricingTierId"); b.ToTable("Customers"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CustomerNote", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("CustomerId") .HasColumnType("int"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsImportant") .HasColumnType("bit"); b.Property("Note") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CustomerId"); b.ToTable("CustomerNotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("EquipmentName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("EquipmentNumber") .HasColumnType("nvarchar(max)"); b.Property("EquipmentType") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("LastMaintenanceDate") .HasColumnType("datetime2"); b.Property("Location") .HasColumnType("nvarchar(max)"); b.Property("ManualContentType") .HasColumnType("nvarchar(max)"); b.Property("ManualFileName") .HasColumnType("nvarchar(max)"); b.Property("ManualFilePath") .HasColumnType("nvarchar(max)"); b.Property("ManualFileSize") .HasColumnType("bigint"); b.Property("ManualUploadedDate") .HasColumnType("datetime2"); b.Property("Manufacturer") .HasColumnType("nvarchar(max)"); b.Property("Model") .HasColumnType("nvarchar(max)"); b.Property("NextScheduledMaintenance") .HasColumnType("datetime2"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PurchaseDate") .HasColumnType("datetime2"); b.Property("PurchasePrice") .HasColumnType("decimal(18,2)"); b.Property("RecommendedMaintenanceIntervalDays") .HasColumnType("int"); b.Property("SerialNumber") .HasColumnType("nvarchar(max)"); b.Property("Status") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.Property("WarrantyExpiration") .HasColumnType("datetime2"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.ToTable("Equipment"); }); modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AverageCost") .HasColumnType("decimal(18,2)"); b.Property("Category") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("ColorCode") .HasColumnType("nvarchar(max)"); b.Property("ColorName") .HasColumnType("nvarchar(max)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CoverageSqFtPerLb") .HasColumnType("decimal(18,2)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("DiscontinuedDate") .HasColumnType("datetime2"); b.Property("Finish") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("LastPurchaseDate") .HasColumnType("datetime2"); b.Property("LastPurchasePrice") .HasColumnType("decimal(18,2)"); b.Property("Location") .HasColumnType("nvarchar(max)"); b.Property("Manufacturer") .HasColumnType("nvarchar(max)"); b.Property("ManufacturerPartNumber") .HasColumnType("nvarchar(max)"); b.Property("MaximumStock") .HasColumnType("decimal(18,2)"); b.Property("MinimumStock") .HasColumnType("decimal(18,2)"); b.Property("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PrimarySupplierId") .HasColumnType("int"); b.Property("QuantityOnHand") .HasColumnType("decimal(18,2)"); b.Property("ReorderPoint") .HasColumnType("decimal(18,2)"); b.Property("ReorderQuantity") .HasColumnType("decimal(18,2)"); b.Property("SKU") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("SupplierPartNumber") .HasColumnType("nvarchar(max)"); b.Property("TransferEfficiency") .HasColumnType("decimal(18,2)"); b.Property("UnitCost") .HasColumnType("decimal(18,2)"); b.Property("UnitOfMeasure") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("PrimarySupplierId"); b.HasIndex("SKU") .IsUnique(); b.ToTable("InventoryItems"); }); modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("BalanceAfter") .HasColumnType("decimal(18,2)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("InventoryItemId") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("Quantity") .HasColumnType("decimal(18,2)"); b.Property("Reference") .HasColumnType("nvarchar(max)"); b.Property("TotalCost") .HasColumnType("decimal(18,2)"); b.Property("TransactionDate") .HasColumnType("datetime2"); b.Property("TransactionType") .HasColumnType("int"); b.Property("UnitCost") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("InventoryItemId"); b.ToTable("InventoryTransactions"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Job", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AssignedWorkerId") .HasColumnType("int"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CompletedDate") .HasColumnType("datetime2"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("CustomerId") .HasColumnType("int"); b.Property("CustomerPO") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DueDate") .HasColumnType("datetime2"); b.Property("FinalPrice") .HasColumnType("decimal(18,2)"); b.Property("IsCustomerApproved") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobNumber") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("Priority") .HasColumnType("int"); b.Property("QuoteId") .HasColumnType("int"); b.Property("QuotedPrice") .HasColumnType("decimal(18,2)"); b.Property("RequiresCustomerApproval") .HasColumnType("bit"); b.Property("ScheduledDate") .HasColumnType("datetime2"); b.Property("SpecialInstructions") .HasColumnType("nvarchar(max)"); b.Property("StartedDate") .HasColumnType("datetime2"); b.Property("Status") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("AssignedWorkerId"); b.HasIndex("CompanyId"); b.HasIndex("CustomerId"); b.HasIndex("JobNumber") .IsUnique(); b.HasIndex("QuoteId") .IsUnique() .HasFilter("[QuoteId] IS NOT NULL"); b.ToTable("Jobs"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ColorCode") .HasColumnType("nvarchar(max)"); b.Property("ColorName") .HasColumnType("nvarchar(max)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("EstimatedMinutes") .HasColumnType("int"); b.Property("Finish") .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("LaborCost") .HasColumnType("decimal(18,2)"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PowderInventoryId") .HasColumnType("int"); b.Property("Quantity") .HasColumnType("int"); b.Property("RequiresMasking") .HasColumnType("bit"); b.Property("RequiresSandblasting") .HasColumnType("bit"); b.Property("SurfaceArea") .HasColumnType("decimal(18,2)"); b.Property("TotalPrice") .HasColumnType("decimal(18,2)"); b.Property("UnitPrice") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("JobId"); b.HasIndex("PowderInventoryId"); b.ToTable("JobItems"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobNote", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsImportant") .HasColumnType("bit"); b.Property("IsInternal") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("Note") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("JobId"); b.ToTable("JobNotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobPhoto", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Caption") .HasColumnType("nvarchar(max)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("ContentType") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("FileName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("FilePath") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("FileSize") .HasColumnType("bigint"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("PhotoType") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.Property("UploadedById") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("UploadedDate") .HasColumnType("datetime2"); b.HasKey("Id"); b.HasIndex("JobId"); b.HasIndex("UploadedById"); b.ToTable("JobPhotos"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ChangedDate") .HasColumnType("datetime2"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("FromStatus") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("ToStatus") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("JobId"); b.ToTable("JobStatusHistory"); }); modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AssignedWorkerId") .HasColumnType("int"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CompletedDate") .HasColumnType("datetime2"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DowntimeHours") .HasColumnType("decimal(18,2)"); b.Property("EquipmentId") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("LaborCost") .HasColumnType("decimal(18,2)"); b.Property("MaintenanceType") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PartsCost") .HasColumnType("decimal(18,2)"); b.Property("PartsReplaced") .HasColumnType("nvarchar(max)"); b.Property("PerformedById") .HasColumnType("nvarchar(450)"); b.Property("Priority") .HasColumnType("int"); b.Property("ScheduledDate") .HasColumnType("datetime2"); b.Property("Status") .HasColumnType("int"); b.Property("TechnicianNotes") .HasColumnType("nvarchar(max)"); b.Property("TotalCost") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.Property("WorkPerformed") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("AssignedWorkerId"); b.HasIndex("EquipmentId"); b.HasIndex("PerformedById"); b.ToTable("MaintenanceRecords"); }); modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("DiscountPercent") .HasColumnType("decimal(18,2)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("TierName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.ToTable("PricingTiers"); b.HasData( new { Id = 1, CompanyId = 0, CreatedAt = new DateTime(2026, 2, 13, 13, 50, 54, 482, DateTimeKind.Utc).AddTicks(7815), Description = "Standard pricing for regular customers", DiscountPercent = 0m, IsActive = true, IsDeleted = false, TierName = "Standard" }, new { Id = 2, CompanyId = 0, CreatedAt = new DateTime(2026, 2, 13, 13, 50, 54, 482, DateTimeKind.Utc).AddTicks(7821), Description = "5% discount for preferred customers", DiscountPercent = 5m, IsActive = true, IsDeleted = false, TierName = "Preferred" }, new { Id = 3, CompanyId = 0, CreatedAt = new DateTime(2026, 2, 13, 13, 50, 54, 482, DateTimeKind.Utc).AddTicks(7822), Description = "10% discount for premium customers", DiscountPercent = 10m, IsActive = true, IsDeleted = false, TierName = "Premium" }); }); modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ApprovedDate") .HasColumnType("datetime2"); b.Property("CompanyId") .HasColumnType("int"); b.Property("ConvertedDate") .HasColumnType("datetime2"); b.Property("ConvertedToJobId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("CustomerId") .HasColumnType("int"); b.Property("CustomerPO") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("DiscountAmount") .HasColumnType("decimal(18,2)"); b.Property("DiscountPercent") .HasColumnType("decimal(18,2)"); b.Property("ExpirationDate") .HasColumnType("datetime2"); b.Property("IsCommercial") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PreparedById") .HasColumnType("nvarchar(450)"); b.Property("ProspectAddress") .HasColumnType("nvarchar(max)"); b.Property("ProspectCity") .HasColumnType("nvarchar(max)"); b.Property("ProspectCompanyName") .HasColumnType("nvarchar(max)"); b.Property("ProspectContactName") .HasColumnType("nvarchar(max)"); b.Property("ProspectEmail") .HasColumnType("nvarchar(max)"); b.Property("ProspectPhone") .HasColumnType("nvarchar(max)"); b.Property("ProspectState") .HasColumnType("nvarchar(max)"); b.Property("ProspectZipCode") .HasColumnType("nvarchar(max)"); b.Property("QuoteDate") .HasColumnType("datetime2"); b.Property("QuoteNumber") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("SentDate") .HasColumnType("datetime2"); b.Property("Status") .HasColumnType("int"); b.Property("SubTotal") .HasColumnType("decimal(18,2)"); b.Property("TaxAmount") .HasColumnType("decimal(18,2)"); b.Property("TaxPercent") .HasColumnType("decimal(18,2)"); b.Property("Terms") .HasColumnType("nvarchar(max)"); b.Property("Total") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("CustomerId"); b.HasIndex("PreparedById"); b.HasIndex("QuoteNumber") .IsUnique(); b.ToTable("Quotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CatalogItemId") .HasColumnType("int"); b.Property("ColorCode") .HasColumnType("nvarchar(max)"); b.Property("ColorName") .HasColumnType("nvarchar(max)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Description") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("EstimatedMinutes") .HasColumnType("int"); b.Property("Finish") .HasColumnType("nvarchar(max)"); b.Property("InventoryItemId") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PowderCostOverride") .HasColumnType("decimal(18,2)"); b.Property("Quantity") .HasColumnType("int"); b.Property("QuoteId") .HasColumnType("int"); b.Property("RequiresMasking") .HasColumnType("bit"); b.Property("RequiresSandblasting") .HasColumnType("bit"); b.Property("SurfaceArea") .HasColumnType("decimal(18,2)"); b.Property("SurfaceAreaSqFt") .HasColumnType("decimal(18,2)"); b.Property("TotalPrice") .HasColumnType("decimal(18,2)"); b.Property("UnitPrice") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CatalogItemId"); b.HasIndex("InventoryItemId"); b.HasIndex("QuoteId"); b.ToTable("QuoteItems"); }); modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CompanyId") .HasColumnType("int"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Email") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("Phone") .HasColumnType("nvarchar(max)"); b.Property("Role") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.ToTable("ShopWorkers"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Address") .HasColumnType("nvarchar(max)"); b.Property("City") .HasColumnType("nvarchar(max)"); b.Property("CompanyId") .HasColumnType("int"); b.Property("CompanyName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("ContactName") .HasColumnType("nvarchar(max)"); b.Property("Country") .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedBy") .HasColumnType("nvarchar(max)"); b.Property("DeletedAt") .HasColumnType("datetime2"); b.Property("DeletedBy") .HasColumnType("nvarchar(max)"); b.Property("Email") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("Phone") .HasColumnType("nvarchar(max)"); b.Property("State") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.Property("Website") .HasColumnType("nvarchar(max)"); b.Property("ZipCode") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.ToTable("Suppliers"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b => { b.HasOne("PowderCoating.Core.Entities.Company", "Company") .WithMany("Users") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Company"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.CatalogCategory", "ParentCategory") .WithMany("SubCategories") .HasForeignKey("ParentCategoryId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("ParentCategory"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CatalogItem", b => { b.HasOne("PowderCoating.Core.Entities.CatalogCategory", "Category") .WithMany("Items") .HasForeignKey("CategoryId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Category"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CompanyOperatingCosts", b => { b.HasOne("PowderCoating.Core.Entities.Company", "Company") .WithOne("OperatingCosts") .HasForeignKey("PowderCoating.Core.Entities.CompanyOperatingCosts", "CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CompanyPreferences", b => { b.HasOne("PowderCoating.Core.Entities.Company", "Company") .WithOne("Preferences") .HasForeignKey("PowderCoating.Core.Entities.CompanyPreferences", "CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("Customers") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.PricingTier", "PricingTier") .WithMany("Customers") .HasForeignKey("PricingTierId") .OnDelete(DeleteBehavior.SetNull); b.Navigation("PricingTier"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CustomerNote", b => { b.HasOne("PowderCoating.Core.Entities.Customer", "Customer") .WithMany("CustomerNotes") .HasForeignKey("CustomerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Customer"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("Equipment") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("InventoryItems") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Supplier", "PrimarySupplier") .WithMany("SuppliedItems") .HasForeignKey("PrimarySupplierId") .OnDelete(DeleteBehavior.SetNull); b.Navigation("PrimarySupplier"); }); modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b => { b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem") .WithMany("Transactions") .HasForeignKey("InventoryItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("InventoryItem"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Job", b => { b.HasOne("PowderCoating.Core.Entities.ShopWorker", "AssignedWorker") .WithMany("AssignedJobs") .HasForeignKey("AssignedWorkerId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("Jobs") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Customer", "Customer") .WithMany("Jobs") .HasForeignKey("CustomerId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Quote", "Quote") .WithOne("ConvertedToJob") .HasForeignKey("PowderCoating.Core.Entities.Job", "QuoteId") .OnDelete(DeleteBehavior.SetNull); b.Navigation("AssignedWorker"); b.Navigation("Customer"); b.Navigation("Quote"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b => { b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany("JobItems") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.InventoryItem", "PowderInventory") .WithMany("JobItems") .HasForeignKey("PowderInventoryId"); b.Navigation("Job"); b.Navigation("PowderInventory"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobNote", b => { b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany("Notes") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Job"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobPhoto", b => { b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany("Photos") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "UploadedBy") .WithMany() .HasForeignKey("UploadedById") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Job"); b.Navigation("UploadedBy"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusHistory", b => { b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany("StatusHistory") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Job"); }); modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b => { b.HasOne("PowderCoating.Core.Entities.ShopWorker", "AssignedWorker") .WithMany("AssignedMaintenanceTasks") .HasForeignKey("AssignedWorkerId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("PowderCoating.Core.Entities.Equipment", "Equipment") .WithMany("MaintenanceRecords") .HasForeignKey("EquipmentId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PerformedBy") .WithMany("PerformedMaintenances") .HasForeignKey("PerformedById") .OnDelete(DeleteBehavior.SetNull); b.Navigation("AssignedWorker"); b.Navigation("Equipment"); b.Navigation("PerformedBy"); }); modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("PricingTiers") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("Quotes") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Customer", "Customer") .WithMany("Quotes") .HasForeignKey("CustomerId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PreparedBy") .WithMany("PreparedQuotes") .HasForeignKey("PreparedById") .OnDelete(DeleteBehavior.SetNull); b.Navigation("Customer"); b.Navigation("PreparedBy"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b => { b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem") .WithMany() .HasForeignKey("CatalogItemId"); b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem") .WithMany() .HasForeignKey("InventoryItemId"); b.HasOne("PowderCoating.Core.Entities.Quote", "Quote") .WithMany("QuoteItems") .HasForeignKey("QuoteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("CatalogItem"); b.Navigation("InventoryItem"); b.Navigation("Quote"); }); modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("ShopWorkers") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany("Suppliers") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b => { b.Navigation("PerformedMaintenances"); b.Navigation("PreparedQuotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b => { b.Navigation("Items"); b.Navigation("SubCategories"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Company", b => { b.Navigation("Customers"); b.Navigation("Equipment"); b.Navigation("InventoryItems"); b.Navigation("Jobs"); b.Navigation("OperatingCosts"); b.Navigation("Preferences"); b.Navigation("PricingTiers"); b.Navigation("Quotes"); b.Navigation("ShopWorkers"); b.Navigation("Suppliers"); b.Navigation("Users"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b => { b.Navigation("CustomerNotes"); b.Navigation("Jobs"); b.Navigation("Quotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b => { b.Navigation("MaintenanceRecords"); }); modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b => { b.Navigation("JobItems"); b.Navigation("Transactions"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Job", b => { b.Navigation("JobItems"); b.Navigation("Notes"); b.Navigation("Photos"); b.Navigation("StatusHistory"); }); modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b => { b.Navigation("Customers"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b => { b.Navigation("ConvertedToJob"); b.Navigation("QuoteItems"); }); modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b => { b.Navigation("AssignedJobs"); b.Navigation("AssignedMaintenanceTasks"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b => { b.Navigation("SuppliedItems"); }); #pragma warning restore 612, 618 } } }