3685 lines
131 KiB
C#
3685 lines
131 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using PowderCoating.Infrastructure.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace PowderCoating.Infrastructure.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20260215234122_AddAdditionalCoatLaborPercentToOperatingCosts")]
|
|
partial class AddAdditionalCoatLaborPercentToOperatingCosts
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.11")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
|
{
|
|
b.Property<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.ApplicationUser", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Address")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("CanApproveQuotes")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanCreateQuotes")
|
|
.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>("CanManageJobs")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageMaintenance")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageProducts")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageSuppliers")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanViewCalendar")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanViewProducts")
|
|
.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<DateTime?>("DateOfBirth")
|
|
.HasColumnType("datetime2");
|
|
|
|
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<decimal>("HourlyRate")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
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<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>("ProfilePictureContentType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<byte[]>("ProfilePictureData")
|
|
.HasColumnType("varbinary(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<int?>("AssignedWorkerId")
|
|
.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>("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>("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("AssignedWorkerId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("CompanyId", "AppointmentStatusId")
|
|
.HasDatabaseName("IX_Appointments_CompanyId_AppointmentStatusId");
|
|
|
|
b.HasIndex("CompanyId", "ScheduledStartTime")
|
|
.HasDatabaseName("IX_Appointments_CompanyId_ScheduledStartTime");
|
|
|
|
b.ToTable("Appointments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentStatusLookup", b =>
|
|
{
|
|
b.Property<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.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<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<int>("CategoryId")
|
|
.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<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SKU")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("CatalogItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Company", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Address")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("LogoContentType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<byte[]>("LogoData")
|
|
.HasColumnType("varbinary(max)");
|
|
|
|
b.Property<string>("LogoFilePath")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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<string>("Settings")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("State")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("SubscriptionEndDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("SubscriptionPlan")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("SubscriptionStartDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("TimeZone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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.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<decimal>("CoatingBoothCostPerHour")
|
|
.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>("GeneralMarkupPercentage")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("OvenOperatingCostPerHour")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("PowderCoatingCostPerSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
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<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>("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<string>("DefaultCurrency")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DefaultDateFormat")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DefaultJobPriority")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DefaultPaymentTerms")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DefaultQuoteValidityDays")
|
|
.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<bool>("EmailNotificationsEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("EnableMaskingStep")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("EnableSandblastingStep")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("JobNumberPrefix")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("JobRetentionYears")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("LogRetentionDays")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaintenanceAlertDays")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("NotifyOnJobStatusChange")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("NotifyOnNewJob")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("NotifyOnPaymentReceived")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("NotifyOnQuoteApproval")
|
|
.HasColumnType("bit");
|
|
|
|
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<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("UseMetricSystem")
|
|
.HasColumnType("bit");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("CompanyPreferences");
|
|
});
|
|
|
|
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>("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>("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>("MobilePhone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PaymentTerms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("PricingTierId")
|
|
.HasColumnType("int");
|
|
|
|
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<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("Email")
|
|
.IsUnique()
|
|
.HasFilter("[Email] IS NOT NULL");
|
|
|
|
b.HasIndex("PricingTierId");
|
|
|
|
b.ToTable("Customers");
|
|
});
|
|
|
|
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.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<string>("Model")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("NextScheduledMaintenance")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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.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<string>("Category")
|
|
.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>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DiscontinuedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Finish")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("InventoryCategoryId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.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?>("PrimarySupplierId")
|
|
.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<string>("SKU")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("SupplierPartNumber")
|
|
.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.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("InventoryCategoryId");
|
|
|
|
b.HasIndex("PrimarySupplierId");
|
|
|
|
b.HasIndex("SKU")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("CompanyId", "QuantityOnHand", "ReorderPoint")
|
|
.HasDatabaseName("IX_InventoryItems_CompanyId_Quantity_Reorder");
|
|
|
|
b.ToTable("InventoryItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b =>
|
|
{
|
|
b.Property<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<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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.ToTable("InventoryTransactions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("AssignedWorkerId")
|
|
.HasColumnType("int");
|
|
|
|
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<DateTime?>("DueDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal>("FinalPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsCustomerApproved")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.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?>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("QuotedPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("RequiresCustomerApproval")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("ScheduledDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("SpecialInstructions")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("StartedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AssignedWorkerId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("JobNumber")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("JobPriorityId");
|
|
|
|
b.HasIndex("JobStatusId");
|
|
|
|
b.HasIndex("QuoteId")
|
|
.IsUnique()
|
|
.HasFilter("[QuoteId] IS NOT NULL");
|
|
|
|
b.HasIndex("CompanyId", "CustomerId")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_CustomerId");
|
|
|
|
b.HasIndex("CompanyId", "DueDate")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_DueDate");
|
|
|
|
b.HasIndex("CompanyId", "JobPriorityId")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_JobPriorityId");
|
|
|
|
b.HasIndex("CompanyId", "JobStatusId")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_JobStatusId");
|
|
|
|
b.HasIndex("CompanyId", "ScheduledDate")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_ScheduledDate");
|
|
|
|
b.ToTable("Jobs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobChangeHistory", b =>
|
|
{
|
|
b.Property<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")
|
|
.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>("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.JobItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ColorCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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>("EstimatedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Finish")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("LaborCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("PowderInventoryId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("RequiresMasking")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("RequiresSandblasting")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal?>("SurfaceArea")
|
|
.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("JobId")
|
|
.HasDatabaseName("IX_JobItems_JobId");
|
|
|
|
b.HasIndex("PowderInventoryId");
|
|
|
|
b.HasIndex("JobId", "IsDeleted")
|
|
.HasDatabaseName("IX_JobItems_JobId_IsDeleted");
|
|
|
|
b.ToTable("JobItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("PhotoType")
|
|
.HasColumnType("int");
|
|
|
|
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.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.MaintenanceRecord", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("AssignedWorkerId")
|
|
.HasColumnType("int");
|
|
|
|
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<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>("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("AssignedWorkerId");
|
|
|
|
b.HasIndex("EquipmentId");
|
|
|
|
b.HasIndex("PerformedById");
|
|
|
|
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.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, 2, 15, 23, 41, 19, 894, DateTimeKind.Utc).AddTicks(9787),
|
|
Description = "Standard pricing for regular customers",
|
|
DiscountPercent = 0m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Standard"
|
|
},
|
|
new
|
|
{
|
|
Id = 2,
|
|
CompanyId = 0,
|
|
CreatedAt = new DateTime(2026, 2, 15, 23, 41, 19, 894, DateTimeKind.Utc).AddTicks(9795),
|
|
Description = "5% discount for preferred customers",
|
|
DiscountPercent = 5m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Preferred"
|
|
},
|
|
new
|
|
{
|
|
Id = 3,
|
|
CompanyId = 0,
|
|
CreatedAt = new DateTime(2026, 2, 15, 23, 41, 19, 894, DateTimeKind.Utc).AddTicks(9841),
|
|
Description = "10% discount for premium customers",
|
|
DiscountPercent = 10m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Premium"
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
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<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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<DateTime?>("ExpirationDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsCommercial")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PreparedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
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<string>("ProspectState")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ProspectZipCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("QuoteDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("QuoteNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("QuoteStatusId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("SentDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
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("CompanyId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("PreparedById");
|
|
|
|
b.HasIndex("QuoteNumber")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("QuoteStatusId");
|
|
|
|
b.HasIndex("CompanyId", "ExpirationDate")
|
|
.HasDatabaseName("IX_Quotes_CompanyId_ExpirationDate");
|
|
|
|
b.HasIndex("CompanyId", "QuoteStatusId")
|
|
.HasDatabaseName("IX_Quotes_CompanyId_QuoteStatusId");
|
|
|
|
b.ToTable("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteChangeHistory", b =>
|
|
{
|
|
b.Property<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")
|
|
.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>("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?>("CatalogItemId")
|
|
.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>("EstimatedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("RequiresMasking")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("RequiresSandblasting")
|
|
.HasColumnType("bit");
|
|
|
|
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("CatalogItemId");
|
|
|
|
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<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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<int?>("SupplierId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("TransferEfficiency")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId")
|
|
.HasDatabaseName("IX_QuoteItemCoats_CompanyId");
|
|
|
|
b.HasIndex("InventoryItemId")
|
|
.HasDatabaseName("IX_QuoteItemCoats_InventoryItemId");
|
|
|
|
b.HasIndex("QuoteItemId")
|
|
.HasDatabaseName("IX_QuoteItemCoats_QuoteItemId");
|
|
|
|
b.HasIndex("SupplierId");
|
|
|
|
b.ToTable("QuoteItemCoats");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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>("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.ShopWorker", 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>("Email")
|
|
.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>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("Role")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("ShopWorkers");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", 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<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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<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.ToTable("Suppliers");
|
|
});
|
|
|
|
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.ApplicationUser", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", "Company")
|
|
.WithMany("Users")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Appointment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.AppointmentStatusLookup", "AppointmentStatus")
|
|
.WithMany("Appointments")
|
|
.HasForeignKey("AppointmentStatusId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.AppointmentTypeLookup", "AppointmentType")
|
|
.WithMany("Appointments")
|
|
.HasForeignKey("AppointmentTypeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ShopWorker", "AssignedWorker")
|
|
.WithMany()
|
|
.HasForeignKey("AssignedWorkerId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId");
|
|
|
|
b.Navigation("AppointmentStatus");
|
|
|
|
b.Navigation("AppointmentType");
|
|
|
|
b.Navigation("AssignedWorker");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogCategory", "ParentCategory")
|
|
.WithMany("SubCategories")
|
|
.HasForeignKey("ParentCategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("ParentCategory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogCategory", "Category")
|
|
.WithMany("Items")
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CompanyOperatingCosts", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", "Company")
|
|
.WithOne("OperatingCosts")
|
|
.HasForeignKey("PowderCoating.Core.Entities.CompanyOperatingCosts", "CompanyId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CompanyPreferences", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", "Company")
|
|
.WithOne("Preferences")
|
|
.HasForeignKey("PowderCoating.Core.Entities.CompanyPreferences", "CompanyId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Customers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PricingTier", "PricingTier")
|
|
.WithMany("Customers")
|
|
.HasForeignKey("PricingTierId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("PricingTier");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CustomerNote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("CustomerNotes")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Equipment")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("InventoryItems")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryCategoryLookup", "InventoryCategory")
|
|
.WithMany("InventoryItems")
|
|
.HasForeignKey("InventoryCategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Supplier", "PrimarySupplier")
|
|
.WithMany("InventoryItems")
|
|
.HasForeignKey("PrimarySupplierId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("InventoryCategory");
|
|
|
|
b.Navigation("PrimarySupplier");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("InventoryItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("InventoryItem");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ShopWorker", "AssignedWorker")
|
|
.WithMany("AssignedJobs")
|
|
.HasForeignKey("AssignedWorkerId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobPriorityLookup", "JobPriority")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("JobPriorityId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "JobStatus")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("JobStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithOne("ConvertedToJob")
|
|
.HasForeignKey("PowderCoating.Core.Entities.Job", "QuoteId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("AssignedWorker");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("JobPriority");
|
|
|
|
b.Navigation("JobStatus");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobChangeHistory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "ChangedBy")
|
|
.WithMany()
|
|
.HasForeignKey("ChangedByUserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("ChangedBy");
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("JobItems")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "PowderInventory")
|
|
.WithMany("JobItems")
|
|
.HasForeignKey("PowderInventoryId");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("PowderInventory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobNote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("Notes")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPhoto", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("Photos")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "UploadedBy")
|
|
.WithMany()
|
|
.HasForeignKey("UploadedById")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("UploadedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPriorityLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusHistory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "FromStatus")
|
|
.WithMany("FromStatusHistory")
|
|
.HasForeignKey("FromStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("StatusHistory")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "ToStatus")
|
|
.WithMany("ToStatusHistory")
|
|
.HasForeignKey("ToStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("FromStatus");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("ToStatus");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ShopWorker", "AssignedWorker")
|
|
.WithMany("AssignedMaintenanceTasks")
|
|
.HasForeignKey("AssignedWorkerId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Equipment", "Equipment")
|
|
.WithMany("MaintenanceRecords")
|
|
.HasForeignKey("EquipmentId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PerformedBy")
|
|
.WithMany("PerformedMaintenances")
|
|
.HasForeignKey("PerformedById")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("AssignedWorker");
|
|
|
|
b.Navigation("Equipment");
|
|
|
|
b.Navigation("PerformedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("PricingTiers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PreparedBy")
|
|
.WithMany("PreparedQuotes")
|
|
.HasForeignKey("PreparedById")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.QuoteStatusLookup", "QuoteStatus")
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("QuoteStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("PreparedBy");
|
|
|
|
b.Navigation("QuoteStatus");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteChangeHistory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "ChangedBy")
|
|
.WithMany()
|
|
.HasForeignKey("ChangedByUserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany()
|
|
.HasForeignKey("QuoteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("ChangedBy");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
|
|
.WithMany()
|
|
.HasForeignKey("CatalogItemId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany("QuoteItems")
|
|
.HasForeignKey("QuoteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("CatalogItem");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemCoat", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryItemId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.QuoteItem", "QuoteItem")
|
|
.WithMany("Coats")
|
|
.HasForeignKey("QuoteItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Supplier", "Supplier")
|
|
.WithMany()
|
|
.HasForeignKey("SupplierId");
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("QuoteItem");
|
|
|
|
b.Navigation("Supplier");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("ShopWorkers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Suppliers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b =>
|
|
{
|
|
b.Navigation("PerformedMaintenances");
|
|
|
|
b.Navigation("PreparedQuotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentStatusLookup", b =>
|
|
{
|
|
b.Navigation("Appointments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentTypeLookup", b =>
|
|
{
|
|
b.Navigation("Appointments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
|
|
b.Navigation("SubCategories");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Company", b =>
|
|
{
|
|
b.Navigation("Customers");
|
|
|
|
b.Navigation("Equipment");
|
|
|
|
b.Navigation("InventoryItems");
|
|
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("OperatingCosts");
|
|
|
|
b.Navigation("Preferences");
|
|
|
|
b.Navigation("PricingTiers");
|
|
|
|
b.Navigation("Quotes");
|
|
|
|
b.Navigation("ShopWorkers");
|
|
|
|
b.Navigation("Suppliers");
|
|
|
|
b.Navigation("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b =>
|
|
{
|
|
b.Navigation("CustomerNotes");
|
|
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
|
|
{
|
|
b.Navigation("MaintenanceRecords");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b =>
|
|
{
|
|
b.Navigation("InventoryItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b =>
|
|
{
|
|
b.Navigation("JobItems");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.Navigation("JobItems");
|
|
|
|
b.Navigation("Notes");
|
|
|
|
b.Navigation("Photos");
|
|
|
|
b.Navigation("StatusHistory");
|
|
});
|
|
|
|
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.PricingTier", b =>
|
|
{
|
|
b.Navigation("Customers");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.Navigation("ConvertedToJob");
|
|
|
|
b.Navigation("QuoteItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
|
|
{
|
|
b.Navigation("Coats");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b =>
|
|
{
|
|
b.Navigation("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b =>
|
|
{
|
|
b.Navigation("AssignedJobs");
|
|
|
|
b.Navigation("AssignedMaintenanceTasks");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b =>
|
|
{
|
|
b.Navigation("InventoryItems");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|