class InstrumentAccountCodeRepository {

    public Pagination<InstrumentAccountCode> search(InstrumentAccountCodeSearch domain) {

        if (financialConfigurationContractRepository.fetchDataFrom() != null
                && financialConfigurationContractRepository.fetchDataFrom().equalsIgnoreCase("es")) {

            InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper();
            InstrumentAccountCodeSearchContract instrumentAccountCodeSearchContract = new InstrumentAccountCodeSearchContract();
            instrumentAccountCodeSearchContract = mapper.toSearchContract(domain);

            return instrumentAccountCodeESRepository.search(instrumentAccountCodeSearchContract);

        } else
            return instrumentAccountCodeJdbcRepository.search(domain);

    }

    @Autowired public  InstrumentAccountCodeRepository(InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository,
            InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository,
            @Value("${persist.through.kafka}") String persistThroughKafka,
            InstrumentAccountCodeESRepository instrumentAccountCodeESRepository,
            FinancialConfigurationContractRepository financialConfigurationContractRepository);

}