refactoring

Entity class InternshipEntity name changed to Internship
namespace Internship changed to InternshipSystem
This commit is contained in:
mborzyszkowski 2020-07-08 18:25:49 +02:00
parent 67cddc1fea
commit 7e181f6887
36 changed files with 61 additions and 1701 deletions

View File

@ -5,17 +5,17 @@ VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A43DB15B-657C-4E02-BC1B-2670DD34D9E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Internship.Api", "src\Internship.Api\Internship.Api.csproj", "{2C72839D-2E0B-4794-9324-3E9E622251E3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternshipSystem.Api", "src\InternshipSystem.Api\InternshipSystem.Api.csproj", "{2C72839D-2E0B-4794-9324-3E9E622251E3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Internship.Repository", "src\Internship.Repository\Internship.Repository.csproj", "{A4697640-0746-4720-9B20-923763612F1A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternshipSystem.Repository", "src\InternshipSystem.Repository\InternshipSystem.Repository.csproj", "{A4697640-0746-4720-9B20-923763612F1A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Internship.Core", "src\Internship.Core\Internship.Core.csproj", "{2C395A11-E3A2-4454-95A1-82A3EAE791EC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternshipSystem.Core", "src\InternshipSystem.Core\InternshipSystem.Core.csproj", "{2C395A11-E3A2-4454-95A1-82A3EAE791EC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{69F62FEE-6768-4B47-9295-4EF5E8E30BEA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Internship.Api.Test", "test\Internship.Api.Test\Internship.Api.Test.csproj", "{90365B6B-B2C6-49D9-84F7-F806B06C1AFE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternshipSystem.Api.Test", "test\InternshipSystem.Api.Test\InternshipSystem.Api.Test.csproj", "{90365B6B-B2C6-49D9-84F7-F806B06C1AFE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Internship.Core.Tests", "test\Internship.Core.Tests\Internship.Core.Tests.csproj", "{748544B4-CBDA-4123-9BD9-499F6C90567F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternshipSystem.Core.Tests", "test\InternshipSystem.Core.Tests\InternshipSystem.Core.Tests.csproj", "{748544B4-CBDA-4123-9BD9-499F6C90567F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -1,428 +0,0 @@
// <auto-generated />
using System;
using Internship.Repository;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Internship.Repository.Migrations
{
[DbContext(typeof(InternshipDbContext))]
[Migration("20200612141652_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("CompanyNip")
.HasColumnName("company_nip")
.HasColumnType("text");
b.Property<int>("Provider")
.HasColumnName("provider")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_branch_office");
b.HasIndex("CompanyNip")
.HasName("ix_branch_office_company_nip");
b.ToTable("branch_office");
});
modelBuilder.Entity("Internship.Core.Company", b =>
{
b.Property<string>("Nip")
.HasColumnName("nip")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<int>("Provider")
.HasColumnName("provider")
.HasColumnType("integer");
b.Property<int>("Range")
.HasColumnName("range")
.HasColumnType("integer");
b.Property<string>("SiteAddress")
.HasColumnName("site_address")
.HasColumnType("text");
b.HasKey("Nip")
.HasName("pk_companies");
b.ToTable("companies");
});
modelBuilder.Entity("Internship.Core.Course", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_course");
b.ToTable("course");
});
modelBuilder.Entity("Internship.Core.Edition", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("EndDate")
.HasColumnName("end_date")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("IPPDeadlineDate")
.HasColumnName("ipp_deadline_date")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("StartDate")
.HasColumnName("start_date")
.HasColumnType("timestamp without time zone");
b.HasKey("Id")
.HasName("pk_editions");
b.ToTable("editions");
});
modelBuilder.Entity("Internship.Core.Intern", b =>
{
b.Property<string>("AlbumNumber")
.HasColumnName("album_number")
.HasColumnType("text");
b.Property<int?>("CourseId")
.HasColumnName("course_id")
.HasColumnType("integer");
b.Property<string>("Email")
.HasColumnName("email")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<int>("Semester")
.HasColumnName("semester")
.HasColumnType("integer");
b.Property<string>("Surname")
.HasColumnName("surname")
.HasColumnType("text");
b.HasKey("AlbumNumber")
.HasName("pk_interns");
b.HasIndex("CourseId")
.HasName("ix_interns_course_id");
b.ToTable("interns");
});
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BranchOfficeId")
.HasColumnName("branch_office_id")
.HasColumnType("integer");
b.Property<int?>("EditionId")
.HasColumnName("edition_id")
.HasColumnType("integer");
b.Property<DateTime>("EndDate")
.HasColumnName("end_date")
.HasColumnType("timestamp without time zone");
b.Property<float>("Grade")
.HasColumnName("grade")
.HasColumnType("real");
b.Property<string>("InternAlbumNumber")
.HasColumnName("intern_album_number")
.HasColumnType("text");
b.Property<int>("InternshipLengthInWeeks")
.HasColumnName("internship_length_in_weeks")
.HasColumnType("integer");
b.Property<bool>("IsAccepted")
.HasColumnName("is_accepted")
.HasColumnType("boolean");
b.Property<int?>("ReportId")
.HasColumnName("report_id")
.HasColumnType("integer");
b.Property<DateTime>("StartDate")
.HasColumnName("start_date")
.HasColumnType("timestamp without time zone");
b.Property<int>("Type")
.HasColumnName("type")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_internships");
b.HasIndex("BranchOfficeId")
.HasName("ix_internships_branch_office_id");
b.HasIndex("EditionId")
.HasName("ix_internships_edition_id");
b.HasIndex("InternAlbumNumber")
.HasName("ix_internships_intern_album_number");
b.HasIndex("ReportId")
.HasName("ix_internships_report_id");
b.ToTable("internships");
});
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("CourseId")
.HasColumnName("course_id")
.HasColumnType("integer");
b.Property<string>("Description")
.HasColumnName("description")
.HasColumnType("text");
b.Property<int?>("EditionId")
.HasColumnName("edition_id")
.HasColumnType("integer");
b.Property<int?>("InternshipEntityId")
.HasColumnName("internship_entity_id")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_internship_program_subject");
b.HasIndex("CourseId")
.HasName("ix_internship_program_subject_course_id");
b.HasIndex("EditionId")
.HasName("ix_internship_program_subject_edition_id");
b.HasIndex("InternshipEntityId")
.HasName("ix_internship_program_subject_internship_entity_id");
b.ToTable("internship_program_subject");
});
modelBuilder.Entity("Internship.Core.Report", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.HasKey("Id")
.HasName("pk_reports");
b.ToTable("reports");
});
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
{
b.HasOne("Internship.Core.Company", "Company")
.WithMany("Branches")
.HasForeignKey("CompanyNip")
.HasConstraintName("fk_branch_office_companies_company_nip");
b.OwnsOne("Internship.Core.Address", "Address", b1 =>
{
b1.Property<int>("BranchOfficeId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<string>("Building")
.HasColumnName("building")
.HasColumnType("text");
b1.Property<string>("City")
.HasColumnName("city")
.HasColumnType("text");
b1.Property<string>("Country")
.HasColumnName("country")
.HasColumnType("text");
b1.Property<string>("PostalCode")
.HasColumnName("postal_code")
.HasColumnType("text");
b1.Property<string>("Street")
.HasColumnName("street")
.HasColumnType("text");
b1.HasKey("BranchOfficeId")
.HasName("pk_branch_office");
b1.ToTable("branch_office");
b1.WithOwner()
.HasForeignKey("BranchOfficeId")
.HasConstraintName("fk_address_branch_office_branch_office_id");
});
});
modelBuilder.Entity("Internship.Core.Intern", b =>
{
b.HasOne("Internship.Core.Course", "Course")
.WithMany()
.HasForeignKey("CourseId")
.HasConstraintName("fk_interns_course_course_id");
});
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
{
b.HasOne("Internship.Core.BranchOffice", "BranchOffice")
.WithMany()
.HasForeignKey("BranchOfficeId")
.HasConstraintName("fk_internships_branch_office_branch_office_id");
b.HasOne("Internship.Core.Edition", "Edition")
.WithMany()
.HasForeignKey("EditionId")
.HasConstraintName("fk_internships_editions_edition_id");
b.HasOne("Internship.Core.Intern", "Intern")
.WithMany()
.HasForeignKey("InternAlbumNumber")
.HasConstraintName("fk_internships_interns_intern_album_number");
b.HasOne("Internship.Core.Report", "Report")
.WithMany()
.HasForeignKey("ReportId")
.HasConstraintName("fk_internships_reports_report_id");
b.OwnsOne("Internship.Core.DeanAcceptance", "DeanAcceptance", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<DateTime>("AcceptanceDate")
.HasColumnName("acceptance_date")
.HasColumnType("timestamp without time zone");
b1.Property<bool>("IsDeansAcceptanceRequired")
.HasColumnName("is_deans_acceptance_required")
.HasColumnType("boolean");
b1.Property<int>("Reason")
.HasColumnName("reason")
.HasColumnType("integer");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_dean_acceptance_internships_internship_entity_id");
});
b.OwnsOne("Internship.Core.Insurance", "Insurance", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<DateTime>("InsuranceDeliveryDate")
.HasColumnName("insurance_delivery_date")
.HasColumnType("timestamp without time zone");
b1.Property<bool>("IsInsuranceRequired")
.HasColumnName("is_insurance_required")
.HasColumnType("boolean");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_insurance_internships_internship_entity_id");
});
});
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
{
b.HasOne("Internship.Core.Course", "Course")
.WithMany()
.HasForeignKey("CourseId")
.HasConstraintName("fk_internship_program_subject_course_course_id");
b.HasOne("Internship.Core.Edition", null)
.WithMany("Subjects")
.HasForeignKey("EditionId")
.HasConstraintName("fk_internship_program_subject_editions_edition_id");
b.HasOne("Internship.Core.InternshipEntity", null)
.WithMany("Program")
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_internship_program_subject_internships_internship_entity_id");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,271 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Internship.Repository.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "companies",
columns: table => new
{
nip = table.Column<string>(nullable: false),
name = table.Column<string>(nullable: true),
range = table.Column<int>(nullable: false),
site_address = table.Column<string>(nullable: true),
provider = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_companies", x => x.nip);
});
migrationBuilder.CreateTable(
name: "course",
columns: table => new
{
id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
name = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_course", x => x.id);
});
migrationBuilder.CreateTable(
name: "editions",
columns: table => new
{
id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
start_date = table.Column<DateTime>(nullable: false),
end_date = table.Column<DateTime>(nullable: false),
ipp_deadline_date = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_editions", x => x.id);
});
migrationBuilder.CreateTable(
name: "reports",
columns: table => new
{
id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
},
constraints: table =>
{
table.PrimaryKey("pk_reports", x => x.id);
});
migrationBuilder.CreateTable(
name: "branch_office",
columns: table => new
{
id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
street = table.Column<string>(nullable: true),
building = table.Column<string>(nullable: true),
city = table.Column<string>(nullable: true),
postal_code = table.Column<string>(nullable: true),
country = table.Column<string>(nullable: true),
company_nip = table.Column<string>(nullable: true),
provider = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_branch_office", x => x.id);
table.ForeignKey(
name: "fk_branch_office_companies_company_nip",
column: x => x.company_nip,
principalTable: "companies",
principalColumn: "nip",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "interns",
columns: table => new
{
album_number = table.Column<string>(nullable: false),
name = table.Column<string>(nullable: true),
surname = table.Column<string>(nullable: true),
email = table.Column<string>(nullable: true),
course_id = table.Column<int>(nullable: true),
semester = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_interns", x => x.album_number);
table.ForeignKey(
name: "fk_interns_course_course_id",
column: x => x.course_id,
principalTable: "course",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "internships",
columns: table => new
{
id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
intern_album_number = table.Column<string>(nullable: true),
edition_id = table.Column<int>(nullable: true),
report_id = table.Column<int>(nullable: true),
branch_office_id = table.Column<int>(nullable: true),
type = table.Column<int>(nullable: false),
start_date = table.Column<DateTime>(nullable: false),
end_date = table.Column<DateTime>(nullable: false),
is_accepted = table.Column<bool>(nullable: false),
acceptance_date = table.Column<DateTime>(nullable: true),
is_deans_acceptance_required = table.Column<bool>(nullable: true),
reason = table.Column<int>(nullable: true),
insurance_delivery_date = table.Column<DateTime>(nullable: true),
is_insurance_required = table.Column<bool>(nullable: true),
internship_length_in_weeks = table.Column<int>(nullable: false),
grade = table.Column<float>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_internships", x => x.id);
table.ForeignKey(
name: "fk_internships_branch_office_branch_office_id",
column: x => x.branch_office_id,
principalTable: "branch_office",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "fk_internships_editions_edition_id",
column: x => x.edition_id,
principalTable: "editions",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "fk_internships_interns_intern_album_number",
column: x => x.intern_album_number,
principalTable: "interns",
principalColumn: "album_number",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "fk_internships_reports_report_id",
column: x => x.report_id,
principalTable: "reports",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "internship_program_subject",
columns: table => new
{
id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
course_id = table.Column<int>(nullable: true),
description = table.Column<string>(nullable: true),
edition_id = table.Column<int>(nullable: true),
internship_entity_id = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_internship_program_subject", x => x.id);
table.ForeignKey(
name: "fk_internship_program_subject_course_course_id",
column: x => x.course_id,
principalTable: "course",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "fk_internship_program_subject_editions_edition_id",
column: x => x.edition_id,
principalTable: "editions",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "fk_internship_program_subject_internships_internship_entity_id",
column: x => x.internship_entity_id,
principalTable: "internships",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "ix_branch_office_company_nip",
table: "branch_office",
column: "company_nip");
migrationBuilder.CreateIndex(
name: "ix_interns_course_id",
table: "interns",
column: "course_id");
migrationBuilder.CreateIndex(
name: "ix_internship_program_subject_course_id",
table: "internship_program_subject",
column: "course_id");
migrationBuilder.CreateIndex(
name: "ix_internship_program_subject_edition_id",
table: "internship_program_subject",
column: "edition_id");
migrationBuilder.CreateIndex(
name: "ix_internship_program_subject_internship_entity_id",
table: "internship_program_subject",
column: "internship_entity_id");
migrationBuilder.CreateIndex(
name: "ix_internships_branch_office_id",
table: "internships",
column: "branch_office_id");
migrationBuilder.CreateIndex(
name: "ix_internships_edition_id",
table: "internships",
column: "edition_id");
migrationBuilder.CreateIndex(
name: "ix_internships_intern_album_number",
table: "internships",
column: "intern_album_number");
migrationBuilder.CreateIndex(
name: "ix_internships_report_id",
table: "internships",
column: "report_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "internship_program_subject");
migrationBuilder.DropTable(
name: "internships");
migrationBuilder.DropTable(
name: "branch_office");
migrationBuilder.DropTable(
name: "editions");
migrationBuilder.DropTable(
name: "interns");
migrationBuilder.DropTable(
name: "reports");
migrationBuilder.DropTable(
name: "companies");
migrationBuilder.DropTable(
name: "course");
}
}
}

View File

@ -1,462 +0,0 @@
// <auto-generated />
using System;
using Internship.Repository;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Internship.Repository.Migrations
{
[DbContext(typeof(InternshipDbContext))]
[Migration("20200706165537_AddMentor")]
partial class AddMentor
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("CompanyNip")
.HasColumnName("company_nip")
.HasColumnType("text");
b.Property<int>("Provider")
.HasColumnName("provider")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_branch_office");
b.HasIndex("CompanyNip")
.HasName("ix_branch_office_company_nip");
b.ToTable("branch_office");
});
modelBuilder.Entity("Internship.Core.Company", b =>
{
b.Property<string>("Nip")
.HasColumnName("nip")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<int>("Provider")
.HasColumnName("provider")
.HasColumnType("integer");
b.Property<int>("Range")
.HasColumnName("range")
.HasColumnType("integer");
b.Property<string>("SiteAddress")
.HasColumnName("site_address")
.HasColumnType("text");
b.HasKey("Nip")
.HasName("pk_companies");
b.ToTable("companies");
});
modelBuilder.Entity("Internship.Core.Course", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_course");
b.ToTable("course");
});
modelBuilder.Entity("Internship.Core.Edition", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("EndDate")
.HasColumnName("end_date")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("IPPDeadlineDate")
.HasColumnName("ipp_deadline_date")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("StartDate")
.HasColumnName("start_date")
.HasColumnType("timestamp without time zone");
b.HasKey("Id")
.HasName("pk_editions");
b.ToTable("editions");
});
modelBuilder.Entity("Internship.Core.Intern", b =>
{
b.Property<string>("AlbumNumber")
.HasColumnName("album_number")
.HasColumnType("text");
b.Property<int?>("CourseId")
.HasColumnName("course_id")
.HasColumnType("integer");
b.Property<string>("Email")
.HasColumnName("email")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<int>("Semester")
.HasColumnName("semester")
.HasColumnType("integer");
b.Property<string>("Surname")
.HasColumnName("surname")
.HasColumnType("text");
b.HasKey("AlbumNumber")
.HasName("pk_interns");
b.HasIndex("CourseId")
.HasName("ix_interns_course_id");
b.ToTable("interns");
});
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BranchOfficeId")
.HasColumnName("branch_office_id")
.HasColumnType("integer");
b.Property<int?>("EditionId")
.HasColumnName("edition_id")
.HasColumnType("integer");
b.Property<DateTime>("EndDate")
.HasColumnName("end_date")
.HasColumnType("timestamp without time zone");
b.Property<float>("Grade")
.HasColumnName("grade")
.HasColumnType("real");
b.Property<string>("InternAlbumNumber")
.HasColumnName("intern_album_number")
.HasColumnType("text");
b.Property<int>("InternshipLengthInWeeks")
.HasColumnName("internship_length_in_weeks")
.HasColumnType("integer");
b.Property<bool>("IsAccepted")
.HasColumnName("is_accepted")
.HasColumnType("boolean");
b.Property<int?>("ReportId")
.HasColumnName("report_id")
.HasColumnType("integer");
b.Property<DateTime>("StartDate")
.HasColumnName("start_date")
.HasColumnType("timestamp without time zone");
b.Property<int>("Type")
.HasColumnName("type")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_internships");
b.HasIndex("BranchOfficeId")
.HasName("ix_internships_branch_office_id");
b.HasIndex("EditionId")
.HasName("ix_internships_edition_id");
b.HasIndex("InternAlbumNumber")
.HasName("ix_internships_intern_album_number");
b.HasIndex("ReportId")
.HasName("ix_internships_report_id");
b.ToTable("internships");
});
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("CourseId")
.HasColumnName("course_id")
.HasColumnType("integer");
b.Property<string>("Description")
.HasColumnName("description")
.HasColumnType("text");
b.Property<int?>("EditionId")
.HasColumnName("edition_id")
.HasColumnType("integer");
b.Property<int?>("InternshipEntityId")
.HasColumnName("internship_entity_id")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_internship_program_subject");
b.HasIndex("CourseId")
.HasName("ix_internship_program_subject_course_id");
b.HasIndex("EditionId")
.HasName("ix_internship_program_subject_edition_id");
b.HasIndex("InternshipEntityId")
.HasName("ix_internship_program_subject_internship_entity_id");
b.ToTable("internship_program_subject");
});
modelBuilder.Entity("Internship.Core.Report", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.HasKey("Id")
.HasName("pk_reports");
b.ToTable("reports");
});
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
{
b.HasOne("Internship.Core.Company", "Company")
.WithMany("Branches")
.HasForeignKey("CompanyNip")
.HasConstraintName("fk_branch_office_companies_company_nip");
b.OwnsOne("Internship.Core.Address", "Address", b1 =>
{
b1.Property<int>("BranchOfficeId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<string>("Building")
.HasColumnName("building")
.HasColumnType("text");
b1.Property<string>("City")
.HasColumnName("city")
.HasColumnType("text");
b1.Property<string>("Country")
.HasColumnName("country")
.HasColumnType("text");
b1.Property<string>("PostalCode")
.HasColumnName("postal_code")
.HasColumnType("text");
b1.Property<string>("Street")
.HasColumnName("street")
.HasColumnType("text");
b1.HasKey("BranchOfficeId")
.HasName("pk_branch_office");
b1.ToTable("branch_office");
b1.WithOwner()
.HasForeignKey("BranchOfficeId")
.HasConstraintName("fk_address_branch_office_branch_office_id");
});
});
modelBuilder.Entity("Internship.Core.Intern", b =>
{
b.HasOne("Internship.Core.Course", "Course")
.WithMany()
.HasForeignKey("CourseId")
.HasConstraintName("fk_interns_course_course_id");
});
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
{
b.HasOne("Internship.Core.BranchOffice", "BranchOffice")
.WithMany()
.HasForeignKey("BranchOfficeId")
.HasConstraintName("fk_internships_branch_office_branch_office_id");
b.HasOne("Internship.Core.Edition", "Edition")
.WithMany()
.HasForeignKey("EditionId")
.HasConstraintName("fk_internships_editions_edition_id");
b.HasOne("Internship.Core.Intern", "Intern")
.WithMany()
.HasForeignKey("InternAlbumNumber")
.HasConstraintName("fk_internships_interns_intern_album_number");
b.HasOne("Internship.Core.Report", "Report")
.WithMany()
.HasForeignKey("ReportId")
.HasConstraintName("fk_internships_reports_report_id");
b.OwnsOne("Internship.Core.DeanAcceptance", "DeanAcceptance", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<DateTime>("AcceptanceDate")
.HasColumnName("acceptance_date")
.HasColumnType("timestamp without time zone");
b1.Property<bool>("IsDeansAcceptanceRequired")
.HasColumnName("is_deans_acceptance_required")
.HasColumnType("boolean");
b1.Property<int>("Reason")
.HasColumnName("reason")
.HasColumnType("integer");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_dean_acceptance_internships_internship_entity_id");
});
b.OwnsOne("Internship.Core.Insurance", "Insurance", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<DateTime>("InsuranceDeliveryDate")
.HasColumnName("insurance_delivery_date")
.HasColumnType("timestamp without time zone");
b1.Property<bool>("IsInsuranceRequired")
.HasColumnName("is_insurance_required")
.HasColumnType("boolean");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_insurance_internships_internship_entity_id");
});
b.OwnsOne("Internship.Core.Mentor", "Mentor", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<string>("Emali")
.HasColumnName("emali")
.HasColumnType("text");
b1.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b1.Property<string>("Phone")
.HasColumnName("phone")
.HasColumnType("text");
b1.Property<string>("Surname")
.HasColumnName("surname")
.HasColumnType("text");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_mentor_internships_internship_entity_id");
});
});
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
{
b.HasOne("Internship.Core.Course", "Course")
.WithMany()
.HasForeignKey("CourseId")
.HasConstraintName("fk_internship_program_subject_course_course_id");
b.HasOne("Internship.Core.Edition", null)
.WithMany("Subjects")
.HasForeignKey("EditionId")
.HasConstraintName("fk_internship_program_subject_editions_edition_id");
b.HasOne("Internship.Core.InternshipEntity", null)
.WithMany("Program")
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_internship_program_subject_internships_internship_entity_id");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,49 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Internship.Repository.Migrations
{
public partial class AddMentor : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "emali",
table: "internships",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "name",
table: "internships",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "phone",
table: "internships",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "surname",
table: "internships",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "emali",
table: "internships");
migrationBuilder.DropColumn(
name: "name",
table: "internships");
migrationBuilder.DropColumn(
name: "phone",
table: "internships");
migrationBuilder.DropColumn(
name: "surname",
table: "internships");
}
}
}

