class BankAccountRepository {

	public Pagination<BankAccount> search(BankAccountSearch domain) {

		if (!financialConfigurationService.fetchDataFrom().isEmpty()
				&& financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) {
			BankAccountSearchContract bankAccountSearchContract = new BankAccountSearchContract();
			ModelMapper mapper = new ModelMapper();
			mapper.map(domain, bankAccountSearchContract);
			return bankAccountESRepository.search(bankAccountSearchContract);
		} else {
			return bankAccountJdbcRepository.search(domain);
		}

	}

	@Autowired public  BankAccountRepository(BankAccountJdbcRepository bankAccountJdbcRepository,
			MastersQueueRepository bankAccountQueueRepository,
			FinancialConfigurationService financialConfigurationService,
			BankAccountESRepository bankAccountESRepository,
			@Value("${persist.through.kafka}") String persistThroughKafka);

}