2180 lines
77 KiB
C#
2180 lines
77 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("20260207035534_AddPowderCoatingCostAndTaxToOperatingCosts")]
|
|
partial class AddPowderCoatingCostAndTaxToOperatingCosts
|
|
{
|
|
/// <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>("CanManageCustomers")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageInventory")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageJobs")
|
|
.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>("ProfilePicturePath")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.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.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>("LogoPath")
|
|
.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>("AdminOverheadPercentage")
|
|
.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>("ElectricityRatePerKwh")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("FacilityCostPercentage")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("GasRatePerUnit")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
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>("OvertimeLaborRate")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("PowderCoatingCostPerSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("SandblasterCostPerHour")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("SpecializedLaborRate")
|
|
.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.Property<decimal>("WaterRatePerUnit")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("CompanyOperatingCosts");
|
|
});
|
|
|
|
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<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>("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");
|
|
|
|
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>("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.ToTable("Equipment");
|
|
});
|
|
|
|
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<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<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>("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("PrimarySupplierId");
|
|
|
|
b.HasIndex("SKU")
|
|
.IsUnique();
|
|
|
|
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<decimal>("ActualCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("ActualHours")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("AssignedEmployeeId")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("CompletedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("CustomerApprovedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
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>("EstimatedCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("EstimatedHours")
|
|
.HasColumnType("int");
|
|
|
|
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>("Priority")
|
|
.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<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AssignedEmployeeId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("JobNumber")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("QuoteId")
|
|
.IsUnique()
|
|
.HasFilter("[QuoteId] IS NOT NULL");
|
|
|
|
b.ToTable("Jobs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("ActualMinutes")
|
|
.HasColumnType("int");
|
|
|
|
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<decimal?>("Height")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("LaborCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal?>("Length")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("MaterialCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("MeasurementUnit")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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.Property<decimal?>("Weight")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal?>("Width")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("PowderInventoryId");
|
|
|
|
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");
|
|
|
|
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<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>("FileName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FilePath")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("PhotoDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("PhotoType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.ToTable("JobPhotos");
|
|
});
|
|
|
|
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>("FromStatus")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ToStatus")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.ToTable("JobStatusHistory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
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("EquipmentId");
|
|
|
|
b.HasIndex("PerformedById");
|
|
|
|
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, 7, 3, 55, 32, 342, DateTimeKind.Utc).AddTicks(7640),
|
|
Description = "Standard pricing for regular customers",
|
|
DiscountPercent = 0m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Standard"
|
|
},
|
|
new
|
|
{
|
|
Id = 2,
|
|
CompanyId = 0,
|
|
CreatedAt = new DateTime(2026, 2, 7, 3, 55, 32, 342, DateTimeKind.Utc).AddTicks(7647),
|
|
Description = "5% discount for preferred customers",
|
|
DiscountPercent = 5m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Preferred"
|
|
},
|
|
new
|
|
{
|
|
Id = 3,
|
|
CompanyId = 0,
|
|
CreatedAt = new DateTime(2026, 2, 7, 3, 55, 32, 342, DateTimeKind.Utc).AddTicks(7649),
|
|
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<string>("AIPriceRationale")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("AISuggestedPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
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<DateTime?>("SentDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("SubTotal")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TaxAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TaxPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Terms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("Total")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("UsedAISuggestion")
|
|
.HasColumnType("bit");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("PreparedById");
|
|
|
|
b.HasIndex("QuoteNumber")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
|
|
{
|
|
b.Property<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<decimal?>("Height")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal?>("Length")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("MeasurementUnit")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
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>("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.Property<decimal?>("Width")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("QuoteId");
|
|
|
|
b.ToTable("QuoteItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", 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")
|
|
.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<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>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("State")
|
|
.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.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.Customer", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Customers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PricingTier", "PricingTier")
|
|
.WithMany("Customers")
|
|
.HasForeignKey("PricingTierId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("PricingTier");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CustomerNote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("CustomerNotes")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Equipment")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("InventoryItems")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Supplier", "PrimarySupplier")
|
|
.WithMany("SuppliedItems")
|
|
.HasForeignKey("PrimarySupplierId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("PrimarySupplier");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("InventoryItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("InventoryItem");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AssignedEmployee")
|
|
.WithMany("AssignedJobs")
|
|
.HasForeignKey("AssignedEmployeeId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithOne("ConvertedToJob")
|
|
.HasForeignKey("PowderCoating.Core.Entities.Job", "QuoteId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("AssignedEmployee");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("JobItems")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "PowderInventory")
|
|
.WithMany("JobItems")
|
|
.HasForeignKey("PowderInventoryId");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("PowderInventory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobNote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("Notes")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPhoto", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("Photos")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusHistory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("StatusHistory")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.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("Equipment");
|
|
|
|
b.Navigation("PerformedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("PricingTiers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PreparedBy")
|
|
.WithMany("PreparedQuotes")
|
|
.HasForeignKey("PreparedById")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("PreparedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany("QuoteItems")
|
|
.HasForeignKey("QuoteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
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("AssignedJobs");
|
|
|
|
b.Navigation("PerformedMaintenances");
|
|
|
|
b.Navigation("PreparedQuotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Company", b =>
|
|
{
|
|
b.Navigation("Customers");
|
|
|
|
b.Navigation("Equipment");
|
|
|
|
b.Navigation("InventoryItems");
|
|
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("OperatingCosts");
|
|
|
|
b.Navigation("PricingTiers");
|
|
|
|
b.Navigation("Quotes");
|
|
|
|
b.Navigation("Suppliers");
|
|
|
|
b.Navigation("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b =>
|
|
{
|
|
b.Navigation("CustomerNotes");
|
|
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
|
|
{
|
|
b.Navigation("MaintenanceRecords");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b =>
|
|
{
|
|
b.Navigation("JobItems");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.Navigation("JobItems");
|
|
|
|
b.Navigation("Notes");
|
|
|
|
b.Navigation("Photos");
|
|
|
|
b.Navigation("StatusHistory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b =>
|
|
{
|
|
b.Navigation("Customers");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.Navigation("ConvertedToJob");
|
|
|
|
b.Navigation("QuoteItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Supplier", b =>
|
|
{
|
|
b.Navigation("SuppliedItems");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|