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);
        }
Exemple #2
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);
        }
        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);
            }
        }
Exemple #4
0
        private Task Handle(IApplicationReviewEvent notification)
        {
            _logger.LogInformation("Handling {notificationType} for vacancyReference: {vacancyReference}", notification.GetType().Name, notification.VacancyReference);

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