diff --git a/.docker/docker-compose.yaml b/.docker/docker-compose.yaml index fc4967b..f2625a2 100644 --- a/.docker/docker-compose.yaml +++ b/.docker/docker-compose.yaml @@ -6,14 +6,13 @@ services: environment: CONNECTIONSTRINGS__INTERNSHIPDATABASE: "Host=db.postgres;Port=5432;Database=postgres;Username=postgres;Password=szwoniu" ASPNETCORE_ENVIRONMENT: Development - APIPREFIX: /api depends_on: - db.postgres ports: - 8080:80 db.postgres: - image: mborzyszkowski/internship_system_db:latest + image: postgres:latest restart: always environment: POSTGRES_PASSWORD: szwoniu diff --git a/src/InternshipSystem.Api/Controllers/AdminController.cs b/src/InternshipSystem.Api/Controllers/AdminController.cs index 9e81473..bf7e2e5 100644 --- a/src/InternshipSystem.Api/Controllers/AdminController.cs +++ b/src/InternshipSystem.Api/Controllers/AdminController.cs @@ -1,60 +1,60 @@ -using System.Threading.Tasks; -using InternshipSystem.Repository; -using Microsoft.AspNetCore.Mvc; - -namespace Internship.Api.Controller -{ - [ApiController] - [Route("admin")] - public class AdminController : ControllerBase - { - public AdminController(DatabaseFiller fillerService) - { - FillerService = fillerService; - } - - public DatabaseFiller FillerService { get; } - - - [HttpPost("fill")] - public async Task Fill() { - await FillerService.FillCompany(); - await FillerService.FillInterns(); - await FillerService.FillInternshipTypes(); - await FillerService.FillEditions(); - await FillerService.FillInternShips(); - return Ok(); - } - - [HttpPost("fill/companies")] - public async Task FillCompaniesAsync() - { - await FillerService.FillCompany(); - return Ok(); - } - - [HttpPost("fill/interns")] - public async Task FillInternsAsync() { - await FillerService.FillInterns(); - return Ok(); - } - - [HttpPost("fill/internshiptypes")] - public async Task FillInternshipTypesAsync() { - await FillerService.FillInternshipTypes(); - return Ok(); - } - - [HttpPost("fill/editions")] - public async Task FillEditionsAsync() { - await FillerService.FillEditions(); - return Ok(); - } - - [HttpPost("fill/internships")] - public async Task FillInternShipsAsync() { - await FillerService.FillInternShips(); - return Ok(); - } - } -} \ No newline at end of file +// using System.Threading.Tasks; +// using InternshipSystem.Repository; +// using Microsoft.AspNetCore.Mvc; +// +// namespace Internship.Api.Controller +// { +// [ApiController] +// [Route("admin")] +// public class AdminController : ControllerBase +// { +// public AdminController(DatabaseFiller fillerService) +// { +// FillerService = fillerService; +// } +// +// public DatabaseFiller FillerService { get; } +// +// +// [HttpPost("fill")] +// public async Task Fill() { +// await FillerService.FillCompany(); +// await FillerService.FillInterns(); +// await FillerService.FillInternshipTypes(); +// await FillerService.FillEditions(); +// await FillerService.FillInternShips(); +// return Ok(); +// } +// +// [HttpPost("fill/companies")] +// public async Task FillCompaniesAsync() +// { +// await FillerService.FillCompany(); +// return Ok(); +// } +// +// [HttpPost("fill/interns")] +// public async Task FillInternsAsync() { +// await FillerService.FillInterns(); +// return Ok(); +// } +// +// [HttpPost("fill/internshiptypes")] +// public async Task FillInternshipTypesAsync() { +// await FillerService.FillInternshipTypes(); +// return Ok(); +// } +// +// [HttpPost("fill/editions")] +// public async Task FillEditionsAsync() { +// await FillerService.FillEditions(); +// return Ok(); +// } +// +// [HttpPost("fill/internships")] +// public async Task FillInternShipsAsync() { +// await FillerService.FillInternShips(); +// return Ok(); +// } +// } +// } \ No newline at end of file diff --git a/src/InternshipSystem.Api/Controllers/CompaniesController.cs b/src/InternshipSystem.Api/Controllers/CompaniesController.cs index f08aae1..fb8f49c 100644 --- a/src/InternshipSystem.Api/Controllers/CompaniesController.cs +++ b/src/InternshipSystem.Api/Controllers/CompaniesController.cs @@ -1,40 +1,40 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using InternshipSystem.Api.Queries; -using InternshipSystem.Core; -using InternshipSystem.Repository; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; - -namespace InternshipSystem.Api.Controllers -{ - [ApiController] - [Route("companies")] - public class CompaniesController : ControllerBase - { - public CompaniesController(InternshipDbContext context) - { - Context = context; - } - private InternshipDbContext Context { get; } - - /// - /// Get companies matching provided paginated query - /// - /// Paginated query description - /// Part of companies collection - [HttpGet] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task> SearchByNameAsync([FromQuery] SearchQuery searchQuery, CancellationToken cancellationToken) => - await Context.Companies - .Where(c => c.Name.ToLower().Contains(searchQuery.Query.ToLower())) - .OrderBy(o => o.Name) - .Skip(searchQuery.Page * searchQuery.PerPage) - .Take(searchQuery.PerPage) - .ToListAsync(cancellationToken); - } - -} \ No newline at end of file +// using System.Collections.Generic; +// using System.Linq; +// using System.Threading; +// using System.Threading.Tasks; +// using InternshipSystem.Api.Queries; +// using InternshipSystem.Core; +// using InternshipSystem.Repository; +// using Microsoft.AspNetCore.Http; +// using Microsoft.AspNetCore.Mvc; +// using Microsoft.EntityFrameworkCore; +// +// namespace InternshipSystem.Api.Controllers +// { +// [ApiController] +// [Route("companies")] +// public class CompaniesController : ControllerBase +// { +// public CompaniesController(InternshipDbContext context) +// { +// Context = context; +// } +// private InternshipDbContext Context { get; } +// +// /// +// /// Get companies matching provided paginated query +// /// +// /// Paginated query description +// /// Part of companies collection +// [HttpGet] +// [ProducesResponseType(StatusCodes.Status200OK)] +// public async Task> SearchByNameAsync([FromQuery] SearchQuery searchQuery, CancellationToken cancellationToken) => +// await Context.Companies +// .Where(c => c.Name.ToLower().Contains(searchQuery.Query.ToLower())) +// .OrderBy(o => o.Name) +// .Skip(searchQuery.Page * searchQuery.PerPage) +// .Take(searchQuery.PerPage) +// .ToListAsync(cancellationToken); +// } +// +// } \ No newline at end of file diff --git a/src/InternshipSystem.Api/Startup.cs b/src/InternshipSystem.Api/Startup.cs index aa5f0c8..71e2992 100644 --- a/src/InternshipSystem.Api/Startup.cs +++ b/src/InternshipSystem.Api/Startup.cs @@ -29,7 +29,7 @@ namespace InternshipSystem.Api var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); options.IncludeXmlComments(xmlPath); }) - .AddScoped() + // .AddScoped() .AddControllers() ; diff --git a/src/InternshipSystem.Core/Entity/Approval.cs b/src/InternshipSystem.Core/Entity/Approval.cs new file mode 100644 index 0000000..f79d782 --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Approval.cs @@ -0,0 +1,9 @@ +namespace InternshipSystem.Core +{ + public class Approval + { + public long Id { get; set; } + public byte[] Scan { get; set; } + public DocumentState State { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/BranchOffice.cs b/src/InternshipSystem.Core/Entity/BranchOffice.cs new file mode 100644 index 0000000..9f3dac9 --- /dev/null +++ b/src/InternshipSystem.Core/Entity/BranchOffice.cs @@ -0,0 +1,9 @@ +namespace InternshipSystem.Core +{ + public class BranchOffice + { + public long Id { get; set; } + + public BranchAddress Address { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Company.cs b/src/InternshipSystem.Core/Entity/Company.cs new file mode 100644 index 0000000..0d69b13 --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Company.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using System.Linq; + +namespace InternshipSystem.Core +{ + public class Company + { + public long Id { get; set; } + public Nip Nip { get; set; } + public string Name { get; set; } + public RangeOfActivity Range { get; set; } + public List Branches { get; set; } + + public Company CreateCompany(Nip nip, RangeOfActivity range, string name) + { + return new Company + { + Nip = nip, + Range = range, + Name = name + }; + } + + public void AddBranchAddress(BranchAddress branch) + { + } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Course.cs b/src/InternshipSystem.Core/Entity/Course.cs new file mode 100644 index 0000000..68d15ba --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Course.cs @@ -0,0 +1,8 @@ +namespace InternshipSystem.Core +{ + public class Course + { + public long Id { get; set; } + public string Name { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Document.cs b/src/InternshipSystem.Core/Entity/Document.cs new file mode 100644 index 0000000..6a75cc2 --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Document.cs @@ -0,0 +1,9 @@ +namespace InternshipSystem.Core +{ + public class Document + { + public long Id { get; set; } + public string Description { get; set; } + public DocumentState State { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Edition.cs b/src/InternshipSystem.Core/Entity/Edition.cs new file mode 100644 index 0000000..70fd418 --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Edition.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace InternshipSystem.Core +{ + public class Edition + { + public long Id { get; private set; } + public DateTime EditionStart { get; private set; } + public DateTime EditionFinish { get; private set; } + public DateTime ReportingStart { get; private set; } + public Course Course { get; private set; } + public IReadOnlyCollection AvailableSubjects { get; private set; } + + public Edition CreateEdition(DateTime start, DateTime end, DateTime reportingStart) + { + return new Edition + { + EditionStart = start, + EditionFinish = end, + ReportingStart = reportingStart + }; + } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Internship/Internship.cs b/src/InternshipSystem.Core/Entity/Internship/Internship.cs new file mode 100644 index 0000000..3d3bc20 --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Internship/Internship.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace InternshipSystem.Core +{ + public class Internship + { + public long Id { get; set; } + public Student Student { get; set; } + public InternshipRegistration InternshipRegistration { get; set; } + public InternshipProgram InternshipProgram { get; set; } + public Report Report { get; set; } + public List Approvals { get; set; } + public List Documents { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Internship/InternshipProgram.cs b/src/InternshipSystem.Core/Entity/Internship/InternshipProgram.cs new file mode 100644 index 0000000..89b2eb3 --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Internship/InternshipProgram.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace InternshipSystem.Core +{ + public class InternshipProgram + { + public long Id { get; set; } + public Mentor Mentor { get; set; } + public List ChosenSubjects { get; set; } + public DocumentState State { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs b/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs new file mode 100644 index 0000000..7861b8a --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs @@ -0,0 +1,15 @@ +using System; + +namespace InternshipSystem.Core +{ + public class InternshipRegistration + { + public long Id { get; set; } + public Company Company { get; set; } + public BranchOffice BranchAddress { get; set; } + public DateTime Start { get; set; } + public DateTime End { get; set; } + public InternshipType Type { get; set; } + public DocumentState State { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Report.cs b/src/InternshipSystem.Core/Entity/Report.cs new file mode 100644 index 0000000..944678d --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Report.cs @@ -0,0 +1,8 @@ +namespace InternshipSystem.Core +{ + public class Report + { + public long Id { get; set; } + public DocumentState State { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Entity/Student.cs b/src/InternshipSystem.Core/Entity/Student.cs new file mode 100644 index 0000000..b3e7fab --- /dev/null +++ b/src/InternshipSystem.Core/Entity/Student.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace InternshipSystem.Core +{ + public class Student + { + public long Id { get; set; } + public int AlbumNumber { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } + public int Semester { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Interface/Repository/IInternshipRepository.cs b/src/InternshipSystem.Core/Interface/Repository/IInternshipRepository.cs new file mode 100644 index 0000000..d2de047 --- /dev/null +++ b/src/InternshipSystem.Core/Interface/Repository/IInternshipRepository.cs @@ -0,0 +1,11 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace InternshipSystem.Core.Interface.Repository +{ + public interface IInternshipRepository + { + Task SaveInternship(Internship internship, CancellationToken token); + Task GetStudentsInternship(Student student, CancellationToken token); + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/Interface/Repository/IStudentRepository.cs b/src/InternshipSystem.Core/Interface/Repository/IStudentRepository.cs new file mode 100644 index 0000000..7cc0826 --- /dev/null +++ b/src/InternshipSystem.Core/Interface/Repository/IStudentRepository.cs @@ -0,0 +1,11 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace InternshipSystem.Core.Interface.Repository +{ + public interface IStudentRepository + { + Task GetAlbumNumber(int album, CancellationToken token); + Task SaveStudent(Student student, CancellationToken token); + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Address.cs b/src/InternshipSystem.Core/ValueObject/BranchAddress.cs similarity index 88% rename from src/InternshipSystem.Repository/Model/Address.cs rename to src/InternshipSystem.Core/ValueObject/BranchAddress.cs index 95b2dcc..3538ec6 100644 --- a/src/InternshipSystem.Repository/Model/Address.cs +++ b/src/InternshipSystem.Core/ValueObject/BranchAddress.cs @@ -1,6 +1,6 @@ namespace InternshipSystem.Core { - public class Address + public struct BranchAddress { public string Street { get; set; } public string Building { get; set; } @@ -8,4 +8,4 @@ public string PostalCode { get; set; } public string Country { get; set; } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/ValueObject/DocumentState.cs b/src/InternshipSystem.Core/ValueObject/DocumentState.cs new file mode 100644 index 0000000..465aa58 --- /dev/null +++ b/src/InternshipSystem.Core/ValueObject/DocumentState.cs @@ -0,0 +1,10 @@ +namespace InternshipSystem.Core +{ + public enum DocumentState + { + Draft, + Submitted, + Accepted, + Rejected + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/ValueObject/InternshipSubject.cs b/src/InternshipSystem.Core/ValueObject/InternshipSubject.cs new file mode 100644 index 0000000..7e4d091 --- /dev/null +++ b/src/InternshipSystem.Core/ValueObject/InternshipSubject.cs @@ -0,0 +1,7 @@ +namespace InternshipSystem.Core +{ + public struct InternshipSubject + { + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/InternshipType.cs b/src/InternshipSystem.Core/ValueObject/InternshipType.cs similarity index 67% rename from src/InternshipSystem.Repository/Model/InternshipType.cs rename to src/InternshipSystem.Core/ValueObject/InternshipType.cs index 22eff95..5b0ca30 100644 --- a/src/InternshipSystem.Repository/Model/InternshipType.cs +++ b/src/InternshipSystem.Core/ValueObject/InternshipType.cs @@ -1,8 +1,7 @@ namespace InternshipSystem.Core { - public class InternshipType + public struct InternshipType { - public int Id { get; set; } public string Type { get; set; } public string Description { get; set; } } diff --git a/src/InternshipSystem.Core/ValueObject/Mentor.cs b/src/InternshipSystem.Core/ValueObject/Mentor.cs new file mode 100644 index 0000000..27d982d --- /dev/null +++ b/src/InternshipSystem.Core/ValueObject/Mentor.cs @@ -0,0 +1,10 @@ +namespace InternshipSystem.Core +{ + public struct Mentor + { + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } + public PhoneNumber PhoneNumber { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/ValueObject/Nip.cs b/src/InternshipSystem.Core/ValueObject/Nip.cs new file mode 100644 index 0000000..06053d7 --- /dev/null +++ b/src/InternshipSystem.Core/ValueObject/Nip.cs @@ -0,0 +1,18 @@ +namespace InternshipSystem.Core +{ + public struct Nip + { + private readonly string nip; + + private Nip(string maybeNip) + { + nip = maybeNip; + } + + public static implicit operator string(Nip nip) => + nip.nip; + + public static implicit operator Nip(string maybeNip) => + new Nip(maybeNip); + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/ValueObject/PhoneNumber.cs b/src/InternshipSystem.Core/ValueObject/PhoneNumber.cs new file mode 100644 index 0000000..29011cd --- /dev/null +++ b/src/InternshipSystem.Core/ValueObject/PhoneNumber.cs @@ -0,0 +1,6 @@ +namespace InternshipSystem.Core +{ + public struct PhoneNumber + { + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Core/ValueObject/RangeOfActivity.cs b/src/InternshipSystem.Core/ValueObject/RangeOfActivity.cs new file mode 100644 index 0000000..8719404 --- /dev/null +++ b/src/InternshipSystem.Core/ValueObject/RangeOfActivity.cs @@ -0,0 +1,9 @@ +namespace InternshipSystem.Core +{ + public enum RangeOfActivity + { + International, + National, + Local + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/DatabaseFiller.cs b/src/InternshipSystem.Repository/DatabaseFiller.cs index 5a5c72c..2ff9d4e 100644 --- a/src/InternshipSystem.Repository/DatabaseFiller.cs +++ b/src/InternshipSystem.Repository/DatabaseFiller.cs @@ -1,330 +1,330 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using InternshipSystem.Core; - -namespace InternshipSystem.Repository -{ - public class DatabaseFiller - { - public DatabaseFiller(InternshipDbContext context) - { - Context = context; - } - - public InternshipDbContext Context { get; } - - public async Task FillCompany() - { - var companies = new List - { - new Company - { - Name = "Intel", - SiteAddress = new Uri("https://www.intel.com/content/www/us/en/jobs/locations/poland.html"), - Nip = "9570752316", - Range = RangeOfActivities.International, - Branches = new List - { - new BranchOffice - { - Address = new Address - { - City = "Gdańsk", - Street = "ul. Słowackiego", - Building = "173", - PostalCode = "80-298", - Country = "Poland" - } - }, - new BranchOffice - { - Address = new Address - { - City = "Gdańsk", - Street = "Jana z Kolna", - Building = "11", - PostalCode = "80-001", - Country = "Poland" - } - }, - new BranchOffice - { - Address = new Address - { - City = "Boston", - Street = "State St", - Building = "53", - PostalCode = "MA 02109", - Country = "Stany Zjednoczone" - } - } - } - }, - new Company - { - Name = "Asseco Poland", - SiteAddress = new Uri("http://pl.asseco.com"), - Nip = "5842068320", - Range = RangeOfActivities.National, - Branches = new List - { - new BranchOffice - { - Address = new Address - { - City = "Gdańsk", - Street = "ul. Podolska", - Building = "21", - PostalCode = "81-321", - Country = "Poland" - } - }, - new BranchOffice - { - Address = new Address - { - City = "Wrocław", - Street = "Traugutta", - Building = "1/7", - PostalCode = "50-449", - Country = "Poland" - } - } - } - } - }; - Context.Companies.AddRange(companies); - await Context.SaveChangesAsync(); - } - - public async Task FillInterns() - { - var interns = new List - { - new Intern { - Name = "Jan", - Surname = "Kowalski", - AlbumNumber = "123456", - Email = "s123456@student.pg.edu.pl", - Semester = 4, - Course = new Course - { - Name = "Informatyka", - DesiredSemesters = new List { 4, 6 }, - ProgramEntries = new List - { - new InternshipProgramEntry - { - Description = "Instalacja, konfiguracja i administracja niewielkich sieci komputerowych, w tym bezprzewodowych." - }, - new InternshipProgramEntry - { - Description = "Implementacja polityki bezpieczeństwa informacji w firmie lub instytucji, instalacja ochrony antywirusowej, konfiguracja zapór ogniowych." - }, - new InternshipProgramEntry - { - Description = "Instalacja, konfiguracja i administracja oprogramowania, w szczególnościsystemów operacyjnychiserwerów aplikacji." - }, - new InternshipProgramEntry - { - Description = "Projektowanie, implementacja i modyfikacjeoprogramowaniaw różnych technologiach i dla różnych zastosowań." - } - } - } - }, - new Intern { - Name = "Adam", - Surname = "Kołek", - AlbumNumber = "102137", - Email = "s102137@student.pg.edu.pl", - Semester = 6, - Course = new Course - { - Name = "Robotyka", - DesiredSemesters = new List { 6 }, - ProgramEntries = new List - { - new InternshipProgramEntry - { - Description = "Testowanie oprogramowania, także z wykorzystaniem narzędzi do testowania automatycznego." - }, - new InternshipProgramEntry - { - Description = "Wykorzystanie otwartych komponentów programowych z uwzględnieniem prawnych zależności pomiędzy nimi a produktem wynikowym." - }, - new InternshipProgramEntry - { - Description = "Projektowanie i implementacja baz danych oraz badanie ich wydajności." - }, - new InternshipProgramEntry - { - Description = "Projektowanie i prototypowaniezaawansowanychinterfejsów użytkownika." - } - } - } - } - }; - Context.Interns.AddRange(interns); - await Context.SaveChangesAsync(); - } - - public async Task FillInternshipTypes() { - var internshipTypes = new List - { - new InternshipType - { - Type = "FreeInternship", - Description = "Praktyka bezpłatna", - }, - new InternshipType - { - Type = "GraduateInternship" - }, - new InternshipType - { - Type = "FreeApprenticeship" - }, - new InternshipType - { - Type = "PaidApprenticeship", - Description = "np. przemysłowy" - }, - new InternshipType - { - Type = "ForeignInternship", - Description = "np. IAESTE, ERASMUS" - }, - new InternshipType - { - Type = "UOP" - }, - new InternshipType - { - Type = "UD" - }, - new InternshipType - { - Type = "UZ" - }, - new InternshipType - { - Type = "Other", - Description = "Należy wprowadzić samodzielnie" - } - }; - Context.InternshipTypes.AddRange(internshipTypes); - await Context.SaveChangesAsync(); - } - - public async Task FillEditions() { - var editions = new List - { - new Edition - { - StartDate = new DateTime(2000, 5, 10), - EndDate = new DateTime(2000, 11, 10), - IPPDeadlineDate = new DateTime(2000, 9, 30), - Subjects = new List - { - Context.InternshipProgramEntries - .Where(i => i.Description == "Instalacja, konfiguracja i administracja niewielkich sieci komputerowych, w tym bezprzewodowych.") - .First(), - Context.InternshipProgramEntries - .Where(i => i.Description == "Projektowanie, implementacja i modyfikacjeoprogramowaniaw różnych technologiach i dla różnych zastosowań.") - .First() - } - } - }; - Context.Editions.AddRange(editions); - await Context.SaveChangesAsync(); - } - - public async Task FillInternShips() { - var edition = Context.Editions.First(); - - var intenrships = new List - { - new Internship - { - Intern = Context.Interns.Where(i => i.AlbumNumber == "123456").First(), - Edition = edition, - BranchOffice = - Context.Companies - .Where(c => c.Nip == "9570752316") //Intel - .First() - .Branches - .First(), - Type = Context.InternshipTypes.Where(t => t.Type == "UOP").First(), - StartDate = new DateTime(2000, 7, 1), - EndDate = new DateTime(2000, 8, 30), - IsAccepted = false, - DeanAcceptance = new DeanAcceptance - { - AcceptanceDate = new DateTime(2000, 6, 26), - IsDeansAcceptanceRequired = true, - Reason = DeanAcceptanceReason.Semester - }, - Insurance = new Insurance - { - InsuranceDeliveryDate = new DateTime(2000, 6, 29), - IsInsuranceRequired = true - }, - LengthInWeeks = 9, - Grade = 0, - Program = new List - { - edition.Subjects.First() - }, - Mentor = new Mentor - { - Name = "Horacy", - Surname = "Wościcki", - Email = "howos@intel.com", - Phone = "605-555-555" - } - }, - new Internship - { - Intern = Context.Interns.Where(i => i.AlbumNumber == "102137").First(), - Edition = edition, - BranchOffice = - Context.Companies - .Where(c => c.Nip == "5842068320") //Asseco - .First() - .Branches - .First(), - Type = Context.InternshipTypes.Where(t => t.Type == "UZ").First(), - StartDate = new DateTime(2000, 7, 1), - EndDate = new DateTime(2000, 8, 30), - IsAccepted = false, - DeanAcceptance = new DeanAcceptance - { - IsDeansAcceptanceRequired = false - }, - Insurance = new Insurance - { - InsuranceDeliveryDate = new DateTime(2000, 6, 29), - IsInsuranceRequired = true - }, - LengthInWeeks = 9, - Grade = 0, - Program = new List - { - edition.Subjects.First() - }, - Mentor = new Mentor - { - Name = "Horacy", - Surname = "Wościcki", - Email = "howos@intel.com", - Phone = "605-555-555" - } - } - }; - Context.Internships.AddRange(intenrships); - await Context.SaveChangesAsync(); - } - } -} \ No newline at end of file +// using System; +// using System.Collections.Generic; +// using System.Linq; +// using System.Threading.Tasks; +// using InternshipSystem.Core; +// +// namespace InternshipSystem.Repository +// { +// public class DatabaseFiller +// { +// public DatabaseFiller(InternshipDbContext context) +// { +// Context = context; +// } +// +// public InternshipDbContext Context { get; } +// +// public async Task FillCompany() +// { +// var companies = new List +// { +// new Company +// { +// Name = "Intel", +// SiteAddress = new Uri("https://www.intel.com/content/www/us/en/jobs/locations/poland.html"), +// Nip = "9570752316", +// Range = RangeOfActivities.International, +// Branches = new List +// { +// new BranchOffice +// { +// Address = new Address +// { +// City = "Gdańsk", +// Street = "ul. Słowackiego", +// Building = "173", +// PostalCode = "80-298", +// Country = "Poland" +// } +// }, +// new BranchOffice +// { +// Address = new Address +// { +// City = "Gdańsk", +// Street = "Jana z Kolna", +// Building = "11", +// PostalCode = "80-001", +// Country = "Poland" +// } +// }, +// new BranchOffice +// { +// Address = new Address +// { +// City = "Boston", +// Street = "State St", +// Building = "53", +// PostalCode = "MA 02109", +// Country = "Stany Zjednoczone" +// } +// } +// } +// }, +// new Company +// { +// Name = "Asseco Poland", +// SiteAddress = new Uri("http://pl.asseco.com"), +// Nip = "5842068320", +// Range = RangeOfActivities.National, +// Branches = new List +// { +// new BranchOffice +// { +// Address = new Address +// { +// City = "Gdańsk", +// Street = "ul. Podolska", +// Building = "21", +// PostalCode = "81-321", +// Country = "Poland" +// } +// }, +// new BranchOffice +// { +// Address = new Address +// { +// City = "Wrocław", +// Street = "Traugutta", +// Building = "1/7", +// PostalCode = "50-449", +// Country = "Poland" +// } +// } +// } +// } +// }; +// Context.Companies.AddRange(companies); +// await Context.SaveChangesAsync(); +// } +// +// public async Task FillInterns() +// { +// var interns = new List +// { +// new Intern { +// Name = "Jan", +// Surname = "Kowalski", +// AlbumNumber = "123456", +// Email = "s123456@student.pg.edu.pl", +// Semester = 4, +// Course = new Course +// { +// Name = "Informatyka", +// DesiredSemesters = new List { 4, 6 }, +// ProgramEntries = new List +// { +// new InternshipProgramEntry +// { +// Description = "Instalacja, konfiguracja i administracja niewielkich sieci komputerowych, w tym bezprzewodowych." +// }, +// new InternshipProgramEntry +// { +// Description = "Implementacja polityki bezpieczeństwa informacji w firmie lub instytucji, instalacja ochrony antywirusowej, konfiguracja zapór ogniowych." +// }, +// new InternshipProgramEntry +// { +// Description = "Instalacja, konfiguracja i administracja oprogramowania, w szczególnościsystemów operacyjnychiserwerów aplikacji." +// }, +// new InternshipProgramEntry +// { +// Description = "Projektowanie, implementacja i modyfikacjeoprogramowaniaw różnych technologiach i dla różnych zastosowań." +// } +// } +// } +// }, +// new Intern { +// Name = "Adam", +// Surname = "Kołek", +// AlbumNumber = "102137", +// Email = "s102137@student.pg.edu.pl", +// Semester = 6, +// Course = new Course +// { +// Name = "Robotyka", +// DesiredSemesters = new List { 6 }, +// ProgramEntries = new List +// { +// new InternshipProgramEntry +// { +// Description = "Testowanie oprogramowania, także z wykorzystaniem narzędzi do testowania automatycznego." +// }, +// new InternshipProgramEntry +// { +// Description = "Wykorzystanie otwartych komponentów programowych z uwzględnieniem prawnych zależności pomiędzy nimi a produktem wynikowym." +// }, +// new InternshipProgramEntry +// { +// Description = "Projektowanie i implementacja baz danych oraz badanie ich wydajności." +// }, +// new InternshipProgramEntry +// { +// Description = "Projektowanie i prototypowaniezaawansowanychinterfejsów użytkownika." +// } +// } +// } +// } +// }; +// Context.Interns.AddRange(interns); +// await Context.SaveChangesAsync(); +// } +// +// public async Task FillInternshipTypes() { +// var internshipTypes = new List +// { +// new InternshipType +// { +// Type = "FreeInternship", +// Description = "Praktyka bezpłatna", +// }, +// new InternshipType +// { +// Type = "GraduateInternship" +// }, +// new InternshipType +// { +// Type = "FreeApprenticeship" +// }, +// new InternshipType +// { +// Type = "PaidApprenticeship", +// Description = "np. przemysłowy" +// }, +// new InternshipType +// { +// Type = "ForeignInternship", +// Description = "np. IAESTE, ERASMUS" +// }, +// new InternshipType +// { +// Type = "UOP" +// }, +// new InternshipType +// { +// Type = "UD" +// }, +// new InternshipType +// { +// Type = "UZ" +// }, +// new InternshipType +// { +// Type = "Other", +// Description = "Należy wprowadzić samodzielnie" +// } +// }; +// Context.InternshipTypes.AddRange(internshipTypes); +// await Context.SaveChangesAsync(); +// } +// +// public async Task FillEditions() { +// var editions = new List +// { +// new Edition +// { +// StartDate = new DateTime(2000, 5, 10), +// EndDate = new DateTime(2000, 11, 10), +// IPPDeadlineDate = new DateTime(2000, 9, 30), +// Subjects = new List +// { +// Context.InternshipProgramEntries +// .Where(i => i.Description == "Instalacja, konfiguracja i administracja niewielkich sieci komputerowych, w tym bezprzewodowych.") +// .First(), +// Context.InternshipProgramEntries +// .Where(i => i.Description == "Projektowanie, implementacja i modyfikacjeoprogramowaniaw różnych technologiach i dla różnych zastosowań.") +// .First() +// } +// } +// }; +// Context.Editions.AddRange(editions); +// await Context.SaveChangesAsync(); +// } +// +// public async Task FillInternShips() { +// var edition = Context.Editions.First(); +// +// var intenrships = new List +// { +// new Internship +// { +// Intern = Context.Interns.Where(i => i.AlbumNumber == "123456").First(), +// Edition = edition, +// BranchOffice = +// Context.Companies +// .Where(c => c.Nip == "9570752316") //Intel +// .First() +// .Branches +// .First(), +// Type = Context.InternshipTypes.Where(t => t.Type == "UOP").First(), +// StartDate = new DateTime(2000, 7, 1), +// EndDate = new DateTime(2000, 8, 30), +// IsAccepted = false, +// DeanAcceptance = new DeanAcceptance +// { +// AcceptanceDate = new DateTime(2000, 6, 26), +// IsDeansAcceptanceRequired = true, +// Reason = DeanAcceptanceReason.Semester +// }, +// Insurance = new Insurance +// { +// InsuranceDeliveryDate = new DateTime(2000, 6, 29), +// IsInsuranceRequired = true +// }, +// LengthInWeeks = 9, +// Grade = 0, +// Program = new List +// { +// edition.Subjects.First() +// }, +// Mentor = new Mentor +// { +// Name = "Horacy", +// Surname = "Wościcki", +// Email = "howos@intel.com", +// Phone = "605-555-555" +// } +// }, +// new Internship +// { +// Intern = Context.Interns.Where(i => i.AlbumNumber == "102137").First(), +// Edition = edition, +// BranchOffice = +// Context.Companies +// .Where(c => c.Nip == "5842068320") //Asseco +// .First() +// .Branches +// .First(), +// Type = Context.InternshipTypes.Where(t => t.Type == "UZ").First(), +// StartDate = new DateTime(2000, 7, 1), +// EndDate = new DateTime(2000, 8, 30), +// IsAccepted = false, +// DeanAcceptance = new DeanAcceptance +// { +// IsDeansAcceptanceRequired = false +// }, +// Insurance = new Insurance +// { +// InsuranceDeliveryDate = new DateTime(2000, 6, 29), +// IsInsuranceRequired = true +// }, +// LengthInWeeks = 9, +// Grade = 0, +// Program = new List +// { +// edition.Subjects.First() +// }, +// Mentor = new Mentor +// { +// Name = "Horacy", +// Surname = "Wościcki", +// Email = "howos@intel.com", +// Phone = "605-555-555" +// } +// } +// }; +// Context.Internships.AddRange(intenrships); +// await Context.SaveChangesAsync(); +// } +// } +// } \ No newline at end of file diff --git a/src/InternshipSystem.Repository/InternshipDbContext.cs b/src/InternshipSystem.Repository/InternshipDbContext.cs index cd53a19..69bac5d 100644 --- a/src/InternshipSystem.Repository/InternshipDbContext.cs +++ b/src/InternshipSystem.Repository/InternshipDbContext.cs @@ -1,18 +1,25 @@ +using System.Collections.Generic; using Microsoft.EntityFrameworkCore; using InternshipSystem.Core; +using InternshipSystem.Repository.Model; namespace InternshipSystem.Repository { public class InternshipDbContext : DbContext { - public DbSet Internships { get; set; } - public DbSet Companies { get; set; } - public DbSet Editions { get; set; } - public DbSet Reports { get; set; } - public DbSet Interns { get; set; } - public DbSet InternshipTypes { get; set; } - public DbSet Mentors { get; set; } - public DbSet InternshipProgramEntries { get; set; } + public DbSet Documents { get; set; } + public DbSet Courses { get; set; } + public DbSet Companies { get; set; } + public DbSet Subjects { get; set; } + public DbSet Editions { get; set; } + public DbSet Students { get; set; } + public DbSet Approvals { get; set; } + public DbSet BranchOffices { get; set; } + public DbSet Registrations { get; set; } + public DbSet Programs { get; set; } + public DbSet Internships { get; set; } + public DbSet InternshipTypes { get; set; } + public InternshipDbContext(DbContextOptions options) : base(options) { @@ -22,24 +29,39 @@ namespace InternshipSystem.Repository optionsBuilder .UseSnakeCaseNamingConvention(); - protected override void OnModelCreating(ModelBuilder modelBuilder) { - modelBuilder - .Entity(ie => { - ie.OwnsOne(i => i.DeanAcceptance); - ie.OwnsOne(i => i.Insurance); - }); + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(builder => + { + builder + .HasKey(subject => new { subject.InternshipProgramId, subject.InternshipSubjectId }); + + builder + .HasOne() + .WithMany(model => model.ChosenSubjects) + .HasForeignKey(subject => subject.InternshipProgramId); + + builder + .HasOne() + .WithMany() + .HasForeignKey(subject => subject.InternshipSubjectId); + }); - modelBuilder - .Entity() - .HasKey(c => c.Nip); - - modelBuilder - .Entity() - .OwnsOne(b => b.Address); + modelBuilder.Entity(builder => + { + builder + .HasKey(subject => new { subject.EditionId, subject.InternshipId}); + + builder + .HasOne() + .WithMany(model => model.AvailableSubjects) + .HasForeignKey(p => p.EditionId); - modelBuilder - .Entity() - .HasKey(i => i.AlbumNumber); + builder + .HasOne() + .WithMany() + .HasForeignKey(subject => subject.InternshipId); + }); } } } \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/BranchOffice.cs b/src/InternshipSystem.Repository/Model/BranchOffice.cs deleted file mode 100644 index c30610f..0000000 --- a/src/InternshipSystem.Repository/Model/BranchOffice.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace InternshipSystem.Core -{ - public class BranchOffice - { - public int Id { get; set; } - public Address Address { get; set; } - public Company Company { get; set; } - public int Provider { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/BranchOfficeReadModel.cs b/src/InternshipSystem.Repository/Model/BranchOfficeReadModel.cs new file mode 100644 index 0000000..a3dbac1 --- /dev/null +++ b/src/InternshipSystem.Repository/Model/BranchOfficeReadModel.cs @@ -0,0 +1,14 @@ +using InternshipSystem.Core; + +namespace InternshipSystem.Repository.Model +{ + public class BranchOfficeReadModel + { + public long Id { get; set; } + public string Street { get; set; } + public string Building { get; set; } + public string City { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Company.cs b/src/InternshipSystem.Repository/Model/Company.cs deleted file mode 100644 index d99b861..0000000 --- a/src/InternshipSystem.Repository/Model/Company.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace InternshipSystem.Core -{ - public class Company - { - public string Nip { get; set; } - public string Name { get; set; } - public RangeOfActivities Range { get; set; } - public Uri SiteAddress { get; set; } - public int Provider { get; set; } - public List Branches { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/CompanyReadModel.cs b/src/InternshipSystem.Repository/Model/CompanyReadModel.cs new file mode 100644 index 0000000..2a5b2c9 --- /dev/null +++ b/src/InternshipSystem.Repository/Model/CompanyReadModel.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using InternshipSystem.Core; + +namespace InternshipSystem.Repository.Model +{ + public class CompanyReadModel + { + public long Id { get; set; } + public string Nip { get; set; } + public string Name { get; set; } + public RangeOfActivity Range { get; set; } + public List Branches { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Course.cs b/src/InternshipSystem.Repository/Model/Course.cs deleted file mode 100644 index 4a91813..0000000 --- a/src/InternshipSystem.Repository/Model/Course.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; - -namespace InternshipSystem.Core -{ - public class Course - { - public int Id { get; set; } - public string Name { get; set; } - public List DesiredSemesters { get; set; } - public List ProgramEntries { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/DeanAcceptance.cs b/src/InternshipSystem.Repository/Model/DeanAcceptance.cs deleted file mode 100644 index 8982849..0000000 --- a/src/InternshipSystem.Repository/Model/DeanAcceptance.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace InternshipSystem.Core -{ - public class DeanAcceptance - { - public DateTime? AcceptanceDate { get; set; } - public bool IsDeansAcceptanceRequired { get; set; } - public DeanAcceptanceReason? Reason { get; set; } - } - - public enum DeanAcceptanceReason - { - Semester, - Delay, - Whatever - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Edition.cs b/src/InternshipSystem.Repository/Model/Edition.cs deleted file mode 100644 index 6e237a9..0000000 --- a/src/InternshipSystem.Repository/Model/Edition.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace InternshipSystem.Core -{ - public class Edition - { - public int Id { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } - public DateTime IPPDeadlineDate { get; set; } - public List Subjects { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/EditionReadModel.cs b/src/InternshipSystem.Repository/Model/EditionReadModel.cs new file mode 100644 index 0000000..cd221b0 --- /dev/null +++ b/src/InternshipSystem.Repository/Model/EditionReadModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using InternshipSystem.Core; + +namespace InternshipSystem.Repository.Model +{ + public class EditionReadModel + { + public long Id { get; set; } + public DateTime EditionStart { get; set; } + public DateTime EditionFinish { get; set; } + public DateTime ReportingStart { get; set; } + public Course Course { get; set; } + public ImmutableList AvailableSubjects { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/EditionSubject.cs b/src/InternshipSystem.Repository/Model/EditionSubject.cs new file mode 100644 index 0000000..9141724 --- /dev/null +++ b/src/InternshipSystem.Repository/Model/EditionSubject.cs @@ -0,0 +1,8 @@ +namespace InternshipSystem.Repository +{ + public class EditionSubject + { + public long EditionId { get; set; } + public long InternshipId { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Insurance.cs b/src/InternshipSystem.Repository/Model/Insurance.cs deleted file mode 100644 index 2306d9e..0000000 --- a/src/InternshipSystem.Repository/Model/Insurance.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace InternshipSystem.Core -{ - public class Insurance - { - public DateTime InsuranceDeliveryDate { get; set; } - public bool IsInsuranceRequired { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Intern.cs b/src/InternshipSystem.Repository/Model/Intern.cs deleted file mode 100644 index 02339cd..0000000 --- a/src/InternshipSystem.Repository/Model/Intern.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace InternshipSystem.Core -{ - public class Intern - { - public string AlbumNumber { get; set; } - public string Name { get; set; } - public string Surname { get; set; } - public string Email { get; set; } - public int Semester { get; set; } - public Course Course { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Internship.cs b/src/InternshipSystem.Repository/Model/Internship.cs deleted file mode 100644 index 34d763f..0000000 --- a/src/InternshipSystem.Repository/Model/Internship.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace InternshipSystem.Core -{ - public class Internship - { - public int Id { get; set; } - public Intern Intern { get; set; } - public Edition Edition { get; set; } - public Report Report { get; set; } - public BranchOffice BranchOffice { get; set; } - public InternshipType Type { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } - public bool IsAccepted { get; set; } - public DeanAcceptance DeanAcceptance { get; set; } - public Insurance Insurance { get; set; } - public int LengthInWeeks { get; set; } - public float Grade { get; set; } - public List Program { get; set; } - public Mentor Mentor { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/InternshipProgramEntry.cs b/src/InternshipSystem.Repository/Model/InternshipProgramEntry.cs deleted file mode 100644 index 16d2115..0000000 --- a/src/InternshipSystem.Repository/Model/InternshipProgramEntry.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace InternshipSystem.Core -{ - public class InternshipProgramEntry - { - public int Id { get; set; } - public Course Course { get; set; } - public string Description { get; set; } - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/InternshipProgramReadModel.cs b/src/InternshipSystem.Repository/Model/InternshipProgramReadModel.cs new file mode 100644 index 0000000..aec7595 --- /dev/null +++ b/src/InternshipSystem.Repository/Model/InternshipProgramReadModel.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using InternshipSystem.Core; + +namespace InternshipSystem.Repository.Model +{ + public class InternshipProgramReadModel + { + public long Id { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } + public string PhoneNumber { get; set; } + public List ChosenSubjects { get; set; } + public DocumentState State { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/InternshipReadModel.cs b/src/InternshipSystem.Repository/Model/InternshipReadModel.cs new file mode 100644 index 0000000..9cec245 --- /dev/null +++ b/src/InternshipSystem.Repository/Model/InternshipReadModel.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using InternshipSystem.Core; + +namespace InternshipSystem.Repository.Model +{ + public class InternshipReadModel + { + public long Id { get; set; } + public Student Student { get; set; } + public InternshipRegistrationReadModel InternshipRegistration { get; set; } + public InternshipProgramReadModel InternshipProgram { get; set; } + public Report Report { get; set; } + public List Approvals { get; set; } + public List Documents { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/InternshipRegistrationReadModel.cs b/src/InternshipSystem.Repository/Model/InternshipRegistrationReadModel.cs new file mode 100644 index 0000000..9f53e9c --- /dev/null +++ b/src/InternshipSystem.Repository/Model/InternshipRegistrationReadModel.cs @@ -0,0 +1,16 @@ +using System; +using InternshipSystem.Core; + +namespace InternshipSystem.Repository.Model +{ + public class InternshipRegistrationReadModel + { + public long Id { get; set; } + public CompanyReadModel Company { get; set; } + public BranchOfficeReadModel BranchAddress { get; set; } + public DateTime Start { get; set; } + public DateTime End { get; set; } + public InternshipTypeReadModel Type { get; set; } + public DocumentState State { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/InternshipSubjectReadModel.cs b/src/InternshipSystem.Repository/Model/InternshipSubjectReadModel.cs new file mode 100644 index 0000000..9ed596c --- /dev/null +++ b/src/InternshipSystem.Repository/Model/InternshipSubjectReadModel.cs @@ -0,0 +1,12 @@ +using System; +using InternshipSystem.Core; + +namespace InternshipSystem.Repository.Model +{ + public class InternshipSubjectReadModel + { + public long Id { get; set; } + + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/InternshipTypeReadModel.cs b/src/InternshipSystem.Repository/Model/InternshipTypeReadModel.cs new file mode 100644 index 0000000..849fe1d --- /dev/null +++ b/src/InternshipSystem.Repository/Model/InternshipTypeReadModel.cs @@ -0,0 +1,9 @@ +namespace InternshipSystem.Repository.Model +{ + public class InternshipTypeReadModel + { + public long Id { get; set; } + public string Type { get; set; } + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Mentor.cs b/src/InternshipSystem.Repository/Model/Mentor.cs deleted file mode 100644 index 4d42630..0000000 --- a/src/InternshipSystem.Repository/Model/Mentor.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace InternshipSystem.Core -{ - public class Mentor { - public int Id { get; set; } - public string Name { get; set; } - public string Surname { get; set; } - public string Email { get; set; } - public string Phone { get; set; } - public Company Company { get; set; } - } -} diff --git a/src/InternshipSystem.Repository/Model/ProgramSubject.cs b/src/InternshipSystem.Repository/Model/ProgramSubject.cs new file mode 100644 index 0000000..256c3ca --- /dev/null +++ b/src/InternshipSystem.Repository/Model/ProgramSubject.cs @@ -0,0 +1,8 @@ +namespace InternshipSystem.Repository.Model +{ + public class ProgramSubject + { + public long InternshipProgramId { get; set; } + public long InternshipSubjectId { get; set; } + } +} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/RangeOfActivities.cs b/src/InternshipSystem.Repository/Model/RangeOfActivities.cs deleted file mode 100644 index 84da216..0000000 --- a/src/InternshipSystem.Repository/Model/RangeOfActivities.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace InternshipSystem.Core -{ - public enum RangeOfActivities - { - Other, - National, - International - } -} \ No newline at end of file diff --git a/src/InternshipSystem.Repository/Model/Report.cs b/src/InternshipSystem.Repository/Model/Report.cs deleted file mode 100644 index 9835b76..0000000 --- a/src/InternshipSystem.Repository/Model/Report.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace InternshipSystem.Core -{ - public class Report - { - public int Id { get; set; } - } -} \ No newline at end of file