Merge branch 'master' of http://git.kadet.net/system-praktyk/system-praktyk-api into fix/tytokurwaniepotrafisznicporzadniezrobic

This commit is contained in:
MaxchilKH 2020-10-02 23:19:44 +02:00
commit 2fdf2f2326

View File

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