//TODO: Sprawdzić
        public async Task <ApiResponse> CoachManagmentRequest(CoachManagmentRequestVm coachManagmentRequestVm)
        {
            var user      = _unitOfWork.userRepository.FindByCondition(x => x.Id == coachManagmentRequestVm.ProfilePupilId).FirstOrDefault();
            var userCoach = _unitOfWork.userRepository.FindByCondition(x => x.Id == coachManagmentRequestVm.ProfileCoachId).FirstOrDefault();
            var status    = coachManagmentRequestVm.Partnership;

            if (user == null && userCoach == null && user.Id != userCoach.Id)
            {
                throw new MyNotFoundException(ApiResponseDescription.USER_NOT_FOUND);
            }

            if (status == true)
            {
                var model = _mapper.Map <CoachManagmentRequestVm, Pupil>(coachManagmentRequestVm);

                model.ProfilePupilId = coachManagmentRequestVm.ProfilePupilId;

                _unitOfWork.pupilRepository.Create(model);

                var coachRequest = _unitOfWork.coachingRequestRepository.FindByCondition(x => x.CoachId == userCoach.Id && x.ApplicationUserId == user.Id).FirstOrDefault();

                coachRequest.Status = CoachingRequestStatus.Accepted; //(CoachingRequestStatus)1;

                _unitOfWork.coachingRequestRepository.Update(coachRequest);

                await _unitOfWork.CompleteAsync();

                return(new ApiResponse(true));
            }
            else
            {
                var coachRequest = _unitOfWork.coachingRequestRepository.FindByCondition(x => x.CoachId == userCoach.Id && x.ApplicationUserId == user.Id).FirstOrDefault();

                coachRequest.Status = (CoachingRequestStatus)2;

                _unitOfWork.coachingRequestRepository.Update(coachRequest);

                await _unitOfWork.CompleteAsync();

                return(new ApiResponse(true));
            }
        }
 public async Task <IActionResult> CoachManagmentRequest([FromBody] CoachManagmentRequestVm coachManagmentRequestVm) =>
 Ok(await _coachService.CoachManagmentRequest(coachManagmentRequestVm));