public async Task <DateTime> Handle(GetDateRecomendationQuery request, CancellationToken cancellationToken) { var meeting = await _meetingRepository.GetMeetingByIdAsync(request.MeetingID); _authorizationService.AuthorizeGroupAccessOrThrow(_httpContextAccessor.HttpContext, meeting.GroupID); if (meeting is null) { throw new NotFoundException(); } var users = await _userRepository.GetUsersByGroupIdAsync(meeting.GroupID); return(_datePickerService.PickDate(GetDates(users))); }
public async Task <MeetingDO> GetRecomendations(MeetingDO meeting) { var users = await _userRepository.GetUsersByGroupIdAsync(meeting.GroupID); var mealPreferences = users.Select(x => x.MealPreference).ToList(); var moviePreferences = users.Select(x => x.MoviePreference).ToList(); var dates = GetDates(users); meeting.MealsPropositions = await _foodRecomendationService.GetMealRecomendations(mealPreferences); meeting.MoviePropositions = await _movieRecomendationService.GetMovieRecomendations(moviePreferences); meeting.DateProposition = _datePickerService.PickDate(dates); return(meeting); }