class AccountDetailKeyRepository {

	public Pagination<AccountDetailKey> search(final AccountDetailKeySearch domain) {

		if (!financialConfigurationService.fetchDataFrom().isEmpty()
				&& financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) {
			final AccountDetailKeySearchContract accountDetailKeySearchContract = new AccountDetailKeySearchContract();
			final ModelMapper mapper = new ModelMapper();
			mapper.map(domain, accountDetailKeySearchContract);
			return accountDetailKeyESRepository.search(accountDetailKeySearchContract);
		} else
			return accountDetailKeyJdbcRepository.search(domain);

	}

	@Autowired public  AccountDetailKeyRepository(AccountDetailKeyJdbcRepository accountDetailKeyJdbcRepository,
			MastersQueueRepository accountDetailKeyQueueRepository,
			FinancialConfigurationService financialConfigurationService,
			AccountDetailKeyESRepository accountDetailKeyESRepository,
			@Value("${persist.through.kafka}") String persistThroughKafka);

}