// 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("20260225033952_AddGenericQuoteItemFields")] partial class AddGenericQuoteItemFields { /// 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("CanManageCalendar") .HasColumnType("bit"); b.Property("CanManageCustomers") .HasColumnType("bit"); b.Property("CanManageEquipment") .HasColumnType("bit"); b.Property("CanManageInventory") .HasColumnType("bit"); b.Property("CanManageJobs") .HasColumnType("bit"); b.Property("CanManageMaintenance") .HasColumnType("bit"); b.Property("CanManageProducts") .HasColumnType("bit"); b.Property("CanManageSuppliers") .HasColumnType("bit"); b.Property("CanViewCalendar") .HasColumnType("bit"); b.Property("CanViewProducts") .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("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.Appointment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ActualEndTime") .HasColumnType("datetime2"); b.Property("ActualStartTime") .HasColumnType("datetime2"); b.Property("AppointmentNumber") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("AppointmentStatusId") .HasColumnType("int"); b.Property("AppointmentTypeId") .HasColumnType("int"); b.Property("AssignedWorkerId") .HasColumnType("int"); 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("Description") .HasColumnType("nvarchar(max)"); b.Property("IsAllDay") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsReminderEnabled") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("Location") .HasColumnType("nvarchar(max)"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("ReminderMinutesBefore") .HasColumnType("int"); b.Property("ScheduledEndTime") .HasColumnType("datetime2"); b.Property("ScheduledStartTime") .HasColumnType("datetime2"); b.Property("Title") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("AppointmentStatusId"); b.HasIndex("AppointmentTypeId"); b.HasIndex("AssignedWorkerId"); b.HasIndex("CustomerId"); b.HasIndex("JobId"); b.HasIndex("CompanyId", "AppointmentStatusId") .HasDatabaseName("IX_Appointments_CompanyId_AppointmentStatusId"); b.HasIndex("CompanyId", "ScheduledStartTime") .HasDatabaseName("IX_Appointments_CompanyId_ScheduledStartTime"); b.ToTable("Appointments"); }); modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentStatusLookup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ColorClass") .IsRequired() .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") .HasColumnType("nvarchar(max)"); b.Property("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IconClass") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsSystemDefined") .HasColumnType("bit"); b.Property("IsTerminalStatus") .HasColumnType("bit"); b.Property("StatusCode") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("AppointmentStatusLookups"); }); modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentTypeLookup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ColorClass") .IsRequired() .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") .HasColumnType("nvarchar(max)"); b.Property("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IconClass") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsSystemDefined") .HasColumnType("bit"); b.Property("RequiresJobLink") .HasColumnType("bit"); b.Property("TypeCode") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("AppointmentTypeLookups"); }); 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("ApproximateArea") .HasColumnType("decimal(18,2)"); 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("StripeCustomerId") .HasColumnType("nvarchar(max)"); b.Property("StripeSubscriptionId") .HasColumnType("nvarchar(max)"); b.Property("SubscriptionEndDate") .HasColumnType("datetime2"); b.Property("SubscriptionPlan") .HasColumnType("int"); b.Property("SubscriptionStartDate") .HasColumnType("datetime2"); b.Property("SubscriptionStatus") .HasColumnType("int"); 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("AdditionalCoatLaborPercent") .HasColumnType("decimal(18,2)"); 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("ShopSuppliesRate") .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("EmailFromAddress") .HasColumnType("nvarchar(max)"); b.Property("EmailFromName") .HasColumnType("nvarchar(max)"); 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.Property("UseMetricSystem") .HasColumnType("bit"); 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("NotifyByEmail") .HasColumnType("bit"); b.Property("NotifyBySms") .HasColumnType("bit"); b.Property("PaymentTerms") .HasColumnType("nvarchar(max)"); b.Property("Phone") .HasColumnType("nvarchar(max)"); b.Property("PricingTierId") .HasColumnType("int"); b.Property("SmsConsentMethod") .HasColumnType("nvarchar(max)"); b.Property("SmsConsentedAt") .HasColumnType("datetime2"); 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("UnsubscribeToken") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("nvarchar(450)") .HasDefaultValueSql("REPLACE(NEWID(),'-','')"); 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("PricingTierId"); b.HasIndex("UnsubscribeToken") .IsUnique() .HasDatabaseName("IX_Customers_UnsubscribeToken"); b.HasIndex("CompanyId", "Email") .IsUnique() .HasFilter("[Email] IS NOT NULL"); 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", "CreatedAt") .HasDatabaseName("IX_CustomerNotes_CustomerId_CreatedAt"); 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.HasIndex("CompanyId", "Status") .HasDatabaseName("IX_Equipment_CompanyId_Status"); b.ToTable("Equipment"); }); modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CategoryCode") .IsRequired() .HasColumnType("nvarchar(450)"); 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("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsCoating") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsSystemDefined") .HasColumnType("bit"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("CompanyId", "CategoryCode") .IsUnique(); b.ToTable("InventoryCategoryLookups"); }); 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("InventoryCategoryId") .HasColumnType("int"); 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("InventoryCategoryId"); b.HasIndex("PrimarySupplierId"); b.HasIndex("SKU") .IsUnique(); b.HasIndex("CompanyId", "QuantityOnHand", "ReorderPoint") .HasDatabaseName("IX_InventoryItems_CompanyId_Quantity_Reorder"); 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("ActualTimeSpentHours") .HasColumnType("decimal(18,2)"); 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("InternalNotes") .HasColumnType("nvarchar(max)"); b.Property("IsCustomerApproved") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobNumber") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("JobPriorityId") .HasColumnType("int"); b.Property("JobStatusId") .HasColumnType("int"); b.Property("OvenCostId") .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("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("JobPriorityId"); b.HasIndex("JobStatusId"); b.HasIndex("OvenCostId"); b.HasIndex("QuoteId") .IsUnique() .HasFilter("[QuoteId] IS NOT NULL"); b.HasIndex("CompanyId", "CustomerId") .HasDatabaseName("IX_Jobs_CompanyId_CustomerId"); b.HasIndex("CompanyId", "DueDate") .HasDatabaseName("IX_Jobs_CompanyId_DueDate"); b.HasIndex("CompanyId", "JobPriorityId") .HasDatabaseName("IX_Jobs_CompanyId_JobPriorityId"); b.HasIndex("CompanyId", "JobStatusId") .HasDatabaseName("IX_Jobs_CompanyId_JobStatusId"); b.HasIndex("CompanyId", "ScheduledDate") .HasDatabaseName("IX_Jobs_CompanyId_ScheduledDate"); b.ToTable("Jobs"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobChangeHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ChangeDescription") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("ChangedAt") .HasColumnType("datetime2"); b.Property("ChangedByUserId") .IsRequired() .HasColumnType("nvarchar(450)"); 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("FieldName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("NewValue") .HasColumnType("nvarchar(max)"); b.Property("OldValue") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("ChangedByUserId"); b.HasIndex("CompanyId"); b.HasIndex("JobId"); b.ToTable("JobChangeHistories"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobDailyPriority", 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("DisplayOrder") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("ScheduledDate") .HasColumnType("datetime2"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("JobId"); b.ToTable("JobDailyPriorities"); }); 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") .HasDatabaseName("IX_JobItems_JobId"); b.HasIndex("PowderInventoryId"); b.HasIndex("JobId", "IsDeleted") .HasDatabaseName("IX_JobItems_JobId_IsDeleted"); b.ToTable("JobItems"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobItemCoat", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ActualPowderUsedLbs") .HasColumnType("decimal(18,2)"); b.Property("CoatName") .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("Finish") .HasColumnType("nvarchar(max)"); b.Property("InventoryItemId") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobItemId") .HasColumnType("int"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PowderCostPerLb") .HasColumnType("decimal(18,2)"); b.Property("PowderToOrder") .HasColumnType("decimal(18,2)"); b.Property("Sequence") .HasColumnType("int"); b.Property("SupplierId") .HasColumnType("int"); b.Property("TransferEfficiency") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("InventoryItemId"); b.HasIndex("JobItemId"); b.HasIndex("SupplierId"); b.ToTable("JobItemCoats"); }); 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", "CreatedAt") .HasDatabaseName("IX_JobNotes_JobId_CreatedAt"); 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("UploadedById"); b.HasIndex("JobId", "IsDeleted", "DisplayOrder") .HasDatabaseName("IX_JobPhotos_JobId_IsDeleted_DisplayOrder"); b.ToTable("JobPhotos"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobPrepService", 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("JobId") .HasColumnType("int"); b.Property("PrepServiceId") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("JobId"); b.HasIndex("PrepServiceId"); b.ToTable("JobPrepServices"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobPriorityLookup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ColorClass") .IsRequired() .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") .HasColumnType("nvarchar(max)"); b.Property("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IconClass") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsSystemDefined") .HasColumnType("bit"); b.Property("PriorityCode") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("CompanyId", "PriorityCode") .IsUnique(); b.ToTable("JobPriorityLookups"); }); 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("FromStatusId") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("ToStatusId") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("FromStatusId"); b.HasIndex("JobId"); b.HasIndex("ToStatusId"); b.ToTable("JobStatusHistory"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusLookup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ColorClass") .IsRequired() .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") .HasColumnType("nvarchar(max)"); b.Property("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IconClass") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsSystemDefined") .HasColumnType("bit"); b.Property("IsTerminalStatus") .HasColumnType("bit"); b.Property("IsWorkInProgressStatus") .HasColumnType("bit"); b.Property("StatusCode") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.Property("WorkflowCategory") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("CompanyId", "StatusCode") .IsUnique(); b.ToTable("JobStatusLookups"); }); 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("IsRecurring") .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("RecurrenceEndDate") .HasColumnType("datetime2"); b.Property("RecurrenceFrequency") .HasColumnType("int"); b.Property("RecurrenceGroupId") .HasColumnType("nvarchar(max)"); b.Property("RecurrenceParentId") .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.HasIndex("RecurrenceParentId"); b.HasIndex("CompanyId", "ScheduledDate") .HasDatabaseName("IX_MaintenanceRecords_CompanyId_ScheduledDate"); b.HasIndex("CompanyId", "Status") .HasDatabaseName("IX_MaintenanceRecords_CompanyId_Status"); b.ToTable("MaintenanceRecords"); }); modelBuilder.Entity("PowderCoating.Core.Entities.NotificationLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Channel") .HasColumnType("int"); 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("ErrorMessage") .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("JobId") .HasColumnType("int"); b.Property("Message") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("NotificationType") .HasColumnType("int"); b.Property("QuoteId") .HasColumnType("int"); b.Property("Recipient") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("RecipientName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("SentAt") .HasColumnType("datetime2"); b.Property("Status") .HasColumnType("int"); b.Property("Subject") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CustomerId"); b.HasIndex("JobId"); b.HasIndex("QuoteId"); b.HasIndex("CompanyId", "SentAt") .HasDatabaseName("IX_NotificationLogs_CompanyId_SentAt"); b.HasIndex("CompanyId", "Status") .HasDatabaseName("IX_NotificationLogs_CompanyId_Status"); b.ToTable("NotificationLogs"); }); modelBuilder.Entity("PowderCoating.Core.Entities.NotificationTemplate", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Body") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Channel") .HasColumnType("int"); 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("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("NotificationType") .HasColumnType("int"); b.Property("Subject") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId", "NotificationType", "Channel") .IsUnique() .HasDatabaseName("IX_NotificationTemplates_Company_Type_Channel"); b.ToTable("NotificationTemplates"); }); modelBuilder.Entity("PowderCoating.Core.Entities.OvenCost", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CompanyId") .HasColumnType("int"); b.Property("CostPerHour") .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("DisplayOrder") .HasColumnType("int"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Label") .IsRequired() .HasMaxLength(100) .HasColumnType("nvarchar(100)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.ToTable("OvenCosts"); }); modelBuilder.Entity("PowderCoating.Core.Entities.PrepService", 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("ServiceName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("PrepServices"); }); 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, 25, 3, 39, 48, 790, DateTimeKind.Utc).AddTicks(1225), Description = "Standard pricing for regular customers", DiscountPercent = 0m, IsActive = true, IsDeleted = false, TierName = "Standard" }, new { Id = 2, CompanyId = 0, CreatedAt = new DateTime(2026, 2, 25, 3, 39, 48, 790, DateTimeKind.Utc).AddTicks(1233), Description = "5% discount for preferred customers", DiscountPercent = 5m, IsActive = true, IsDeleted = false, TierName = "Preferred" }, new { Id = 3, CompanyId = 0, CreatedAt = new DateTime(2026, 2, 25, 3, 39, 48, 790, DateTimeKind.Utc).AddTicks(1234), 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("DiscountReason") .HasColumnType("nvarchar(max)"); b.Property("DiscountType") .HasColumnType("int"); b.Property("DiscountValue") .HasColumnType("decimal(18,2)"); b.Property("ExpirationDate") .HasColumnType("datetime2"); b.Property("IsCommercial") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsRushJob") .HasColumnType("bit"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("OvenCostId") .HasColumnType("int"); 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("QuoteStatusId") .HasColumnType("int"); b.Property("RushFee") .HasColumnType("decimal(18,2)"); b.Property("SentDate") .HasColumnType("datetime2"); 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("OvenCostId"); b.HasIndex("PreparedById"); b.HasIndex("QuoteNumber") .IsUnique(); b.HasIndex("QuoteStatusId"); b.HasIndex("CompanyId", "ExpirationDate") .HasDatabaseName("IX_Quotes_CompanyId_ExpirationDate"); b.HasIndex("CompanyId", "QuoteStatusId") .HasDatabaseName("IX_Quotes_CompanyId_QuoteStatusId"); b.ToTable("Quotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteChangeHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ChangeDescription") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("ChangedAt") .HasColumnType("datetime2"); b.Property("ChangedByUserId") .IsRequired() .HasColumnType("nvarchar(450)"); 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("FieldName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("NewValue") .HasColumnType("nvarchar(max)"); b.Property("OldValue") .HasColumnType("nvarchar(max)"); b.Property("QuoteId") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("ChangedByUserId"); b.HasIndex("CompanyId"); b.HasIndex("QuoteId"); b.ToTable("QuoteChangeHistories"); }); 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("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("IsDeleted") .HasColumnType("bit"); b.Property("IsGenericItem") .HasColumnType("bit"); b.Property("ManualUnitPrice") .HasColumnType("decimal(18,2)"); b.Property("Notes") .HasColumnType("nvarchar(max)"); 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("QuoteId") .HasDatabaseName("IX_QuoteItems_QuoteId"); b.ToTable("QuoteItems"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemCoat", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CoatLaborCost") .HasColumnType("decimal(18,2)"); b.Property("CoatMaterialCost") .HasColumnType("decimal(18,2)"); b.Property("CoatName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("CoatTotalCost") .HasColumnType("decimal(18,2)"); 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("Finish") .HasColumnType("nvarchar(max)"); b.Property("InventoryItemId") .HasColumnType("int"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PowderCostPerLb") .HasColumnType("decimal(18,2)"); b.Property("PowderToOrder") .HasColumnType("decimal(18,2)"); b.Property("QuoteItemId") .HasColumnType("int"); b.Property("Sequence") .HasColumnType("int"); b.Property("SupplierId") .HasColumnType("int"); b.Property("TransferEfficiency") .HasColumnType("decimal(18,2)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId") .HasDatabaseName("IX_QuoteItemCoats_CompanyId"); b.HasIndex("InventoryItemId") .HasDatabaseName("IX_QuoteItemCoats_InventoryItemId"); b.HasIndex("QuoteItemId") .HasDatabaseName("IX_QuoteItemCoats_QuoteItemId"); b.HasIndex("SupplierId"); b.ToTable("QuoteItemCoats"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuotePrepService", 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("PrepServiceId") .HasColumnType("int"); b.Property("QuoteId") .HasColumnType("int"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("PrepServiceId"); b.HasIndex("QuoteId"); b.ToTable("QuotePrepServices"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ColorClass") .IsRequired() .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") .HasColumnType("nvarchar(max)"); b.Property("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("DisplayOrder") .HasColumnType("int"); b.Property("IconClass") .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsApprovedStatus") .HasColumnType("bit"); b.Property("IsConvertedStatus") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsDraftStatus") .HasColumnType("bit"); b.Property("IsSystemDefined") .HasColumnType("bit"); b.Property("StatusCode") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("CompanyId", "StatusCode") .IsUnique(); b.ToTable("QuoteStatusLookups"); }); 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.SubscriptionPlanConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AnnualPrice") .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("Description") .HasColumnType("nvarchar(max)"); b.Property("DisplayName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("IsActive") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("MaxActiveJobs") .HasColumnType("int"); b.Property("MaxCatalogItems") .HasColumnType("int"); b.Property("MaxCustomers") .HasColumnType("int"); b.Property("MaxQuotes") .HasColumnType("int"); b.Property("MaxUsers") .HasColumnType("int"); b.Property("MonthlyPrice") .HasColumnType("decimal(18,2)"); b.Property("Plan") .HasColumnType("int"); b.Property("SortOrder") .HasColumnType("int"); b.Property("StripePriceIdAnnual") .HasColumnType("nvarchar(max)"); b.Property("StripePriceIdMonthly") .HasColumnType("nvarchar(max)"); b.Property("UpdatedAt") .HasColumnType("datetime2"); b.Property("UpdatedBy") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("SubscriptionPlanConfigs"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AccountNumber") .HasColumnType("nvarchar(max)"); 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("CreditLimit") .HasColumnType("decimal(18,2)"); 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("IsPreferred") .HasColumnType("bit"); b.Property("Notes") .HasColumnType("nvarchar(max)"); b.Property("PaymentTerms") .HasColumnType("nvarchar(max)"); b.Property("Phone") .HasColumnType("nvarchar(max)"); b.Property("State") .HasColumnType("nvarchar(max)"); b.Property("TaxId") .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.Appointment", b => { b.HasOne("PowderCoating.Core.Entities.AppointmentStatusLookup", "AppointmentStatus") .WithMany("Appointments") .HasForeignKey("AppointmentStatusId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.AppointmentTypeLookup", "AppointmentType") .WithMany("Appointments") .HasForeignKey("AppointmentTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.ShopWorker", "AssignedWorker") .WithMany() .HasForeignKey("AssignedWorkerId"); b.HasOne("PowderCoating.Core.Entities.Customer", "Customer") .WithMany() .HasForeignKey("CustomerId"); b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany() .HasForeignKey("JobId"); b.Navigation("AppointmentStatus"); b.Navigation("AppointmentType"); b.Navigation("AssignedWorker"); b.Navigation("Customer"); b.Navigation("Job"); }); 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.InventoryCategoryLookup", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .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.InventoryCategoryLookup", "InventoryCategory") .WithMany("InventoryItems") .HasForeignKey("InventoryCategoryId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("PowderCoating.Core.Entities.Supplier", "PrimarySupplier") .WithMany("InventoryItems") .HasForeignKey("PrimarySupplierId") .OnDelete(DeleteBehavior.SetNull); b.Navigation("InventoryCategory"); 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.JobPriorityLookup", "JobPriority") .WithMany("Jobs") .HasForeignKey("JobPriorityId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "JobStatus") .WithMany("Jobs") .HasForeignKey("JobStatusId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.OvenCost", "OvenCost") .WithMany("Jobs") .HasForeignKey("OvenCostId") .OnDelete(DeleteBehavior.Restrict); 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("JobPriority"); b.Navigation("JobStatus"); b.Navigation("OvenCost"); b.Navigation("Quote"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobChangeHistory", b => { b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "ChangedBy") .WithMany() .HasForeignKey("ChangedByUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany() .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ChangedBy"); b.Navigation("Job"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobDailyPriority", b => { b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany() .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Job"); }); 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.JobItemCoat", b => { b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem") .WithMany() .HasForeignKey("InventoryItemId"); b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem") .WithMany("Coats") .HasForeignKey("JobItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Supplier", "Supplier") .WithMany() .HasForeignKey("SupplierId"); b.Navigation("InventoryItem"); b.Navigation("JobItem"); b.Navigation("Supplier"); }); 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.JobPrepService", b => { b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany("JobPrepServices") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService") .WithMany() .HasForeignKey("PrepServiceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Job"); b.Navigation("PrepService"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobPriorityLookup", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusHistory", b => { b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "FromStatus") .WithMany("FromStatusHistory") .HasForeignKey("FromStatusId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany("StatusHistory") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "ToStatus") .WithMany("ToStatusHistory") .HasForeignKey("ToStatusId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("FromStatus"); b.Navigation("Job"); b.Navigation("ToStatus"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusLookup", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); 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.HasOne("PowderCoating.Core.Entities.MaintenanceRecord", "RecurrenceParent") .WithMany() .HasForeignKey("RecurrenceParentId"); b.Navigation("AssignedWorker"); b.Navigation("Equipment"); b.Navigation("PerformedBy"); b.Navigation("RecurrenceParent"); }); modelBuilder.Entity("PowderCoating.Core.Entities.NotificationLog", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Customer", "Customer") .WithMany("NotificationLogs") .HasForeignKey("CustomerId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("PowderCoating.Core.Entities.Job", "Job") .WithMany() .HasForeignKey("JobId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("PowderCoating.Core.Entities.Quote", "Quote") .WithMany() .HasForeignKey("QuoteId") .OnDelete(DeleteBehavior.SetNull); b.Navigation("Customer"); b.Navigation("Job"); b.Navigation("Quote"); }); modelBuilder.Entity("PowderCoating.Core.Entities.NotificationTemplate", b => { b.HasOne("PowderCoating.Core.Entities.Company", "Company") .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); }); modelBuilder.Entity("PowderCoating.Core.Entities.OvenCost", b => { b.HasOne("PowderCoating.Core.Entities.Company", "Company") .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Company"); }); 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.OvenCost", "OvenCost") .WithMany("Quotes") .HasForeignKey("OvenCostId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PreparedBy") .WithMany("PreparedQuotes") .HasForeignKey("PreparedById") .OnDelete(DeleteBehavior.SetNull); b.HasOne("PowderCoating.Core.Entities.QuoteStatusLookup", "QuoteStatus") .WithMany("Quotes") .HasForeignKey("QuoteStatusId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Customer"); b.Navigation("OvenCost"); b.Navigation("PreparedBy"); b.Navigation("QuoteStatus"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteChangeHistory", b => { b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "ChangedBy") .WithMany() .HasForeignKey("ChangedByUserId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Quote", "Quote") .WithMany() .HasForeignKey("QuoteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ChangedBy"); b.Navigation("Quote"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b => { b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem") .WithMany() .HasForeignKey("CatalogItemId"); b.HasOne("PowderCoating.Core.Entities.Quote", "Quote") .WithMany("QuoteItems") .HasForeignKey("QuoteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("CatalogItem"); b.Navigation("Quote"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemCoat", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem") .WithMany() .HasForeignKey("InventoryItemId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("PowderCoating.Core.Entities.QuoteItem", "QuoteItem") .WithMany("Coats") .HasForeignKey("QuoteItemId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Supplier", "Supplier") .WithMany() .HasForeignKey("SupplierId"); b.Navigation("InventoryItem"); b.Navigation("QuoteItem"); b.Navigation("Supplier"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuotePrepService", b => { b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService") .WithMany() .HasForeignKey("PrepServiceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PowderCoating.Core.Entities.Quote", "Quote") .WithMany("QuotePrepServices") .HasForeignKey("QuoteId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("PrepService"); b.Navigation("Quote"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b => { b.HasOne("PowderCoating.Core.Entities.Company", null) .WithMany() .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); 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.AppointmentStatusLookup", b => { b.Navigation("Appointments"); }); modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentTypeLookup", b => { b.Navigation("Appointments"); }); 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("NotificationLogs"); b.Navigation("Quotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b => { b.Navigation("MaintenanceRecords"); }); modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b => { b.Navigation("InventoryItems"); }); 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("JobPrepServices"); b.Navigation("Notes"); b.Navigation("Photos"); b.Navigation("StatusHistory"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b => { b.Navigation("Coats"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobPriorityLookup", b => { b.Navigation("Jobs"); }); modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusLookup", b => { b.Navigation("FromStatusHistory"); b.Navigation("Jobs"); b.Navigation("ToStatusHistory"); }); modelBuilder.Entity("PowderCoating.Core.Entities.OvenCost", b => { b.Navigation("Jobs"); b.Navigation("Quotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b => { b.Navigation("Customers"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b => { b.Navigation("ConvertedToJob"); b.Navigation("QuoteItems"); b.Navigation("QuotePrepServices"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b => { b.Navigation("Coats"); }); modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b => { b.Navigation("Quotes"); }); modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b => { b.Navigation("AssignedJobs"); b.Navigation("AssignedMaintenanceTasks"); }); modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b => { b.Navigation("InventoryItems"); }); #pragma warning restore 612, 618 } } }