//
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using vendorApproverBackend.Data;
#nullable disable
namespace vendorApproverBackend.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20251017142714_AddUserProfileAttributes")]
partial class AddUserProfileAttributes
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("ApplicationCategoryUser", b =>
{
b.Property("CategoriesId")
.HasColumnType("bigint");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("CategoriesId", "UserId");
b.HasIndex("UserId");
b.ToTable("UserApplicationCategories", (string)null);
});
modelBuilder.Entity("AssessmentReport", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedById")
.HasColumnType("bigint");
b.Property("Grade")
.HasColumnType("text");
b.Property("PrequalificationRequestId")
.HasColumnType("bigint");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("TotalMarks")
.HasColumnType("double precision");
b.Property("passed")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("PrequalificationRequestId")
.IsUnique();
b.ToTable("AssessmentReports");
});
modelBuilder.Entity("DegreeUser", b =>
{
b.Property("DegreesId")
.HasColumnType("bigint");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("DegreesId", "UserId");
b.HasIndex("UserId");
b.ToTable("UserDegrees", (string)null);
});
modelBuilder.Entity("EmployeeCertificationUser", b =>
{
b.Property("CertificationsId")
.HasColumnType("bigint");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("CertificationsId", "UserId");
b.HasIndex("UserId");
b.ToTable("UserCertifications", (string)null);
});
modelBuilder.Entity("PrequalificationRequestUser", b =>
{
b.Property("InspectedPrequalificationRequestsId")
.HasColumnType("bigint");
b.Property("InspectorsId")
.HasColumnType("bigint");
b.HasKey("InspectedPrequalificationRequestsId", "InspectorsId");
b.HasIndex("InspectorsId");
b.ToTable("PqRequestInspector", (string)null);
});
modelBuilder.Entity("UserWorkExperience", b =>
{
b.Property("UserId")
.HasColumnType("bigint");
b.Property("WorkExperiencesId")
.HasColumnType("bigint");
b.HasKey("UserId", "WorkExperiencesId");
b.HasIndex("WorkExperiencesId");
b.ToTable("UserWorkExperiences", (string)null);
});
modelBuilder.Entity("vendorApproverBackend.Entities.ApplicationCategory", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("NameAr")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("ApplicationCategories");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Category", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ApplicationCategoryId")
.HasColumnType("bigint");
b.Property("Label")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("LabelAr")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("ApplicationCategoryId");
b.ToTable("Categories");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Certification", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CertificationNumber")
.IsRequired()
.HasColumnType("text")
.HasColumnName("certification_number");
b.Property("CertificationType")
.IsRequired()
.HasColumnType("text")
.HasColumnName("certification_type");
b.Property("ExpiryDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("expiry_date");
b.Property("IssueDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("issue_date");
b.Property("PrequalificationRequestId")
.HasColumnType("bigint")
.HasColumnName("prequalification_request_id");
b.Property("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property("SupplierId")
.HasColumnType("bigint")
.HasColumnName("supplier_id");
b.Property("SupplierName")
.IsRequired()
.HasColumnType("text")
.HasColumnName("supplier_name");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("VerifiedById")
.HasColumnType("bigint")
.HasColumnName("verified_by_user_id");
b.HasKey("Id");
b.HasIndex("PrequalificationRequestId")
.IsUnique();
b.HasIndex("VerifiedById");
b.ToTable("certifications");
});
modelBuilder.Entity("vendorApproverBackend.Entities.CertificationPack", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("Price")
.HasColumnType("double precision")
.HasColumnName("price");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("CertificationPacks");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Degree", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("FileId")
.HasColumnType("bigint")
.HasColumnName("file_id");
b.Property("Institution")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("Year")
.HasColumnType("integer")
.HasColumnName("completion_year");
b.HasKey("Id");
b.ToTable("Degrees");
});
modelBuilder.Entity("vendorApproverBackend.Entities.EmployeeApplication", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.PrimitiveCollection>("CertificationIds")
.IsRequired()
.HasColumnType("bigint[]")
.HasColumnName("certification_ids");
b.Property("Experience")
.HasColumnType("integer")
.HasColumnName("experience");
b.Property("Qualifications")
.IsRequired()
.HasColumnType("text")
.HasColumnName("qualifications");
b.Property("Reason")
.HasColumnType("text")
.HasColumnName("reason");
b.Property("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property("SubmissionDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("submission_date");
b.Property("Type")
.HasColumnType("integer")
.HasColumnName("type");
b.Property("UserId")
.HasColumnType("bigint")
.HasColumnName("user_id");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("employee_applications");
});
modelBuilder.Entity("vendorApproverBackend.Entities.EmployeeCertification", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("FileId")
.HasColumnType("bigint")
.HasColumnName("file_id");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.ToTable("EmployeeCertifications");
});
modelBuilder.Entity("vendorApproverBackend.Entities.FileModel", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.HasColumnType("text")
.HasColumnName("description");
b.Property("Name")
.HasColumnType("text")
.HasColumnName("file_name");
b.Property("Range")
.HasColumnType("integer")
.HasColumnName("range");
b.Property("Share")
.HasColumnType("boolean")
.HasColumnName("share");
b.Property("Size")
.HasColumnType("bigint")
.HasColumnName("file_size");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("Type")
.HasColumnType("text")
.HasColumnName("file_type");
b.Property("Url")
.IsRequired()
.HasColumnType("text")
.HasColumnName("file_url");
b.HasKey("Id");
b.ToTable("File_model");
});
modelBuilder.Entity("vendorApproverBackend.Entities.NotificationModel", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("notificatoin_id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Action")
.IsRequired()
.HasColumnType("text")
.HasColumnName("action");
b.Property("ActionId")
.HasColumnType("bigint")
.HasColumnName("action_id");
b.Property("Content")
.IsRequired()
.HasColumnType("text")
.HasColumnName("content");
b.Property("LogUrl")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logUrl");
b.Property("ReciverId")
.HasColumnType("bigint")
.HasColumnName("ReciverId");
b.Property("SenderId")
.HasColumnType("bigint")
.HasColumnName("SenderId");
b.Property("Status")
.IsRequired()
.HasColumnType("text")
.HasColumnName("status");
b.Property("Subject")
.IsRequired()
.HasColumnType("text")
.HasColumnName("subject");
b.Property("Timestmp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.HasKey("Id");
b.HasIndex("ReciverId");
b.HasIndex("SenderId");
b.ToTable("notificationmodel");
});
modelBuilder.Entity("vendorApproverBackend.Entities.PaymentDetail", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Amount")
.HasColumnType("double precision")
.HasColumnName("amount");
b.Property("AttachementId")
.HasColumnType("bigint")
.HasColumnName("attachement_id");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("description");
b.Property("PaymentDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("payment_date");
b.Property("PaymentMethode")
.HasColumnType("integer")
.HasColumnName("payment_methode");
b.Property("Reference")
.IsRequired()
.HasColumnType("text")
.HasColumnName("reference");
b.Property("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.HasKey("Id");
b.ToTable("PaymentDetail");
});
modelBuilder.Entity("vendorApproverBackend.Entities.PrequalificationRequest", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AssignedToUserId")
.HasColumnType("bigint")
.HasColumnName("assigned_to_user_id");
b.Property("PaymentDetailId")
.HasColumnType("bigint")
.HasColumnName("payment_detail_id");
b.Property("Reason")
.HasColumnType("text");
b.Property("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property("SubmissionDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("submission_date");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("VendorId")
.HasColumnType("bigint");
b.Property("VisitRequestId")
.HasColumnType("bigint");
b.Property("deadline")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("AssignedToUserId");
b.HasIndex("PaymentDetailId")
.IsUnique();
b.HasIndex("VendorId");
b.HasIndex("VisitRequestId")
.IsUnique();
b.ToTable("PrequalificationRequests");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Product", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Category")
.HasColumnType("text")
.HasColumnName("category");
b.Property("PrequalificationRequestId")
.HasColumnType("bigint")
.HasColumnName("prequalification_request_id");
b.Property("ProductCity")
.HasColumnType("text")
.HasColumnName("product_city");
b.Property("ProductCountry")
.HasColumnType("text")
.HasColumnName("product_country");
b.Property("ProductDesc")
.HasColumnType("text")
.HasColumnName("product_desc");
b.Property("ProductName")
.HasColumnType("text")
.HasColumnName("product_name");
b.Property("ProductType")
.HasColumnType("text")
.HasColumnName("product_type");
b.Property("Sku")
.HasColumnType("text")
.HasColumnName("sku");
b.Property("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property("Subcategory")
.HasColumnType("text")
.HasColumnName("sub_category");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("VendorId")
.HasColumnType("bigint")
.HasColumnName("vendor_id");
b.Property("VendorName")
.HasColumnType("text")
.HasColumnName("vendor_name");
b.HasKey("Id");
b.HasIndex("PrequalificationRequestId")
.IsUnique();
b.ToTable("products");
});
modelBuilder.Entity("vendorApproverBackend.Entities.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("user_id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Active")
.HasColumnType("boolean")
.HasColumnName("active");
b.Property("Category")
.HasColumnType("integer")
.HasColumnName("Category");
b.Property("City")
.HasColumnType("text")
.HasColumnName("city");
b.Property("Code")
.HasColumnType("text")
.HasColumnName("code");
b.Property("Country")
.HasColumnType("text")
.HasColumnName("country");
b.Property("Deleted")
.HasColumnType("boolean")
.HasColumnName("deleted");
b.Property("Departement")
.HasColumnType("text")
.HasColumnName("departement");
b.Property("Email")
.IsRequired()
.HasColumnType("text")
.HasColumnName("email");
b.Property("EvaluationPqId")
.HasColumnType("bigint")
.HasColumnName("evaluation_pq_id");
b.Property("InspectionPqId")
.HasColumnType("bigint")
.HasColumnName("inspection_pq_id");
b.Property("LastOtp")
.HasColumnType("text")
.HasColumnName("otp");
b.Property("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property("Password")
.IsRequired()
.HasColumnType("text")
.HasColumnName("password");
b.Property("PhoneNumber")
.HasColumnType("text")
.HasColumnName("phone_number");
b.Property("Position")
.HasColumnType("text")
.HasColumnName("position");
b.Property("Role")
.HasColumnType("integer")
.HasColumnName("role");
b.Property("StartDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("start_date");
b.Property("Status")
.HasColumnType("boolean")
.HasColumnName("Status");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("Type")
.HasColumnType("integer")
.HasColumnName("type");
b.Property("Username")
.IsRequired()
.HasColumnType("text")
.HasColumnName("user_name");
b.Property("user_device")
.HasColumnType("bigint");
b.Property("users_profile_media")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Email")
.IsUnique();
b.HasIndex("PhoneNumber")
.IsUnique();
b.HasIndex("Username")
.IsUnique();
b.HasIndex("user_device")
.IsUnique();
b.HasIndex("users_profile_media")
.IsUnique();
b.ToTable("users_table", (string)null);
});
modelBuilder.Entity("vendorApproverBackend.Entities.UserDevice", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("DeviceId")
.HasColumnType("text")
.HasColumnName("device_Id");
b.Property("DeviceType")
.HasColumnType("text")
.HasColumnName("deviceType");
b.Property("Ip")
.HasColumnType("text")
.HasColumnName("ip");
b.Property("LastJwt")
.HasColumnType("text")
.HasColumnName("token");
b.Property("PushNotificationToken")
.HasColumnType("text")
.HasColumnName("tokendevice");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.HasKey("Id");
b.ToTable("UserDevice");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Vendor", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CommercialRegistrationNo")
.HasColumnType("text")
.HasColumnName("Commercial_registratio_no");
b.Property("LocalAgentName")
.HasColumnType("text")
.HasColumnName("Local_agent_name");
b.Property("LocalAgentPhone")
.HasColumnType("text")
.HasColumnName("Local_agent_phone");
b.Property("ManifactoryName")
.HasColumnType("text")
.HasColumnName("manifactory_name");
b.Property("PartnerCompany")
.HasColumnType("text")
.HasColumnName("partner_company");
b.Property("Position")
.HasColumnType("text")
.HasColumnName("position");
b.Property("RepresentativeEmail")
.HasColumnType("text")
.HasColumnName("representative_email");
b.Property("RepresentativeName")
.HasColumnType("text")
.HasColumnName("representative_name");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("Vendors");
});
modelBuilder.Entity("vendorApproverBackend.Entities.VisitRequest", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ContactPerson")
.HasColumnType("text")
.HasColumnName("contact_person");
b.Property("EndDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("end_date");
b.Property("Location")
.HasColumnType("text")
.HasColumnName("location");
b.Property("Reason")
.HasColumnType("text")
.HasColumnName("reason");
b.Property("StartDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("start_date");
b.Property("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestamp");
b.Property("VisitPlanId")
.HasColumnType("bigint")
.HasColumnName("visit_plan_id");
b.Property("VisitPurpose")
.HasColumnType("text")
.HasColumnName("visit_purpose");
b.HasKey("Id");
b.ToTable("visit_requests");
});
modelBuilder.Entity("vendorApproverBackend.Entities.WorkExperience", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CompanyName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("company_name");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("description");
b.Property("FileId")
.HasColumnType("bigint")
.HasColumnName("file_id");
b.Property("JobTitle")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("job_title");
b.Property("Years")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("WorkExperiences");
});
modelBuilder.Entity("ApplicationCategoryUser", b =>
{
b.HasOne("vendorApproverBackend.Entities.ApplicationCategory", null)
.WithMany()
.HasForeignKey("CategoriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("AssessmentReport", b =>
{
b.HasOne("vendorApproverBackend.Entities.User", "CreatedBy")
.WithMany("CreatedAssessmentReports")
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.PrequalificationRequest", "PrequalificationRequest")
.WithOne("AssessmentReport")
.HasForeignKey("AssessmentReport", "PrequalificationRequestId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsMany("QuestionsRate", "AuditVisit", b1 =>
{
b1.Property("AssessmentReportId")
.HasColumnType("bigint");
b1.Property("__synthesizedOrdinal")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
b1.Property("Description")
.HasColumnType("text");
b1.Property("QuestionNumber")
.HasColumnType("text");
b1.Property("Score")
.HasColumnType("double precision");
b1.HasKey("AssessmentReportId", "__synthesizedOrdinal");
b1.ToTable("AssessmentReports");
b1.ToJson("AuditVisit");
b1.WithOwner()
.HasForeignKey("AssessmentReportId");
});
b.OwnsMany("QuestionsRate", "DocumentationReview", b1 =>
{
b1.Property("AssessmentReportId")
.HasColumnType("bigint");
b1.Property("__synthesizedOrdinal")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
b1.Property("Description")
.HasColumnType("text");
b1.Property("QuestionNumber")
.HasColumnType("text");
b1.Property("Score")
.HasColumnType("double precision");
b1.HasKey("AssessmentReportId", "__synthesizedOrdinal");
b1.ToTable("AssessmentReports");
b1.ToJson("DocumentationReview");
b1.WithOwner()
.HasForeignKey("AssessmentReportId");
});
b.OwnsMany("QuestionsRate", "TechnicalFactoryAuditVisit", b1 =>
{
b1.Property("AssessmentReportId")
.HasColumnType("bigint");
b1.Property("__synthesizedOrdinal")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
b1.Property("Description")
.HasColumnType("text");
b1.Property("QuestionNumber")
.HasColumnType("text");
b1.Property("Score")
.HasColumnType("double precision");
b1.HasKey("AssessmentReportId", "__synthesizedOrdinal");
b1.ToTable("AssessmentReports");
b1.ToJson("TechnicalFactoryAuditVisit");
b1.WithOwner()
.HasForeignKey("AssessmentReportId");
});
b.OwnsOne("vendorApproverBackend.Entities.OutcomeFactoryAudit", "FactoryAuditOutcome", b1 =>
{
b1.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
b1.Property("AssessmentReportId")
.HasColumnType("bigint");
b1.Property("AuditDate")
.HasColumnType("timestamp with time zone");
b1.Property("FirstAuditorName")
.HasColumnType("text");
b1.Property("Grade")
.HasColumnType("text");
b1.Property("Recommendation")
.HasColumnType("integer");
b1.Property("SecondAuditorName")
.HasColumnType("text");
b1.Property("Timestamp")
.HasColumnType("timestamp with time zone");
b1.Property("TotalMarks")
.HasColumnType("double precision");
b1.Property("passed")
.HasColumnType("boolean");
b1.HasKey("Id");
b1.HasIndex("AssessmentReportId")
.IsUnique();
b1.ToTable("AssessmentReports");
b1.ToJson("FactoryAuditOutcome");
b1.WithOwner()
.HasForeignKey("AssessmentReportId");
});
b.Navigation("AuditVisit");
b.Navigation("CreatedBy");
b.Navigation("DocumentationReview");
b.Navigation("FactoryAuditOutcome");
b.Navigation("PrequalificationRequest");
b.Navigation("TechnicalFactoryAuditVisit");
});
modelBuilder.Entity("DegreeUser", b =>
{
b.HasOne("vendorApproverBackend.Entities.Degree", null)
.WithMany()
.HasForeignKey("DegreesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("EmployeeCertificationUser", b =>
{
b.HasOne("vendorApproverBackend.Entities.EmployeeCertification", null)
.WithMany()
.HasForeignKey("CertificationsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PrequalificationRequestUser", b =>
{
b.HasOne("vendorApproverBackend.Entities.PrequalificationRequest", null)
.WithMany()
.HasForeignKey("InspectedPrequalificationRequestsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.User", null)
.WithMany()
.HasForeignKey("InspectorsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("UserWorkExperience", b =>
{
b.HasOne("vendorApproverBackend.Entities.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.WorkExperience", null)
.WithMany()
.HasForeignKey("WorkExperiencesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("vendorApproverBackend.Entities.Category", b =>
{
b.HasOne("vendorApproverBackend.Entities.ApplicationCategory", "ApplicationCategory")
.WithMany("Categories")
.HasForeignKey("ApplicationCategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ApplicationCategory");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Certification", b =>
{
b.HasOne("vendorApproverBackend.Entities.PrequalificationRequest", "PrequalificationRequest")
.WithOne("Certification")
.HasForeignKey("vendorApproverBackend.Entities.Certification", "PrequalificationRequestId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.User", "VerifiedBy")
.WithMany()
.HasForeignKey("VerifiedById")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("PrequalificationRequest");
b.Navigation("VerifiedBy");
});
modelBuilder.Entity("vendorApproverBackend.Entities.EmployeeApplication", b =>
{
b.HasOne("vendorApproverBackend.Entities.User", "User")
.WithMany("EmployeeApplications")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("vendorApproverBackend.Entities.NotificationModel", b =>
{
b.HasOne("vendorApproverBackend.Entities.User", "Reciver")
.WithMany()
.HasForeignKey("ReciverId");
b.HasOne("vendorApproverBackend.Entities.User", "Sender")
.WithMany()
.HasForeignKey("SenderId");
b.Navigation("Reciver");
b.Navigation("Sender");
});
modelBuilder.Entity("vendorApproverBackend.Entities.PrequalificationRequest", b =>
{
b.HasOne("vendorApproverBackend.Entities.User", "AssignedTo")
.WithMany("AssignedPrequalificationRequests")
.HasForeignKey("AssignedToUserId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("vendorApproverBackend.Entities.PaymentDetail", "PaymentDetail")
.WithOne("PrequalificationRequest")
.HasForeignKey("vendorApproverBackend.Entities.PrequalificationRequest", "PaymentDetailId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("vendorApproverBackend.Entities.Vendor", "Vendor")
.WithMany("PrequalificationRequests")
.HasForeignKey("VendorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("vendorApproverBackend.Entities.VisitRequest", "VisitRequest")
.WithOne()
.HasForeignKey("vendorApproverBackend.Entities.PrequalificationRequest", "VisitRequestId");
b.OwnsMany("vendorApproverBackend.Entities.AdminObservation", "AdminObservations", b1 =>
{
b1.Property("PrequalificationRequestId")
.HasColumnType("bigint");
b1.Property("__synthesizedOrdinal")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
b1.Property("Description")
.HasColumnType("text");
b1.Property("EnableUpdate")
.HasColumnType("boolean");
b1.Property("StepNumber")
.HasColumnType("integer");
b1.HasKey("PrequalificationRequestId", "__synthesizedOrdinal");
b1.ToTable("PrequalificationRequests");
b1.ToJson("AdminObservations");
b1.WithOwner()
.HasForeignKey("PrequalificationRequestId");
});
b.OwnsOne("vendorApproverBackend.Entities.Compliance", "Compliance", b1 =>
{
b1.Property("PrequalificationRequestId")
.HasColumnType("bigint");
b1.Property("ComplianceConfirmed")
.HasColumnType("boolean");
b1.Property("ComplianceConfirmedFileId")
.HasColumnType("bigint");
b1.Property("GtpFileId")
.HasColumnType("bigint");
b1.Property("GtpSubmitted")
.HasColumnType("boolean");
b1.Property("GtpSubmittedFileId")
.HasColumnType("bigint");
b1.HasKey("PrequalificationRequestId");
b1.ToTable("PrequalificationRequests");
b1.ToJson("Compliance");
b1.WithOwner()
.HasForeignKey("PrequalificationRequestId");
});
b.OwnsOne("vendorApproverBackend.Entities.Declaration", "Declaration", b1 =>
{
b1.Property("PrequalificationRequestId")
.HasColumnType("bigint");
b1.Property("Designation")
.HasColumnType("text");
b1.Property("FullName")
.HasColumnType("text");
b1.Property("OnBehalfOf")
.HasColumnType("text");
b1.Property("PowerOfAttorneyFileId")
.HasColumnType("bigint");
b1.Property("SignedDate")
.HasColumnType("timestamp with time zone");
b1.HasKey("PrequalificationRequestId");
b1.ToTable("PrequalificationRequests");
b1.ToJson("Declaration");
b1.WithOwner()
.HasForeignKey("PrequalificationRequestId");
});
b.OwnsOne("vendorApproverBackend.Entities.EquipmentGeneralArrangement", "EquipmentGeneralArrangement", b1 =>
{
b1.Property("PrequalificationRequestId")
.HasColumnType("bigint");
b1.Property("ConnectionDrawingFileId")
.HasColumnType("bigint");
b1.Property("GaDrawingEnclosed")
.HasColumnType("boolean");
b1.Property("GaFileId")
.HasColumnType("bigint");
b1.Property("Product3DModel")
.HasColumnType("boolean");
b1.Property("Product3DModelFileId")
.HasColumnType("bigint");
b1.Property("TypicalConnectionDrawing")
.HasColumnType("boolean");
b1.HasKey("PrequalificationRequestId");
b1.ToTable("PrequalificationRequests");
b1.ToJson("EquipmentGeneralArrangement");
b1.WithOwner()
.HasForeignKey("PrequalificationRequestId");
});
b.OwnsOne("vendorApproverBackend.Entities.ExperienceAndAfterSales", "ExperienceAndAfterSales", b1 =>
{
b1.Property("PrequalificationRequestId")
.HasColumnType("bigint");
b1.Property("AfterSalesReport")
.HasColumnType("boolean");
b1.Property("ClientRefDate")
.HasColumnType("timestamp with time zone");
b1.Property("IssueTrackingSystem")
.HasColumnType("boolean");
b1.Property("ManufacturerProductInfo")
.HasColumnType("text");
b1.Property("WarrantyCertificateFileId")
.HasColumnType("bigint")
.HasColumnName("warranty_certificate_file_id");
b1.HasKey("PrequalificationRequestId");
b1.HasIndex("WarrantyCertificateFileId")
.IsUnique();
b1.ToTable("PrequalificationRequests");
b1.WithOwner()
.HasForeignKey("PrequalificationRequestId");
b1.HasOne("vendorApproverBackend.Entities.FileModel", "WarrantyCertificateFile")
.WithOne()
.HasForeignKey("vendorApproverBackend.Entities.PrequalificationRequest.ExperienceAndAfterSales#vendorApproverBackend.Entities.ExperienceAndAfterSales", "WarrantyCertificateFileId")
.OnDelete(DeleteBehavior.Restrict);
b1.OwnsMany("vendorApproverBackend.Entities.ClientReference", "ClientReferences", b2 =>
{
b2.Property("ExperienceAndAfterSalesPrequalificationRequestId")
.HasColumnType("bigint");
b2.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b2.Property("Id"));
b2.Property("CertificateAttached")
.HasColumnType("boolean");
b2.Property("CertificateFileId")
.HasColumnType("bigint");
b2.Property("Client")
.HasColumnType("text");
b2.Property("Country")
.HasColumnType("text");
b2.Property("DeliveryYear")
.HasColumnType("text");
b2.Property("Industry")
.HasColumnType("text");
b2.Property("OrderYear")
.HasColumnType("text");
b2.Property("Quantity")
.HasColumnType("text");
b2.Property("YearsInService")
.HasColumnType("text");
b2.HasKey("ExperienceAndAfterSalesPrequalificationRequestId", "Id");
b2.ToTable("ClientReference");
b2.WithOwner()
.HasForeignKey("ExperienceAndAfterSalesPrequalificationRequestId");
});
b1.Navigation("ClientReferences");
b1.Navigation("WarrantyCertificateFile");
});
b.OwnsOne("vendorApproverBackend.Entities.FinancialStanding", "FinancialStanding", b1 =>
{
b1.Property("PrequalificationRequestId")
.HasColumnType("bigint");
b1.PrimitiveCollection>("AuditReportsIds")
.IsRequired()
.HasColumnType("bigint[]");
b1.Property