View File

@ -1,460 +0,0 @@
// <auto-generated />
using System;
using Internship.Repository;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Internship.Repository.Migrations
{
[DbContext(typeof(InternshipDbContext))]
partial class InternshipDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("CompanyNip")
.HasColumnName("company_nip")
.HasColumnType("text");
b.Property<int>("Provider")
.HasColumnName("provider")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_branch_office");
b.HasIndex("CompanyNip")
.HasName("ix_branch_office_company_nip");
b.ToTable("branch_office");
});
modelBuilder.Entity("Internship.Core.Company", b =>
{
b.Property<string>("Nip")
.HasColumnName("nip")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<int>("Provider")
.HasColumnName("provider")
.HasColumnType("integer");
b.Property<int>("Range")
.HasColumnName("range")
.HasColumnType("integer");
b.Property<string>("SiteAddress")
.HasColumnName("site_address")
.HasColumnType("text");
b.HasKey("Nip")
.HasName("pk_companies");
b.ToTable("companies");
});
modelBuilder.Entity("Internship.Core.Course", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_course");
b.ToTable("course");
});
modelBuilder.Entity("Internship.Core.Edition", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<DateTime>("EndDate")
.HasColumnName("end_date")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("IPPDeadlineDate")
.HasColumnName("ipp_deadline_date")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("StartDate")
.HasColumnName("start_date")
.HasColumnType("timestamp without time zone");
b.HasKey("Id")
.HasName("pk_editions");
b.ToTable("editions");
});
modelBuilder.Entity("Internship.Core.Intern", b =>
{
b.Property<string>("AlbumNumber")
.HasColumnName("album_number")
.HasColumnType("text");
b.Property<int?>("CourseId")
.HasColumnName("course_id")
.HasColumnType("integer");
b.Property<string>("Email")
.HasColumnName("email")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<int>("Semester")
.HasColumnName("semester")
.HasColumnType("integer");
b.Property<string>("Surname")
.HasColumnName("surname")
.HasColumnType("text");
b.HasKey("AlbumNumber")
.HasName("pk_interns");
b.HasIndex("CourseId")
.HasName("ix_interns_course_id");
b.ToTable("interns");
});
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("BranchOfficeId")
.HasColumnName("branch_office_id")
.HasColumnType("integer");
b.Property<int?>("EditionId")
.HasColumnName("edition_id")
.HasColumnType("integer");
b.Property<DateTime>("EndDate")
.HasColumnName("end_date")
.HasColumnType("timestamp without time zone");
b.Property<float>("Grade")
.HasColumnName("grade")
.HasColumnType("real");
b.Property<string>("InternAlbumNumber")
.HasColumnName("intern_album_number")
.HasColumnType("text");
b.Property<int>("InternshipLengthInWeeks")
.HasColumnName("internship_length_in_weeks")
.HasColumnType("integer");
b.Property<bool>("IsAccepted")
.HasColumnName("is_accepted")
.HasColumnType("boolean");
b.Property<int?>("ReportId")
.HasColumnName("report_id")
.HasColumnType("integer");
b.Property<DateTime>("StartDate")
.HasColumnName("start_date")
.HasColumnType("timestamp without time zone");
b.Property<int>("Type")
.HasColumnName("type")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_internships");
b.HasIndex("BranchOfficeId")
.HasName("ix_internships_branch_office_id");
b.HasIndex("EditionId")
.HasName("ix_internships_edition_id");
b.HasIndex("InternAlbumNumber")
.HasName("ix_internships_intern_album_number");
b.HasIndex("ReportId")
.HasName("ix_internships_report_id");
b.ToTable("internships");
});
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int?>("CourseId")
.HasColumnName("course_id")
.HasColumnType("integer");
b.Property<string>("Description")
.HasColumnName("description")
.HasColumnType("text");
b.Property<int?>("EditionId")
.HasColumnName("edition_id")
.HasColumnType("integer");
b.Property<int?>("InternshipEntityId")
.HasColumnName("internship_entity_id")
.HasColumnType("integer");
b.HasKey("Id")
.HasName("pk_internship_program_subject");
b.HasIndex("CourseId")
.HasName("ix_internship_program_subject_course_id");
b.HasIndex("EditionId")
.HasName("ix_internship_program_subject_edition_id");
b.HasIndex("InternshipEntityId")
.HasName("ix_internship_program_subject_internship_entity_id");
b.ToTable("internship_program_subject");
});
modelBuilder.Entity("Internship.Core.Report", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.HasKey("Id")
.HasName("pk_reports");
b.ToTable("reports");
});
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
{
b.HasOne("Internship.Core.Company", "Company")
.WithMany("Branches")
.HasForeignKey("CompanyNip")
.HasConstraintName("fk_branch_office_companies_company_nip");
b.OwnsOne("Internship.Core.Address", "Address", b1 =>
{
b1.Property<int>("BranchOfficeId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<string>("Building")
.HasColumnName("building")
.HasColumnType("text");
b1.Property<string>("City")
.HasColumnName("city")
.HasColumnType("text");
b1.Property<string>("Country")
.HasColumnName("country")
.HasColumnType("text");
b1.Property<string>("PostalCode")
.HasColumnName("postal_code")
.HasColumnType("text");
b1.Property<string>("Street")
.HasColumnName("street")
.HasColumnType("text");
b1.HasKey("BranchOfficeId")
.HasName("pk_branch_office");
b1.ToTable("branch_office");
b1.WithOwner()
.HasForeignKey("BranchOfficeId")
.HasConstraintName("fk_address_branch_office_branch_office_id");
});
});
modelBuilder.Entity("Internship.Core.Intern", b =>
{
b.HasOne("Internship.Core.Course", "Course")
.WithMany()
.HasForeignKey("CourseId")
.HasConstraintName("fk_interns_course_course_id");
});
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
{
b.HasOne("Internship.Core.BranchOffice", "BranchOffice")
.WithMany()
.HasForeignKey("BranchOfficeId")
.HasConstraintName("fk_internships_branch_office_branch_office_id");
b.HasOne("Internship.Core.Edition", "Edition")
.WithMany()
.HasForeignKey("EditionId")
.HasConstraintName("fk_internships_editions_edition_id");
b.HasOne("Internship.Core.Intern", "Intern")
.WithMany()
.HasForeignKey("InternAlbumNumber")
.HasConstraintName("fk_internships_interns_intern_album_number");
b.HasOne("Internship.Core.Report", "Report")
.WithMany()
.HasForeignKey("ReportId")
.HasConstraintName("fk_internships_reports_report_id");
b.OwnsOne("Internship.Core.DeanAcceptance", "DeanAcceptance", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<DateTime>("AcceptanceDate")
.HasColumnName("acceptance_date")
.HasColumnType("timestamp without time zone");
b1.Property<bool>("IsDeansAcceptanceRequired")
.HasColumnName("is_deans_acceptance_required")
.HasColumnType("boolean");
b1.Property<int>("Reason")
.HasColumnName("reason")
.HasColumnType("integer");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_dean_acceptance_internships_internship_entity_id");
});
b.OwnsOne("Internship.Core.Insurance", "Insurance", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<DateTime>("InsuranceDeliveryDate")
.HasColumnName("insurance_delivery_date")
.HasColumnType("timestamp without time zone");
b1.Property<bool>("IsInsuranceRequired")
.HasColumnName("is_insurance_required")
.HasColumnType("boolean");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_insurance_internships_internship_entity_id");
});
b.OwnsOne("Internship.Core.Mentor", "Mentor", b1 =>
{
b1.Property<int>("InternshipEntityId")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b1.Property<string>("Emali")
.HasColumnName("emali")
.HasColumnType("text");
b1.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b1.Property<string>("Phone")
.HasColumnName("phone")
.HasColumnType("text");
b1.Property<string>("Surname")
.HasColumnName("surname")
.HasColumnType("text");
b1.HasKey("InternshipEntityId")
.HasName("pk_internships");
b1.ToTable("internships");
b1.WithOwner()
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_mentor_internships_internship_entity_id");
});
});
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
{
b.HasOne("Internship.Core.Course", "Course")
.WithMany()
.HasForeignKey("CourseId")
.HasConstraintName("fk_internship_program_subject_course_course_id");
b.HasOne("Internship.Core.Edition", null)
.WithMany("Subjects")
.HasForeignKey("EditionId")
.HasConstraintName("fk_internship_program_subject_editions_edition_id");
b.HasOne("Internship.Core.InternshipEntity", null)
.WithMany("Program")
.HasForeignKey("InternshipEntityId")
.HasConstraintName("fk_internship_program_subject_internships_internship_entity_id");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,26 @@
using System;
using Microsoft.AspNetCore.Mvc;
using InternshipSystem.Core;
namespace InternshipSystem.Api.Controllers {
[ApiController]
//[Route("[internship]")]
public class InternshipController : ControllerBase {
[HttpGet]
public IActionResult GetInternships() {
//TODO: parse params
//return JsonResult("");
return Ok();
}
[HttpPost]
public IActionResult CreateInternship(Internship internship) {
//TODO: add internship
return Ok();
}
}
}

View File

@ -17,4 +17,8 @@
<Folder Include="Controllers" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Internship.Core\InternshipSystem.Core.csproj" />
</ItemGroup>
</Project>

View File

@ -10,7 +10,7 @@ using Serilog;
using Serilog.Events;
using Serilog.Formatting.Compact;
namespace Internship.Api
namespace InternshipSystem.Api
{
public class Program
{

View File

@ -5,7 +5,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
namespace Internship.Api
namespace InternshipSystem.Api
{
public class Startup
{

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Address
{

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public class BranchOffice
{

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Company
{

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Course
{

View File

@ -1,6 +1,6 @@
using System;
namespace Internship.Core
namespace InternshipSystem.Core
{
public class DeanAcceptance
{

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Edition
{

View File

@ -1,6 +1,6 @@
using System;
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Insurance
{

View File

@ -1,6 +1,6 @@
using System;
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Intern
{

View File

@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
namespace Internship.Core
namespace InternshipSystem.Core
{
public class InternshipEntity
public class Internship
{
public int Id { get; set; }
public Intern Intern { get; set; }

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public class InternshipProgramSubject
{

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public enum InternshipType
{

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Mentor {
public string Name { get; set; }

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public enum RangeOfActivities
{

View File

@ -1,4 +1,4 @@
namespace Internship.Core
namespace InternshipSystem.Core
{
public class Report
{

View File

@ -1,11 +1,11 @@
using Microsoft.EntityFrameworkCore;
using Internship.Core;
using InternshipSystem.Core;
namespace Internship.Repository
namespace InternshipSystem.Repository
{
public class InternshipDbContext : DbContext
{
public DbSet<InternshipEntity> Internships { get; set; }
public DbSet<Internship> Internships { get; set; }
public DbSet<Company> Companies { get; set; }
public DbSet<Edition> Editions { get; set; }
public DbSet<Report> Reports { get; set; }
@ -17,7 +17,7 @@ namespace Internship.Repository
protected override void OnModelCreating(ModelBuilder modelBuilder) {
modelBuilder
.Entity<InternshipEntity>(ie => {
.Entity<Internship>(ie => {
ie.OwnsOne(i => i.DeanAcceptance);
ie.OwnsOne(i => i.Insurance);
ie.OwnsOne(i => i.Mentor);

View File

@ -16,7 +16,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Internship.Core\Internship.Core.csproj" />
<ProjectReference Include="..\InternshipSystem.Core\InternshipSystem.Core.csproj" />
</ItemGroup>
</Project>

View File

@ -1,6 +1,6 @@
using System;
using Machine.Specifications;
namespace Internship.Api.Test
namespace InternshipSystem.Api.Test
{
}

View File

@ -16,7 +16,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Internship.Core\Internship.Core.csproj" />
<ProjectReference Include="..\..\src\InternshipSystem.Core\InternshipSystem.Core.csproj" />
</ItemGroup>
</Project>

View File

@ -2,9 +2,9 @@ using System;
using Machine.Specifications;
// ReSharper disable InconsistentNaming
namespace Internship.Core.Tests
namespace InternshipSystem.Core.Tests
{
[Subject(typeof(InternshipEntity))]
[Subject(typeof(Internship))]
class When_doing_something
{
Establish context = () => { };