class AccountCodePurposeRepository {

	public Pagination<AccountCodePurpose> search(AccountCodePurposeSearch domain) {
		if (!financialConfigurationService.fetchDataFrom().isEmpty()
				&& financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) {
			AccountCodePurposeSearchContract accountCodePurposeSearchContract = new AccountCodePurposeSearchContract();
			ModelMapper mapper = new ModelMapper();
			mapper.map(domain, accountCodePurposeSearchContract);
			return accountCodePurposeESRepository.search(accountCodePurposeSearchContract);
		} else {
			return accountCodePurposeJdbcRepository.search(domain);
		}

	}

	@Autowired public  AccountCodePurposeRepository(AccountCodePurposeJdbcRepository accountCodePurposeJdbcRepository,
			MastersQueueRepository accountCodePurposeQueueRepository,
			FinancialConfigurationService financialConfigurationService,
			AccountCodePurposeESRepository accountCodePurposeESRepository,
			@Value("${persist.through.kafka}") String persistThroughKafka);

}