public async Task <int> UpdateInterview(AddInterviewCommand request, CancellationToken cancellationToken)
        {
            throw new NotImplementedException();
            //var interview = await _context.ApplicationEvents.FindAsync(request.InterviewId);
            //if (interview == null)
            //{
            //    throw new NotFoundException(nameof(JobApplicationEvent), request.InterviewId);
            //}

            //interview.Date = request.ScheduledFor;
            //// TODO

            //return interview.Id;
        }
        public async Task <Result <int> > Handle(AddInterviewCommand request, CancellationToken cancellationToken)
        {
            var application = await _context.Applications.FindAsync(request.ApplicationId);

            if (application == null)
            {
                return(Result.Fail(new NotFoundError(nameof(JobApplication), request.ApplicationId)));
            }

            var interview = application.ScheduleInterview(request.ScheduledFor, request.Medium, request.Interviewers, request.Duration);

            if (!interview.IsFailed)
            {
                await _context.SaveChangesAsync(cancellationToken);

                return(Result.Ok(interview.Value.Id));
            }

            return(Result.Fail("").WithReasons(interview.Reasons));
        }