fix/tytokurwaniepotrafisznicporzadniezrobic #55

Merged
maxchil merged 5 commits from fix/tytokurwaniepotrafisznicporzadniezrobic into master 2020-10-03 00:37:17 +02:00
Showing only changes of commit 2fdf2f2326 - Show all commits

View File

@ -49,9 +49,11 @@ namespace InternshipSystem.Core.Entity.Internship
.SetValidator(new Mentor.Validate())
.NotNull();
RuleFor(x => x.Subjects)
.NotEmpty();
.NotEmpty()
.Must(s => edition.AreSubjectsAvailable(s.Select(su => su.InternshipSubjectId)));
RuleFor(x => x.Type)
.NotNull();
.NotNull()
.Must(edition.IsTypeAvailable);
RuleFor(x => x.Start)
.GreaterThanOrEqualTo(edition.EditionStart)
.LessThan(x => x.End)