public async Task <Guid> CreateJobAsync(Job job) { await _dbContext.Jobs.AddAsync(job); await _dbContext.SaveChangesAsync(); return(job.Id); }
public async Task <Guid?> ChangeStatusAsync(Guid id, ApplicationStatus status, ApplicationStatus previousStatus) { var application = await GetApplicationByIdAsync(id); if (application.Status == previousStatus) { application.Status = status; await _dbContext.SaveChangesAsync(); return(application.Id); } return(null); }
public async Task <Guid> CreateInterviewAsync(Interview interview) { await _dbContext.Interviews.AddAsync(interview); await _dbContext.SaveChangesAsync(); return(interview.Id); }
public async Task <Guid> ScheduleInterviewAsync(SchedulerDTO request) { var interview = await _interviewsService.GetInterviewByIdAsync(request.InterviewId); var scheduler = new Scheduler { Id = Guid.NewGuid(), SchedulerStatus = SchedulerStatus.PLANNED }; interview.SchedulerId = scheduler.Id; await _dbContext.Schedulers.AddAsync(scheduler); await _dbContext.SaveChangesAsync(); // send email to candidate var to_address = interview.Application.Email; return(scheduler.Id); }