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

#nullable disable

namespace ProfessionalProfile.Migrations
{
    [DbContext(typeof(DataContext))]
    partial class DataContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.4")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("ProfessionalProfile.Domain.Answer", b =>
                {
                    b.Property<int>("answerId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

                    b.HasKey("answerId");

                    b.HasIndex("questionId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentResult", b =>
                {
                    b.Property<int>("assesmentResultId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

                    b.HasKey("assesmentResultId");

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

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

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

            modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
                {
                    b.Property<int>("assessmentTestId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

                    b.HasKey("assessmentTestId");

                    b.HasIndex("skillid");

                    b.HasIndex("userId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
                {
                    b.Property<int>("bcId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

                    b.HasKey("bcId");

                    b.HasIndex("userId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Certificate", b =>
                {
                    b.Property<int>("certificateId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

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

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

                    b.HasKey("certificateId");

                    b.HasIndex("userId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Education", b =>
                {
                    b.Property<int>("educationId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

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

                    b.HasKey("educationId");

                    b.HasIndex("userId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Endorsement", b =>
                {
                    b.Property<int>("endorsementId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

                    b.HasKey("endorsementId");

                    b.HasIndex("endorserId");

                    b.HasIndex("recipientid");

                    b.HasIndex("skillId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Notification", b =>
                {
                    b.Property<int>("notificationId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

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

                    b.HasKey("notificationId");

                    b.HasIndex("userId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Privacy", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Project", b =>
                {
                    b.Property<int>("projectId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

                    b.HasKey("projectId");

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

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Question", b =>
                {
                    b.Property<int>("questionId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

                    b.HasKey("questionId");

                    b.HasIndex("assesmentTestId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
                {
                    b.Property<int>("skillId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

                    b.HasKey("skillId");

                    b.HasIndex("BusinessCardbcId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.User", b =>
                {
                    b.Property<int>("userId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("userId");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Volunteering", b =>
                {
                    b.Property<int>("volunteeringId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

                    b.HasKey("volunteeringId");

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

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

            modelBuilder.Entity("ProfessionalProfile.Domain.WorkExperience", b =>
                {
                    b.Property<int>("workId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

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

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

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

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

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

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

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

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

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

                    b.HasKey("workId");

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

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Answer", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.Question", "Question")
                        .WithMany()
                        .HasForeignKey("questionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentResult", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.AssessmentTest", "AssessmentTest")
                        .WithOne("AssessmentResult")
                        .HasForeignKey("ProfessionalProfile.Domain.AssessmentResult", "assesmentTestId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithOne("AssessmentResult")
                        .HasForeignKey("ProfessionalProfile.Domain.AssessmentResult", "userId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("AssessmentTest");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.Skill", "Skill")
                        .WithMany()
                        .HasForeignKey("skillid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithMany()
                        .HasForeignKey("userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Skill");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithMany()
                        .HasForeignKey("userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Certificate", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithMany()
                        .HasForeignKey("userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Education", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithMany()
                        .HasForeignKey("userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Endorsement", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "Endorser")
                        .WithMany()
                        .HasForeignKey("endorserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("ProfessionalProfile.Domain.User", "Recipient")
                        .WithMany()
                        .HasForeignKey("recipientid")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("ProfessionalProfile.Domain.Skill", null)
                        .WithMany("endorsements")
                        .HasForeignKey("skillId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Endorser");

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Notification", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithMany("Notifications")
                        .HasForeignKey("userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Privacy", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithOne("Privacy")
                        .HasForeignKey("ProfessionalProfile.Domain.Privacy", "userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Project", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithOne("Project")
                        .HasForeignKey("ProfessionalProfile.Domain.Project", "userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Question", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.AssessmentTest", "AssessmentTest")
                        .WithMany()
                        .HasForeignKey("assesmentTestId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.BusinessCard", null)
                        .WithMany("keySkills")
                        .HasForeignKey("BusinessCardbcId");
                });

            modelBuilder.Entity("ProfessionalProfile.Domain.Volunteering", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithOne("Volunteering")
                        .HasForeignKey("ProfessionalProfile.Domain.Volunteering", "userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.WorkExperience", b =>
                {
                    b.HasOne("ProfessionalProfile.Domain.User", "User")
                        .WithOne("WorkExperience")
                        .HasForeignKey("ProfessionalProfile.Domain.WorkExperience", "userId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("ProfessionalProfile.Domain.AssessmentTest", b =>
                {
                    b.Navigation("AssessmentResult")
                        .IsRequired();
                });

            modelBuilder.Entity("ProfessionalProfile.Domain.BusinessCard", b =>
                {
                    b.Navigation("keySkills");
                });

            modelBuilder.Entity("ProfessionalProfile.Domain.Skill", b =>
                {
                    b.Navigation("endorsements");
                });

            modelBuilder.Entity("ProfessionalProfile.Domain.User", b =>
                {
                    b.Navigation("AssessmentResult");

                    b.Navigation("Notifications");

                    b.Navigation("Privacy");

                    b.Navigation("Project");

                    b.Navigation("Volunteering");

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