public CandidateMigrationProcessor(ICandidateMappers candidateMappers, SyncRepository syncRepository, IGenericSyncRespository genericSyncRespository, IGetOpenConnection targetDatabase, IConfigurationService configurationService, ILogService logService)
        {
            _candidateMappers       = candidateMappers;
            _syncRepository         = syncRepository;
            _genericSyncRespository = genericSyncRespository;
            _targetDatabase         = targetDatabase;
            _logService             = logService;

            _vacancyRepository          = new VacancyRepository(targetDatabase);
            _localAuthorityRepository   = new LocalAuthorityRepository(targetDatabase);
            _candidateRepository        = new CandidateRepository(targetDatabase);
            _schoolAttendedRepository   = new SchoolAttendedRepository(targetDatabase);
            _candidateHistoryRepository = new CandidateHistoryRepository(targetDatabase);
            _candidateUserRepository    = new CandidateUserRepository(configurationService, _logService);
            _userRepository             = new UserRepository(configurationService, logService);

            var configuration = configurationService.Get <MigrateFromFaaToAvmsPlusConfiguration>();

            _anonymiseData = configuration.AnonymiseData;
        }
Exemplo n.º 2
0
        public CandidateUserUpdater(IConfigurationService configurationService, ILogService logService)
        {
            _logService = logService;

            var configuration = configurationService.Get <MigrateFromFaaToAvmsPlusConfiguration>();

            _targetDatabase = new GetOpenConnectionFromConnectionString(configuration.TargetConnectionString);

            _candidateMappers = new CandidateMappers(logService);

            _candidateUserRepository    = new CandidateUserRepository(configurationService, logService);
            _userRepository             = new UserRepository(configurationService, logService);
            _candidateRepository        = new CandidateRepository(_targetDatabase);
            _schoolAttendedRepository   = new SchoolAttendedRepository(_targetDatabase);
            _candidateHistoryRepository = new CandidateHistoryRepository(_targetDatabase);
            _applicationRepository      = new ApplicationRepository(_targetDatabase);

            _vacancyLocalAuthorities = new Lazy <IDictionary <string, int> >(() => new VacancyRepository(_targetDatabase).GetAllVacancyLocalAuthorities());
            _localAuthorityCountyIds = new Lazy <IDictionary <int, int> >(() => new LocalAuthorityRepository(_targetDatabase).GetLocalAuthorityCountyIds());

            _anonymiseData = configuration.AnonymiseData;
        }