class RecoveryRepository {

    public Pagination<Recovery> search(RecoverySearch domain) {
        if (!financialConfigurationService.fetchDataFrom().isEmpty()
                && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) {
            RecoverySearchContract recoverySearchContract = new RecoverySearchContract();
            ModelMapper mapper = new ModelMapper();
            mapper.map(domain, recoverySearchContract);
            return recoveryESRepository.search(recoverySearchContract);
        } else {
            return recoveryJdbcRepository.search(domain);
        }

    }

    @Autowired public  RecoveryRepository(MastersQueueRepository recoveryQueueRepository, FinancialConfigurationService financialConfigurationService,
                              @Value("${persist.through.kafka}") String persistThroughKafka,
                              RecoveryJdbcRepository recoveryJdbcRepository,
                              RecoveryESRepository recoveryESRepository);

}