private async Task Handle(IApplicationReviewEvent notification)
        {
            if (notification == null)
            {
                throw new ArgumentNullException(nameof(notification), "Should not be null");
            }

            var vacancy = await _vacancyRepository.GetVacancyAsync(notification.VacancyReference);

            _logger.LogInformation("Handling {eventType} for accountId: {employerAccountId} and vacancyReference: {vacancyReference}", notification.GetType().Name, vacancy.EmployerAccountId, notification.VacancyReference);
            await _dashboardService.ReBuildDashboardAsync(vacancy.EmployerAccountId);
        }
        private async Task Handle(IApplicationReviewEvent notification)
        {
            if (notification == null)
            {
                throw new ArgumentNullException(nameof(notification), "Should not be null");
            }

            var vacancy = await _vacancyRepository.GetVacancyAsync(notification.VacancyReference);

            if (vacancy.OwnerType != OwnerType.Employer)
            {
                _logger.LogInformation("Handling {eventType} for ukprn: {ukprn} and vacancyReference: {vacancyReference}", notification.GetType().Name, vacancy.TrainingProvider.Ukprn.Value, notification.VacancyReference);
                await _dashboardService.ReBuildDashboardAsync(vacancy.TrainingProvider.Ukprn.Value);
            }
        }
Ejemplo n.º 3
0
        private async Task Handle(IApplicationReviewEvent notification)
        {
            _logger.LogInformation("Handling {notificationType} for vacancyReference: {vacancyReference}", notification.GetType().Name, notification?.VacancyReference);

            var vacancy = await _vacancyRepository.GetVacancyAsync(notification.VacancyReference);

            var vacancyApplicationReviews = await _applicationReviewQuery.GetForVacancyAsync <ApplicationReview>(vacancy.VacancyReference.Value);

            var vacancyApplications = new VacancyApplications
            {
                VacancyReference = vacancy.VacancyReference.Value,
                Applications     = vacancyApplicationReviews.Select(MapToVacancyApplication).ToList()
            };

            await _writer.UpdateVacancyApplicationsAsync(vacancyApplications);
        }
Ejemplo n.º 4
0
        private Task Handle(IApplicationReviewEvent notification)
        {
            _logger.LogInformation("Handling {notificationType} for vacancyReference: {vacancyReference}", notification.GetType().Name, notification.VacancyReference);

            return(_projectionService.UpdateVacancyApplicationsAsync(notification.VacancyReference));
        }