БД, контракты
This commit is contained in:
parent
ec714f489d
commit
9803c50681
24
CandidateReviewDatabaseImplement/CandidateReviewDatabase.cs
Normal file
24
CandidateReviewDatabaseImplement/CandidateReviewDatabase.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using CandidateReviewDatabaseImplement.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement
|
||||
{
|
||||
public class CandidateReviewDatabase : DbContext
|
||||
{
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=CandidateReviewDatabase;Username=postgres;Password=12345");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
public virtual DbSet<User> Users { set; get; }
|
||||
public virtual DbSet<Company> Companies { set; get; }
|
||||
public virtual DbSet<Vacancy> Vacancies { set; get; }
|
||||
public virtual DbSet<Resume> Resumes { set; get; }
|
||||
public virtual DbSet<Assessment> Assessments { set; get; }
|
||||
public virtual DbSet<Criterion> Criterions { set; get; }
|
||||
public virtual DbSet<AssessmentCriterion> AssessmentCriterions { set; get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CourseWorkContracts\CandidateReviewContracts.csproj" />
|
||||
<ProjectReference Include="..\CourseWorkDataModels\CandidateReviewDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
12
CandidateReviewDatabaseImplement/Implements/UserStorage.cs
Normal file
12
CandidateReviewDatabaseImplement/Implements/UserStorage.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Implements
|
||||
{
|
||||
internal class UserStorage
|
||||
{
|
||||
}
|
||||
}
|
401
CandidateReviewDatabaseImplement/Migrations/20241104182335_InitialCreate.Designer.cs
generated
Normal file
401
CandidateReviewDatabaseImplement/Migrations/20241104182335_InitialCreate.Designer.cs
generated
Normal file
@ -0,0 +1,401 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CandidateReviewDatabaseImplement;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(CandidateReviewDatabase))]
|
||||
[Migration("20241104182335_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.10")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int?>("Rating")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("ResumeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Assessments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.AssessmentCriterion", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("AssessmentId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("CriterionId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Value")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssessmentId");
|
||||
|
||||
b.HasIndex("CriterionId");
|
||||
|
||||
b.ToTable("AssessmentCriterions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Company", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Contacts")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Website")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Criterion", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Weight")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Criterions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Resume", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Education")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Experience")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhotoFilePath")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("ResumeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Skills")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("VacancyId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ResumeId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("VacancyId");
|
||||
|
||||
b.ToTable("Resumes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CompanyId")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Role")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Surname")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CompanyId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CompanyId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("JobTitle")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("JobType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Requirements")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Responsibilities")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Salary")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Tags")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CompanyId");
|
||||
|
||||
b.ToTable("Vacancies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.User", "User")
|
||||
.WithMany("Assessments")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.AssessmentCriterion", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Assessment", "Assessment")
|
||||
.WithMany("Criterions")
|
||||
.HasForeignKey("AssessmentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Criterion", "Criterion")
|
||||
.WithMany("AssessmentCriterions")
|
||||
.HasForeignKey("CriterionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Assessment");
|
||||
|
||||
b.Navigation("Criterion");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Resume", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Assessment", "Assessment")
|
||||
.WithOne("Resume")
|
||||
.HasForeignKey("CandidateReviewDatabaseImplement.Models.Resume", "ResumeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.User", "User")
|
||||
.WithMany("Resumes")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Vacancy", "Vacancy")
|
||||
.WithMany("Resumes")
|
||||
.HasForeignKey("VacancyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Assessment");
|
||||
|
||||
b.Navigation("User");
|
||||
|
||||
b.Navigation("Vacancy");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Company", "Company")
|
||||
.WithMany("Users")
|
||||
.HasForeignKey("CompanyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Company", "Company")
|
||||
.WithMany("Vacancies")
|
||||
.HasForeignKey("CompanyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
|
||||
{
|
||||
b.Navigation("Criterions");
|
||||
|
||||
b.Navigation("Resume")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Company", b =>
|
||||
{
|
||||
b.Navigation("Users");
|
||||
|
||||
b.Navigation("Vacancies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Criterion", b =>
|
||||
{
|
||||
b.Navigation("AssessmentCriterions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
|
||||
{
|
||||
b.Navigation("Assessments");
|
||||
|
||||
b.Navigation("Resumes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
|
||||
{
|
||||
b.Navigation("Resumes");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,260 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Companies",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: true),
|
||||
Website = table.Column<string>(type: "text", nullable: true),
|
||||
Address = table.Column<string>(type: "text", nullable: true),
|
||||
Contacts = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Companies", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Criterions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Type = table.Column<int>(type: "integer", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: true),
|
||||
Weight = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Criterions", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
CompanyId = table.Column<int>(type: "integer", nullable: false),
|
||||
Surname = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
LastName = table.Column<string>(type: "text", nullable: true),
|
||||
Email = table.Column<string>(type: "text", nullable: false),
|
||||
Password = table.Column<string>(type: "text", nullable: false),
|
||||
PhoneNumber = table.Column<string>(type: "text", nullable: true),
|
||||
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Role = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Users_Companies_CompanyId",
|
||||
column: x => x.CompanyId,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Vacancies",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
CompanyId = table.Column<int>(type: "integer", nullable: false),
|
||||
JobTitle = table.Column<string>(type: "text", nullable: false),
|
||||
Requirements = table.Column<string>(type: "text", nullable: false),
|
||||
Responsibilities = table.Column<string>(type: "text", nullable: false),
|
||||
JobType = table.Column<int>(type: "integer", nullable: false),
|
||||
Salary = table.Column<string>(type: "text", nullable: true),
|
||||
Description = table.Column<string>(type: "text", nullable: true),
|
||||
Status = table.Column<int>(type: "integer", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
Tags = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Vacancies", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Vacancies_Companies_CompanyId",
|
||||
column: x => x.CompanyId,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Assessments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ResumeId = table.Column<int>(type: "integer", nullable: false),
|
||||
UserId = table.Column<int>(type: "integer", nullable: false),
|
||||
Rating = table.Column<int>(type: "integer", nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
Comment = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Assessments", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Assessments_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AssessmentCriterions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
AssessmentId = table.Column<int>(type: "integer", nullable: false),
|
||||
CriterionId = table.Column<int>(type: "integer", nullable: false),
|
||||
Value = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AssessmentCriterions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AssessmentCriterions_Assessments_AssessmentId",
|
||||
column: x => x.AssessmentId,
|
||||
principalTable: "Assessments",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_AssessmentCriterions_Criterions_CriterionId",
|
||||
column: x => x.CriterionId,
|
||||
principalTable: "Criterions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Resumes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
VacancyId = table.Column<int>(type: "integer", nullable: false),
|
||||
UserId = table.Column<int>(type: "integer", nullable: false),
|
||||
Title = table.Column<string>(type: "text", nullable: false),
|
||||
Experience = table.Column<string>(type: "text", nullable: false),
|
||||
Education = table.Column<string>(type: "text", nullable: false),
|
||||
PhotoFilePath = table.Column<string>(type: "text", nullable: true),
|
||||
Description = table.Column<string>(type: "text", nullable: true),
|
||||
Skills = table.Column<string>(type: "text", nullable: false),
|
||||
Status = table.Column<int>(type: "integer", nullable: false),
|
||||
ResumeId = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Resumes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Resumes_Assessments_ResumeId",
|
||||
column: x => x.ResumeId,
|
||||
principalTable: "Assessments",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Resumes_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Resumes_Vacancies_VacancyId",
|
||||
column: x => x.VacancyId,
|
||||
principalTable: "Vacancies",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AssessmentCriterions_AssessmentId",
|
||||
table: "AssessmentCriterions",
|
||||
column: "AssessmentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AssessmentCriterions_CriterionId",
|
||||
table: "AssessmentCriterions",
|
||||
column: "CriterionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Assessments_UserId",
|
||||
table: "Assessments",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Resumes_ResumeId",
|
||||
table: "Resumes",
|
||||
column: "ResumeId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Resumes_UserId",
|
||||
table: "Resumes",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Resumes_VacancyId",
|
||||
table: "Resumes",
|
||||
column: "VacancyId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_CompanyId",
|
||||
table: "Users",
|
||||
column: "CompanyId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Vacancies_CompanyId",
|
||||
table: "Vacancies",
|
||||
column: "CompanyId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AssessmentCriterions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Resumes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Criterions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Assessments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Vacancies");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Companies");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,398 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CandidateReviewDatabaseImplement;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(CandidateReviewDatabase))]
|
||||
partial class CandidateReviewDatabaseModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.10")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int?>("Rating")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("ResumeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Assessments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.AssessmentCriterion", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("AssessmentId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("CriterionId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Value")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssessmentId");
|
||||
|
||||
b.HasIndex("CriterionId");
|
||||
|
||||
b.ToTable("AssessmentCriterions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Company", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Contacts")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Website")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Criterion", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Weight")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Criterions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Resume", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Education")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Experience")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhotoFilePath")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("ResumeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Skills")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("VacancyId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ResumeId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("VacancyId");
|
||||
|
||||
b.ToTable("Resumes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("CompanyId")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Role")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Surname")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CompanyId");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CompanyId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("JobTitle")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("JobType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Requirements")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Responsibilities")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Salary")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Tags")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CompanyId");
|
||||
|
||||
b.ToTable("Vacancies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.User", "User")
|
||||
.WithMany("Assessments")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.AssessmentCriterion", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Assessment", "Assessment")
|
||||
.WithMany("Criterions")
|
||||
.HasForeignKey("AssessmentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Criterion", "Criterion")
|
||||
.WithMany("AssessmentCriterions")
|
||||
.HasForeignKey("CriterionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Assessment");
|
||||
|
||||
b.Navigation("Criterion");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Resume", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Assessment", "Assessment")
|
||||
.WithOne("Resume")
|
||||
.HasForeignKey("CandidateReviewDatabaseImplement.Models.Resume", "ResumeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.User", "User")
|
||||
.WithMany("Resumes")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Vacancy", "Vacancy")
|
||||
.WithMany("Resumes")
|
||||
.HasForeignKey("VacancyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Assessment");
|
||||
|
||||
b.Navigation("User");
|
||||
|
||||
b.Navigation("Vacancy");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Company", "Company")
|
||||
.WithMany("Users")
|
||||
.HasForeignKey("CompanyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
|
||||
{
|
||||
b.HasOne("CandidateReviewDatabaseImplement.Models.Company", "Company")
|
||||
.WithMany("Vacancies")
|
||||
.HasForeignKey("CompanyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Assessment", b =>
|
||||
{
|
||||
b.Navigation("Criterions");
|
||||
|
||||
b.Navigation("Resume")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Company", b =>
|
||||
{
|
||||
b.Navigation("Users");
|
||||
|
||||
b.Navigation("Vacancies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Criterion", b =>
|
||||
{
|
||||
b.Navigation("AssessmentCriterions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.User", b =>
|
||||
{
|
||||
b.Navigation("Assessments");
|
||||
|
||||
b.Navigation("Resumes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CandidateReviewDatabaseImplement.Models.Vacancy", b =>
|
||||
{
|
||||
b.Navigation("Resumes");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
116
CandidateReviewDatabaseImplement/Models/Assessment.cs
Normal file
116
CandidateReviewDatabaseImplement/Models/Assessment.cs
Normal file
@ -0,0 +1,116 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
using CandidateReviewDataModels.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Models
|
||||
{
|
||||
public class Assessment : IAssessmentModel
|
||||
{
|
||||
[Required]
|
||||
public int ResumeId { get; set; }
|
||||
[Required]
|
||||
public int UserId { get; set; }
|
||||
|
||||
public int? Rating { get; set; }
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public string? Comment { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public virtual User User { get; set; }
|
||||
public virtual Resume Resume { get; set; }
|
||||
|
||||
private Dictionary<int, (ICriterionModel, int)>? _assessmentCriterions = null;
|
||||
|
||||
public Dictionary<int, (ICriterionModel, int)> AssessmentCriterions
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_assessmentCriterions == null)
|
||||
{
|
||||
_assessmentCriterions = Criterions
|
||||
.ToDictionary(recAC => recAC.CriterionId, recAC =>
|
||||
(recAC.Criterion as ICriterionModel, recAC.Value));
|
||||
}
|
||||
return _assessmentCriterions;
|
||||
}
|
||||
}
|
||||
|
||||
[ForeignKey("AssessmentId")]
|
||||
public virtual List<AssessmentCriterion> Criterions { get; set; } = new();
|
||||
|
||||
public static Assessment? Create(CandidateReviewDatabase context, AssessmentBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new Assessment()
|
||||
{
|
||||
Id = model.Id,
|
||||
ResumeId = model.ResumeId,
|
||||
UserId = model.UserId,
|
||||
Rating = model.Rating,
|
||||
CreatedAt = model.CreatedAt,
|
||||
Comment = model.Comment,
|
||||
Criterions = model.AssessmentCriterions.Select(x => new AssessmentCriterion()
|
||||
{
|
||||
Criterion = context.Criterions.First(y => y.Id == x.Key),
|
||||
Value = x.Value.Item2
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
public void Update(AssessmentBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ResumeId = model.ResumeId;
|
||||
UserId = model.UserId;
|
||||
Rating = model.Rating;
|
||||
CreatedAt = model.CreatedAt;
|
||||
Comment = model.Comment;
|
||||
}
|
||||
public AssessmentViewModel GetViewModel => new()
|
||||
{
|
||||
Id = Id,
|
||||
ResumeId = ResumeId,
|
||||
UserId = UserId,
|
||||
Rating = Rating,
|
||||
CreatedAt = CreatedAt,
|
||||
Comment = Comment
|
||||
};
|
||||
|
||||
public void UpdateCriterions(CandidateReviewDatabase context, AssessmentBindingModel model)
|
||||
{
|
||||
var assessmentCriterions = context.AssessmentCriterions.Where(rec => rec.AssessmentId == model.Id).ToList();
|
||||
if (assessmentCriterions != null && assessmentCriterions.Count > 0)
|
||||
{
|
||||
context.AssessmentCriterions.RemoveRange(assessmentCriterions.Where(rec => !model.AssessmentCriterions.ContainsKey(rec.CriterionId)));
|
||||
context.SaveChanges();
|
||||
foreach (var updateCriterion in assessmentCriterions)
|
||||
{
|
||||
updateCriterion.Value = model.AssessmentCriterions[updateCriterion.CriterionId].Item2;
|
||||
model.AssessmentCriterions.Remove(updateCriterion.CriterionId);
|
||||
}
|
||||
context.SaveChanges();
|
||||
}
|
||||
var assessment = context.Assessments.First(x => x.Id == Id);
|
||||
foreach (var ac in model.AssessmentCriterions)
|
||||
{
|
||||
context.AssessmentCriterions.Add(new AssessmentCriterion
|
||||
{
|
||||
Assessment = assessment,
|
||||
Criterion = context.Criterions.First(x => x.Id == ac.Key),
|
||||
Value = ac.Value.Item2
|
||||
});
|
||||
context.SaveChanges();
|
||||
}
|
||||
_assessmentCriterions = null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Models
|
||||
{
|
||||
public class AssessmentCriterion
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public int AssessmentId { get; set; }
|
||||
[Required]
|
||||
public int CriterionId { get; set; }
|
||||
[Required]
|
||||
public int Value { get; set; }
|
||||
public virtual Assessment Assessment { get; set; } = new();
|
||||
public virtual Criterion Criterion { get; set; } = new();
|
||||
}
|
||||
}
|
82
CandidateReviewDatabaseImplement/Models/Company.cs
Normal file
82
CandidateReviewDatabaseImplement/Models/Company.cs
Normal file
@ -0,0 +1,82 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
using CandidateReviewDataModels.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Models
|
||||
{
|
||||
public class Company : ICompanyModel
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? Website { get; set; }
|
||||
|
||||
public string? Address { get; set; }
|
||||
|
||||
public string? Contacts { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
[ForeignKey("CompanyId")]
|
||||
public virtual List<User> Users { get; set; } = new();
|
||||
|
||||
[ForeignKey("CompanyId")]
|
||||
public virtual List<Vacancy> Vacancies { get; set; } = new();
|
||||
|
||||
public static Company? Create(CompanyBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new Company()
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Description = model.Description,
|
||||
Website = model.Website,
|
||||
Address = model.Address,
|
||||
Contacts = model.Contacts
|
||||
};
|
||||
}
|
||||
|
||||
public static Company Create(CompanyViewModel model)
|
||||
{
|
||||
return new Company
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Description = model.Description,
|
||||
Website = model.Website,
|
||||
Address = model.Address,
|
||||
Contacts = model.Contacts
|
||||
};
|
||||
}
|
||||
|
||||
public void Update(CompanyBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Name = model.Name;
|
||||
Description = model.Description;
|
||||
Website = model.Website;
|
||||
Address = model.Address;
|
||||
Contacts = model.Contacts;
|
||||
}
|
||||
public CompanyViewModel GetViewModel => new()
|
||||
{
|
||||
Id = Id,
|
||||
Name = Name,
|
||||
Description = Description,
|
||||
Website = Website,
|
||||
Address = Address,
|
||||
Contacts = Contacts
|
||||
};
|
||||
}
|
||||
}
|
71
CandidateReviewDatabaseImplement/Models/Criterion.cs
Normal file
71
CandidateReviewDatabaseImplement/Models/Criterion.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Models
|
||||
{
|
||||
public class Criterion : ICriterionModel
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public CriterionTypeEnum Type { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
[Required]
|
||||
public int Weight { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("CriterionId")]
|
||||
public virtual List<AssessmentCriterion> AssessmentCriterions { get; set; } = new();
|
||||
|
||||
public static Criterion? Create(CriterionBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new Criterion()
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Type = model.Type,
|
||||
Description = model.Description,
|
||||
Weight = model.Weight
|
||||
};
|
||||
}
|
||||
public static Criterion Create(CriterionViewModel model)
|
||||
{
|
||||
return new Criterion
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Type = model.Type,
|
||||
Description = model.Description,
|
||||
Weight = model.Weight
|
||||
};
|
||||
}
|
||||
public void Update(CriterionBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Name = model.Name;
|
||||
Type = model.Type;
|
||||
Description = model.Description;
|
||||
Weight = model.Weight;
|
||||
}
|
||||
public CriterionViewModel GetViewModel => new()
|
||||
{
|
||||
Id = Id,
|
||||
Name = Name,
|
||||
Type = Type,
|
||||
Description = Description,
|
||||
Weight = Weight
|
||||
};
|
||||
}
|
||||
}
|
104
CandidateReviewDatabaseImplement/Models/Resume.cs
Normal file
104
CandidateReviewDatabaseImplement/Models/Resume.cs
Normal file
@ -0,0 +1,104 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Models
|
||||
{
|
||||
public class Resume : IResumeModel
|
||||
{
|
||||
[Required]
|
||||
public int VacancyId { get; set; }
|
||||
[Required]
|
||||
public int UserId { get; set; }
|
||||
[Required]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Experience { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Education { get; set; } = string.Empty;
|
||||
|
||||
public string? PhotoFilePath { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
[Required]
|
||||
public string Skills { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public ResumeStatusEnum Status { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
[ForeignKey("ResumeId")]
|
||||
public virtual Assessment Assessment { get; set; } = new();
|
||||
public virtual Vacancy Vacancy { get; set; }
|
||||
public virtual User User { get; set; }
|
||||
|
||||
public static Resume? Create(ResumeBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new Resume()
|
||||
{
|
||||
Id = model.Id,
|
||||
VacancyId = model.VacancyId,
|
||||
UserId = model.UserId,
|
||||
Title = model.Title,
|
||||
Experience = model.Experience,
|
||||
Education = model.Education,
|
||||
PhotoFilePath = model.PhotoFilePath,
|
||||
Description = model.Description,
|
||||
Skills = model.Skills,
|
||||
Status = model.Status
|
||||
};
|
||||
}
|
||||
public static Resume Create(ResumeViewModel model)
|
||||
{
|
||||
return new Resume
|
||||
{
|
||||
Id = model.Id,
|
||||
VacancyId = model.VacancyId,
|
||||
UserId = model.UserId,
|
||||
Title = model.Title,
|
||||
Experience = model.Experience,
|
||||
Education = model.Education,
|
||||
PhotoFilePath = model.PhotoFilePath,
|
||||
Description = model.Description,
|
||||
Skills = model.Skills,
|
||||
Status = model.Status
|
||||
};
|
||||
}
|
||||
public void Update(ResumeBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
VacancyId = model.VacancyId;
|
||||
UserId = model.UserId;
|
||||
Title = model.Title;
|
||||
Experience = model.Experience;
|
||||
Education = model.Education;
|
||||
PhotoFilePath = model.PhotoFilePath;
|
||||
Description = model.Description;
|
||||
Skills = model.Skills;
|
||||
Status = model.Status;
|
||||
}
|
||||
public ResumeViewModel GetViewModel => new()
|
||||
{
|
||||
Id = Id,
|
||||
VacancyId = VacancyId,
|
||||
UserId = UserId,
|
||||
Title = Title,
|
||||
Experience = Experience,
|
||||
Education = Education,
|
||||
PhotoFilePath = PhotoFilePath,
|
||||
Description = Description,
|
||||
Skills = Skills,
|
||||
Status = Status
|
||||
};
|
||||
}
|
||||
}
|
106
CandidateReviewDatabaseImplement/Models/User.cs
Normal file
106
CandidateReviewDatabaseImplement/Models/User.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Models
|
||||
{
|
||||
public class User : IUserModel
|
||||
{
|
||||
[Required]
|
||||
public int? CompanyId { get; set; }
|
||||
[Required]
|
||||
public string Surname { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string? LastName { get; set; }
|
||||
[Required]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
public string? PhoneNumber { get; set; }
|
||||
[Required]
|
||||
public bool EmailConfirmed { get; set; }
|
||||
[Required]
|
||||
public RoleEnum Role { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public virtual Company Company { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual List<Resume> Resumes { get; set; } = new();
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual List<Assessment> Assessments { get; set; } = new();
|
||||
|
||||
public static User? Create(UserBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new User()
|
||||
{
|
||||
Id = model.Id,
|
||||
Surname = model.Surname,
|
||||
Name = model.Name,
|
||||
LastName = model.LastName,
|
||||
Email = model.Email,
|
||||
Password = model.Password,
|
||||
PhoneNumber = model.PhoneNumber,
|
||||
EmailConfirmed = model.EmailConfirmed,
|
||||
Role = model.Role,
|
||||
CompanyId = model.CompanyId
|
||||
};
|
||||
}
|
||||
public static User Create(UserViewModel model)
|
||||
{
|
||||
return new User
|
||||
{
|
||||
Id = model.Id,
|
||||
Surname = model.Surname,
|
||||
Name = model.Name,
|
||||
LastName = model.LastName,
|
||||
Email = model.Email,
|
||||
Password = model.Password,
|
||||
PhoneNumber = model.PhoneNumber,
|
||||
EmailConfirmed = model.EmailConfirmed,
|
||||
Role = model.Role,
|
||||
CompanyId = model.CompanyId
|
||||
};
|
||||
}
|
||||
public void Update(UserBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Surname = model.Surname;
|
||||
Name = model.Name;
|
||||
LastName = model.LastName;
|
||||
Email = model.Email;
|
||||
Password = model.Password;
|
||||
PhoneNumber = model.PhoneNumber;
|
||||
EmailConfirmed = model.EmailConfirmed;
|
||||
Role = model.Role;
|
||||
CompanyId = model.CompanyId;
|
||||
}
|
||||
public UserViewModel GetViewModel => new()
|
||||
{
|
||||
Id = Id,
|
||||
Name = Name,
|
||||
Surname = Surname,
|
||||
LastName = LastName,
|
||||
Email = Email,
|
||||
Password = Password,
|
||||
PhoneNumber = PhoneNumber,
|
||||
EmailConfirmed = EmailConfirmed,
|
||||
Role = Role,
|
||||
CompanyId = CompanyId
|
||||
};
|
||||
}
|
||||
}
|
109
CandidateReviewDatabaseImplement/Models/Vacancy.cs
Normal file
109
CandidateReviewDatabaseImplement/Models/Vacancy.cs
Normal file
@ -0,0 +1,109 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CandidateReviewDatabaseImplement.Models
|
||||
{
|
||||
public class Vacancy : IVacancyModel
|
||||
{
|
||||
[Required]
|
||||
public int CompanyId { get; set; }
|
||||
[Required]
|
||||
public string JobTitle { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Requirements { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Responsibilities { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public JobTypeEnum JobType { get; set; }
|
||||
|
||||
public string? Salary { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
[Required]
|
||||
public VacancyStatusEnum Status { get; set; }
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public string? Tags { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public virtual Company Company { get; set; }
|
||||
|
||||
[ForeignKey("VacancyId")]
|
||||
public virtual List<Resume> Resumes { get; set; } = new();
|
||||
|
||||
public static Vacancy? Create(VacancyBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new Vacancy()
|
||||
{
|
||||
Id = model.Id,
|
||||
CompanyId = model.CompanyId,
|
||||
JobTitle = model.JobTitle,
|
||||
Requirements = model.Requirements,
|
||||
Responsibilities = model.Responsibilities,
|
||||
JobType = model.JobType,
|
||||
Salary = model.Salary,
|
||||
Description = model.Description,
|
||||
Status = model.Status,
|
||||
CreatedAt = model.CreatedAt,
|
||||
Tags = model.Tags
|
||||
};
|
||||
}
|
||||
public static Vacancy Create(VacancyViewModel model)
|
||||
{
|
||||
return new Vacancy
|
||||
{
|
||||
Id = model.Id,
|
||||
CompanyId = model.CompanyId,
|
||||
JobTitle = model.JobTitle,
|
||||
Requirements = model.Requirements,
|
||||
Responsibilities = model.Responsibilities,
|
||||
JobType = model.JobType,
|
||||
Salary = model.Salary,
|
||||
Description = model.Description,
|
||||
Status = model.Status,
|
||||
CreatedAt = model.CreatedAt,
|
||||
Tags = model.Tags
|
||||
};
|
||||
}
|
||||
public void Update(VacancyBindingModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CompanyId = model.CompanyId;
|
||||
JobTitle = model.JobTitle;
|
||||
Requirements = model.Requirements;
|
||||
Responsibilities = model.Responsibilities;
|
||||
JobType = model.JobType;
|
||||
Salary = model.Salary;
|
||||
Description = model.Description;
|
||||
Status = model.Status;
|
||||
CreatedAt = model.CreatedAt;
|
||||
Tags = model.Tags;
|
||||
}
|
||||
public VacancyViewModel GetViewModel => new()
|
||||
{
|
||||
Id = Id,
|
||||
CompanyId = CompanyId,
|
||||
JobTitle = JobTitle,
|
||||
Requirements = Requirements,
|
||||
Responsibilities = Responsibilities,
|
||||
JobType = JobType,
|
||||
Salary = Salary,
|
||||
Description = Description,
|
||||
Status = Status,
|
||||
CreatedAt = CreatedAt,
|
||||
Tags = Tags
|
||||
};
|
||||
}
|
||||
}
|
20
CourseWorkContracts/BindingModels/AssessmentBindingModel.cs
Normal file
20
CourseWorkContracts/BindingModels/AssessmentBindingModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class AssessmentBindingModel : IAssessmentModel
|
||||
{
|
||||
public int ResumeId { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public int? Rating { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
||||
|
||||
public string? Comment { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public Dictionary<int, (ICriterionModel, int)> AssessmentCriterions { get; set; } = new();
|
||||
}
|
||||
}
|
19
CourseWorkContracts/BindingModels/CompanyBindingModel.cs
Normal file
19
CourseWorkContracts/BindingModels/CompanyBindingModel.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class CompanyBindingModel : ICompanyModel
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? Website { get; set; }
|
||||
|
||||
public string? Address { get; set; }
|
||||
|
||||
public string? Contacts { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
18
CourseWorkContracts/BindingModels/CriterionBindingModel.cs
Normal file
18
CourseWorkContracts/BindingModels/CriterionBindingModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class CriterionBindingModel : ICriterionModel
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public CriterionTypeEnum Type { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public int Weight { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
12
CourseWorkContracts/BindingModels/MailConfigBindingModel.cs
Normal file
12
CourseWorkContracts/BindingModels/MailConfigBindingModel.cs
Normal file
@ -0,0 +1,12 @@
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class MailConfigBindingModel
|
||||
{
|
||||
public string MailLogin { get; set; } = string.Empty;
|
||||
public string MailPassword { get; set; } = string.Empty;
|
||||
public string SmtpClientHost { get; set; } = string.Empty;
|
||||
public int SmtpClientPort { get; set; }
|
||||
public string PopHost { get; set; } = string.Empty;
|
||||
public int PopPort { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class MailSendInfoBindingModel
|
||||
{
|
||||
public string MailAddress { get; set; } = string.Empty;
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
public string Text { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
9
CourseWorkContracts/BindingModels/ReportBindingModel.cs
Normal file
9
CourseWorkContracts/BindingModels/ReportBindingModel.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class ReportBindingModel
|
||||
{
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
}
|
28
CourseWorkContracts/BindingModels/ResumeBindingModel.cs
Normal file
28
CourseWorkContracts/BindingModels/ResumeBindingModel.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class ResumeBindingModel : IResumeModel
|
||||
{
|
||||
public int VacancyId { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
public string Experience { get; set; } = string.Empty;
|
||||
|
||||
public string Education { get; set; } = string.Empty;
|
||||
|
||||
public string? PhotoFilePath { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string Skills { get; set; } = string.Empty;
|
||||
|
||||
public ResumeStatusEnum Status { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
28
CourseWorkContracts/BindingModels/UserBindingModel.cs
Normal file
28
CourseWorkContracts/BindingModels/UserBindingModel.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class UserBindingModel : IUserModel
|
||||
{
|
||||
public int? CompanyId { get; set; }
|
||||
|
||||
public string Surname { get; set; } = string.Empty;
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string? LastName { get; set; }
|
||||
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
public RoleEnum Role { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
30
CourseWorkContracts/BindingModels/VacancyBindingModel.cs
Normal file
30
CourseWorkContracts/BindingModels/VacancyBindingModel.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.BindingModels
|
||||
{
|
||||
public class VacancyBindingModel : IVacancyModel
|
||||
{
|
||||
public int CompanyId { get; set; }
|
||||
|
||||
public string JobTitle { get; set; } = string.Empty;
|
||||
|
||||
public string Requirements { get; set; } = string.Empty;
|
||||
|
||||
public string Responsibilities { get; set; } = string.Empty;
|
||||
|
||||
public JobTypeEnum JobType { get; set; }
|
||||
|
||||
public string? Salary { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public VacancyStatusEnum Status { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public string? Tags { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IAssessmentLogic
|
||||
{
|
||||
List<AssessmentViewModel>? ReadList(AssessmentSearchModel? model);
|
||||
AssessmentViewModel? ReadElement(AssessmentSearchModel model);
|
||||
bool Create(AssessmentBindingModel model);
|
||||
bool Update(AssessmentBindingModel model);
|
||||
bool Delete(AssessmentBindingModel model);
|
||||
}
|
||||
}
|
15
CourseWorkContracts/BusinessLogicsContracts/ICompanyLogic.cs
Normal file
15
CourseWorkContracts/BusinessLogicsContracts/ICompanyLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface ICompanyLogic
|
||||
{
|
||||
List<CompanyViewModel>? ReadList(CompanySearchModel? model);
|
||||
CompanyViewModel? ReadElement(CompanySearchModel model);
|
||||
bool Create(CompanyBindingModel model);
|
||||
bool Update(CompanyBindingModel model);
|
||||
bool Delete(CompanyBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface ICriterionLogic
|
||||
{
|
||||
List<CriterionViewModel>? ReadList(CriterionSearchModel? model);
|
||||
CriterionViewModel? ReadElement(CriterionSearchModel model);
|
||||
bool Create(CriterionBindingModel model);
|
||||
bool Update(CriterionBindingModel model);
|
||||
bool Delete(CriterionBindingModel model);
|
||||
}
|
||||
}
|
32
CourseWorkContracts/BusinessLogicsContracts/IReportLogic.cs
Normal file
32
CourseWorkContracts/BusinessLogicsContracts/IReportLogic.cs
Normal file
@ -0,0 +1,32 @@
|
||||
namespace CandidateReviewContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IReportLogic
|
||||
{
|
||||
/*/// <summary>
|
||||
/// Получение списка компонент с указанием, в каких изделиях используются
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<ReportEngineComponentViewModel> GetEngineComponent();
|
||||
/// <summary>
|
||||
/// Получение списка заказов за определенный период
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
List<ReportOrdersViewModel> GetOrders(ReportBindingModel model);
|
||||
/// <summary>
|
||||
/// Сохранение компонент в файл-Word
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
void SaveEnginesToWordFile(ReportBindingModel model);
|
||||
/// <summary>
|
||||
/// Сохранение компонент с указаеним продуктов в файл-Excel
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
void SaveEngineComponentToExcelFile(ReportBindingModel model);
|
||||
/// <summary>
|
||||
/// Сохранение заказов в файл-Pdf
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
void SaveOrdersToPdfFile(ReportBindingModel model);*/
|
||||
}
|
||||
}
|
15
CourseWorkContracts/BusinessLogicsContracts/IResumeLogic.cs
Normal file
15
CourseWorkContracts/BusinessLogicsContracts/IResumeLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IResumeLogic
|
||||
{
|
||||
List<ResumeViewModel>? ReadList(ResumeSearchModel? model);
|
||||
ResumeViewModel? ReadElement(ResumeSearchModel model);
|
||||
bool Create(ResumeBindingModel model);
|
||||
bool Update(ResumeBindingModel model);
|
||||
bool Delete(ResumeBindingModel model);
|
||||
}
|
||||
}
|
15
CourseWorkContracts/BusinessLogicsContracts/IUserLogic.cs
Normal file
15
CourseWorkContracts/BusinessLogicsContracts/IUserLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IUserLogic
|
||||
{
|
||||
List<UserViewModel>? ReadList(UserSearchModel? model);
|
||||
UserViewModel? ReadElement(UserSearchModel model);
|
||||
bool Create(UserBindingModel model);
|
||||
bool Update(UserBindingModel model);
|
||||
bool Delete(UserBindingModel model);
|
||||
}
|
||||
}
|
15
CourseWorkContracts/BusinessLogicsContracts/IVacancyLogic.cs
Normal file
15
CourseWorkContracts/BusinessLogicsContracts/IVacancyLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IVacancyLogic
|
||||
{
|
||||
List<VacancyViewModel>? ReadList(VacancySearchModel? model);
|
||||
VacancyViewModel? ReadElement(VacancySearchModel model);
|
||||
bool Create(VacancyBindingModel model);
|
||||
bool Update(VacancyBindingModel model);
|
||||
bool Delete(VacancyBindingModel model);
|
||||
}
|
||||
}
|
@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CourseWorkDataModels\CandidateReviewDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
11
CourseWorkContracts/SearchModels/AssessmentSearchModel.cs
Normal file
11
CourseWorkContracts/SearchModels/AssessmentSearchModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace CandidateReviewContracts.SearchModels
|
||||
{
|
||||
public class AssessmentSearchModel
|
||||
{
|
||||
public int? ResumeId { get; set; }
|
||||
|
||||
public int? UserId { get; set; }
|
||||
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
9
CourseWorkContracts/SearchModels/CompanySearchModel.cs
Normal file
9
CourseWorkContracts/SearchModels/CompanySearchModel.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace CandidateReviewContracts.SearchModels
|
||||
{
|
||||
public class CompanySearchModel
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
9
CourseWorkContracts/SearchModels/CriterionSearchModel.cs
Normal file
9
CourseWorkContracts/SearchModels/CriterionSearchModel.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace CandidateReviewContracts.SearchModels
|
||||
{
|
||||
public class CriterionSearchModel
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
15
CourseWorkContracts/SearchModels/ResumeSearchModel.cs
Normal file
15
CourseWorkContracts/SearchModels/ResumeSearchModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
|
||||
namespace CandidateReviewContracts.SearchModels
|
||||
{
|
||||
public class ResumeSearchModel
|
||||
{
|
||||
public int? VacancyId { get; set; }
|
||||
|
||||
public int? UserId { get; set; }
|
||||
|
||||
public string? Title { get; set; }
|
||||
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
15
CourseWorkContracts/SearchModels/UserSearchModel.cs
Normal file
15
CourseWorkContracts/SearchModels/UserSearchModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace CandidateReviewContracts.SearchModels
|
||||
{
|
||||
public class UserSearchModel
|
||||
{
|
||||
public int? CompanyId { get; set; }
|
||||
|
||||
public string? Surname { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
public string? Email { get; set; } = string.Empty;
|
||||
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
15
CourseWorkContracts/SearchModels/VacancySearchModel.cs
Normal file
15
CourseWorkContracts/SearchModels/VacancySearchModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace CandidateReviewContracts.SearchModels
|
||||
{
|
||||
public class VacancySearchModel
|
||||
{
|
||||
public int? CompanyId { get; set; }
|
||||
|
||||
public string? JobTitle { get; set; }
|
||||
|
||||
public string? Salary { get; set; }
|
||||
|
||||
public string? Tags { get; set; }
|
||||
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
16
CourseWorkContracts/StoragesContracts/IAssessmentStorage.cs
Normal file
16
CourseWorkContracts/StoragesContracts/IAssessmentStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.StoragesContracts
|
||||
{
|
||||
public interface IAssessmentStorage
|
||||
{
|
||||
List<AssessmentViewModel> GetFullList();
|
||||
List<AssessmentViewModel> GetFilteredList(AssessmentSearchModel model);
|
||||
AssessmentViewModel? GetElement(AssessmentSearchModel model);
|
||||
AssessmentViewModel? Insert(AssessmentBindingModel model);
|
||||
AssessmentViewModel? Update(AssessmentBindingModel model);
|
||||
AssessmentViewModel? Delete(AssessmentBindingModel model);
|
||||
}
|
||||
}
|
16
CourseWorkContracts/StoragesContracts/ICompanyStorage.cs
Normal file
16
CourseWorkContracts/StoragesContracts/ICompanyStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.StoragesContracts
|
||||
{
|
||||
public interface ICompanyStorage
|
||||
{
|
||||
List<CompanyViewModel> GetFullList();
|
||||
List<CompanyViewModel> GetFilteredList(CompanySearchModel model);
|
||||
CompanyViewModel? GetElement(CompanySearchModel model);
|
||||
CompanyViewModel? Insert(CompanyBindingModel model);
|
||||
CompanyViewModel? Update(CompanyBindingModel model);
|
||||
CompanyViewModel? Delete(CompanyBindingModel model);
|
||||
}
|
||||
}
|
16
CourseWorkContracts/StoragesContracts/ICriterionStorage.cs
Normal file
16
CourseWorkContracts/StoragesContracts/ICriterionStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.StoragesContracts
|
||||
{
|
||||
public interface ICriterionStorage
|
||||
{
|
||||
List<CriterionViewModel> GetFullList();
|
||||
List<CriterionViewModel> GetFilteredList(CriterionSearchModel model);
|
||||
CriterionViewModel? GetElement(CriterionSearchModel model);
|
||||
CriterionViewModel? Insert(CriterionBindingModel model);
|
||||
CriterionViewModel? Update(CriterionBindingModel model);
|
||||
CriterionViewModel? Delete(CriterionBindingModel model);
|
||||
}
|
||||
}
|
16
CourseWorkContracts/StoragesContracts/IResumeStorage.cs
Normal file
16
CourseWorkContracts/StoragesContracts/IResumeStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.StoragesContracts
|
||||
{
|
||||
public interface IResumeStorage
|
||||
{
|
||||
List<ResumeViewModel> GetFullList();
|
||||
List<ResumeViewModel> GetFilteredList(ResumeSearchModel model);
|
||||
ResumeViewModel? GetElement(ResumeSearchModel model);
|
||||
ResumeViewModel? Insert(ResumeBindingModel model);
|
||||
ResumeViewModel? Update(ResumeBindingModel model);
|
||||
ResumeViewModel? Delete(ResumeBindingModel model);
|
||||
}
|
||||
}
|
16
CourseWorkContracts/StoragesContracts/IUserStorage.cs
Normal file
16
CourseWorkContracts/StoragesContracts/IUserStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.StoragesContracts
|
||||
{
|
||||
public interface IUserStorage
|
||||
{
|
||||
List<UserViewModel> GetFullList();
|
||||
List<UserViewModel> GetFilteredList(UserSearchModel model);
|
||||
UserViewModel? GetElement(UserSearchModel model);
|
||||
UserViewModel? Insert(UserBindingModel model);
|
||||
UserViewModel? Update(UserBindingModel model);
|
||||
UserViewModel? Delete(UserBindingModel model);
|
||||
}
|
||||
}
|
16
CourseWorkContracts/StoragesContracts/IVacancyStorage.cs
Normal file
16
CourseWorkContracts/StoragesContracts/IVacancyStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using CandidateReviewContracts.BindingModels;
|
||||
using CandidateReviewContracts.SearchModels;
|
||||
using CandidateReviewContracts.ViewModels;
|
||||
|
||||
namespace CandidateReviewContracts.StoragesContracts
|
||||
{
|
||||
public interface IVacancyStorage
|
||||
{
|
||||
List<VacancyViewModel> GetFullList();
|
||||
List<VacancyViewModel> GetFilteredList(VacancySearchModel model);
|
||||
VacancyViewModel? GetElement(VacancySearchModel model);
|
||||
VacancyViewModel? Insert(VacancyBindingModel model);
|
||||
VacancyViewModel? Update(VacancyBindingModel model);
|
||||
VacancyViewModel? Delete(VacancyBindingModel model);
|
||||
}
|
||||
}
|
19
CourseWorkContracts/ViewModels/AssessmentViewModel.cs
Normal file
19
CourseWorkContracts/ViewModels/AssessmentViewModel.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.ViewModels
|
||||
{
|
||||
public class AssessmentViewModel : IAssessmentModel
|
||||
{
|
||||
public int ResumeId { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public int? Rating { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public string? Comment { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
19
CourseWorkContracts/ViewModels/CompanyViewModel.cs
Normal file
19
CourseWorkContracts/ViewModels/CompanyViewModel.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.ViewModels
|
||||
{
|
||||
public class CompanyViewModel : ICompanyModel
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? Website { get; set; }
|
||||
|
||||
public string? Address { get; set; }
|
||||
|
||||
public string? Contacts { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
18
CourseWorkContracts/ViewModels/CriterionViewModel.cs
Normal file
18
CourseWorkContracts/ViewModels/CriterionViewModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.ViewModels
|
||||
{
|
||||
public class CriterionViewModel : ICriterionModel
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public CriterionTypeEnum Type { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public int Weight { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
28
CourseWorkContracts/ViewModels/ResumeViewModel.cs
Normal file
28
CourseWorkContracts/ViewModels/ResumeViewModel.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.ViewModels
|
||||
{
|
||||
public class ResumeViewModel : IResumeModel
|
||||
{
|
||||
public int VacancyId { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
public string Experience { get; set; } = string.Empty;
|
||||
|
||||
public string Education { get; set; } = string.Empty;
|
||||
|
||||
public string? PhotoFilePath { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string Skills { get; set; } = string.Empty;
|
||||
|
||||
public ResumeStatusEnum Status { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
28
CourseWorkContracts/ViewModels/UserViewModel.cs
Normal file
28
CourseWorkContracts/ViewModels/UserViewModel.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.ViewModels
|
||||
{
|
||||
public class UserViewModel : IUserModel
|
||||
{
|
||||
public int? CompanyId { get; set; }
|
||||
|
||||
public string Surname { get; set; } = string.Empty;
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string? LastName { get; set; }
|
||||
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
public RoleEnum Role { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
30
CourseWorkContracts/ViewModels/VacancyViewModel.cs
Normal file
30
CourseWorkContracts/ViewModels/VacancyViewModel.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using CandidateReviewDataModels.Enums;
|
||||
using CandidateReviewDataModels.Models;
|
||||
|
||||
namespace CandidateReviewContracts.ViewModels
|
||||
{
|
||||
public class VacancyViewModel : IVacancyModel
|
||||
{
|
||||
public int CompanyId { get; set; }
|
||||
|
||||
public string JobTitle { get; set; } = string.Empty;
|
||||
|
||||
public string Requirements { get; set; } = string.Empty;
|
||||
|
||||
public string Responsibilities { get; set; } = string.Empty;
|
||||
|
||||
public JobTypeEnum JobType { get; set; }
|
||||
|
||||
public string? Salary { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public VacancyStatusEnum Status { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public string? Tags { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels.Enums
|
||||
namespace CandidateReviewDataModels.Enums
|
||||
{
|
||||
public enum CriterionTypeEnum
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels.Enums
|
||||
namespace CandidateReviewDataModels.Enums
|
||||
{
|
||||
public enum JobTypeEnum
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels.Enums
|
||||
namespace CandidateReviewDataModels.Enums
|
||||
{
|
||||
public enum ResumeStatusEnum
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels.Enums
|
||||
namespace CandidateReviewDataModels.Enums
|
||||
{
|
||||
public enum RoleEnum
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels.Enums
|
||||
namespace CandidateReviewDataModels.Enums
|
||||
{
|
||||
public enum VacancyStatusEnum
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels
|
||||
namespace CandidateReviewDataModels
|
||||
{
|
||||
public interface IId
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels.Models
|
||||
namespace CandidateReviewDataModels.Models
|
||||
{
|
||||
public interface IAssessmentModel : IId
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWorkDataModels.Models
|
||||
namespace CandidateReviewDataModels.Models
|
||||
{
|
||||
public interface ICompanyModel : IId
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using CourseWorkDataModels.Enums;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
|
||||
namespace CourseWorkDataModels.Models
|
||||
namespace CandidateReviewDataModels.Models
|
||||
{
|
||||
public interface ICriterionModel : IId
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using CourseWorkDataModels.Enums;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
|
||||
namespace CourseWorkDataModels.Models
|
||||
namespace CandidateReviewDataModels.Models
|
||||
{
|
||||
public interface IResumeModel : IId
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using CourseWorkDataModels.Enums;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
|
||||
namespace CourseWorkDataModels.Models
|
||||
namespace CandidateReviewDataModels.Models
|
||||
{
|
||||
public interface IUserModel : IId
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using CourseWorkDataModels.Enums;
|
||||
using CandidateReviewDataModels.Enums;
|
||||
|
||||
namespace CourseWorkDataModels.Models
|
||||
namespace CandidateReviewDataModels.Models
|
||||
{
|
||||
public interface IVacancyModel : IId
|
||||
{
|
||||
|
21
CourseWork_KPO/CandidateReview.csproj
Normal file
21
CourseWork_KPO/CandidateReview.csproj
Normal file
@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CandidateReviewDatabaseImplement\CandidateReviewDatabaseImplement.csproj" />
|
||||
<ProjectReference Include="..\CourseWorkDataModels\CandidateReviewDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
43
CourseWork_KPO/CandidateReview.sln
Normal file
43
CourseWork_KPO/CandidateReview.sln
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34728.123
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CandidateReview", "CandidateReview.csproj", "{33841075-EF26-40F4-8CE0-07C2095872D5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CandidateReviewDataModels", "..\CourseWorkDataModels\CandidateReviewDataModels.csproj", "{E0BF707A-5463-47A4-A990-0C89BCD6D18B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CandidateReviewContracts", "..\CourseWorkContracts\CandidateReviewContracts.csproj", "{5AD56404-B345-41E8-9674-7C2570966AAC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CandidateReviewDatabaseImplement", "..\CandidateReviewDatabaseImplement\CandidateReviewDatabaseImplement.csproj", "{746A65FE-AC70-4D79-9103-218A43903948}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5AD56404-B345-41E8-9674-7C2570966AAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5AD56404-B345-41E8-9674-7C2570966AAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5AD56404-B345-41E8-9674-7C2570966AAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5AD56404-B345-41E8-9674-7C2570966AAC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{746A65FE-AC70-4D79-9103-218A43903948}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{746A65FE-AC70-4D79-9103-218A43903948}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{746A65FE-AC70-4D79-9103-218A43903948}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{746A65FE-AC70-4D79-9103-218A43903948}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F2DC5290-D709-4D1F-84E6-97C8FE1E6590}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,4 +1,4 @@
|
||||
namespace CourseWork_KPO
|
||||
namespace CandidateReview_KPO
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
@ -1,31 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34728.123
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CourseWork_KPO", "CourseWork_KPO.csproj", "{33841075-EF26-40F4-8CE0-07C2095872D5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CourseWorkDataModels", "..\CourseWorkDataModels\CourseWorkDataModels.csproj", "{E0BF707A-5463-47A4-A990-0C89BCD6D18B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{33841075-EF26-40F4-8CE0-07C2095872D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E0BF707A-5463-47A4-A990-0C89BCD6D18B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F2DC5290-D709-4D1F-84E6-97C8FE1E6590}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Loading…
Reference in New Issue
Block a user