// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PowderCoating.Infrastructure.Data;

#nullable disable

namespace PowderCoating.Infrastructure.Migrations
{
    [DbContext(typeof(ApplicationDbContext))]
    partial class ApplicationDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.11")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("FriendlyName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Xml")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("DataProtectionKeys");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("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<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("RoleId")
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Name")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Value")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens", (string)null);
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Account", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("AccountNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("AccountSubType")
                        .HasColumnType("int");

                    b.Property<int>("AccountType")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("CurrentBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSystem")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("OpeningBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("OpeningBalanceDate")
                        .HasColumnType("datetime2");

                    b.Property<int?>("ParentAccountId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("ParentAccountId");

                    b.ToTable("Accounts");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.AiItemPrediction", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("AiTags")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("Confidence")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("ConversationRounds")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("PredictedComplexity")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("PredictedMinutes")
                        .HasColumnType("int");

                    b.Property<decimal>("PredictedSurfaceAreaSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("PredictedUnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Reasoning")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("UserOverrodeEstimate")
                        .HasColumnType("bit");

                    b.HasKey("Id");

                    b.ToTable("AiItemPredictions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.AiUsageLog", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<DateTime>("CalledAt")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("Feature")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("InputLength")
                        .HasColumnType("int");

                    b.Property<bool>("Success")
                        .HasColumnType("bit");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId", "CalledAt")
                        .HasDatabaseName("IX_AiUsageLogs_CompanyId_CalledAt");

                    b.ToTable("AiUsageLogs");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Announcement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedByUserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CreatedByUserName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ExpiresAt")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDismissible")
                        .HasColumnType("bit");

                    b.Property<string>("Message")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("StartsAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("Target")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("TargetCompanyId")
                        .HasColumnType("int");

                    b.Property<int?>("TargetPlan")
                        .HasColumnType("int");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.HasKey("Id");

                    b.ToTable("Announcements");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.AnnouncementDismissal", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("AnnouncementId")
                        .HasColumnType("int");

                    b.Property<DateTime>("DismissedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("AnnouncementId", "UserId")
                        .IsUnique();

                    b.ToTable("AnnouncementDismissals");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("int");

                    b.Property<string>("Address")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("BanReason")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("BannedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("BannedByUserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("CanApproveQuotes")
                        .HasColumnType("bit");

                    b.Property<bool>("CanCreateQuotes")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageAccounting")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageBills")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageCalendar")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageCustomers")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageEquipment")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageInventory")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageInvoices")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageJobs")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageMaintenance")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageProducts")
                        .HasColumnType("bit");

                    b.Property<bool>("CanManageVendors")
                        .HasColumnType("bit");

                    b.Property<bool>("CanViewCalendar")
                        .HasColumnType("bit");

                    b.Property<bool>("CanViewProducts")
                        .HasColumnType("bit");

                    b.Property<bool>("CanViewReports")
                        .HasColumnType("bit");

                    b.Property<bool>("CanViewShopFloor")
                        .HasColumnType("bit");

                    b.Property<string>("City")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("CompanyRole")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<int?>("DashboardLayout")
                        .HasColumnType("int");

                    b.Property<string>("DateFormat")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Department")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("bit");

                    b.Property<string>("EmployeeNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("HireDate")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsBanned")
                        .HasColumnType("bit");

                    b.Property<string>("KioskPin")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("LaborCostPerHour")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("LastLoginDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("bit");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("datetimeoffset");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("PasskeyPromptDismissed")
                        .HasColumnType("bit");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("bit");

                    b.Property<string>("Position")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProfilePictureFilePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SidebarColor")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("State")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("TerminationDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("Theme")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("TimeZone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("nvarchar(256)");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime?>("ActualEndTime")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("ActualStartTime")
                        .HasColumnType("datetime2");

                    b.Property<string>("AppointmentNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("AppointmentStatusId")
                        .HasColumnType("int");

                    b.Property<int>("AppointmentTypeId")
                        .HasColumnType("int");

                    b.Property<string>("AssignedUserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsAllDay")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsReminderEnabled")
                        .HasColumnType("bit");

                    b.Property<int?>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Location")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("ReminderMinutesBefore")
                        .HasColumnType("int");

                    b.Property<DateTime?>("ReminderSentAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime>("ScheduledEndTime")
                        .HasColumnType("datetime2");

                    b.Property<DateTime>("ScheduledStartTime")
                        .HasColumnType("datetime2");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AppointmentStatusId");

                    b.HasIndex("AppointmentTypeId");

                    b.HasIndex("AssignedUserId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("JobId");

                    b.HasIndex("ScheduledStartTime");

                    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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ColorClass")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("IconClass")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSystemDefined")
                        .HasColumnType("bit");

                    b.Property<bool>("IsTerminalStatus")
                        .HasColumnType("bit");

                    b.Property<string>("StatusCode")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("AppointmentStatusLookups");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentTypeLookup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ColorClass")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("IconClass")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSystemDefined")
                        .HasColumnType("bit");

                    b.Property<bool>("RequiresJobLink")
                        .HasColumnType("bit");

                    b.Property<string>("TypeCode")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("AppointmentTypeLookups");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.AuditLog", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("Action")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("CompanyName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EntityDescription")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EntityId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("EntityType")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("IpAddress")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("NewValues")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("OldValues")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("Timestamp")
                        .HasColumnType("datetime2");

                    b.Property<string>("UserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId", "Timestamp");

                    b.HasIndex("EntityType", "EntityId");

                    b.ToTable("AuditLogs");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BankReconciliation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<decimal>("BeginningBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CompletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("EndingBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("StatementDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

                    b.ToTable("BankReconciliations");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BannedIp", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("BannedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("BannedByUserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ExpiresAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("IpAddress")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<string>("Reason")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("BannedIps");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Bill", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("APAccountId")
                        .HasColumnType("int");

                    b.Property<decimal>("AmountPaid")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("BillDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("BillNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DueDate")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Memo")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ReceiptFilePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("SubTotal")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TaxAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TaxPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Terms")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Total")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("VendorId")
                        .HasColumnType("int");

                    b.Property<string>("VendorInvoiceNumber")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("APAccountId");

                    b.HasIndex("DueDate");

                    b.HasIndex("Status");

                    b.HasIndex("VendorId");

                    b.HasIndex("CompanyId", "Status");

                    b.ToTable("Bills");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BillLineItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("AccountId")
                        .HasColumnType("int");

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("BillId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("JobId")
                        .HasColumnType("int");

                    b.Property<decimal>("Quantity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("UnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

                    b.HasIndex("BillId");

                    b.HasIndex("JobId");

                    b.ToTable("BillLineItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BillPayment", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("BankAccountId")
                        .HasColumnType("int");

                    b.Property<int>("BillId")
                        .HasColumnType("int");

                    b.Property<string>("CheckNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ClearedDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsCleared")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Memo")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("PaymentDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("PaymentMethod")
                        .HasColumnType("int");

                    b.Property<string>("PaymentNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("VendorId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("BankAccountId");

                    b.HasIndex("BillId");

                    b.HasIndex("VendorId");

                    b.ToTable("BillPayments");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Budget", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("FiscalYear")
                        .HasColumnType("int");

                    b.Property<bool>("IsDefault")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("Budgets");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BudgetLine", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<decimal>("Apr")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Aug")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("BudgetId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Dec")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Feb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<decimal>("Jan")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Jul")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Jun")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Mar")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("May")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Nov")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Oct")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Sep")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

                    b.HasIndex("BudgetId");

                    b.ToTable("BudgetLines");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BugReport", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("CompanyName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("Priority")
                        .HasColumnType("int");

                    b.Property<string>("ResolutionNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ResolvedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("ResolvedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("SubmittedByUserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SubmittedByUserName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("BugReports");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BugReportAttachment", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("BlobPath")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("BugReportId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("ContentType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<long>("FileSizeBytes")
                        .HasColumnType("bigint");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("BugReportId");

                    b.ToTable("BugReportAttachments");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsMerchandise")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("ParentCategoryId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal?>("ApproximateArea")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CategoryId")
                        .HasColumnType("int");

                    b.Property<int?>("CogsAccountId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DefaultEstimatedMinutes")
                        .HasColumnType("int");

                    b.Property<decimal>("DefaultPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("DefaultRequiresMasking")
                        .HasColumnType("bit");

                    b.Property<bool>("DefaultRequiresSandblasting")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("ImagePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsMerchandise")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("RevenueAccountId")
                        .HasColumnType("int");

                    b.Property<string>("SKU")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ThumbnailPath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CategoryId");

                    b.HasIndex("CogsAccountId");

                    b.HasIndex("CompanyId");

                    b.HasIndex("InventoryItemId");

                    b.HasIndex("RevenueAccountId");

                    b.ToTable("CatalogItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CatalogPriceCheckReport", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("ItemsChecked")
                        .HasColumnType("int");

                    b.Property<string>("OperatingCostsSummary")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ResultsJson")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("RunAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("CatalogPriceCheckReports");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Company", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("AccountingMethod")
                        .HasColumnType("int");

                    b.Property<bool?>("AccountingOverride")
                        .HasColumnType("bit");

                    b.Property<string>("Address")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("AiCatalogPriceCheckEnabled")
                        .HasColumnType("bit");

                    b.Property<bool>("AiInventoryAssistEnabled")
                        .HasColumnType("bit");

                    b.Property<bool>("AiPhotoQuotesEnabled")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("BookLockedThrough")
                        .HasColumnType("datetime2");

                    b.Property<string>("City")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CompanyCode")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("CompanyName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsAnnualBilling")
                        .HasColumnType("bit");

                    b.Property<bool>("IsComped")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("KioskActivationToken")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("LogoContentType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<byte[]>("LogoData")
                        .HasColumnType("varbinary(max)");

                    b.Property<string>("LogoFilePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("MarketingEmailOptOut")
                        .HasColumnType("bit");

                    b.Property<string>("MarketingUnsubscribeToken")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("MaxActiveJobsOverride")
                        .HasColumnType("int");

                    b.Property<int?>("MaxAiPhotoQuotesPerMonthOverride")
                        .HasColumnType("int");

                    b.Property<int?>("MaxCatalogItemsOverride")
                        .HasColumnType("int");

                    b.Property<int?>("MaxCustomersOverride")
                        .HasColumnType("int");

                    b.Property<int?>("MaxJobPhotosOverride")
                        .HasColumnType("int");

                    b.Property<int?>("MaxQuotePhotosOverride")
                        .HasColumnType("int");

                    b.Property<int?>("MaxQuotesOverride")
                        .HasColumnType("int");

                    b.Property<int?>("MaxUsersOverride")
                        .HasColumnType("int");

                    b.Property<int>("OnlinePaymentSurchargeType")
                        .HasColumnType("int");

                    b.Property<decimal>("OnlinePaymentSurchargeValue")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool?>("OnlinePaymentsOverride")
                        .HasColumnType("bit");

                    b.Property<bool>("OnlineSurchargeAcknowledged")
                        .HasColumnType("bit");

                    b.Property<string>("Phone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PrimaryContactEmail")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PrimaryContactName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("SmsDisabledByAdmin")
                        .HasColumnType("bit");

                    b.Property<bool>("SmsEnabled")
                        .HasColumnType("bit");

                    b.Property<string>("State")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("StripeAccountId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("StripeConnectStatus")
                        .HasColumnType("int");

                    b.Property<string>("StripeCustomerId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("StripeSubscriptionId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("SubscriptionEndDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("SubscriptionNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("SubscriptionPlan")
                        .HasColumnType("int");

                    b.Property<DateTime>("SubscriptionStartDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("SubscriptionStatus")
                        .HasColumnType("int");

                    b.Property<string>("TimeZone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("TimeclockAllowMultiplePunchesPerDay")
                        .HasColumnType("bit");

                    b.Property<int?>("TimeclockAutoClockOutHours")
                        .HasColumnType("int");

                    b.Property<bool>("TimeclockEnabled")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ZipCode")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyCode")
                        .IsUnique()
                        .HasFilter("[CompanyCode] IS NOT NULL");

                    b.ToTable("Companies");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CompanyBlastSetup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("BlastNozzleSize")
                        .HasColumnType("int");

                    b.Property<decimal?>("BlastRateSqFtPerHourOverride")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<decimal>("CompressorCfm")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDefault")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<int>("PrimarySubstrate")
                        .HasColumnType("int");

                    b.Property<int>("SetupType")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.ToTable("CompanyBlastSetups");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CompanyOperatingCosts", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("AdditionalCoatLaborPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("AiContextProfile")
                        .HasMaxLength(2000)
                        .HasColumnType("nvarchar(2000)");

                    b.Property<int>("BlastNozzleSize")
                        .HasColumnType("int");

                    b.Property<decimal?>("BlastRateSqFtPerHourOverride")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("BlastSetupType")
                        .HasColumnType("int");

                    b.Property<decimal>("CoatingBoothCostPerHour")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CoatingGunType")
                        .HasColumnType("int");

                    b.Property<decimal?>("CoatingRateSqFtPerHourOverride")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<decimal>("ComplexityComplexPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ComplexityExtremePercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ComplexityModeratePercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ComplexitySimplePercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("CompressorCfm")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DefaultOvenCycleMinutes")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("GeneralMarkupPercentage")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<decimal?>("LaborCostPerHour")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("MonthlyBillableHours")
                        .HasColumnType("int");

                    b.Property<decimal>("MonthlyRent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("MonthlyUtilities")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("OvenOperatingCostPerHour")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("PowderCoatingCostPerSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("PricingMode")
                        .HasColumnType("int");

                    b.Property<int>("PrimaryBlastSubstrate")
                        .HasColumnType("int");

                    b.Property<decimal>("RushChargeFixedAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("RushChargePercentage")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("RushChargeType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("SandblasterCostPerHour")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("ShopCapabilityTier")
                        .HasColumnType("int");

                    b.Property<decimal>("ShopMinimumCharge")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ShopSuppliesRate")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("StandardLaborRate")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TargetMarginPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TaxPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId")
                        .IsUnique();

                    b.ToTable("CompanyOperatingCosts");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CompanyPreferences", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("AllowCustomerApproval")
                        .HasColumnType("bit");

                    b.Property<int>("AutoArchiveJobsDays")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DefaultCogsAccountId")
                        .HasColumnType("int");

                    b.Property<string>("DefaultCurrency")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DefaultDateFormat")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DefaultInventoryAccountId")
                        .HasColumnType("int");

                    b.Property<string>("DefaultJobPriority")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DefaultPaymentTerms")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DefaultQuoteValidityDays")
                        .HasColumnType("int");

                    b.Property<int?>("DefaultRevenueAccountId")
                        .HasColumnType("int");

                    b.Property<string>("DefaultTimeFormat")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DefaultTurnaroundDays")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DeletedRecordRetentionDays")
                        .HasColumnType("int");

                    b.Property<int>("DueDateWarningDays")
                        .HasColumnType("int");

                    b.Property<string>("EmailFromAddress")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EmailFromName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("EmailNotificationsEnabled")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("FirstInvoiceCreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("FirstJobCreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("FirstQuoteCreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<bool>("FirstWorkflowCompleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("FirstWorkflowCompletedAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("GuidedActivationDismissedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("InAccentColor")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("InDefaultTerms")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("InFooterNote")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("InvoiceNumberPrefix")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("JobNumberPrefix")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("JobRetentionYears")
                        .HasColumnType("int");

                    b.Property<string>("KioskIntakeOutput")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("LogRetentionDays")
                        .HasColumnType("int");

                    b.Property<int>("MaintenanceAlertDays")
                        .HasColumnType("int");

                    b.Property<bool>("MigratingFromQuickBooks")
                        .HasColumnType("bit");

                    b.Property<bool>("NotifyOnJobStatusChange")
                        .HasColumnType("bit");

                    b.Property<bool>("NotifyOnNewJob")
                        .HasColumnType("bit");

                    b.Property<bool>("NotifyOnNewQuote")
                        .HasColumnType("bit");

                    b.Property<bool>("NotifyOnPaymentReceived")
                        .HasColumnType("bit");

                    b.Property<bool>("NotifyOnQuoteApproval")
                        .HasColumnType("bit");

                    b.Property<string>("OnboardingPath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PaymentReminderDays")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("PaymentRemindersEnabled")
                        .HasColumnType("bit");

                    b.Property<string>("QbMigrationStateJson")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("QtAccentColor")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("QtDefaultTerms")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("QtFooterNote")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("QuoteExpiryWarningDays")
                        .HasColumnType("int");

                    b.Property<string>("QuoteNumberPrefix")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("QuoteRetentionYears")
                        .HasColumnType("int");

                    b.Property<bool>("RequireCustomerPO")
                        .HasColumnType("bit");

                    b.Property<bool>("SetupWizardCompleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("SetupWizardCompletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("SetupWizardCompletedByName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SetupWizardCompletedByUserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SetupWizardDoneSteps")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SetupWizardSkippedSteps")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("SetupWizardStarted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("UseMetricSystem")
                        .HasColumnType("bit");

                    b.Property<string>("WoAccentColor")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("WoTerms")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId")
                        .IsUnique();

                    b.HasIndex("DefaultCogsAccountId");

                    b.HasIndex("DefaultInventoryAccountId");

                    b.HasIndex("DefaultRevenueAccountId");

                    b.ToTable("CompanyPreferences");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CompanySmsAgreement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("AgreedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("AgreedByUserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("AgreedByUserName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("IpAddress")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("TermsVersion")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserAgent")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("CompanySmsAgreements");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.ContactSubmission", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("AdminNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Category")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("CompanyName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsRead")
                        .HasColumnType("bit");

                    b.Property<string>("Message")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ReadAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("ReadByUserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ReadByUserName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SenderEmail")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SenderName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Subject")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId", "IsDeleted", "CreatedAt");

                    b.ToTable("ContactSubmissions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemo", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("AmountApplied")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ExpiryDate")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime>("IssueDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("IssuedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("MemoNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("OriginalInvoiceId")
                        .HasColumnType("int");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("ReworkRecordId")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.HasIndex("IssuedById");

                    b.HasIndex("OriginalInvoiceId");

                    b.HasIndex("ReworkRecordId");

                    b.HasIndex("CompanyId", "MemoNumber")
                        .IsUnique()
                        .HasDatabaseName("IX_CreditMemos_CompanyId_MemoNumber");

                    b.ToTable("CreditMemos");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemoApplication", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("AmountApplied")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("AppliedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime>("AppliedDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CreditMemoId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("InvoiceId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AppliedById");

                    b.HasIndex("CreditMemoId");

                    b.HasIndex("InvoiceId");

                    b.ToTable("CreditMemoApplications");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CustomItemTemplate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("DefaultRate")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DiagramImagePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("FieldsJson")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Formula")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsModifiedFromSource")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("OutputMode")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("RateLabel")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("SourceFormulaLibraryItemId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("SourceFormulaLibraryItemId");

                    b.ToTable("CustomItemTemplates");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Address")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("BillingEmail")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("City")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("CompanyName")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("ContactFirstName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ContactLastName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Country")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("CreditBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("CreditLimit")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("CurrentBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Email")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("GeneralNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsCommercial")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsTaxExempt")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("LastContactDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("LeadSource")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("MobilePhone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("NotifyByEmail")
                        .HasColumnType("bit");

                    b.Property<bool>("NotifyBySms")
                        .HasColumnType("bit");

                    b.Property<string>("PaymentTerms")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Phone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("PricingTierId")
                        .HasColumnType("int");

                    b.Property<string>("ShipToAddress")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ShipToCity")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ShipToCountry")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ShipToState")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ShipToZipCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SmsConsentMethod")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("SmsConsentedAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("SmsOptedOutAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("State")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("TaxExemptCertificateContentType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<byte[]>("TaxExemptCertificateData")
                        .HasColumnType("varbinary(max)");

                    b.Property<string>("TaxExemptCertificateFileName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("TaxId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UnsubscribeToken")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnType("nvarchar(450)")
                        .HasDefaultValueSql("REPLACE(NEWID(),'-','')");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("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.CustomerContact", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("ContactRole")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Email")
                        .HasMaxLength(200)
                        .HasColumnType("nvarchar(200)");

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("LastName")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<string>("MobilePhone")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("nvarchar(500)");

                    b.Property<string>("Phone")
                        .HasMaxLength(20)
                        .HasColumnType("nvarchar(20)");

                    b.Property<string>("Title")
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.ToTable("CustomerContacts");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CustomerNote", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsImportant")
                        .HasColumnType("bit");

                    b.Property<string>("Note")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId", "CreatedAt")
                        .HasDatabaseName("IX_CustomerNotes_CustomerId_CreatedAt");

                    b.ToTable("CustomerNotes");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CustomerPreferredPowder", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("InventoryItemId");

                    b.HasIndex("CustomerId", "InventoryItemId")
                        .IsUnique()
                        .HasDatabaseName("IX_CustomerPreferredPowders_CustomerId_InventoryItemId");

                    b.ToTable("CustomerPreferredPowders");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.DashboardTip", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<string>("TipText")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("DashboardTips");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Deposit", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("AppliedDate")
                        .HasColumnType("datetime2");

                    b.Property<int?>("AppliedToInvoiceId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DepositAccountId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("PaymentMethod")
                        .HasColumnType("int");

                    b.Property<int?>("QuoteId")
                        .HasColumnType("int");

                    b.Property<string>("ReceiptNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("ReceivedDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("RecordedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Reference")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AppliedToInvoiceId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("JobId");

                    b.HasIndex("QuoteId");

                    b.HasIndex("RecordedById");

                    b.ToTable("Deposits");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.EmployeeClockEntry", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("ClockInTime")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("ClockOutTime")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("EntryType")
                        .HasColumnType("int");

                    b.Property<decimal?>("HoursWorked")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.HasIndex("CompanyId", "ClockInTime");

                    b.ToTable("EmployeeClockEntries");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EquipmentName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EquipmentNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EquipmentType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("LastMaintenanceDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("Location")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ManualContentType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ManualFileName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ManualFilePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<long?>("ManualFileSize")
                        .HasColumnType("bigint");

                    b.Property<DateTime?>("ManualUploadedDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("Manufacturer")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("MaxLoadSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Model")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("NextScheduledMaintenance")
                        .HasColumnType("datetime2");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("OvenCycleMinutes")
                        .HasColumnType("int");

                    b.Property<DateTime?>("PurchaseDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("PurchasePrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("RecommendedMaintenanceIntervalDays")
                        .HasColumnType("int");

                    b.Property<string>("SerialNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("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.Expense", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("ClearedDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("Date")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("ExpenseAccountId")
                        .HasColumnType("int");

                    b.Property<string>("ExpenseNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsCleared")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Memo")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("PaymentAccountId")
                        .HasColumnType("int");

                    b.Property<int>("PaymentMethod")
                        .HasColumnType("int");

                    b.Property<string>("ReceiptFilePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("VendorId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ExpenseAccountId");

                    b.HasIndex("JobId");

                    b.HasIndex("PaymentAccountId");

                    b.HasIndex("VendorId");

                    b.ToTable("Expenses");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FixedAsset", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("AccumDepreciationAccountId")
                        .HasColumnType("int");

                    b.Property<decimal>("AccumulatedDepreciation")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("AssetAccountId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DepreciationExpenseAccountId")
                        .HasColumnType("int");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DisposalDate")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDisposed")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("PurchaseCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("PurchaseDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("SalvageValue")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("UsefulLifeMonths")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("AccumDepreciationAccountId");

                    b.HasIndex("AssetAccountId");

                    b.HasIndex("DepreciationExpenseAccountId");

                    b.ToTable("FixedAssets");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FixedAssetDepreciationEntry", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("FixedAssetId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("JournalEntryId")
                        .HasColumnType("int");

                    b.Property<int>("PeriodMonth")
                        .HasColumnType("int");

                    b.Property<int>("PeriodYear")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("FixedAssetId");

                    b.HasIndex("JournalEntryId");

                    b.ToTable("FixedAssetDepreciationEntries");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FormulaLibraryImport", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("FormulaLibraryItemId")
                        .HasColumnType("int");

                    b.Property<DateTime>("ImportedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("ImportedByUserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("ResultingCustomItemTemplateId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("FormulaLibraryItemId");

                    b.HasIndex("ResultingCustomItemTemplateId");

                    b.HasIndex("CompanyId", "FormulaLibraryItemId")
                        .IsUnique()
                        .HasDatabaseName("IX_FormulaLibraryImports_Company_Item");

                    b.ToTable("FormulaLibraryImports");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FormulaLibraryItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<decimal?>("DefaultRate")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DiagramImagePath")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FieldsJson")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Formula")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("ImportCount")
                        .HasColumnType("int");

                    b.Property<string>("IndustryHint")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InspiredByFormulaLibraryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsPublished")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("OutputMode")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("RateLabel")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("SharedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("SharedByUserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("SourceCompanyId")
                        .HasColumnType("int");

                    b.Property<string>("SourceCompanyName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("SourceCustomItemTemplateId")
                        .HasColumnType("int");

                    b.Property<string>("Tags")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.HasKey("Id");

                    b.HasIndex("InspiredByFormulaLibraryItemId");

                    b.HasIndex("IsPublished")
                        .HasDatabaseName("IX_FormulaLibraryItems_IsPublished");

                    b.HasIndex("SourceCompanyId")
                        .HasDatabaseName("IX_FormulaLibraryItems_SourceCompanyId");

                    b.ToTable("FormulaLibraryItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FormulaLibraryRating", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<int>("FormulaLibraryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsPositive")
                        .HasColumnType("bit");

                    b.Property<DateTime>("RatedAt")
                        .HasColumnType("datetime2");

                    b.HasKey("Id");

                    b.HasIndex("FormulaLibraryItemId", "CompanyId")
                        .IsUnique()
                        .HasDatabaseName("IX_FormulaLibraryRatings_Item_Company");

                    b.ToTable("FormulaLibraryRatings");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<Guid?>("BatchId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("CertificateCode")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ExpiryDate")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime>("IssueDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("IssuedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("IssuedReason")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("OriginalAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal?>("PurchasePrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("PurchasingCustomerId")
                        .HasColumnType("int");

                    b.Property<int?>("RecipientCustomerId")
                        .HasColumnType("int");

                    b.Property<string>("RecipientEmail")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("RecipientName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("RedeemedAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("SourceInvoiceItemId")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("IssuedById");

                    b.HasIndex("PurchasingCustomerId");

                    b.HasIndex("RecipientCustomerId");

                    b.HasIndex("CompanyId", "CertificateCode")
                        .IsUnique();

                    b.ToTable("GiftCertificates");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificateRedemption", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("AmountRedeemed")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("GiftCertificateId")
                        .HasColumnType("int");

                    b.Property<int>("InvoiceId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("RedeemedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime>("RedeemedDate")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("GiftCertificateId");

                    b.HasIndex("InvoiceId");

                    b.HasIndex("RedeemedById");

                    b.ToTable("GiftCertificateRedemptions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InAppNotification", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InvoiceId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsRead")
                        .HasColumnType("bit");

                    b.Property<string>("Link")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Message")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("NotificationType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("QuoteId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("ReadAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.HasIndex("InvoiceId");

                    b.HasIndex("QuoteId");

                    b.HasIndex("CompanyId", "IsDeleted", "CreatedAt");

                    b.HasIndex("CompanyId", "IsDeleted", "IsRead");

                    b.ToTable("InAppNotifications");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("CategoryCode")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsCoating")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSystemDefined")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("AverageCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("CatalogPriceUpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<decimal?>("CatalogReferencePrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Category")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CogsAccountId")
                        .HasColumnType("int");

                    b.Property<string>("ColorCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorFamilies")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<decimal?>("CoverageSqFtPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("CureTemperatureF")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("CureTimeMinutes")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DiscontinuedDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("Finish")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("HasSamplePanel")
                        .HasColumnType("bit");

                    b.Property<string>("ImageUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InventoryAccountId")
                        .HasColumnType("int");

                    b.Property<int?>("InventoryCategoryId")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsIncoming")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("LastPurchaseDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("LastPurchasePrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Location")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Manufacturer")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ManufacturerPartNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("MaximumStock")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("MinimumStock")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("PowderCatalogItemId")
                        .HasColumnType("int");

                    b.Property<int?>("PrimaryVendorId")
                        .HasColumnType("int");

                    b.Property<decimal>("QuantityOnHand")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ReorderPoint")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ReorderQuantity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("RequiresClearCoat")
                        .HasColumnType("bit");

                    b.Property<string>("SKU")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("SdsUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SpecPageUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("SpecificGravity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("TdsUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("TransferEfficiency")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("UnitCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("UnitOfMeasure")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("VendorPartNumber")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CogsAccountId");

                    b.HasIndex("CompanyId");

                    b.HasIndex("InventoryAccountId");

                    b.HasIndex("InventoryCategoryId");

                    b.HasIndex("IsActive");

                    b.HasIndex("PrimaryVendorId");

                    b.HasIndex("CompanyId", "IsActive");

                    b.HasIndex("CompanyId", "SKU")
                        .IsUnique()
                        .HasDatabaseName("IX_InventoryItems_CompanyId_SKU")
                        .HasFilter("[IsDeleted] = 0");

                    b.HasIndex("CompanyId", "QuantityOnHand", "ReorderPoint")
                        .HasDatabaseName("IX_InventoryItems_CompanyId_Quantity_Reorder");

                    b.ToTable("InventoryItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("BalanceAfter")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("PurchaseOrderId")
                        .HasColumnType("int");

                    b.Property<decimal>("Quantity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Reference")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("TotalCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("TransactionDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("TransactionType")
                        .HasColumnType("int");

                    b.Property<decimal>("UnitCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("InventoryItemId");

                    b.HasIndex("JobId");

                    b.HasIndex("PurchaseOrderId");

                    b.HasIndex("TransactionType", "TransactionDate");

                    b.ToTable("InventoryTransactions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Invoice", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("AmountPaid")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("CreditApplied")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CustomerId")
                        .HasColumnType("int");

                    b.Property<string>("CustomerPO")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("DiscountAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("DueDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("EarlyPaymentDiscountDays")
                        .HasColumnType("int");

                    b.Property<decimal>("EarlyPaymentDiscountPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("ExternalReference")
                        .HasColumnType("nvarchar(450)");

                    b.Property<decimal>("GiftCertificateRedeemed")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("InternalNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("InvoiceDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("InvoiceNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("OnlineAmountPaid")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("OnlinePaymentStatus")
                        .HasColumnType("int");

                    b.Property<decimal>("OnlineSurchargeCollected")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("PaidDate")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("PaymentLinkExpiresAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("PaymentLinkToken")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PreparedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("ProjectName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PublicViewToken")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("SalesTaxAccountId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("SentDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("StripePaymentIntentId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("SubTotal")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TaxAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TaxPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Terms")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Total")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.HasIndex("DueDate");

                    b.HasIndex("InvoiceDate");

                    b.HasIndex("JobId")
                        .IsUnique()
                        .HasFilter("[JobId] IS NOT NULL");

                    b.HasIndex("PreparedById");

                    b.HasIndex("SalesTaxAccountId");

                    b.HasIndex("Status");

                    b.HasIndex("CompanyId", "CustomerId")
                        .HasDatabaseName("IX_Invoices_CompanyId_CustomerId");

                    b.HasIndex("CompanyId", "DueDate")
                        .HasDatabaseName("IX_Invoices_CompanyId_DueDate");

                    b.HasIndex("CompanyId", "ExternalReference")
                        .HasDatabaseName("IX_Invoices_CompanyId_ExternalReference");

                    b.HasIndex("CompanyId", "InvoiceNumber")
                        .IsUnique()
                        .HasDatabaseName("IX_Invoices_CompanyId_InvoiceNumber");

                    b.HasIndex("CompanyId", "IsDeleted");

                    b.HasIndex("CompanyId", "JobId")
                        .IsUnique()
                        .HasDatabaseName("IX_Invoices_CompanyId_JobId")
                        .HasFilter("[JobId] IS NOT NULL");

                    b.HasIndex("CompanyId", "Status")
                        .HasDatabaseName("IX_Invoices_CompanyId_Status");

                    b.ToTable("Invoices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InvoiceItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("CatalogItemId")
                        .HasColumnType("int");

                    b.Property<string>("ColorName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<DateTime?>("GcExpiryDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("GcRecipientEmail")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("GcRecipientName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("GeneratedGiftCertificateId")
                        .HasColumnType("int");

                    b.Property<int>("InvoiceId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsGiftCertificate")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Quantity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("RevenueAccountId")
                        .HasColumnType("int");

                    b.Property<int?>("SourceJobItemId")
                        .HasColumnType("int");

                    b.Property<decimal>("TotalPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("UnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CatalogItemId");

                    b.HasIndex("CompanyId");

                    b.HasIndex("GeneratedGiftCertificateId");

                    b.HasIndex("InvoiceId")
                        .HasDatabaseName("IX_InvoiceItems_InvoiceId");

                    b.HasIndex("RevenueAccountId");

                    b.HasIndex("SourceJobItemId");

                    b.ToTable("InvoiceItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal?>("ActualTimeSpentHours")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("AssignedUserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("CompletedDate")
                        .HasColumnType("datetime2");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CustomerId")
                        .HasColumnType("int");

                    b.Property<string>("CustomerPO")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DiscountReason")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DiscountType")
                        .HasColumnType("int");

                    b.Property<decimal>("DiscountValue")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("DueDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("FinalPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("IntakeCheckedByUserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("IntakeConditionNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("IntakeDate")
                        .HasColumnType("datetime2");

                    b.Property<int?>("IntakePartCount")
                        .HasColumnType("int");

                    b.Property<string>("InternalNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsCustomerApproved")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsReworkJob")
                        .HasColumnType("bit");

                    b.Property<bool>("IsRushJob")
                        .HasColumnType("bit");

                    b.Property<string>("JobNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("JobPriorityId")
                        .HasColumnType("int");

                    b.Property<int>("JobStatusId")
                        .HasColumnType("int");

                    b.Property<int?>("OriginalJobId")
                        .HasColumnType("int");

                    b.Property<decimal>("OvenBatchCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("OvenBatches")
                        .HasColumnType("int");

                    b.Property<int?>("OvenCostId")
                        .HasColumnType("int");

                    b.Property<int?>("OvenCycleMinutes")
                        .HasColumnType("int");

                    b.Property<string>("PricingBreakdownJson")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProjectName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("QuoteId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("QuoteSnapshotUpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("QuotedPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("RequiresCustomerApproval")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("ScheduledDate")
                        .HasColumnType("datetime2");

                    b.Property<Guid>("ShopAccessCode")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier")
                        .HasDefaultValueSql("NEWID()");

                    b.Property<decimal>("ShopSuppliesAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ShopSuppliesPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("SpecialInstructions")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("StartedDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("Tags")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AssignedUserId");

                    b.HasIndex("CompanyId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("DueDate");

                    b.HasIndex("IntakeCheckedByUserId");

                    b.HasIndex("JobPriorityId");

                    b.HasIndex("JobStatusId");

                    b.HasIndex("OriginalJobId");

                    b.HasIndex("OvenCostId");

                    b.HasIndex("QuoteId")
                        .IsUnique()
                        .HasFilter("[QuoteId] IS NOT NULL");

                    b.HasIndex("ScheduledDate");

                    b.HasIndex("CompanyId", "CustomerId")
                        .HasDatabaseName("IX_Jobs_CompanyId_CustomerId");

                    b.HasIndex("CompanyId", "DueDate")
                        .HasDatabaseName("IX_Jobs_CompanyId_DueDate");

                    b.HasIndex("CompanyId", "IsDeleted");

                    b.HasIndex("CompanyId", "JobNumber")
                        .IsUnique()
                        .HasDatabaseName("IX_Jobs_CompanyId_JobNumber");

                    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.HasIndex("CompanyId", "ShopAccessCode")
                        .IsUnique()
                        .HasDatabaseName("IX_Jobs_CompanyId_ShopAccessCode");

                    b.ToTable("Jobs");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobChangeHistory", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ChangeDescription")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("ChangedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("ChangedByUserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FieldName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("NewValue")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("OldValue")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<DateTime>("ScheduledDate")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("JobId");

                    b.ToTable("JobDailyPriorities");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("AiPredictionId")
                        .HasColumnType("int");

                    b.Property<string>("AiTags")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CatalogItemId")
                        .HasColumnType("int");

                    b.Property<string>("ColorCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("Complexity")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CustomItemTemplateId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("EstimatedMinutes")
                        .HasColumnType("int");

                    b.Property<string>("Finish")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FormulaFieldValuesJson")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IncludePrepCost")
                        .HasColumnType("bit");

                    b.Property<bool>("IsAiItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsCustomFormulaItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsGenericItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsLaborItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSalesItem")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<decimal>("LaborCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal?>("ManualUnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("PowderCostOverride")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Quantity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("RequiresMasking")
                        .HasColumnType("bit");

                    b.Property<bool>("RequiresSandblasting")
                        .HasColumnType("bit");

                    b.Property<string>("Sku")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("SurfaceArea")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("SurfaceAreaSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TotalPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("UnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AiPredictionId");

                    b.HasIndex("CatalogItemId");

                    b.HasIndex("CustomItemTemplateId");

                    b.HasIndex("JobId")
                        .HasDatabaseName("IX_JobItems_JobId");

                    b.HasIndex("JobId", "IsDeleted")
                        .HasDatabaseName("IX_JobItems_JobId_IsDeleted");

                    b.ToTable("JobItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobItemCoat", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal?>("ActualPowderUsedLbs")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("CoatName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<decimal>("CoverageSqFtPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Finish")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobItemId")
                        .HasColumnType("int");

                    b.Property<bool>("NoExtraLayerCharge")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("PowderCostPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("PowderOrdered")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("PowderOrderedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("PowderOrderedByUserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("PowderReceived")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("PowderReceivedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("PowderReceivedByUserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("PowderReceivedLbs")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal?>("PowderToOrder")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("Sequence")
                        .HasColumnType("int");

                    b.Property<decimal>("TransferEfficiency")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("VendorId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("InventoryItemId");

                    b.HasIndex("JobItemId");

                    b.HasIndex("VendorId");

                    b.ToTable("JobItemCoats");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobItemPrepService", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("BlastSetupId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("EstimatedMinutes")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobItemId")
                        .HasColumnType("int");

                    b.Property<int>("PrepServiceId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("BlastSetupId");

                    b.HasIndex("CompanyId")
                        .HasDatabaseName("IX_JobItemPrepServices_CompanyId");

                    b.HasIndex("JobItemId")
                        .HasDatabaseName("IX_JobItemPrepServices_JobItemId");

                    b.HasIndex("PrepServiceId")
                        .HasDatabaseName("IX_JobItemPrepServices_PrepServiceId");

                    b.ToTable("JobItemPrepServices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobNote", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsImportant")
                        .HasColumnType("bit");

                    b.Property<bool>("IsInternal")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Note")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Caption")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("ContentType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FilePath")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<long>("FileSize")
                        .HasColumnType("bigint");

                    b.Property<bool>("IsAiAnalysisPhoto")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<int>("PhotoType")
                        .HasColumnType("int");

                    b.Property<string>("Tags")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UploadedById")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<int>("PrepServiceId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ColorClass")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("IconClass")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSystemDefined")
                        .HasColumnType("bit");

                    b.Property<string>("PriorityCode")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("ChangedDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("FromStatusId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("ToStatusId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ColorClass")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("IconClass")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSystemDefined")
                        .HasColumnType("bit");

                    b.Property<bool>("IsTerminalStatus")
                        .HasColumnType("bit");

                    b.Property<bool>("IsWorkInProgressStatus")
                        .HasColumnType("bit");

                    b.Property<string>("StatusCode")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("WorkflowCategory")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("CompanyId", "StatusCode")
                        .IsUnique();

                    b.ToTable("JobStatusLookups");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SpecialInstructions")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("UsageCount")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.ToTable("JobTemplates");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("CatalogItemId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("Complexity")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<int>("EstimatedMinutes")
                        .HasColumnType("int");

                    b.Property<bool>("IncludePrepCost")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsGenericItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsLaborItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSalesItem")
                        .HasColumnType("bit");

                    b.Property<int>("JobTemplateId")
                        .HasColumnType("int");

                    b.Property<decimal?>("ManualUnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Quantity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("RequiresMasking")
                        .HasColumnType("bit");

                    b.Property<bool>("RequiresSandblasting")
                        .HasColumnType("bit");

                    b.Property<string>("Sku")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("SurfaceAreaSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CatalogItemId");

                    b.HasIndex("JobTemplateId");

                    b.ToTable("JobTemplateItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemCoat", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("CoatName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<decimal>("CoverageSqFtPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Finish")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobTemplateItemId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("PowderCostPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("Sequence")
                        .HasColumnType("int");

                    b.Property<decimal>("TransferEfficiency")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("VendorId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("InventoryItemId");

                    b.HasIndex("JobTemplateItemId");

                    b.HasIndex("VendorId");

                    b.ToTable("JobTemplateItemCoats");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemPrepService", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("EstimatedMinutes")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobTemplateItemId")
                        .HasColumnType("int");

                    b.Property<int>("PrepServiceId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("JobTemplateItemId");

                    b.HasIndex("PrepServiceId");

                    b.ToTable("JobTemplateItemPrepServices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTimeEntry", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("HoursWorked")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Stage")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserDisplayName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("WorkDate")
                        .HasColumnType("datetime2");

                    b.HasKey("Id");

                    b.HasIndex("JobId");

                    b.ToTable("JobTimeEntries");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JournalEntry", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("EntryDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("EntryNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsReversal")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("PostedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("PostedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Reference")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("ReversalOfId")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("ReversalOfId");

                    b.ToTable("JournalEntries");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JournalEntryLine", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("CreditAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("DebitAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JournalEntryId")
                        .HasColumnType("int");

                    b.Property<int>("LineOrder")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

                    b.HasIndex("JournalEntryId");

                    b.ToTable("JournalEntryLines");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.KioskSession", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("AgreedToTerms")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("AgreedToTermsAt")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CustomerEmail")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CustomerFirstName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CustomerLastName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CustomerPhone")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("ExpiresAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("HowDidYouHearAboutUs")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsReturningCustomer")
                        .HasColumnType("bit");

                    b.Property<string>("JobDescription")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("LinkedCustomerId")
                        .HasColumnType("int");

                    b.Property<int?>("LinkedJobId")
                        .HasColumnType("int");

                    b.Property<int?>("LinkedQuoteId")
                        .HasColumnType("int");

                    b.Property<string>("RemoteLinkEmail")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("RemoteLinkSentAt")
                        .HasColumnType("datetime2");

                    b.Property<Guid>("SessionToken")
                        .HasColumnType("uniqueidentifier");

                    b.Property<int>("SessionType")
                        .HasColumnType("int");

                    b.Property<string>("SignatureDataBase64")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("SmsOptIn")
                        .HasColumnType("bit");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("SubmittedAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("LinkedCustomerId");

                    b.HasIndex("LinkedJobId");

                    b.HasIndex("SessionToken")
                        .IsUnique();

                    b.ToTable("KioskSessions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("AssignedUserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("CompletedDate")
                        .HasColumnType("datetime2");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("DowntimeHours")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("EquipmentId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsRecurring")
                        .HasColumnType("bit");

                    b.Property<decimal>("LaborCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("MaintenanceType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("PartsCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("PartsReplaced")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PerformedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("Priority")
                        .HasColumnType("int");

                    b.Property<DateTime?>("RecurrenceEndDate")
                        .HasColumnType("datetime2");

                    b.Property<int?>("RecurrenceFrequency")
                        .HasColumnType("int");

                    b.Property<string>("RecurrenceGroupId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("RecurrenceParentId")
                        .HasColumnType("int");

                    b.Property<DateTime>("ScheduledDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("TechnicianNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("TotalCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("WorkPerformed")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AssignedUserId");

                    b.HasIndex("EquipmentId");

                    b.HasIndex("PerformedById");

                    b.HasIndex("RecurrenceParentId");

                    b.HasIndex("ScheduledDate");

                    b.HasIndex("Status");

                    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.ManufacturerLookupPattern", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Domain")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("ManufacturerName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProductUrlTemplate")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SlugTransform")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("ManufacturerLookupPatterns");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.NotificationLog", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("Channel")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CustomerId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ErrorMessage")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InvoiceId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("JobId")
                        .HasColumnType("int");

                    b.Property<string>("Message")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("NotificationType")
                        .HasColumnType("int");

                    b.Property<int?>("QuoteId")
                        .HasColumnType("int");

                    b.Property<string>("Recipient")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("RecipientName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("SentAt")
                        .HasColumnType("datetime2");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("Subject")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.HasIndex("InvoiceId");

                    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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Body")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Channel")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("NotificationType")
                        .HasColumnType("int");

                    b.Property<string>("Subject")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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.OvenBatch", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime?>("ActualEndTime")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("ActualStartTime")
                        .HasColumnType("datetime2");

                    b.Property<string>("AiReasoningJson")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("AiSuggested")
                        .HasColumnType("bit");

                    b.Property<string>("BatchNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("CureTemperatureF")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CycleMinutes")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("EquipmentId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("EstimatedEndTime")
                        .HasColumnType("datetime2");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("OvenCostId")
                        .HasColumnType("int");

                    b.Property<string>("PrimaryColorCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PrimaryColorName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("ScheduledDate")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("ScheduledStartTime")
                        .HasColumnType("datetime2");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("TotalSurfaceAreaSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("EquipmentId");

                    b.HasIndex("OvenCostId");

                    b.HasIndex("ScheduledDate", "Status");

                    b.ToTable("OvenBatches");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatchItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CoatPassNumber")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<int>("JobItemCoatId")
                        .HasColumnType("int");

                    b.Property<int>("JobItemId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("OvenBatchId")
                        .HasColumnType("int");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("SurfaceAreaContribution")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("JobId");

                    b.HasIndex("JobItemCoatId");

                    b.HasIndex("JobItemId");

                    b.HasIndex("OvenBatchId");

                    b.ToTable("OvenBatchItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.OvenCost", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<decimal>("CostPerHour")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DefaultCycleMinutes")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Label")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("nvarchar(100)");

                    b.Property<decimal?>("MaxLoadSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.ToTable("OvenCosts");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Payment", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("ClearedDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DepositAccountId")
                        .HasColumnType("int");

                    b.Property<int>("InvoiceId")
                        .HasColumnType("int");

                    b.Property<bool>("IsCleared")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("PaymentDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("PaymentMethod")
                        .HasColumnType("int");

                    b.Property<string>("RecordedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Reference")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("DepositAccountId");

                    b.HasIndex("InvoiceId")
                        .HasDatabaseName("IX_Payments_InvoiceId");

                    b.HasIndex("PaymentDate");

                    b.HasIndex("RecordedById");

                    b.HasIndex("CompanyId", "PaymentDate")
                        .HasDatabaseName("IX_Payments_CompanyId_PaymentDate");

                    b.ToTable("Payments");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PendingRegistrationSession", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("CompanyName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CompanyPhone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsAnnual")
                        .HasColumnType("bit");

                    b.Property<bool>("IsCompleted")
                        .HasColumnType("bit");

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Plan")
                        .HasColumnType("int");

                    b.Property<string>("Token")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("PendingRegistrationSessions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PlatformSetting", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("GroupName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("nvarchar(200)");

                    b.Property<string>("Label")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Value")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("PlatformSettings");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PowderCatalogItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ApplicationGuideUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Category")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ChemistryType")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorFamilies")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorName")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<decimal?>("CoverageSqFtPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CureCurvesJson")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CureScheduleText")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("CureTemperatureF")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("CureTimeMinutes")
                        .HasColumnType("int");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Finish")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FormulationChanges")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ImageUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDiscontinued")
                        .HasColumnType("bit");

                    b.Property<bool>("IsUserContributed")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("LastSyncedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("MilThickness")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("PriceTiersJson")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProductUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool?>("RequiresClearCoat")
                        .HasColumnType("bit");

                    b.Property<string>("SdsUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Sku")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Source")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("SpecificGravity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("TdsUrl")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("TransferEfficiency")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("UnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("VendorName")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("ColorName")
                        .HasDatabaseName("IX_PowderCatalogItems_ColorName");

                    b.HasIndex("VendorName", "Sku")
                        .IsUnique()
                        .HasDatabaseName("IX_PowderCatalogItems_Vendor_Sku");

                    b.ToTable("PowderCatalogItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PowderUsageLog", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("ActualLbsUsed")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("EstimatedLbs")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<int?>("InventoryTransactionId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<int>("JobItemCoatId")
                        .HasColumnType("int");

                    b.Property<int>("JobItemId")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("RecordedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("RecordedByUserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("VarianceLbs")
                        .HasColumnType("decimal(18,2)");

                    b.HasKey("Id");

                    b.HasIndex("InventoryItemId");

                    b.HasIndex("InventoryTransactionId");

                    b.HasIndex("JobId");

                    b.HasIndex("JobItemCoatId");

                    b.HasIndex("JobItemId");

                    b.ToTable("PowderUsageLogs");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PrepService", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("RequiresBlastSetup")
                        .HasColumnType("bit");

                    b.Property<string>("ServiceName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("PrepServices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("DiscountPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("TierName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.ToTable("PricingTiers");

                    b.HasData(
                        new
                        {
                            Id = 1,
                            CompanyId = 0,
                            CreatedAt = new DateTime(2026, 6, 20, 13, 49, 14, 564, DateTimeKind.Utc).AddTicks(4507),
                            Description = "Standard pricing for regular customers",
                            DiscountPercent = 0m,
                            IsActive = true,
                            IsDeleted = false,
                            TierName = "Standard"
                        },
                        new
                        {
                            Id = 2,
                            CompanyId = 0,
                            CreatedAt = new DateTime(2026, 6, 20, 13, 49, 14, 564, DateTimeKind.Utc).AddTicks(4514),
                            Description = "5% discount for preferred customers",
                            DiscountPercent = 5m,
                            IsActive = true,
                            IsDeleted = false,
                            TierName = "Preferred"
                        },
                        new
                        {
                            Id = 3,
                            CompanyId = 0,
                            CreatedAt = new DateTime(2026, 6, 20, 13, 49, 14, 564, DateTimeKind.Utc).AddTicks(4515),
                            Description = "10% discount for premium customers",
                            DiscountPercent = 10m,
                            IsActive = true,
                            IsDeleted = false,
                            TierName = "Premium"
                        });
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrder", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("BillId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ExpectedDeliveryDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("InternalNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("OrderDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("PoNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ReceivedDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("ShippingCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("SubTotal")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TotalAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("VendorId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("BillId");

                    b.HasIndex("VendorId");

                    b.ToTable("PurchaseOrders");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrderItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<decimal>("LineTotal")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("PurchaseOrderId")
                        .HasColumnType("int");

                    b.Property<decimal>("QuantityOrdered")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("QuantityReceived")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("UnitCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("UnitOfMeasure")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("InventoryItemId");

                    b.HasIndex("PurchaseOrderId");

                    b.ToTable("PurchaseOrderItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ApprovalToken")
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime?>("ApprovalTokenExpiresAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("ApprovalTokenUsedAt")
                        .HasColumnType("datetime2");

                    b.Property<DateTime?>("ApprovedDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("ConvertedDate")
                        .HasColumnType("datetime2");

                    b.Property<int?>("ConvertedToJobId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CustomerId")
                        .HasColumnType("int");

                    b.Property<string>("CustomerPO")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DeclineReason")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DeclinedByIp")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("DepositAmountPaid")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("DepositPaymentIntentId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DepositPaymentLinkExpiresAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DepositPaymentLinkToken")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("DepositPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("DiscountAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("DiscountPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("DiscountReason")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DiscountType")
                        .HasColumnType("int");

                    b.Property<decimal>("DiscountValue")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("EquipmentCosts")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("ExpirationDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("FacilityOverheadCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("FacilityOverheadRatePerHour")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("HideDiscountFromCustomer")
                        .HasColumnType("bit");

                    b.Property<bool>("IsCommercial")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsRushJob")
                        .HasColumnType("bit");

                    b.Property<decimal>("ItemsSubtotal")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("LaborCosts")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("MaterialCosts")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("OvenBatchCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("OvenBatches")
                        .HasColumnType("int");

                    b.Property<int?>("OvenCostId")
                        .HasColumnType("int");

                    b.Property<int?>("OvenCycleMinutes")
                        .HasColumnType("int");

                    b.Property<decimal>("OverheadAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("OverheadPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("PreparedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<decimal>("PricingTierDiscountAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("PricingTierDiscountPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ProfitMargin")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ProfitPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("ProjectName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProspectAddress")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProspectCity")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProspectCompanyName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProspectContactName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProspectEmail")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProspectPhone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("ProspectSmsConsent")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("ProspectSmsConsentedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("ProspectState")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ProspectZipCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("QuoteDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("QuoteDiscountAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("QuoteDiscountPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("QuoteNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("QuoteStatusId")
                        .HasColumnType("int");

                    b.Property<bool>("RequiresDeposit")
                        .HasColumnType("bit");

                    b.Property<decimal>("RushFee")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("SentDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("ShopSuppliesAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ShopSuppliesPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("SubTotal")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("SubtotalAfterDiscount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Tags")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("TaxAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TaxPercent")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Terms")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Total")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("ApprovalToken")
                        .IsUnique()
                        .HasDatabaseName("IX_Quotes_ApprovalToken")
                        .HasFilter("[ApprovalToken] IS NOT NULL");

                    b.HasIndex("CompanyId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("ExpirationDate");

                    b.HasIndex("OvenCostId");

                    b.HasIndex("PreparedById");

                    b.HasIndex("QuoteStatusId");

                    b.HasIndex("CompanyId", "ExpirationDate")
                        .HasDatabaseName("IX_Quotes_CompanyId_ExpirationDate");

                    b.HasIndex("CompanyId", "IsDeleted");

                    b.HasIndex("CompanyId", "QuoteNumber")
                        .IsUnique()
                        .HasDatabaseName("IX_Quotes_CompanyId_QuoteNumber");

                    b.HasIndex("CompanyId", "QuoteStatusId")
                        .HasDatabaseName("IX_Quotes_CompanyId_QuoteStatusId");

                    b.ToTable("Quotes");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuoteChangeHistory", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ChangeDescription")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("ChangedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("ChangedByUserId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FieldName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("NewValue")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("OldValue")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("QuoteId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("AiPredictionId")
                        .HasColumnType("int");

                    b.Property<string>("AiTags")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CatalogItemId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("Complexity")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CustomItemTemplateId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("EstimatedMinutes")
                        .HasColumnType("int");

                    b.Property<string>("FormulaFieldValuesJson")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IncludePrepCost")
                        .HasColumnType("bit");

                    b.Property<bool>("IsAiItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsCustomFormulaItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsGenericItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsLaborItem")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSalesItem")
                        .HasColumnType("bit");

                    b.Property<decimal>("ItemEquipmentCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ItemLaborCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("ItemMaterialCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal?>("ManualUnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("PowderCostOverride")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("Quantity")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("QuoteId")
                        .HasColumnType("int");

                    b.Property<bool>("RequiresMasking")
                        .HasColumnType("bit");

                    b.Property<bool>("RequiresSandblasting")
                        .HasColumnType("bit");

                    b.Property<string>("Sku")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("SurfaceArea")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("SurfaceAreaSqFt")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("TotalPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("UnitPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AiPredictionId");

                    b.HasIndex("CatalogItemId");

                    b.HasIndex("CustomItemTemplateId");

                    b.HasIndex("QuoteId")
                        .HasDatabaseName("IX_QuoteItems_QuoteId");

                    b.ToTable("QuoteItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemCoat", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("CoatLaborCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("CoatMaterialCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("CoatName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("CoatTotalCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("ColorCode")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ColorName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<decimal>("CoverageSqFtPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Finish")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("InventoryItemId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("NoExtraLayerCharge")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("PowderCatalogItemId")
                        .HasColumnType("int");

                    b.Property<decimal?>("PowderCostPerLb")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal?>("PowderToOrder")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("QuoteItemId")
                        .HasColumnType("int");

                    b.Property<int>("Sequence")
                        .HasColumnType("int");

                    b.Property<decimal>("TransferEfficiency")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("VendorId")
                        .HasColumnType("int");

                    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("VendorId");

                    b.ToTable("QuoteItemCoats");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemPrepService", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("BlastSetupId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("EstimatedMinutes")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("PrepServiceId")
                        .HasColumnType("int");

                    b.Property<int>("QuoteItemId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("BlastSetupId");

                    b.HasIndex("CompanyId")
                        .HasDatabaseName("IX_QuoteItemPrepServices_CompanyId");

                    b.HasIndex("PrepServiceId")
                        .HasDatabaseName("IX_QuoteItemPrepServices_PrepServiceId");

                    b.HasIndex("QuoteItemId")
                        .HasDatabaseName("IX_QuoteItemPrepServices_QuoteItemId");

                    b.ToTable("QuoteItemPrepServices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuotePhoto", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Caption")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("ContentType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("FilePath")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<long>("FileSize")
                        .HasColumnType("bigint");

                    b.Property<bool>("IsAiAnalysisPhoto")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int?>("QuoteId")
                        .HasColumnType("int");

                    b.Property<string>("TempId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UploadedById")
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("QuoteId");

                    b.HasIndex("UploadedById");

                    b.ToTable("QuotePhotos");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuotePrepService", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("PrepServiceId")
                        .HasColumnType("int");

                    b.Property<int>("QuoteId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("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<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ColorClass")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DisplayOrder")
                        .HasColumnType("int");

                    b.Property<string>("IconClass")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsApprovedStatus")
                        .HasColumnType("bit");

                    b.Property<bool>("IsConvertedStatus")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDraftStatus")
                        .HasColumnType("bit");

                    b.Property<bool>("IsRejectedStatus")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSystemDefined")
                        .HasColumnType("bit");

                    b.Property<string>("StatusCode")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("CompanyId", "StatusCode")
                        .IsUnique();

                    b.ToTable("QuoteStatusLookups");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.RecurringTemplate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("EndDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("Frequency")
                        .HasColumnType("int");

                    b.Property<int>("IntervalCount")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("LastError")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("MaxOccurrences")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("NextFireDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("OccurrenceCount")
                        .HasColumnType("int");

                    b.Property<string>("TemplateData")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("TemplateType")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("RecurringTemplates");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Refund", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("CreditMemoId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("DepositAccountId")
                        .HasColumnType("int");

                    b.Property<int>("InvoiceId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("IssuedById")
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime?>("IssuedDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("PaymentId")
                        .HasColumnType("int");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Reference")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("RefundDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("RefundMethod")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CreditMemoId");

                    b.HasIndex("InvoiceId");

                    b.HasIndex("IssuedById");

                    b.HasIndex("PaymentId");

                    b.ToTable("Refunds");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.ReleaseNote", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Body")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedByUserId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CreatedByUserName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsPublished")
                        .HasColumnType("bit");

                    b.Property<DateTime>("ReleasedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("Tag")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("Version")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("ReleaseNotes");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.ReworkRecord", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("ActualReworkCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("BillingNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DefectDescription")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("DiscoveredBy")
                        .HasColumnType("int");

                    b.Property<DateTime>("DiscoveredDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("EstimatedReworkCost")
                        .HasColumnType("decimal(18,2)");

                    b.Property<bool>("IsBillableToCustomer")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JobId")
                        .HasColumnType("int");

                    b.Property<int?>("JobItemId")
                        .HasColumnType("int");

                    b.Property<int>("Reason")
                        .HasColumnType("int");

                    b.Property<string>("ReportedByName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int?>("Resolution")
                        .HasColumnType("int");

                    b.Property<string>("ResolutionNotes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ResolvedDate")
                        .HasColumnType("datetime2");

                    b.Property<int?>("ReworkJobId")
                        .HasColumnType("int");

                    b.Property<int?>("ReworkPricingType")
                        .HasColumnType("int");

                    b.Property<int>("ReworkType")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("JobId");

                    b.HasIndex("JobItemId");

                    b.HasIndex("ReworkJobId");

                    b.ToTable("ReworkRecords");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.StripeWebhookEvent", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<int?>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("ErrorMessage")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EventId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EventType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("ProcessedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("RawJson")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("ReceivedAt")
                        .HasColumnType("datetime2");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.ToTable("StripeWebhookEvents");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.SubscriptionPlanConfig", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("AllowAccounting")
                        .HasColumnType("bit");

                    b.Property<bool>("AllowAiCatalogPriceCheck")
                        .HasColumnType("bit");

                    b.Property<bool>("AllowAiInventoryAssist")
                        .HasColumnType("bit");

                    b.Property<bool>("AllowAiPhotoQuotes")
                        .HasColumnType("bit");

                    b.Property<bool>("AllowCustomFormulas")
                        .HasColumnType("bit");

                    b.Property<bool>("AllowOnlinePayments")
                        .HasColumnType("bit");

                    b.Property<bool>("AllowSms")
                        .HasColumnType("bit");

                    b.Property<decimal>("AnnualPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("MaxActiveJobs")
                        .HasColumnType("int");

                    b.Property<int>("MaxAiPhotoQuotesPerMonth")
                        .HasColumnType("int");

                    b.Property<int>("MaxCatalogItems")
                        .HasColumnType("int");

                    b.Property<int>("MaxCustomers")
                        .HasColumnType("int");

                    b.Property<int>("MaxJobPhotos")
                        .HasColumnType("int");

                    b.Property<int>("MaxQuotePhotos")
                        .HasColumnType("int");

                    b.Property<int>("MaxQuotes")
                        .HasColumnType("int");

                    b.Property<int>("MaxUsers")
                        .HasColumnType("int");

                    b.Property<decimal>("MonthlyPrice")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("Plan")
                        .HasColumnType("int");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<string>("StripePriceIdAnnual")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("StripePriceIdMonthly")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("SubscriptionPlanConfigs");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.TaxRate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDefault")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Rate")
                        .HasColumnType("decimal(18,2)");

                    b.Property<string>("State")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("TaxRates");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.TermsAcceptance", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("AcceptedAt")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("IpAddress")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("TosVersion")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserAgent")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("TermsAcceptances");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.TimeclockKioskDevice", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("ActivatedAt")
                        .HasColumnType("datetime2");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("DeviceName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("LastSeenAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("Token")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("Token")
                        .IsUnique();

                    b.ToTable("TimeclockKioskDevices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.UserPasskey", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<byte[]>("CredentialId")
                        .IsRequired()
                        .HasColumnType("varbinary(900)");

                    b.Property<string>("DeviceFriendlyName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("LastUsedAt")
                        .HasColumnType("datetime2");

                    b.Property<byte[]>("PublicKey")
                        .IsRequired()
                        .HasColumnType("varbinary(max)");

                    b.Property<long>("SignCount")
                        .HasColumnType("bigint");

                    b.Property<byte[]>("UserHandle")
                        .IsRequired()
                        .HasColumnType("varbinary(max)");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CredentialId")
                        .IsUnique();

                    b.ToTable("UserPasskeys");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Vendor", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("AccountNumber")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Address")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("City")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<string>("CompanyName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ContactName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Country")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal?>("CreditLimit")
                        .HasColumnType("decimal(18,2)");

                    b.Property<decimal>("CurrentBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int?>("DefaultExpenseAccountId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Email")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("Is1099Vendor")
                        .HasColumnType("bit");

                    b.Property<bool>("IsActive")
                        .HasColumnType("bit");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<bool>("IsPreferred")
                        .HasColumnType("bit");

                    b.Property<string>("Notes")
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("OpeningBalance")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("OpeningBalanceDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("PaymentTerms")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Phone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("State")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("TaxId")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Website")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ZipCode")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

                    b.HasIndex("DefaultExpenseAccountId");

                    b.ToTable("Vendors");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.VendorCredit", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("APAccountId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime>("CreditDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreditNumber")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<string>("Memo")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("PostedDate")
                        .HasColumnType("datetime2");

                    b.Property<decimal>("RemainingAmount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("Total")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("VendorId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("APAccountId");

                    b.HasIndex("VendorId");

                    b.ToTable("VendorCredits");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.VendorCreditApplication", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("AppliedDate")
                        .HasColumnType("datetime2");

                    b.Property<int>("BillId")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("VendorCreditId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("BillId");

                    b.HasIndex("VendorCreditId");

                    b.ToTable("VendorCreditApplications");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.VendorCreditLineItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("AccountId")
                        .HasColumnType("int");

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("VendorCreditId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

                    b.HasIndex("VendorCreditId");

                    b.ToTable("VendorCreditLineItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.YearEndClose", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("ClosedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("ClosedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("ClosedYear")
                        .HasColumnType("int");

                    b.Property<int>("CompanyId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("CreatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTime?>("DeletedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("DeletedBy")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("bit");

                    b.Property<int>("JournalEntryId")
                        .HasColumnType("int");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("datetime2");

                    b.Property<string>("UpdatedBy")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("JournalEntryId");

                    b.ToTable("YearEndCloses");
                });

            modelBuilder.Entity("VendorInventoryCategories", b =>
                {
                    b.Property<int>("InventoryCategoryLookupId")
                        .HasColumnType("int");

                    b.Property<int>("VendorId")
                        .HasColumnType("int");

                    b.HasKey("InventoryCategoryLookupId", "VendorId");

                    b.HasIndex("VendorId");

                    b.ToTable("VendorInventoryCategories");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Account", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "ParentAccount")
                        .WithMany("SubAccounts")
                        .HasForeignKey("ParentAccountId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("ParentAccount");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.AiUsageLog", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Company", "Company")
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Company");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.AnnouncementDismissal", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Announcement", "Announcement")
                        .WithMany("Dismissals")
                        .HasForeignKey("AnnouncementId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Announcement");
                });

            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.ApplicationUser", "AssignedUser")
                        .WithMany()
                        .HasForeignKey("AssignedUserId")
                        .OnDelete(DeleteBehavior.NoAction);

                    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("AssignedUser");

                    b.Navigation("Customer");

                    b.Navigation("Job");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BankReconciliation", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "Account")
                        .WithMany()
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Account");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Bill", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "APAccount")
                        .WithMany("Bills")
                        .HasForeignKey("APAccountId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
                        .WithMany("Bills")
                        .HasForeignKey("VendorId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("APAccount");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BillLineItem", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "Account")
                        .WithMany("BillLineItems")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("PowderCoating.Core.Entities.Bill", "Bill")
                        .WithMany("LineItems")
                        .HasForeignKey("BillId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany()
                        .HasForeignKey("JobId");

                    b.Navigation("Account");

                    b.Navigation("Bill");

                    b.Navigation("Job");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BillPayment", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "BankAccount")
                        .WithMany("BillPayments")
                        .HasForeignKey("BankAccountId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Bill", "Bill")
                        .WithMany("Payments")
                        .HasForeignKey("BillId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
                        .WithMany("BillPayments")
                        .HasForeignKey("VendorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("BankAccount");

                    b.Navigation("Bill");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BudgetLine", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "Account")
                        .WithMany()
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Budget", "Budget")
                        .WithMany("Lines")
                        .HasForeignKey("BudgetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

                    b.Navigation("Budget");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BugReportAttachment", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.BugReport", "BugReport")
                        .WithMany("Attachments")
                        .HasForeignKey("BugReportId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("BugReport");
                });

            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.Account", "CogsAccount")
                        .WithMany()
                        .HasForeignKey("CogsAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
                        .WithMany()
                        .HasForeignKey("InventoryItemId");

                    b.HasOne("PowderCoating.Core.Entities.Account", "RevenueAccount")
                        .WithMany()
                        .HasForeignKey("RevenueAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("Category");

                    b.Navigation("CogsAccount");

                    b.Navigation("InventoryItem");

                    b.Navigation("RevenueAccount");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CompanyBlastSetup", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Company", "Company")
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Company");
                });

            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.HasOne("PowderCoating.Core.Entities.Account", null)
                        .WithMany()
                        .HasForeignKey("DefaultCogsAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.Account", null)
                        .WithMany()
                        .HasForeignKey("DefaultInventoryAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.Account", null)
                        .WithMany()
                        .HasForeignKey("DefaultRevenueAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("Company");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemo", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "IssuedBy")
                        .WithMany()
                        .HasForeignKey("IssuedById");

                    b.HasOne("PowderCoating.Core.Entities.Invoice", "OriginalInvoice")
                        .WithMany()
                        .HasForeignKey("OriginalInvoiceId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.ReworkRecord", "ReworkRecord")
                        .WithMany()
                        .HasForeignKey("ReworkRecordId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("Customer");

                    b.Navigation("IssuedBy");

                    b.Navigation("OriginalInvoice");

                    b.Navigation("ReworkRecord");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemoApplication", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AppliedBy")
                        .WithMany()
                        .HasForeignKey("AppliedById");

                    b.HasOne("PowderCoating.Core.Entities.CreditMemo", "CreditMemo")
                        .WithMany("Applications")
                        .HasForeignKey("CreditMemoId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
                        .WithMany("CreditApplications")
                        .HasForeignKey("InvoiceId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AppliedBy");

                    b.Navigation("CreditMemo");

                    b.Navigation("Invoice");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CustomItemTemplate", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.FormulaLibraryItem", "SourceFormulaLibraryItem")
                        .WithMany()
                        .HasForeignKey("SourceFormulaLibraryItemId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("SourceFormulaLibraryItem");
                });

            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.CustomerContact", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
                        .WithMany("CustomerContacts")
                        .HasForeignKey("CustomerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Customer");
                });

            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.CustomerPreferredPowder", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
                        .WithMany()
                        .HasForeignKey("InventoryItemId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Customer");

                    b.Navigation("InventoryItem");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Deposit", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Invoice", "AppliedToInvoice")
                        .WithMany()
                        .HasForeignKey("AppliedToInvoiceId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany()
                        .HasForeignKey("JobId");

                    b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
                        .WithMany()
                        .HasForeignKey("QuoteId");

                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "RecordedBy")
                        .WithMany()
                        .HasForeignKey("RecordedById");

                    b.Navigation("AppliedToInvoice");

                    b.Navigation("Customer");

                    b.Navigation("Job");

                    b.Navigation("Quote");

                    b.Navigation("RecordedBy");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.EmployeeClockEntry", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("User");
                });

            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.Expense", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "ExpenseAccount")
                        .WithMany("Expenses")
                        .HasForeignKey("ExpenseAccountId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany()
                        .HasForeignKey("JobId");

                    b.HasOne("PowderCoating.Core.Entities.Account", "PaymentAccount")
                        .WithMany("ExpensePaymentAccounts")
                        .HasForeignKey("PaymentAccountId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
                        .WithMany("Expenses")
                        .HasForeignKey("VendorId");

                    b.Navigation("ExpenseAccount");

                    b.Navigation("Job");

                    b.Navigation("PaymentAccount");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FixedAsset", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "AccumDepreciationAccount")
                        .WithMany()
                        .HasForeignKey("AccumDepreciationAccountId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("PowderCoating.Core.Entities.Account", "AssetAccount")
                        .WithMany()
                        .HasForeignKey("AssetAccountId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("PowderCoating.Core.Entities.Account", "DepreciationExpenseAccount")
                        .WithMany()
                        .HasForeignKey("DepreciationExpenseAccountId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("AccumDepreciationAccount");

                    b.Navigation("AssetAccount");

                    b.Navigation("DepreciationExpenseAccount");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FixedAssetDepreciationEntry", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.FixedAsset", "FixedAsset")
                        .WithMany("DepreciationEntries")
                        .HasForeignKey("FixedAssetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JournalEntry", "JournalEntry")
                        .WithMany()
                        .HasForeignKey("JournalEntryId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("FixedAsset");

                    b.Navigation("JournalEntry");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FormulaLibraryImport", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.FormulaLibraryItem", "FormulaLibraryItem")
                        .WithMany()
                        .HasForeignKey("FormulaLibraryItemId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.CustomItemTemplate", "ResultingCustomItemTemplate")
                        .WithMany()
                        .HasForeignKey("ResultingCustomItemTemplateId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("FormulaLibraryItem");

                    b.Navigation("ResultingCustomItemTemplate");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FormulaLibraryItem", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.FormulaLibraryItem", "InspiredBy")
                        .WithMany()
                        .HasForeignKey("InspiredByFormulaLibraryItemId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("InspiredBy");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FormulaLibraryRating", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.FormulaLibraryItem", "FormulaLibraryItem")
                        .WithMany()
                        .HasForeignKey("FormulaLibraryItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("FormulaLibraryItem");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificate", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "IssuedBy")
                        .WithMany()
                        .HasForeignKey("IssuedById");

                    b.HasOne("PowderCoating.Core.Entities.Customer", "PurchasingCustomer")
                        .WithMany()
                        .HasForeignKey("PurchasingCustomerId");

                    b.HasOne("PowderCoating.Core.Entities.Customer", "RecipientCustomer")
                        .WithMany()
                        .HasForeignKey("RecipientCustomerId");

                    b.Navigation("IssuedBy");

                    b.Navigation("PurchasingCustomer");

                    b.Navigation("RecipientCustomer");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificateRedemption", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.GiftCertificate", "GiftCertificate")
                        .WithMany("Redemptions")
                        .HasForeignKey("GiftCertificateId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
                        .WithMany("GiftCertificateRedemptions")
                        .HasForeignKey("InvoiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "RedeemedBy")
                        .WithMany()
                        .HasForeignKey("RedeemedById");

                    b.Navigation("GiftCertificate");

                    b.Navigation("Invoice");

                    b.Navigation("RedeemedBy");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InAppNotification", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId");

                    b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
                        .WithMany()
                        .HasForeignKey("InvoiceId");

                    b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
                        .WithMany()
                        .HasForeignKey("QuoteId");

                    b.Navigation("Customer");

                    b.Navigation("Invoice");

                    b.Navigation("Quote");
                });

            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.Account", "CogsAccount")
                        .WithMany()
                        .HasForeignKey("CogsAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany("InventoryItems")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Account", "InventoryAccount")
                        .WithMany()
                        .HasForeignKey("InventoryAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.InventoryCategoryLookup", "InventoryCategory")
                        .WithMany("InventoryItems")
                        .HasForeignKey("InventoryCategoryId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("PowderCoating.Core.Entities.Vendor", "PrimaryVendor")
                        .WithMany("InventoryItems")
                        .HasForeignKey("PrimaryVendorId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("CogsAccount");

                    b.Navigation("InventoryAccount");

                    b.Navigation("InventoryCategory");

                    b.Navigation("PrimaryVendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
                        .WithMany("Transactions")
                        .HasForeignKey("InventoryItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany()
                        .HasForeignKey("JobId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.PurchaseOrder", "PurchaseOrder")
                        .WithMany()
                        .HasForeignKey("PurchaseOrderId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("InventoryItem");

                    b.Navigation("Job");

                    b.Navigation("PurchaseOrder");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Invoice", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
                        .WithMany("Invoices")
                        .HasForeignKey("CustomerId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithOne("Invoice")
                        .HasForeignKey("PowderCoating.Core.Entities.Invoice", "JobId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PreparedBy")
                        .WithMany()
                        .HasForeignKey("PreparedById")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.Account", "SalesTaxAccount")
                        .WithMany()
                        .HasForeignKey("SalesTaxAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("Customer");

                    b.Navigation("Job");

                    b.Navigation("PreparedBy");

                    b.Navigation("SalesTaxAccount");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InvoiceItem", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
                        .WithMany()
                        .HasForeignKey("CatalogItemId");

                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.GiftCertificate", "GeneratedGiftCertificate")
                        .WithMany()
                        .HasForeignKey("GeneratedGiftCertificateId");

                    b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
                        .WithMany("InvoiceItems")
                        .HasForeignKey("InvoiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Account", "RevenueAccount")
                        .WithMany()
                        .HasForeignKey("RevenueAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.JobItem", "SourceJobItem")
                        .WithMany()
                        .HasForeignKey("SourceJobItemId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("CatalogItem");

                    b.Navigation("GeneratedGiftCertificate");

                    b.Navigation("Invoice");

                    b.Navigation("RevenueAccount");

                    b.Navigation("SourceJobItem");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AssignedUser")
                        .WithMany()
                        .HasForeignKey("AssignedUserId")
                        .OnDelete(DeleteBehavior.NoAction);

                    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.ApplicationUser", "IntakeCheckedBy")
                        .WithMany()
                        .HasForeignKey("IntakeCheckedByUserId");

                    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.Job", "OriginalJob")
                        .WithMany()
                        .HasForeignKey("OriginalJobId")
                        .OnDelete(DeleteBehavior.NoAction);

                    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("AssignedUser");

                    b.Navigation("Customer");

                    b.Navigation("IntakeCheckedBy");

                    b.Navigation("JobPriority");

                    b.Navigation("JobStatus");

                    b.Navigation("OriginalJob");

                    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);

                    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.AiItemPrediction", "AiPrediction")
                        .WithMany()
                        .HasForeignKey("AiPredictionId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
                        .WithMany()
                        .HasForeignKey("CatalogItemId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.CustomItemTemplate", "CustomItemTemplate")
                        .WithMany()
                        .HasForeignKey("CustomItemTemplateId");

                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany("JobItems")
                        .HasForeignKey("JobId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AiPrediction");

                    b.Navigation("CatalogItem");

                    b.Navigation("CustomItemTemplate");

                    b.Navigation("Job");
                });

            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.Vendor", "Vendor")
                        .WithMany()
                        .HasForeignKey("VendorId");

                    b.Navigation("InventoryItem");

                    b.Navigation("JobItem");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobItemPrepService", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.CompanyBlastSetup", "BlastSetup")
                        .WithMany()
                        .HasForeignKey("BlastSetupId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
                        .WithMany("PrepServices")
                        .HasForeignKey("JobItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
                        .WithMany()
                        .HasForeignKey("PrepServiceId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("BlastSetup");

                    b.Navigation("JobItem");

                    b.Navigation("PrepService");
                });

            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.JobTemplate", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId");

                    b.Navigation("Customer");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItem", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
                        .WithMany()
                        .HasForeignKey("CatalogItemId");

                    b.HasOne("PowderCoating.Core.Entities.JobTemplate", "JobTemplate")
                        .WithMany("Items")
                        .HasForeignKey("JobTemplateId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CatalogItem");

                    b.Navigation("JobTemplate");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemCoat", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
                        .WithMany()
                        .HasForeignKey("InventoryItemId");

                    b.HasOne("PowderCoating.Core.Entities.JobTemplateItem", "JobTemplateItem")
                        .WithMany("Coats")
                        .HasForeignKey("JobTemplateItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
                        .WithMany()
                        .HasForeignKey("VendorId");

                    b.Navigation("InventoryItem");

                    b.Navigation("JobTemplateItem");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemPrepService", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.JobTemplateItem", "JobTemplateItem")
                        .WithMany("PrepServices")
                        .HasForeignKey("JobTemplateItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
                        .WithMany()
                        .HasForeignKey("PrepServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("JobTemplateItem");

                    b.Navigation("PrepService");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTimeEntry", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany("TimeEntries")
                        .HasForeignKey("JobId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Job");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JournalEntry", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.JournalEntry", "ReversalOf")
                        .WithMany()
                        .HasForeignKey("ReversalOfId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("ReversalOf");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JournalEntryLine", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "Account")
                        .WithMany()
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JournalEntry", "JournalEntry")
                        .WithMany("Lines")
                        .HasForeignKey("JournalEntryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

                    b.Navigation("JournalEntry");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.KioskSession", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Customer", "LinkedCustomer")
                        .WithMany()
                        .HasForeignKey("LinkedCustomerId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.Job", "LinkedJob")
                        .WithMany()
                        .HasForeignKey("LinkedJobId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("LinkedCustomer");

                    b.Navigation("LinkedJob");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AssignedUser")
                        .WithMany()
                        .HasForeignKey("AssignedUserId")
                        .OnDelete(DeleteBehavior.NoAction);

                    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("AssignedUser");

                    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.Invoice", "Invoice")
                        .WithMany()
                        .HasForeignKey("InvoiceId")
                        .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("Invoice");

                    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.OvenBatch", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Equipment", "Equipment")
                        .WithMany("OvenBatches")
                        .HasForeignKey("EquipmentId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("PowderCoating.Core.Entities.OvenCost", "OvenCost")
                        .WithMany()
                        .HasForeignKey("OvenCostId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("Equipment");

                    b.Navigation("OvenCost");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatchItem", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany()
                        .HasForeignKey("JobId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JobItemCoat", "JobItemCoat")
                        .WithMany()
                        .HasForeignKey("JobItemCoatId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
                        .WithMany()
                        .HasForeignKey("JobItemId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.OvenBatch", "Batch")
                        .WithMany("Items")
                        .HasForeignKey("OvenBatchId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Batch");

                    b.Navigation("Job");

                    b.Navigation("JobItem");

                    b.Navigation("JobItemCoat");
                });

            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.Payment", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Account", "DepositAccount")
                        .WithMany()
                        .HasForeignKey("DepositAccountId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
                        .WithMany("Payments")
                        .HasForeignKey("InvoiceId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "RecordedBy")
                        .WithMany()
                        .HasForeignKey("RecordedById")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("DepositAccount");

                    b.Navigation("Invoice");

                    b.Navigation("RecordedBy");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PowderUsageLog", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
                        .WithMany()
                        .HasForeignKey("InventoryItemId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.InventoryTransaction", "InventoryTransaction")
                        .WithMany()
                        .HasForeignKey("InventoryTransactionId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany()
                        .HasForeignKey("JobId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JobItemCoat", "JobItemCoat")
                        .WithMany()
                        .HasForeignKey("JobItemCoatId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
                        .WithMany()
                        .HasForeignKey("JobItemId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("InventoryItem");

                    b.Navigation("InventoryTransaction");

                    b.Navigation("Job");

                    b.Navigation("JobItem");

                    b.Navigation("JobItemCoat");
                });

            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.PurchaseOrder", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Bill", "Bill")
                        .WithMany()
                        .HasForeignKey("BillId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
                        .WithMany()
                        .HasForeignKey("VendorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Bill");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrderItem", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
                        .WithMany()
                        .HasForeignKey("InventoryItemId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.PurchaseOrder", "PurchaseOrder")
                        .WithMany("Items")
                        .HasForeignKey("PurchaseOrderId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("InventoryItem");

                    b.Navigation("PurchaseOrder");
                });

            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);

                    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.AiItemPrediction", "AiPrediction")
                        .WithMany()
                        .HasForeignKey("AiPredictionId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
                        .WithMany()
                        .HasForeignKey("CatalogItemId");

                    b.HasOne("PowderCoating.Core.Entities.CustomItemTemplate", "CustomItemTemplate")
                        .WithMany()
                        .HasForeignKey("CustomItemTemplateId");

                    b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
                        .WithMany("QuoteItems")
                        .HasForeignKey("QuoteId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AiPrediction");

                    b.Navigation("CatalogItem");

                    b.Navigation("CustomItemTemplate");

                    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.Vendor", "Vendor")
                        .WithMany()
                        .HasForeignKey("VendorId");

                    b.Navigation("InventoryItem");

                    b.Navigation("QuoteItem");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemPrepService", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.CompanyBlastSetup", "BlastSetup")
                        .WithMany()
                        .HasForeignKey("BlastSetupId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany()
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
                        .WithMany()
                        .HasForeignKey("PrepServiceId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.QuoteItem", "QuoteItem")
                        .WithMany("PrepServices")
                        .HasForeignKey("QuoteItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("BlastSetup");

                    b.Navigation("PrepService");

                    b.Navigation("QuoteItem");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuotePhoto", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
                        .WithMany("QuotePhotos")
                        .HasForeignKey("QuoteId");

                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "UploadedBy")
                        .WithMany()
                        .HasForeignKey("UploadedById");

                    b.Navigation("Quote");

                    b.Navigation("UploadedBy");
                });

            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.Refund", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.CreditMemo", "CreditMemo")
                        .WithMany()
                        .HasForeignKey("CreditMemoId");

                    b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
                        .WithMany("Refunds")
                        .HasForeignKey("InvoiceId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "IssuedBy")
                        .WithMany()
                        .HasForeignKey("IssuedById");

                    b.HasOne("PowderCoating.Core.Entities.Payment", "Payment")
                        .WithMany()
                        .HasForeignKey("PaymentId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("CreditMemo");

                    b.Navigation("Invoice");

                    b.Navigation("IssuedBy");

                    b.Navigation("Payment");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.ReworkRecord", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Job", "Job")
                        .WithMany("ReworkRecords")
                        .HasForeignKey("JobId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
                        .WithMany()
                        .HasForeignKey("JobItemId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.HasOne("PowderCoating.Core.Entities.Job", "ReworkJob")
                        .WithMany()
                        .HasForeignKey("ReworkJobId")
                        .OnDelete(DeleteBehavior.NoAction);

                    b.Navigation("Job");

                    b.Navigation("JobItem");

                    b.Navigation("ReworkJob");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Vendor", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Company", null)
                        .WithMany("Vendors")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Account", "DefaultExpenseAccount")
                        .WithMany()
                        .HasForeignKey("DefaultExpenseAccountId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("DefaultExpenseAccount");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.VendorCredit", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "APAccount")
                        .WithMany()
                        .HasForeignKey("APAccountId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
                        .WithMany()
                        .HasForeignKey("VendorId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("APAccount");

                    b.Navigation("Vendor");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.VendorCreditApplication", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Bill", "Bill")
                        .WithMany()
                        .HasForeignKey("BillId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.VendorCredit", "VendorCredit")
                        .WithMany("Applications")
                        .HasForeignKey("VendorCreditId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Bill");

                    b.Navigation("VendorCredit");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.VendorCreditLineItem", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.Account", "Account")
                        .WithMany()
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("PowderCoating.Core.Entities.VendorCredit", "VendorCredit")
                        .WithMany("LineItems")
                        .HasForeignKey("VendorCreditId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

                    b.Navigation("VendorCredit");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.YearEndClose", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.JournalEntry", "JournalEntry")
                        .WithMany()
                        .HasForeignKey("JournalEntryId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("JournalEntry");
                });

            modelBuilder.Entity("VendorInventoryCategories", b =>
                {
                    b.HasOne("PowderCoating.Core.Entities.InventoryCategoryLookup", null)
                        .WithMany()
                        .HasForeignKey("InventoryCategoryLookupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("PowderCoating.Core.Entities.Vendor", null)
                        .WithMany()
                        .HasForeignKey("VendorId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Account", b =>
                {
                    b.Navigation("BillLineItems");

                    b.Navigation("BillPayments");

                    b.Navigation("Bills");

                    b.Navigation("ExpensePaymentAccounts");

                    b.Navigation("Expenses");

                    b.Navigation("SubAccounts");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Announcement", b =>
                {
                    b.Navigation("Dismissals");
                });

            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.Bill", b =>
                {
                    b.Navigation("LineItems");

                    b.Navigation("Payments");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Budget", b =>
                {
                    b.Navigation("Lines");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.BugReport", b =>
                {
                    b.Navigation("Attachments");
                });

            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("Users");

                    b.Navigation("Vendors");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemo", b =>
                {
                    b.Navigation("Applications");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b =>
                {
                    b.Navigation("CustomerContacts");

                    b.Navigation("CustomerNotes");

                    b.Navigation("Invoices");

                    b.Navigation("Jobs");

                    b.Navigation("NotificationLogs");

                    b.Navigation("Quotes");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
                {
                    b.Navigation("MaintenanceRecords");

                    b.Navigation("OvenBatches");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.FixedAsset", b =>
                {
                    b.Navigation("DepreciationEntries");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificate", b =>
                {
                    b.Navigation("Redemptions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b =>
                {
                    b.Navigation("InventoryItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b =>
                {
                    b.Navigation("Transactions");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Invoice", b =>
                {
                    b.Navigation("CreditApplications");

                    b.Navigation("GiftCertificateRedemptions");

                    b.Navigation("InvoiceItems");

                    b.Navigation("Payments");

                    b.Navigation("Refunds");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
                {
                    b.Navigation("Invoice");

                    b.Navigation("JobItems");

                    b.Navigation("JobPrepServices");

                    b.Navigation("Notes");

                    b.Navigation("Photos");

                    b.Navigation("ReworkRecords");

                    b.Navigation("StatusHistory");

                    b.Navigation("TimeEntries");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
                {
                    b.Navigation("Coats");

                    b.Navigation("PrepServices");
                });

            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.JobTemplate", b =>
                {
                    b.Navigation("Items");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItem", b =>
                {
                    b.Navigation("Coats");

                    b.Navigation("PrepServices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.JournalEntry", b =>
                {
                    b.Navigation("Lines");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatch", b =>
                {
                    b.Navigation("Items");
                });

            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.PurchaseOrder", b =>
                {
                    b.Navigation("Items");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
                {
                    b.Navigation("ConvertedToJob");

                    b.Navigation("QuoteItems");

                    b.Navigation("QuotePhotos");

                    b.Navigation("QuotePrepServices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
                {
                    b.Navigation("Coats");

                    b.Navigation("PrepServices");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b =>
                {
                    b.Navigation("Quotes");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.Vendor", b =>
                {
                    b.Navigation("BillPayments");

                    b.Navigation("Bills");

                    b.Navigation("Expenses");

                    b.Navigation("InventoryItems");
                });

            modelBuilder.Entity("PowderCoating.Core.Entities.VendorCredit", b =>
                {
                    b.Navigation("Applications");

                    b.Navigation("LineItems");
                });
#pragma warning restore 612, 618
        }
    }
}
