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

#nullable disable

namespace JobTrackerApi.Migrations
{
    [DbContext(typeof(JobTrackerContext))]
    [Migration("20260311103000_AddCompanyCrmAndChecklistAndIndexes")]
    partial class AddCompanyCrmAndChecklistAndIndexes
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "7.0.17");

            modelBuilder.Entity("JobTrackerApi.Models.Attachment", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

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

                    b.Property<string>("FilePath")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("FileType")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<long>("FileSize")
                        .HasColumnType("INTEGER");

                    b.Property<int>("JobApplicationId")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime>("UploadDate")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("JobApplicationId");

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

            modelBuilder.Entity("JobTrackerApi.Models.Company", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("LastContactedAt")
                        .HasColumnType("TEXT");

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

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

                    b.Property<DateTime?>("NextContactAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("PipelineStage")
                        .HasColumnType("TEXT");

                    b.Property<string>("RecruiterEmail")
                        .HasColumnType("TEXT");

                    b.Property<string>("RecruiterLinkedIn")
                        .HasColumnType("TEXT");

                    b.Property<string>("RecruiterName")
                        .HasColumnType("TEXT");

                    b.Property<string>("Source")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

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

            modelBuilder.Entity("JobTrackerApi.Models.Correspondence", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("Date")
                        .HasColumnType("TEXT");

                    b.Property<string>("From")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<int>("JobApplicationId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("JobApplicationId");

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

            modelBuilder.Entity("JobTrackerApi.Models.JobApplication", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

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

                    b.Property<string>("CoverLetterText")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("DateApplied")
                        .HasColumnType("TEXT");

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

                    b.Property<DateTime?>("FeedbackRequestedAt")
                        .HasColumnType("TEXT");

                    b.Property<DateTime?>("FollowUpAt")
                        .HasColumnType("TEXT");

                    b.Property<bool>("HasCoverLetter")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("HasOtherAttachment")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("HasPortfolio")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("HasResume")
                        .HasColumnType("INTEGER");

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

                    b.Property<string>("JobTitle")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("JobUrl")
                        .HasColumnType("TEXT");

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

                    b.Property<string>("NextAction")
                        .HasColumnType("TEXT");

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

                    b.Property<DateTime?>("ResponseDate")
                        .HasColumnType("TEXT");

                    b.Property<bool>("ResponseReceived")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Salary")
                        .HasColumnType("TEXT");

                    b.Property<string>("Status")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT")
                        .HasDefaultValue("Applied");

                    b.HasKey("Id");

                    b.HasIndex("CompanyId");

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

            modelBuilder.Entity("JobTrackerApi.Models.JobEvent", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<DateTime>("At")
                        .HasColumnType("TEXT");

                    b.Property<int>("JobApplicationId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("NewValue")
                        .HasColumnType("TEXT");

                    b.Property<string>("Note")
                        .HasColumnType("TEXT");

                    b.Property<string>("OldValue")
                        .HasColumnType("TEXT");

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

                    b.HasKey("Id");

                    b.HasIndex("JobApplicationId");

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

            modelBuilder.Entity("JobTrackerApi.Models.RuleSettings", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("INTEGER");

                    b.Property<int>("AppliedFollowUpDays")
                        .HasColumnType("INTEGER");

                    b.Property<int>("AppliedGhostDays")
                        .HasColumnType("INTEGER");

                    b.Property<int>("FeedbackFollowUpDays")
                        .HasColumnType("INTEGER");

                    b.Property<int>("FeedbackGhostDays")
                        .HasColumnType("INTEGER");

                    b.Property<int>("OfferFollowUpDays")
                        .HasColumnType("INTEGER");

                    b.Property<int>("OfferGhostDays")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.ToTable("RuleSettings");

                    b.HasData(new
                    {
                        Id = 1,
                        AppliedFollowUpDays = 14,
                        AppliedGhostDays = 30,
                        OfferFollowUpDays = 7,
                        OfferGhostDays = 14,
                        FeedbackFollowUpDays = 7,
                        FeedbackGhostDays = 14
                    });
                });

            modelBuilder.Entity("JobTrackerApi.Models.Attachment", b =>
                {
                    b.HasOne("JobTrackerApi.Models.JobApplication", "JobApplication")
                        .WithMany("Attachments")
                        .HasForeignKey("JobApplicationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("JobApplication");
                });

            modelBuilder.Entity("JobTrackerApi.Models.Correspondence", b =>
                {
                    b.HasOne("JobTrackerApi.Models.JobApplication", "JobApplication")
                        .WithMany("Messages")
                        .HasForeignKey("JobApplicationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("JobApplication");
                });

            modelBuilder.Entity("JobTrackerApi.Models.JobApplication", b =>
                {
                    b.HasOne("JobTrackerApi.Models.Company", "Company")
                        .WithMany("Jobs")
                        .HasForeignKey("CompanyId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Company");
                });

            modelBuilder.Entity("JobTrackerApi.Models.JobEvent", b =>
                {
                    b.HasOne("JobTrackerApi.Models.JobApplication", "JobApplication")
                        .WithMany("Events")
                        .HasForeignKey("JobApplicationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("JobApplication");
                });

            modelBuilder.Entity("JobTrackerApi.Models.Company", b =>
                {
                    b.Navigation("Jobs");
                });

            modelBuilder.Entity("JobTrackerApi.Models.JobApplication", b =>
                {
                    b.Navigation("Attachments");

                    b.Navigation("Events");

                    b.Navigation("Messages");
                });
#pragma warning restore 612, 618
        }
    }
}

