Пример #1
0
        public async Task <JobApplicationDto> Handle(MakeJobApplicationDecisionCommand request, CancellationToken cancellationToken)
        {
            var jobApplication = await _jobApplicationRepository.GetAsync(request.ApplicationId)
                                 ?? throw new PersonnelDomainException("Could not submit job application decision", new[] { $"Job application with id {request.ApplicationId} does not exist" });

            var myId = _identityService.GetUserIdentity();

            jobApplication.MakeDecision(request.Decision, myId);
            _jobApplicationRepository.Update(jobApplication);

            _logger.LogInformation("----- Saving job application decision - Id: {@Id}, Decision: {@Decision}", request.ApplicationId, request.Decision);

            await _jobApplicationRepository.UnitOfWork.SaveChangesAsync();

            _logger.LogInformation("----- Saved job application decision - Id: {@Id}, Decision: {@Decision}", request.ApplicationId, request.Decision);

            return(await _employmentQueries.GetJobApplicationByIdAsync(jobApplication.Id));
        }
Пример #2
0
 public async Task UpdateJobApplication(JobApplicationViewModel model)
 {
     await _jobApplicationRepository.Update(_mapper.Map <JobApplications>(model));
 }
 public void UpdateJobApplication(JobApplication jobApplication)
 {
     jobApplicationRepository.Update(jobApplication);
 }