public Handler(ICourseRepository courseRepository, IDemandService demandService, ISolver solver, ISerializationService serializationService, ICourseCreationService courseCreationService, IUnitOfWork unitOfWork, IQueue queue) { _courseRepository = courseRepository; _demandService = demandService; _solver = solver; _serializationService = serializationService; _courseCreationService = courseCreationService; _unitOfWork = unitOfWork; _queue = queue; }
public RegistrationController( IUnitOfWork unitOfWork, IDemandService demandService, IRegistrationRepository registrationRepository, ICourseCreationService courseCreationService, ISerializationService serializationService, IMapper mapper, ICollectionMapper <RegistrationParticipantDto, RegistrationParticipant> collectionMapper, ICollectionMapper <CommitRegistrationParticipantDto, RegistrationParticipant> commitCollectionMapper, IOptions <GroupCourseOptionsCollection> groupCourseOptions, IQueue queue) { _unitOfWork = unitOfWork; _demandService = demandService; _registrationRepository = registrationRepository; _courseCreationService = courseCreationService; _serializationService = serializationService; _mapper = mapper; _collectionMapper = collectionMapper; _commitCollectionMapper = commitCollectionMapper; _groupCourseOptions = groupCourseOptions; _queue = queue; }
public IEnumerable <CourseParticipant> AddParticipantsToProposalCourse(IOptions <GroupCourseOptionsCollection> groupCourseOptions, ICourseCreationService courseCreationService) { foreach (var participant in RegistrationParticipants) { // TODO: Use damanding service and verify the registration participants var courseOptions = groupCourseOptions.Value.SingleOrDefault(c => c.Match(participant.Discipline, participant.NiveauId) && c.Identifier == participant.CourseIdentifier); var course = courseCreationService.GetOrCreateProposalGroupCourse(participant.CourseStartDate.Value, participant.NiveauId, courseOptions); var courseParticipant = new CourseParticipant { Participant = participant.ToParticipant(Applicant) }; course.Participants.Add(courseParticipant); yield return(courseParticipant); } }