class AccountEntityRepository {

    public Pagination<AccountEntity> search(AccountEntitySearch domain) {

        if (!financialConfigurationService.fetchDataFrom().isEmpty()
                && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) {
            AccountEntitySearchContract accountEntitySearchContract = new AccountEntitySearchContract();
            ModelMapper mapper = new ModelMapper();
            mapper.map(domain, accountEntitySearchContract);
            return accountEntityESRepository.search(accountEntitySearchContract);
        } else {
            return accountEntityJdbcRepository.search(domain);
        }

    }

    @Autowired public  AccountEntityRepository(AccountEntityJdbcRepository accountEntityJdbcRepository,
                                   MastersQueueRepository accountEntityQueueRepository, FinancialConfigurationService financialConfigurationService,
                                   AccountEntityESRepository accountEntityESRepository, @Value("${persist.through.kafka}") String persistThroughKafka);

}