diff --git a/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs b/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs index 726ec00..b196099 100644 --- a/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs +++ b/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs @@ -144,7 +144,9 @@ namespace InternshipSystem.Api.UseCases private void UpdateMentor(UpdateMentor mentorUpdate) { - subjectRegistration.Mentor.UpdateInformation(mentorUpdate.FirstName, mentorUpdate.LastName, mentorUpdate.Email, mentorUpdate.PhoneNumber); + var mentor = subjectRegistration.Mentor ?? new Mentor(); + + mentor.UpdateInformation(mentorUpdate.FirstName, mentorUpdate.LastName, mentorUpdate.Email, mentorUpdate.PhoneNumber); } } } \ No newline at end of file diff --git a/src/InternshipSystem.Repository/DatabaseFiller.cs b/src/InternshipSystem.Repository/DatabaseFiller.cs index 6ce607c..1bcdedc 100644 --- a/src/InternshipSystem.Repository/DatabaseFiller.cs +++ b/src/InternshipSystem.Repository/DatabaseFiller.cs @@ -215,7 +215,65 @@ namespace InternshipSystem.Repository } }, Internships = new List(), - } + }, + new Edition + { + Id = Guid.Parse("bd0da085-8e51-400d-9630-bdab3f9f6cc8"), + EditionStart = new DateTime(2019, 5, 10), + EditionFinish = new DateTime(2019, 12, 10), + ReportingStart = new DateTime(2019, 9, 30), + AvailableSubjects = new List + { + new EditionSubject + { + Subject = new InternshipSubject + { + Description = "Modelowanie baz danych", + DescriptionEng = "Database modeling", + } + }, + new EditionSubject + { + Subject = new InternshipSubject + { + Description = "Oprogramowywanie kart graficznych", + DescriptionEng = "Graphics card software", + } + }, + new EditionSubject + { + Subject = new InternshipSubject + { + Description = "Projektowanie UI", + DescriptionEng = "UI design", + } + } + }, + Course = new Course + { + Name = "Inżynieria Biomedyczna", + }, + AvailableInternshipTypes = new List + { + new EditionInternshipType + { + InternshipType = Context.InternshipTypes.First(t => t.Label.Equals("Umowa o pracę")) + }, + new EditionInternshipType + { + InternshipType = Context.InternshipTypes.First(t => t.Label.Equals("Umowa zlecenie")) + }, + new EditionInternshipType + { + InternshipType = Context.InternshipTypes.First(t => t.Label.Equals("Umowa o dzieło")) + }, + new EditionInternshipType + { + InternshipType = Context.InternshipTypes.First(t => t.Label.Equals("Praktyka bezpłatna")) + } + }, + Internships = new List(), + } }; var edition = editions.First();