diff --git a/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs b/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs index b3c40e9..db6b877 100644 --- a/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs +++ b/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs @@ -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)