class BankBranchRepository {

	public Pagination<BankBranch> search(BankBranchSearch domain) {

		if (!financialConfigurationService.fetchDataFrom().isEmpty()
				&& financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) {
			BankBranchSearchContract bankBranchSearchContract = new BankBranchSearchContract();
			ModelMapper mapper = new ModelMapper();
			mapper.map(domain, bankBranchSearchContract);
			return bankBranchESRepository.search(bankBranchSearchContract);
		} else {
			return bankBranchJdbcRepository.search(domain);
		}

	}

	@Autowired public  BankBranchRepository(BankBranchJdbcRepository bankBranchJdbcRepository,
			MastersQueueRepository bankBranchQueueRepository,
			FinancialConfigurationService financialConfigurationService, BankBranchESRepository bankBranchESRepository,
			@Value("${persist.through.kafka}") String persistThroughKafka);

}