8479 lines
300 KiB
C#
8479 lines
300 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("20260402015422_AddInvoiceExternalReference")]
|
|
partial class AddInvoiceExternalReference
|
|
{
|
|
/// <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.Account", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("AccountNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("AccountSubType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("AccountType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("CurrentBalance")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSystem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("OpeningBalance")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("OpeningBalanceDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int?>("ParentAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ParentAccountId");
|
|
|
|
b.ToTable("Accounts");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AiItemPrediction", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("AiTags")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Confidence")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ConversationRounds")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("PredictedComplexity")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("PredictedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("PredictedSurfaceAreaSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("PredictedUnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Reasoning")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("UserOverrodeEstimate")
|
|
.HasColumnType("bit");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("AiItemPredictions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Announcement", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedByUserId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("CreatedByUserName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("ExpiresAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDismissible")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Message")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("StartsAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Target")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("TargetCompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("TargetPlan")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Announcements");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AnnouncementDismissal", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AnnouncementId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("DismissedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UserId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AnnouncementId", "UserId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AnnouncementDismissals");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Address")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<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>("CanManageInvoices")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageJobs")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageMaintenance")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageProducts")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanManageVendors")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanViewCalendar")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanViewProducts")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanViewReports")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("CanViewShopFloor")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("City")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CompanyRole")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int?>("DashboardLayout")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("DateFormat")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Department")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("EmployeeNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FirstName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("HireDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<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>("ProfilePictureFilePath")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SidebarColor")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("State")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("TerminationDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Theme")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("TimeZone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("ZipCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("NormalizedEmail")
|
|
.HasDatabaseName("EmailIndex");
|
|
|
|
b.HasIndex("NormalizedUserName")
|
|
.IsUnique()
|
|
.HasDatabaseName("UserNameIndex")
|
|
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
|
|
|
b.ToTable("AspNetUsers", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Appointment", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime?>("ActualEndTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("ActualStartTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("AppointmentNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("AppointmentStatusId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("AppointmentTypeId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("AssignedUserId")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsAllDay")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsReminderEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int?>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Location")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ReminderMinutesBefore")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("ScheduledEndTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("ScheduledStartTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AppointmentStatusId");
|
|
|
|
b.HasIndex("AppointmentTypeId");
|
|
|
|
b.HasIndex("AssignedUserId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("CompanyId", "AppointmentStatusId")
|
|
.HasDatabaseName("IX_Appointments_CompanyId_AppointmentStatusId");
|
|
|
|
b.HasIndex("CompanyId", "ScheduledStartTime")
|
|
.HasDatabaseName("IX_Appointments_CompanyId_ScheduledStartTime");
|
|
|
|
b.ToTable("Appointments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentStatusLookup", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ColorClass")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("IconClass")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSystemDefined")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsTerminalStatus")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("StatusCode")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("AppointmentStatusLookups");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentTypeLookup", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ColorClass")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("IconClass")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSystemDefined")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("RequiresJobLink")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("TypeCode")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("AppointmentTypeLookups");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AuditLog", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("Action")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CompanyName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("EntityDescription")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("EntityId")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("EntityType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("NewValues")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("OldValues")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("Timestamp")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UserId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("UserName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId", "Timestamp");
|
|
|
|
b.HasIndex("EntityType", "EntityId");
|
|
|
|
b.ToTable("AuditLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Bill", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("APAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("AmountPaid")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("BillDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("BillNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DueDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Memo")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("SubTotal")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TaxAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TaxPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Terms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("Total")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("VendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("VendorInvoiceNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("APAccountId");
|
|
|
|
b.HasIndex("VendorId");
|
|
|
|
b.ToTable("Bills");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BillLineItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("BillId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int?>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("UnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId");
|
|
|
|
b.HasIndex("BillId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.ToTable("BillLineItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BillPayment", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("BankAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("BillId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CheckNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<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<string>("Memo")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("PaymentDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("PaymentMethod")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("PaymentNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("VendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("BankAccountId");
|
|
|
|
b.HasIndex("BillId");
|
|
|
|
b.HasIndex("VendorId");
|
|
|
|
b.ToTable("BillPayments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BugReport", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CompanyName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("Priority")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ResolutionNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("ResolvedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("ResolvedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SubmittedByUserId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SubmittedByUserName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("BugReports");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BugReportAttachment", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("BlobPath")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("BugReportId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ContentType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FileName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<long>("FileSizeBytes")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("BugReportId");
|
|
|
|
b.ToTable("BugReportAttachments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsMerchandise")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("ParentCategoryId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("ParentCategoryId");
|
|
|
|
b.ToTable("CatalogCategories");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal?>("ApproximateArea")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CategoryId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("CogsAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("DefaultEstimatedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("DefaultPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("DefaultRequiresMasking")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("DefaultRequiresSandblasting")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("InventoryItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsMerchandise")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("RevenueAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SKU")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("CogsAccountId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("InventoryItemId");
|
|
|
|
b.HasIndex("RevenueAccountId");
|
|
|
|
b.ToTable("CatalogItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Company", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Address")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("AiInventoryAssistEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("AiPhotoQuotesEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
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>("IsComped")
|
|
.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<int?>("MaxActiveJobsOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MaxAiPhotoQuotesPerMonthOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MaxCatalogItemsOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MaxCustomersOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MaxJobPhotosOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MaxQuotePhotosOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MaxQuotesOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MaxUsersOverride")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("OnlinePaymentSurchargeType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("OnlinePaymentSurchargeValue")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("OnlineSurchargeAcknowledged")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PrimaryContactEmail")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PrimaryContactName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("State")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("StripeAccountId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("StripeConnectStatus")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("StripeCustomerId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("StripeSubscriptionId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("SubscriptionEndDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("SubscriptionNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("SubscriptionPlan")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("SubscriptionStartDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("SubscriptionStatus")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("TimeZone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<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<string>("AiContextProfile")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("nvarchar(2000)");
|
|
|
|
b.Property<decimal>("CoatingBoothCostPerHour")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("ComplexityComplexPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("ComplexityExtremePercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("ComplexityModeratePercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("ComplexitySimplePercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DefaultOvenCycleMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("GeneralMarkupPercentage")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("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<string>("EmailFromAddress")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("EmailFromName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("EmailNotificationsEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("InAccentColor")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("InDefaultTerms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("InFooterNote")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("JobNumberPrefix")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("JobRetentionYears")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<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>("NotifyOnNewQuote")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("NotifyOnPaymentReceived")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("NotifyOnQuoteApproval")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("PaymentReminderDays")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("PaymentRemindersEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("QtAccentColor")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("QtDefaultTerms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("QtFooterNote")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("QuoteExpiryWarningDays")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("QuoteNumberPrefix")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("QuoteRetentionYears")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("RequireCustomerPO")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("SetupWizardCompleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("SetupWizardDoneSteps")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SetupWizardSkippedSteps")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("SetupWizardStarted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("UseMetricSystem")
|
|
.HasColumnType("bit");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("CompanyPreferences");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemo", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("AmountApplied")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("ExpiryDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime>("IssueDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("IssuedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("MemoNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("OriginalInvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Reason")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("ReworkRecordId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("IssuedById");
|
|
|
|
b.HasIndex("OriginalInvoiceId");
|
|
|
|
b.HasIndex("ReworkRecordId");
|
|
|
|
b.HasIndex("CompanyId", "MemoNumber")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_CreditMemos_CompanyId_MemoNumber");
|
|
|
|
b.ToTable("CreditMemos");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemoApplication", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("AmountApplied")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("AppliedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime>("AppliedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CreditMemoId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("InvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AppliedById");
|
|
|
|
b.HasIndex("CreditMemoId");
|
|
|
|
b.HasIndex("InvoiceId");
|
|
|
|
b.ToTable("CreditMemoApplications");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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>("CreditBalance")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("CreditLimit")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("CurrentBalance")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("GeneralNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsCommercial")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsTaxExempt")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("LastContactDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("MobilePhone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("NotifyByEmail")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("NotifyBySms")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("PaymentTerms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("PricingTierId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SmsConsentMethod")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("SmsConsentedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("State")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("TaxExemptCertificateContentType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<byte[]>("TaxExemptCertificateData")
|
|
.HasColumnType("varbinary(max)");
|
|
|
|
b.Property<string>("TaxExemptCertificateFileName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("TaxId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("UnsubscribeToken")
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("nvarchar(450)")
|
|
.HasDefaultValueSql("REPLACE(NEWID(),'-','')");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ZipCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CompanyName");
|
|
|
|
b.HasIndex("PricingTierId");
|
|
|
|
b.HasIndex("UnsubscribeToken")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_Customers_UnsubscribeToken");
|
|
|
|
b.HasIndex("CompanyId", "Email")
|
|
.IsUnique()
|
|
.HasFilter("[Email] IS NOT NULL");
|
|
|
|
b.ToTable("Customers");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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.Deposit", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("AppliedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int?>("AppliedToInvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int?>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("PaymentMethod")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ReceiptNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("ReceivedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("RecordedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Reference")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AppliedToInvoiceId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("QuoteId");
|
|
|
|
b.HasIndex("RecordedById");
|
|
|
|
b.ToTable("Deposits");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("EquipmentName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("EquipmentNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("EquipmentType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("LastMaintenanceDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Location")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ManualContentType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ManualFileName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ManualFilePath")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<long?>("ManualFileSize")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime?>("ManualUploadedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Manufacturer")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("MaxLoadSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Model")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("NextScheduledMaintenance")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("OvenCycleMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("PurchaseDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal>("PurchasePrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("RecommendedMaintenanceIntervalDays")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SerialNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("WarrantyExpiration")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CompanyId", "Status")
|
|
.HasDatabaseName("IX_Equipment_CompanyId_Status");
|
|
|
|
b.ToTable("Equipment");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Expense", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("Date")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ExpenseAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ExpenseNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int?>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Memo")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("PaymentAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("PaymentMethod")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ReceiptFilePath")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("VendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ExpenseAccountId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("PaymentAccountId");
|
|
|
|
b.HasIndex("VendorId");
|
|
|
|
b.ToTable("Expenses");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificate", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("CertificateCode")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("ExpiryDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime>("IssueDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("IssuedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("IssuedReason")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("OriginalAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal?>("PurchasePrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int?>("PurchasingCustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("RecipientCustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("RecipientEmail")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("RecipientName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("RedeemedAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int?>("SourceInvoiceItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IssuedById");
|
|
|
|
b.HasIndex("PurchasingCustomerId");
|
|
|
|
b.HasIndex("RecipientCustomerId");
|
|
|
|
b.HasIndex("CompanyId", "CertificateCode")
|
|
.IsUnique();
|
|
|
|
b.ToTable("GiftCertificates");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificateRedemption", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("AmountRedeemed")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("GiftCertificateId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("InvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("RedeemedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime>("RedeemedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("GiftCertificateId");
|
|
|
|
b.HasIndex("InvoiceId");
|
|
|
|
b.HasIndex("RedeemedById");
|
|
|
|
b.ToTable("GiftCertificateRedemptions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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<int?>("CogsAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ColorCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ColorFamilies")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ColorName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal?>("CoverageSqFtPerLb")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("CureTemperatureF")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int?>("CureTimeMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DiscontinuedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Finish")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("InventoryAccountId")
|
|
.HasColumnType("int");
|
|
|
|
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?>("PrimaryVendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("QuantityOnHand")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("ReorderPoint")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("ReorderQuantity")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("RequiresClearCoat")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("SKU")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("SpecPageUrl")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("TransferEfficiency")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("UnitCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("UnitOfMeasure")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("VendorPartNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CogsAccountId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("InventoryAccountId");
|
|
|
|
b.HasIndex("InventoryCategoryId");
|
|
|
|
b.HasIndex("PrimaryVendorId");
|
|
|
|
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<int?>("PurchaseOrderId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Reference")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("TotalCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("TransactionDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("TransactionType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("UnitCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("InventoryItemId");
|
|
|
|
b.HasIndex("PurchaseOrderId");
|
|
|
|
b.ToTable("InventoryTransactions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Invoice", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("AmountPaid")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("CreditApplied")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CustomerPO")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("DiscountAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("DueDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("ExternalReference")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<decimal>("GiftCertificateRedeemed")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("InternalNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("InvoiceDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("InvoiceNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int?>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("OnlineAmountPaid")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("OnlinePaymentStatus")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("OnlineSurchargeCollected")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("PaidDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("PaymentLinkExpiresAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("PaymentLinkToken")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PreparedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int?>("SalesTaxAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("SentDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("StripePaymentIntentId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("SubTotal")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TaxAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TaxPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Terms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("Total")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("DueDate");
|
|
|
|
b.HasIndex("InvoiceDate");
|
|
|
|
b.HasIndex("JobId")
|
|
.IsUnique()
|
|
.HasFilter("[JobId] IS NOT NULL");
|
|
|
|
b.HasIndex("PreparedById");
|
|
|
|
b.HasIndex("SalesTaxAccountId");
|
|
|
|
b.HasIndex("Status");
|
|
|
|
b.HasIndex("CompanyId", "CustomerId")
|
|
.HasDatabaseName("IX_Invoices_CompanyId_CustomerId");
|
|
|
|
b.HasIndex("CompanyId", "DueDate")
|
|
.HasDatabaseName("IX_Invoices_CompanyId_DueDate");
|
|
|
|
b.HasIndex("CompanyId", "ExternalReference")
|
|
.HasDatabaseName("IX_Invoices_CompanyId_ExternalReference");
|
|
|
|
b.HasIndex("CompanyId", "InvoiceNumber")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_Invoices_CompanyId_InvoiceNumber");
|
|
|
|
b.HasIndex("CompanyId", "IsDeleted");
|
|
|
|
b.HasIndex("CompanyId", "JobId")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_Invoices_CompanyId_JobId")
|
|
.HasFilter("[JobId] IS NOT NULL");
|
|
|
|
b.HasIndex("CompanyId", "Status")
|
|
.HasDatabaseName("IX_Invoices_CompanyId_Status");
|
|
|
|
b.ToTable("Invoices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InvoiceItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("CatalogItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ColorName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("GcExpiryDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("GcRecipientEmail")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("GcRecipientName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("GeneratedGiftCertificateId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("InvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsGiftCertificate")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int?>("RevenueAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("SourceJobItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("TotalPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("UnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CatalogItemId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("GeneratedGiftCertificateId");
|
|
|
|
b.HasIndex("InvoiceId")
|
|
.HasDatabaseName("IX_InvoiceItems_InvoiceId");
|
|
|
|
b.HasIndex("RevenueAccountId");
|
|
|
|
b.HasIndex("SourceJobItemId");
|
|
|
|
b.ToTable("InvoiceItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal?>("ActualTimeSpentHours")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("AssignedUserId")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("CompletedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CustomerPO")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DiscountReason")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DiscountType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("DiscountValue")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("DueDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal>("FinalPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("InternalNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsCustomerApproved")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsReworkJob")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsRushJob")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("JobNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("JobPriorityId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("JobStatusId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("OriginalJobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("OvenCostId")
|
|
.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<Guid>("ShopAccessCode")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier")
|
|
.HasDefaultValueSql("NEWID()");
|
|
|
|
b.Property<int?>("ShopWorkerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SpecialInstructions")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("StartedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Tags")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AssignedUserId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("DueDate");
|
|
|
|
b.HasIndex("JobPriorityId");
|
|
|
|
b.HasIndex("JobStatusId");
|
|
|
|
b.HasIndex("OriginalJobId");
|
|
|
|
b.HasIndex("OvenCostId");
|
|
|
|
b.HasIndex("QuoteId")
|
|
.IsUnique()
|
|
.HasFilter("[QuoteId] IS NOT NULL");
|
|
|
|
b.HasIndex("ScheduledDate");
|
|
|
|
b.HasIndex("ShopAccessCode")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_Jobs_ShopAccessCode");
|
|
|
|
b.HasIndex("ShopWorkerId");
|
|
|
|
b.HasIndex("CompanyId", "CustomerId")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_CustomerId");
|
|
|
|
b.HasIndex("CompanyId", "DueDate")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_DueDate");
|
|
|
|
b.HasIndex("CompanyId", "IsDeleted");
|
|
|
|
b.HasIndex("CompanyId", "JobNumber")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_Jobs_CompanyId_JobNumber");
|
|
|
|
b.HasIndex("CompanyId", "JobPriorityId")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_JobPriorityId");
|
|
|
|
b.HasIndex("CompanyId", "JobStatusId")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_JobStatusId");
|
|
|
|
b.HasIndex("CompanyId", "ScheduledDate")
|
|
.HasDatabaseName("IX_Jobs_CompanyId_ScheduledDate");
|
|
|
|
b.ToTable("Jobs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobChangeHistory", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ChangeDescription")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("ChangedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("ChangedByUserId")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FieldName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("NewValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("OldValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ChangedByUserId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.ToTable("JobChangeHistories");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobDailyPriority", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("ScheduledDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.ToTable("JobDailyPriorities");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("AiPredictionId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("AiTags")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CatalogItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ColorCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ColorName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Complexity")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<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>("IncludePrepCost")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsGenericItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsLaborItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSalesItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("LaborCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal?>("ManualUnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("PowderCostOverride")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("RequiresMasking")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("RequiresSandblasting")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Sku")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("SurfaceArea")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("SurfaceAreaSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TotalPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("UnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AiPredictionId");
|
|
|
|
b.HasIndex("CatalogItemId");
|
|
|
|
b.HasIndex("JobId")
|
|
.HasDatabaseName("IX_JobItems_JobId");
|
|
|
|
b.HasIndex("JobId", "IsDeleted")
|
|
.HasDatabaseName("IX_JobItems_JobId_IsDeleted");
|
|
|
|
b.ToTable("JobItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItemCoat", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal?>("ActualPowderUsedLbs")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("CoatName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ColorCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ColorName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("CoverageSqFtPerLb")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Finish")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("InventoryItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("PowderCostPerLb")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("PowderOrdered")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("PowderOrderedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("PowderOrderedByUserId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("PowderReceived")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("PowderReceivedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("PowderReceivedByUserId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("PowderReceivedLbs")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal?>("PowderToOrder")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("Sequence")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("TransferEfficiency")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("VendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("InventoryItemId");
|
|
|
|
b.HasIndex("JobItemId");
|
|
|
|
b.HasIndex("VendorId");
|
|
|
|
b.ToTable("JobItemCoats");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItemPrepService", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("EstimatedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("PrepServiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId")
|
|
.HasDatabaseName("IX_JobItemPrepServices_CompanyId");
|
|
|
|
b.HasIndex("JobItemId")
|
|
.HasDatabaseName("IX_JobItemPrepServices_JobItemId");
|
|
|
|
b.HasIndex("PrepServiceId")
|
|
.HasDatabaseName("IX_JobItemPrepServices_PrepServiceId");
|
|
|
|
b.ToTable("JobItemPrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobNote", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsImportant")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsInternal")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Note")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId", "CreatedAt")
|
|
.HasDatabaseName("IX_JobNotes_JobId_CreatedAt");
|
|
|
|
b.ToTable("JobNotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPhoto", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Caption")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ContentType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("FileName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FilePath")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<long>("FileSize")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<bool>("IsAiAnalysisPhoto")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("PhotoType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Tags")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("UploadedById")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime>("UploadedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UploadedById");
|
|
|
|
b.HasIndex("JobId", "IsDeleted", "DisplayOrder")
|
|
.HasDatabaseName("IX_JobPhotos_JobId_IsDeleted_DisplayOrder");
|
|
|
|
b.ToTable("JobPhotos");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPrepService", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("PrepServiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("PrepServiceId");
|
|
|
|
b.ToTable("JobPrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPriorityLookup", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ColorClass")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("IconClass")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSystemDefined")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("PriorityCode")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CompanyId", "PriorityCode")
|
|
.IsUnique();
|
|
|
|
b.ToTable("JobPriorityLookups");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusHistory", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("ChangedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("FromStatusId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ToStatusId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("FromStatusId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("ToStatusId");
|
|
|
|
b.ToTable("JobStatusHistory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusLookup", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ColorClass")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("IconClass")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSystemDefined")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsTerminalStatus")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsWorkInProgressStatus")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("StatusCode")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("WorkflowCategory")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CompanyId", "StatusCode")
|
|
.IsUnique();
|
|
|
|
b.ToTable("JobStatusLookups");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplate", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SpecialInstructions")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("UsageCount")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.ToTable("JobTemplates");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("CatalogItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Complexity")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("EstimatedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IncludePrepCost")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsGenericItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsLaborItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobTemplateId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal?>("ManualUnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("RequiresMasking")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("RequiresSandblasting")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("SurfaceAreaSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CatalogItemId");
|
|
|
|
b.HasIndex("JobTemplateId");
|
|
|
|
b.ToTable("JobTemplateItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemCoat", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("CoatName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ColorCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ColorName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("CoverageSqFtPerLb")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Finish")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("InventoryItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobTemplateItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("PowderCostPerLb")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("Sequence")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("TransferEfficiency")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("VendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("InventoryItemId");
|
|
|
|
b.HasIndex("JobTemplateItemId");
|
|
|
|
b.HasIndex("VendorId");
|
|
|
|
b.ToTable("JobTemplateItemCoats");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemPrepService", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("EstimatedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobTemplateItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("PrepServiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobTemplateItemId");
|
|
|
|
b.HasIndex("PrepServiceId");
|
|
|
|
b.ToTable("JobTemplateItemPrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTimeEntry", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("HoursWorked")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ShopWorkerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Stage")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("WorkDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("ShopWorkerId");
|
|
|
|
b.ToTable("JobTimeEntries");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("AssignedUserId")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("CompletedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("DowntimeHours")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("EquipmentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsRecurring")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("LaborCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("MaintenanceType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("PartsCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("PartsReplaced")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PerformedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("Priority")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("RecurrenceEndDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int?>("RecurrenceFrequency")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("RecurrenceGroupId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("RecurrenceParentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("ScheduledDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int?>("ShopWorkerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("TechnicianNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("TotalCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("WorkPerformed")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AssignedUserId");
|
|
|
|
b.HasIndex("EquipmentId");
|
|
|
|
b.HasIndex("PerformedById");
|
|
|
|
b.HasIndex("RecurrenceParentId");
|
|
|
|
b.HasIndex("ScheduledDate");
|
|
|
|
b.HasIndex("ShopWorkerId");
|
|
|
|
b.HasIndex("Status");
|
|
|
|
b.HasIndex("CompanyId", "ScheduledDate")
|
|
.HasDatabaseName("IX_MaintenanceRecords_CompanyId_ScheduledDate");
|
|
|
|
b.HasIndex("CompanyId", "Status")
|
|
.HasDatabaseName("IX_MaintenanceRecords_CompanyId_Status");
|
|
|
|
b.ToTable("MaintenanceRecords");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ManufacturerLookupPattern", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Domain")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("ManufacturerName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ProductUrlTemplate")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("SlugTransform")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ManufacturerLookupPatterns");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.NotificationLog", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Channel")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ErrorMessage")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("InvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int?>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Message")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("NotificationType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Recipient")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("RecipientName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("SentAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Subject")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("InvoiceId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("QuoteId");
|
|
|
|
b.HasIndex("CompanyId", "SentAt")
|
|
.HasDatabaseName("IX_NotificationLogs_CompanyId_SentAt");
|
|
|
|
b.HasIndex("CompanyId", "Status")
|
|
.HasDatabaseName("IX_NotificationLogs_CompanyId_Status");
|
|
|
|
b.ToTable("NotificationLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.NotificationTemplate", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Body")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("Channel")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("NotificationType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Subject")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId", "NotificationType", "Channel")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_NotificationTemplates_Company_Type_Channel");
|
|
|
|
b.ToTable("NotificationTemplates");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatch", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime?>("ActualEndTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("ActualStartTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("AiReasoningJson")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("AiSuggested")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("BatchNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("CureTemperatureF")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CycleMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("EquipmentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("EstimatedEndTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("OvenCostId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("PrimaryColorCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PrimaryColorName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("ScheduledDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("ScheduledStartTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("TotalSurfaceAreaSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("EquipmentId");
|
|
|
|
b.HasIndex("OvenCostId");
|
|
|
|
b.HasIndex("ScheduledDate", "Status");
|
|
|
|
b.ToTable("OvenBatches");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatchItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CoatPassNumber")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("JobItemCoatId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("JobItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("OvenBatchId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("SurfaceAreaContribution")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("JobItemCoatId");
|
|
|
|
b.HasIndex("JobItemId");
|
|
|
|
b.HasIndex("OvenBatchId");
|
|
|
|
b.ToTable("OvenBatchItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenCost", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("CostPerHour")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("DefaultCycleMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Label")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("nvarchar(100)");
|
|
|
|
b.Property<decimal?>("MaxLoadSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("OvenCosts");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Payment", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("DepositAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("InvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("PaymentDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("PaymentMethod")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("RecordedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Reference")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DepositAccountId");
|
|
|
|
b.HasIndex("InvoiceId")
|
|
.HasDatabaseName("IX_Payments_InvoiceId");
|
|
|
|
b.HasIndex("PaymentDate");
|
|
|
|
b.HasIndex("RecordedById");
|
|
|
|
b.HasIndex("CompanyId", "PaymentDate")
|
|
.HasDatabaseName("IX_Payments_CompanyId_PaymentDate");
|
|
|
|
b.ToTable("Payments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PowderUsageLog", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("ActualLbsUsed")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("EstimatedLbs")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int?>("InventoryItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("InventoryTransactionId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("JobItemCoatId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("JobItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("RecordedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("RecordedByUserId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("VarianceLbs")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("InventoryItemId");
|
|
|
|
b.HasIndex("InventoryTransactionId");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("JobItemCoatId");
|
|
|
|
b.HasIndex("JobItemId");
|
|
|
|
b.ToTable("PowderUsageLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PrepService", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("ServiceName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("PrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("DiscountPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("TierName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("PricingTiers");
|
|
|
|
b.HasData(
|
|
new
|
|
{
|
|
Id = 1,
|
|
CompanyId = 0,
|
|
CreatedAt = new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9199),
|
|
Description = "Standard pricing for regular customers",
|
|
DiscountPercent = 0m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Standard"
|
|
},
|
|
new
|
|
{
|
|
Id = 2,
|
|
CompanyId = 0,
|
|
CreatedAt = new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9205),
|
|
Description = "5% discount for preferred customers",
|
|
DiscountPercent = 5m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Preferred"
|
|
},
|
|
new
|
|
{
|
|
Id = 3,
|
|
CompanyId = 0,
|
|
CreatedAt = new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9206),
|
|
Description = "10% discount for premium customers",
|
|
DiscountPercent = 10m,
|
|
IsActive = true,
|
|
IsDeleted = false,
|
|
TierName = "Premium"
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrder", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("BillId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("ExpectedDeliveryDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("InternalNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("OrderDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("PoNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("ReceivedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal>("ShippingCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("SubTotal")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TotalAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("VendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("BillId");
|
|
|
|
b.HasIndex("VendorId");
|
|
|
|
b.ToTable("PurchaseOrders");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrderItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("InventoryItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("LineTotal")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("PurchaseOrderId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("QuantityOrdered")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("QuantityReceived")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("UnitCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("UnitOfMeasure")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("InventoryItemId");
|
|
|
|
b.HasIndex("PurchaseOrderId");
|
|
|
|
b.ToTable("PurchaseOrderItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ApprovalToken")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime?>("ApprovalTokenExpiresAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("ApprovalTokenUsedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("ApprovedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("ConvertedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int?>("ConvertedToJobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CustomerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CustomerPO")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DeclineReason")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DeclinedByIp")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("DepositAmountPaid")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("DepositPaymentIntentId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DepositPaymentLinkExpiresAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DepositPaymentLinkToken")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("DepositPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("DiscountAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("DiscountPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("DiscountReason")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DiscountType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("DiscountValue")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("ExpirationDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsCommercial")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsRushJob")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("ItemsSubtotal")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("OvenBatchCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("OvenBatches")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("OvenCostId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("OvenCycleMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("OverheadAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("OverheadPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("PreparedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<decimal>("ProfitMargin")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("ProfitPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
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<bool>("RequiresDeposit")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("RushFee")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("SentDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal>("ShopSuppliesAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("ShopSuppliesPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("SubTotal")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Tags")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("TaxAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TaxPercent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Terms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("Total")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ApprovalToken")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_Quotes_ApprovalToken")
|
|
.HasFilter("[ApprovalToken] IS NOT NULL");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("ExpirationDate");
|
|
|
|
b.HasIndex("OvenCostId");
|
|
|
|
b.HasIndex("PreparedById");
|
|
|
|
b.HasIndex("QuoteStatusId");
|
|
|
|
b.HasIndex("CompanyId", "ExpirationDate")
|
|
.HasDatabaseName("IX_Quotes_CompanyId_ExpirationDate");
|
|
|
|
b.HasIndex("CompanyId", "IsDeleted");
|
|
|
|
b.HasIndex("CompanyId", "QuoteNumber")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_Quotes_CompanyId_QuoteNumber");
|
|
|
|
b.HasIndex("CompanyId", "QuoteStatusId")
|
|
.HasDatabaseName("IX_Quotes_CompanyId_QuoteStatusId");
|
|
|
|
b.ToTable("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteChangeHistory", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ChangeDescription")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("ChangedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("ChangedByUserId")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FieldName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("NewValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("OldValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ChangedByUserId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("QuoteId");
|
|
|
|
b.ToTable("QuoteChangeHistories");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("AiPredictionId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("AiTags")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CatalogItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Complexity")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<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>("IsAiItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsGenericItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsLaborItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSalesItem")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal?>("ManualUnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("PowderCostOverride")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("RequiresMasking")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("RequiresSandblasting")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Sku")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("SurfaceArea")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("SurfaceAreaSqFt")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("TotalPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("UnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AiPredictionId");
|
|
|
|
b.HasIndex("CatalogItemId");
|
|
|
|
b.HasIndex("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<decimal>("TransferEfficiency")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("VendorId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId")
|
|
.HasDatabaseName("IX_QuoteItemCoats_CompanyId");
|
|
|
|
b.HasIndex("InventoryItemId")
|
|
.HasDatabaseName("IX_QuoteItemCoats_InventoryItemId");
|
|
|
|
b.HasIndex("QuoteItemId")
|
|
.HasDatabaseName("IX_QuoteItemCoats_QuoteItemId");
|
|
|
|
b.HasIndex("VendorId");
|
|
|
|
b.ToTable("QuoteItemCoats");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemPrepService", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("EstimatedMinutes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("PrepServiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("QuoteItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId")
|
|
.HasDatabaseName("IX_QuoteItemPrepServices_CompanyId");
|
|
|
|
b.HasIndex("PrepServiceId")
|
|
.HasDatabaseName("IX_QuoteItemPrepServices_PrepServiceId");
|
|
|
|
b.HasIndex("QuoteItemId")
|
|
.HasDatabaseName("IX_QuoteItemPrepServices_QuoteItemId");
|
|
|
|
b.ToTable("QuoteItemPrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuotePhoto", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Caption")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ContentType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FileName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FilePath")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<long>("FileSize")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<bool>("IsAiAnalysisPhoto")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int?>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("TempId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("UploadedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("QuoteId");
|
|
|
|
b.HasIndex("UploadedById");
|
|
|
|
b.ToTable("QuotePhotos");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuotePrepService", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("PrepServiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("QuoteId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PrepServiceId");
|
|
|
|
b.HasIndex("QuoteId");
|
|
|
|
b.ToTable("QuotePrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ColorClass")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("IconClass")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsApprovedStatus")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsConvertedStatus")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDraftStatus")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsRejectedStatus")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsSystemDefined")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("StatusCode")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("CompanyId", "StatusCode")
|
|
.IsUnique();
|
|
|
|
b.ToTable("QuoteStatusLookups");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Refund", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("CreditMemoId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("InvoiceId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("IssuedById")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime?>("IssuedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("PaymentId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Reason")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Reference")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("RefundDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("RefundMethod")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CreditMemoId");
|
|
|
|
b.HasIndex("InvoiceId");
|
|
|
|
b.HasIndex("IssuedById");
|
|
|
|
b.HasIndex("PaymentId");
|
|
|
|
b.ToTable("Refunds");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ReleaseNote", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Body")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedByUserId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("CreatedByUserName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsPublished")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime>("ReleasedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Tag")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Version")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ReleaseNotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ReworkRecord", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<decimal>("ActualReworkCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("BillingNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DefectDescription")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("DiscoveredBy")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("DiscoveredDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal>("EstimatedReworkCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsBillableToCustomer")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("JobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("JobItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Reason")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ReportedByName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("Resolution")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ResolutionNotes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("ResolvedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int?>("ReworkJobId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("ReworkType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("JobId");
|
|
|
|
b.HasIndex("JobItemId");
|
|
|
|
b.HasIndex("ReworkJobId");
|
|
|
|
b.ToTable("ReworkRecords");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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.ShopWorkerRoleCost", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("HourlyRate")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
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", "Role")
|
|
.IsUnique()
|
|
.HasDatabaseName("IX_ShopWorkerRoleCosts_CompanyId_Role");
|
|
|
|
b.ToTable("ShopWorkerRoleCosts");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.SubscriptionPlanConfig", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<bool>("AllowOnlinePayments")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("AnnualPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("MaxActiveJobs")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaxAiPhotoQuotesPerMonth")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaxCatalogItems")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaxCustomers")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaxJobPhotos")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaxQuotePhotos")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaxQuotes")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("MaxUsers")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal>("MonthlyPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("Plan")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("StripePriceIdAnnual")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("StripePriceIdMonthly")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("SubscriptionPlanConfigs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Vendor", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("AccountNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Address")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("City")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CompanyName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ContactName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Country")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("CreditLimit")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("CurrentBalance")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int?>("DefaultExpenseAccountId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DeletedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsPreferred")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("OpeningBalance")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime?>("OpeningBalanceDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("PaymentTerms")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("State")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("TaxId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UpdatedBy")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Website")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ZipCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.HasIndex("DefaultExpenseAccountId");
|
|
|
|
b.ToTable("Vendors");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
|
{
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
|
{
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Account", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "ParentAccount")
|
|
.WithMany("SubAccounts")
|
|
.HasForeignKey("ParentAccountId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("ParentAccount");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AnnouncementDismissal", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Announcement", "Announcement")
|
|
.WithMany("Dismissals")
|
|
.HasForeignKey("AnnouncementId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Announcement");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", "Company")
|
|
.WithMany("Users")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Appointment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.AppointmentStatusLookup", "AppointmentStatus")
|
|
.WithMany("Appointments")
|
|
.HasForeignKey("AppointmentStatusId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.AppointmentTypeLookup", "AppointmentType")
|
|
.WithMany("Appointments")
|
|
.HasForeignKey("AppointmentTypeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AssignedUser")
|
|
.WithMany()
|
|
.HasForeignKey("AssignedUserId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId");
|
|
|
|
b.Navigation("AppointmentStatus");
|
|
|
|
b.Navigation("AppointmentType");
|
|
|
|
b.Navigation("AssignedUser");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Bill", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "APAccount")
|
|
.WithMany("Bills")
|
|
.HasForeignKey("APAccountId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
|
|
.WithMany("Bills")
|
|
.HasForeignKey("VendorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("APAccount");
|
|
|
|
b.Navigation("Vendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BillLineItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "Account")
|
|
.WithMany("BillLineItems")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Bill", "Bill")
|
|
.WithMany("LineItems")
|
|
.HasForeignKey("BillId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId");
|
|
|
|
b.Navigation("Account");
|
|
|
|
b.Navigation("Bill");
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BillPayment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "BankAccount")
|
|
.WithMany("BillPayments")
|
|
.HasForeignKey("BankAccountId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Bill", "Bill")
|
|
.WithMany("Payments")
|
|
.HasForeignKey("BillId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
|
|
.WithMany("BillPayments")
|
|
.HasForeignKey("VendorId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("BankAccount");
|
|
|
|
b.Navigation("Bill");
|
|
|
|
b.Navigation("Vendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BugReportAttachment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.BugReport", "BugReport")
|
|
.WithMany("Attachments")
|
|
.HasForeignKey("BugReportId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("BugReport");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogCategory", "ParentCategory")
|
|
.WithMany("SubCategories")
|
|
.HasForeignKey("ParentCategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("ParentCategory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogCategory", "Category")
|
|
.WithMany("Items")
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "CogsAccount")
|
|
.WithMany()
|
|
.HasForeignKey("CogsAccountId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryItemId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "RevenueAccount")
|
|
.WithMany()
|
|
.HasForeignKey("RevenueAccountId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("CogsAccount");
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("RevenueAccount");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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.CreditMemo", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "IssuedBy")
|
|
.WithMany()
|
|
.HasForeignKey("IssuedById");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "OriginalInvoice")
|
|
.WithMany()
|
|
.HasForeignKey("OriginalInvoiceId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ReworkRecord", "ReworkRecord")
|
|
.WithMany()
|
|
.HasForeignKey("ReworkRecordId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("IssuedBy");
|
|
|
|
b.Navigation("OriginalInvoice");
|
|
|
|
b.Navigation("ReworkRecord");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemoApplication", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AppliedBy")
|
|
.WithMany()
|
|
.HasForeignKey("AppliedById");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.CreditMemo", "CreditMemo")
|
|
.WithMany("Applications")
|
|
.HasForeignKey("CreditMemoId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
|
|
.WithMany("CreditApplications")
|
|
.HasForeignKey("InvoiceId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AppliedBy");
|
|
|
|
b.Navigation("CreditMemo");
|
|
|
|
b.Navigation("Invoice");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.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.Deposit", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "AppliedToInvoice")
|
|
.WithMany()
|
|
.HasForeignKey("AppliedToInvoiceId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany()
|
|
.HasForeignKey("QuoteId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "RecordedBy")
|
|
.WithMany()
|
|
.HasForeignKey("RecordedById");
|
|
|
|
b.Navigation("AppliedToInvoice");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("Quote");
|
|
|
|
b.Navigation("RecordedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Equipment")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Expense", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "ExpenseAccount")
|
|
.WithMany("Expenses")
|
|
.HasForeignKey("ExpenseAccountId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "PaymentAccount")
|
|
.WithMany("ExpensePaymentAccounts")
|
|
.HasForeignKey("PaymentAccountId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
|
|
.WithMany("Expenses")
|
|
.HasForeignKey("VendorId");
|
|
|
|
b.Navigation("ExpenseAccount");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("PaymentAccount");
|
|
|
|
b.Navigation("Vendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificate", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "IssuedBy")
|
|
.WithMany()
|
|
.HasForeignKey("IssuedById");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "PurchasingCustomer")
|
|
.WithMany()
|
|
.HasForeignKey("PurchasingCustomerId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "RecipientCustomer")
|
|
.WithMany()
|
|
.HasForeignKey("RecipientCustomerId");
|
|
|
|
b.Navigation("IssuedBy");
|
|
|
|
b.Navigation("PurchasingCustomer");
|
|
|
|
b.Navigation("RecipientCustomer");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificateRedemption", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.GiftCertificate", "GiftCertificate")
|
|
.WithMany("Redemptions")
|
|
.HasForeignKey("GiftCertificateId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
|
|
.WithMany("GiftCertificateRedemptions")
|
|
.HasForeignKey("InvoiceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "RedeemedBy")
|
|
.WithMany()
|
|
.HasForeignKey("RedeemedById");
|
|
|
|
b.Navigation("GiftCertificate");
|
|
|
|
b.Navigation("Invoice");
|
|
|
|
b.Navigation("RedeemedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "CogsAccount")
|
|
.WithMany()
|
|
.HasForeignKey("CogsAccountId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("InventoryItems")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "InventoryAccount")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryAccountId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryCategoryLookup", "InventoryCategory")
|
|
.WithMany("InventoryItems")
|
|
.HasForeignKey("InventoryCategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Vendor", "PrimaryVendor")
|
|
.WithMany("InventoryItems")
|
|
.HasForeignKey("PrimaryVendorId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("CogsAccount");
|
|
|
|
b.Navigation("InventoryAccount");
|
|
|
|
b.Navigation("InventoryCategory");
|
|
|
|
b.Navigation("PrimaryVendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryTransaction", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("InventoryItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PurchaseOrder", "PurchaseOrder")
|
|
.WithMany()
|
|
.HasForeignKey("PurchaseOrderId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("PurchaseOrder");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Invoice", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("Invoices")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithOne("Invoice")
|
|
.HasForeignKey("PowderCoating.Core.Entities.Invoice", "JobId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PreparedBy")
|
|
.WithMany()
|
|
.HasForeignKey("PreparedById")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "SalesTaxAccount")
|
|
.WithMany()
|
|
.HasForeignKey("SalesTaxAccountId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("PreparedBy");
|
|
|
|
b.Navigation("SalesTaxAccount");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InvoiceItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
|
|
.WithMany()
|
|
.HasForeignKey("CatalogItemId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.GiftCertificate", "GeneratedGiftCertificate")
|
|
.WithMany()
|
|
.HasForeignKey("GeneratedGiftCertificateId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
|
|
.WithMany("InvoiceItems")
|
|
.HasForeignKey("InvoiceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "RevenueAccount")
|
|
.WithMany()
|
|
.HasForeignKey("RevenueAccountId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItem", "SourceJobItem")
|
|
.WithMany()
|
|
.HasForeignKey("SourceJobItemId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("CatalogItem");
|
|
|
|
b.Navigation("GeneratedGiftCertificate");
|
|
|
|
b.Navigation("Invoice");
|
|
|
|
b.Navigation("RevenueAccount");
|
|
|
|
b.Navigation("SourceJobItem");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AssignedUser")
|
|
.WithMany()
|
|
.HasForeignKey("AssignedUserId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobPriorityLookup", "JobPriority")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("JobPriorityId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "JobStatus")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("JobStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "OriginalJob")
|
|
.WithMany()
|
|
.HasForeignKey("OriginalJobId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.OvenCost", "OvenCost")
|
|
.WithMany("Jobs")
|
|
.HasForeignKey("OvenCostId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithOne("ConvertedToJob")
|
|
.HasForeignKey("PowderCoating.Core.Entities.Job", "QuoteId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ShopWorker", null)
|
|
.WithMany("AssignedJobs")
|
|
.HasForeignKey("ShopWorkerId");
|
|
|
|
b.Navigation("AssignedUser");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("JobPriority");
|
|
|
|
b.Navigation("JobStatus");
|
|
|
|
b.Navigation("OriginalJob");
|
|
|
|
b.Navigation("OvenCost");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobChangeHistory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "ChangedBy")
|
|
.WithMany()
|
|
.HasForeignKey("ChangedByUserId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("ChangedBy");
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobDailyPriority", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.AiItemPrediction", "AiPrediction")
|
|
.WithMany()
|
|
.HasForeignKey("AiPredictionId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
|
|
.WithMany()
|
|
.HasForeignKey("CatalogItemId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("JobItems")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AiPrediction");
|
|
|
|
b.Navigation("CatalogItem");
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItemCoat", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryItemId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
|
|
.WithMany("Coats")
|
|
.HasForeignKey("JobItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
|
|
.WithMany()
|
|
.HasForeignKey("VendorId");
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("JobItem");
|
|
|
|
b.Navigation("Vendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItemPrepService", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
|
|
.WithMany("PrepServices")
|
|
.HasForeignKey("JobItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
|
|
.WithMany()
|
|
.HasForeignKey("PrepServiceId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("JobItem");
|
|
|
|
b.Navigation("PrepService");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobNote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("Notes")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPhoto", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("Photos")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "UploadedBy")
|
|
.WithMany()
|
|
.HasForeignKey("UploadedById")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("UploadedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPrepService", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("JobPrepServices")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
|
|
.WithMany()
|
|
.HasForeignKey("PrepServiceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("PrepService");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPriorityLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusHistory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "FromStatus")
|
|
.WithMany("FromStatusHistory")
|
|
.HasForeignKey("FromStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("StatusHistory")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobStatusLookup", "ToStatus")
|
|
.WithMany("ToStatusHistory")
|
|
.HasForeignKey("ToStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("FromStatus");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("ToStatus");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplate", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId");
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
|
|
.WithMany()
|
|
.HasForeignKey("CatalogItemId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobTemplate", "JobTemplate")
|
|
.WithMany("Items")
|
|
.HasForeignKey("JobTemplateId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("CatalogItem");
|
|
|
|
b.Navigation("JobTemplate");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemCoat", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryItemId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobTemplateItem", "JobTemplateItem")
|
|
.WithMany("Coats")
|
|
.HasForeignKey("JobTemplateItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
|
|
.WithMany()
|
|
.HasForeignKey("VendorId");
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("JobTemplateItem");
|
|
|
|
b.Navigation("Vendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItemPrepService", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.JobTemplateItem", "JobTemplateItem")
|
|
.WithMany("PrepServices")
|
|
.HasForeignKey("JobTemplateItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
|
|
.WithMany()
|
|
.HasForeignKey("PrepServiceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("JobTemplateItem");
|
|
|
|
b.Navigation("PrepService");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTimeEntry", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("TimeEntries")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ShopWorker", "Worker")
|
|
.WithMany("TimeEntries")
|
|
.HasForeignKey("ShopWorkerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("Worker");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.MaintenanceRecord", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "AssignedUser")
|
|
.WithMany()
|
|
.HasForeignKey("AssignedUserId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Equipment", "Equipment")
|
|
.WithMany("MaintenanceRecords")
|
|
.HasForeignKey("EquipmentId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PerformedBy")
|
|
.WithMany("PerformedMaintenances")
|
|
.HasForeignKey("PerformedById")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.MaintenanceRecord", "RecurrenceParent")
|
|
.WithMany()
|
|
.HasForeignKey("RecurrenceParentId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ShopWorker", null)
|
|
.WithMany("AssignedMaintenanceTasks")
|
|
.HasForeignKey("ShopWorkerId");
|
|
|
|
b.Navigation("AssignedUser");
|
|
|
|
b.Navigation("Equipment");
|
|
|
|
b.Navigation("PerformedBy");
|
|
|
|
b.Navigation("RecurrenceParent");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.NotificationLog", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("NotificationLogs")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
|
|
.WithMany()
|
|
.HasForeignKey("InvoiceId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany()
|
|
.HasForeignKey("QuoteId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Invoice");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.NotificationTemplate", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", "Company")
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatch", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Equipment", "Equipment")
|
|
.WithMany("OvenBatches")
|
|
.HasForeignKey("EquipmentId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.OvenCost", "OvenCost")
|
|
.WithMany()
|
|
.HasForeignKey("OvenCostId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("Equipment");
|
|
|
|
b.Navigation("OvenCost");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatchItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItemCoat", "JobItemCoat")
|
|
.WithMany()
|
|
.HasForeignKey("JobItemCoatId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
|
|
.WithMany()
|
|
.HasForeignKey("JobItemId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.OvenBatch", "Batch")
|
|
.WithMany("Items")
|
|
.HasForeignKey("OvenBatchId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Batch");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("JobItem");
|
|
|
|
b.Navigation("JobItemCoat");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenCost", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", "Company")
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Payment", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "DepositAccount")
|
|
.WithMany()
|
|
.HasForeignKey("DepositAccountId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
|
|
.WithMany("Payments")
|
|
.HasForeignKey("InvoiceId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "RecordedBy")
|
|
.WithMany()
|
|
.HasForeignKey("RecordedById")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("DepositAccount");
|
|
|
|
b.Navigation("Invoice");
|
|
|
|
b.Navigation("RecordedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PowderUsageLog", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryItemId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryTransaction", "InventoryTransaction")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryTransactionId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany()
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItemCoat", "JobItemCoat")
|
|
.WithMany()
|
|
.HasForeignKey("JobItemCoatId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
|
|
.WithMany()
|
|
.HasForeignKey("JobItemId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("InventoryTransaction");
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("JobItem");
|
|
|
|
b.Navigation("JobItemCoat");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("PricingTiers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrder", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Bill", "Bill")
|
|
.WithMany()
|
|
.HasForeignKey("BillId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Vendor", "Vendor")
|
|
.WithMany()
|
|
.HasForeignKey("VendorId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Bill");
|
|
|
|
b.Navigation("Vendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrderItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.InventoryItem", "InventoryItem")
|
|
.WithMany()
|
|
.HasForeignKey("InventoryItemId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PurchaseOrder", "PurchaseOrder")
|
|
.WithMany("Items")
|
|
.HasForeignKey("PurchaseOrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("PurchaseOrder");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Customer", "Customer")
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.OvenCost", "OvenCost")
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("OvenCostId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "PreparedBy")
|
|
.WithMany("PreparedQuotes")
|
|
.HasForeignKey("PreparedById")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.QuoteStatusLookup", "QuoteStatus")
|
|
.WithMany("Quotes")
|
|
.HasForeignKey("QuoteStatusId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("OvenCost");
|
|
|
|
b.Navigation("PreparedBy");
|
|
|
|
b.Navigation("QuoteStatus");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteChangeHistory", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "ChangedBy")
|
|
.WithMany()
|
|
.HasForeignKey("ChangedByUserId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany()
|
|
.HasForeignKey("QuoteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("ChangedBy");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.AiItemPrediction", "AiPrediction")
|
|
.WithMany()
|
|
.HasForeignKey("AiPredictionId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.CatalogItem", "CatalogItem")
|
|
.WithMany()
|
|
.HasForeignKey("CatalogItemId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany("QuoteItems")
|
|
.HasForeignKey("QuoteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AiPrediction");
|
|
|
|
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.Vendor", "Vendor")
|
|
.WithMany()
|
|
.HasForeignKey("VendorId");
|
|
|
|
b.Navigation("InventoryItem");
|
|
|
|
b.Navigation("QuoteItem");
|
|
|
|
b.Navigation("Vendor");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItemPrepService", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
|
|
.WithMany()
|
|
.HasForeignKey("PrepServiceId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.QuoteItem", "QuoteItem")
|
|
.WithMany("PrepServices")
|
|
.HasForeignKey("QuoteItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("PrepService");
|
|
|
|
b.Navigation("QuoteItem");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuotePhoto", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany("QuotePhotos")
|
|
.HasForeignKey("QuoteId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "UploadedBy")
|
|
.WithMany()
|
|
.HasForeignKey("UploadedById");
|
|
|
|
b.Navigation("Quote");
|
|
|
|
b.Navigation("UploadedBy");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuotePrepService", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.PrepService", "PrepService")
|
|
.WithMany()
|
|
.HasForeignKey("PrepServiceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Quote", "Quote")
|
|
.WithMany("QuotePrepServices")
|
|
.HasForeignKey("QuoteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("PrepService");
|
|
|
|
b.Navigation("Quote");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Refund", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.CreditMemo", "CreditMemo")
|
|
.WithMany()
|
|
.HasForeignKey("CreditMemoId");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Invoice", "Invoice")
|
|
.WithMany("Refunds")
|
|
.HasForeignKey("InvoiceId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.ApplicationUser", "IssuedBy")
|
|
.WithMany()
|
|
.HasForeignKey("IssuedById");
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Payment", "Payment")
|
|
.WithMany()
|
|
.HasForeignKey("PaymentId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.Navigation("CreditMemo");
|
|
|
|
b.Navigation("Invoice");
|
|
|
|
b.Navigation("IssuedBy");
|
|
|
|
b.Navigation("Payment");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ReworkRecord", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "Job")
|
|
.WithMany("ReworkRecords")
|
|
.HasForeignKey("JobId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.JobItem", "JobItem")
|
|
.WithMany()
|
|
.HasForeignKey("JobItemId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Job", "ReworkJob")
|
|
.WithMany()
|
|
.HasForeignKey("ReworkJobId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.Navigation("Job");
|
|
|
|
b.Navigation("JobItem");
|
|
|
|
b.Navigation("ReworkJob");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("ShopWorkers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Vendor", b =>
|
|
{
|
|
b.HasOne("PowderCoating.Core.Entities.Company", null)
|
|
.WithMany("Vendors")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PowderCoating.Core.Entities.Account", "DefaultExpenseAccount")
|
|
.WithMany()
|
|
.HasForeignKey("DefaultExpenseAccountId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("DefaultExpenseAccount");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Account", b =>
|
|
{
|
|
b.Navigation("BillLineItems");
|
|
|
|
b.Navigation("BillPayments");
|
|
|
|
b.Navigation("Bills");
|
|
|
|
b.Navigation("ExpensePaymentAccounts");
|
|
|
|
b.Navigation("Expenses");
|
|
|
|
b.Navigation("SubAccounts");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Announcement", b =>
|
|
{
|
|
b.Navigation("Dismissals");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ApplicationUser", b =>
|
|
{
|
|
b.Navigation("PerformedMaintenances");
|
|
|
|
b.Navigation("PreparedQuotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentStatusLookup", b =>
|
|
{
|
|
b.Navigation("Appointments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.AppointmentTypeLookup", b =>
|
|
{
|
|
b.Navigation("Appointments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Bill", b =>
|
|
{
|
|
b.Navigation("LineItems");
|
|
|
|
b.Navigation("Payments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.BugReport", b =>
|
|
{
|
|
b.Navigation("Attachments");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CatalogCategory", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
|
|
b.Navigation("SubCategories");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Company", b =>
|
|
{
|
|
b.Navigation("Customers");
|
|
|
|
b.Navigation("Equipment");
|
|
|
|
b.Navigation("InventoryItems");
|
|
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("OperatingCosts");
|
|
|
|
b.Navigation("Preferences");
|
|
|
|
b.Navigation("PricingTiers");
|
|
|
|
b.Navigation("Quotes");
|
|
|
|
b.Navigation("ShopWorkers");
|
|
|
|
b.Navigation("Users");
|
|
|
|
b.Navigation("Vendors");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.CreditMemo", b =>
|
|
{
|
|
b.Navigation("Applications");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Customer", b =>
|
|
{
|
|
b.Navigation("CustomerNotes");
|
|
|
|
b.Navigation("Invoices");
|
|
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("NotificationLogs");
|
|
|
|
b.Navigation("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Equipment", b =>
|
|
{
|
|
b.Navigation("MaintenanceRecords");
|
|
|
|
b.Navigation("OvenBatches");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.GiftCertificate", b =>
|
|
{
|
|
b.Navigation("Redemptions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryCategoryLookup", b =>
|
|
{
|
|
b.Navigation("InventoryItems");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.InventoryItem", b =>
|
|
{
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Invoice", b =>
|
|
{
|
|
b.Navigation("CreditApplications");
|
|
|
|
b.Navigation("GiftCertificateRedemptions");
|
|
|
|
b.Navigation("InvoiceItems");
|
|
|
|
b.Navigation("Payments");
|
|
|
|
b.Navigation("Refunds");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Job", b =>
|
|
{
|
|
b.Navigation("Invoice");
|
|
|
|
b.Navigation("JobItems");
|
|
|
|
b.Navigation("JobPrepServices");
|
|
|
|
b.Navigation("Notes");
|
|
|
|
b.Navigation("Photos");
|
|
|
|
b.Navigation("ReworkRecords");
|
|
|
|
b.Navigation("StatusHistory");
|
|
|
|
b.Navigation("TimeEntries");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobItem", b =>
|
|
{
|
|
b.Navigation("Coats");
|
|
|
|
b.Navigation("PrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobPriorityLookup", b =>
|
|
{
|
|
b.Navigation("Jobs");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobStatusLookup", b =>
|
|
{
|
|
b.Navigation("FromStatusHistory");
|
|
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("ToStatusHistory");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplate", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.JobTemplateItem", b =>
|
|
{
|
|
b.Navigation("Coats");
|
|
|
|
b.Navigation("PrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenBatch", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.OvenCost", b =>
|
|
{
|
|
b.Navigation("Jobs");
|
|
|
|
b.Navigation("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PricingTier", b =>
|
|
{
|
|
b.Navigation("Customers");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.PurchaseOrder", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Quote", b =>
|
|
{
|
|
b.Navigation("ConvertedToJob");
|
|
|
|
b.Navigation("QuoteItems");
|
|
|
|
b.Navigation("QuotePhotos");
|
|
|
|
b.Navigation("QuotePrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteItem", b =>
|
|
{
|
|
b.Navigation("Coats");
|
|
|
|
b.Navigation("PrepServices");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.QuoteStatusLookup", b =>
|
|
{
|
|
b.Navigation("Quotes");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.ShopWorker", b =>
|
|
{
|
|
b.Navigation("AssignedJobs");
|
|
|
|
b.Navigation("AssignedMaintenanceTasks");
|
|
|
|
b.Navigation("TimeEntries");
|
|
});
|
|
|
|
modelBuilder.Entity("PowderCoating.Core.Entities.Vendor", b =>
|
|
{
|
|
b.Navigation("BillPayments");
|
|
|
|
b.Navigation("Bills");
|
|
|
|
b.Navigation("Expenses");
|
|
|
|
b.Navigation("InventoryItems");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|