class AccountDetailTypeRepository {

	public Pagination<AccountDetailType> search(AccountDetailTypeSearch domain) {
		if (!financialConfigurationService.fetchDataFrom().isEmpty()
				&& financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) {
			AccountDetailTypeSearchContract accountCodeTypeSearchContract = new AccountDetailTypeSearchContract();
			ModelMapper mapper = new ModelMapper();
			mapper.map(domain, accountCodeTypeSearchContract);
			return accountDetailTypeESRepository.search(accountCodeTypeSearchContract);
		} else {
			return accountDetailTypeJdbcRepository.search(domain);
		}

	}

	@Autowired public  AccountDetailTypeRepository(AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository,
			MastersQueueRepository accountDetailTypeQueueRepository,
			FinancialConfigurationService financialConfigurationService,
			AccountDetailTypeESRepository accountDetailTypeESRepository,
			@Value("${persist.through.kafka}") String persistThroughKafka);

}