Search in sources :

Example 1 with PspChannel

use of it.pagopa.pagopa.apiconfig.model.psp.PspChannel in project pagopa-api-config by pagopa.

the class PspService method getChannelsList.

/**
 * Maps a list of PspCanaleTipoVersamento into a list of PspChannel
 *
 * @param pspCanaleTipoVersamentoList list of PspCanaleTipoVersamento from DB
 * @param channelPaymentType          the data structure with the PaymentTypeCode associated at one Channel
 * @return the list of {@link PspChannel}
 */
private List<PspChannel> getChannelsList(List<PspCanaleTipoVersamento> pspCanaleTipoVersamentoList, Map<String, Set<String>> channelPaymentType) {
    return pspCanaleTipoVersamentoList.stream().filter(Objects::nonNull).map(elem -> {
        PspChannel result = modelMapper.map(elem, PspChannel.class);
        // the mapping of PaymentTypeList is custom
        result.setPaymentTypeList(getPaymentTypeList(channelPaymentType, result.getChannelCode()));
        return result;
    }).distinct().collect(Collectors.toList());
}
Also used : PspChannel(it.pagopa.pagopa.apiconfig.model.psp.PspChannel)

Example 2 with PspChannel

use of it.pagopa.pagopa.apiconfig.model.psp.PspChannel in project pagopa-api-config by pagopa.

the class MappingsConfiguration method modelMapper.

@Bean
public ModelMapper modelMapper() {
    ModelMapper mapper = new ModelMapper();
    mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
    Converter<Pa, CreditorInstitutionDetails> convertPaToCreditorInstitutionDetails = new ConvertPaToCreditorInstitutionDetails();
    Converter<Pa, CreditorInstitution> convertPaToCreditorInstitution = new ConvertPaToCreditorInstitution();
    Converter<Stazioni, Station> convertStazioniToStation = new ConvertStazioniToStation();
    Converter<Stazioni, StationDetails> convertStazioniToStationDetails = new ConvertStazioniToStationDetails();
    Converter<PaStazionePa, CreditorInstitutionStation> convertPaStazionePaToCreditorInstitutionStation = new ConvertPaStazionePaToCreditorInstitutionStation();
    Converter<PaStazionePa, StationCreditorInstitution> convertPaStazionePaToStationCreditorInstitution = new ConvertPaStazionePaToStationCreditorInstitution();
    Converter<CodifichePa, Encoding> convertCodifichePaToEncoding = new ConvertCodifichePaToEncoding();
    Converter<IntermediariPa, Broker> convertIntermediariPaToBroker = new ConvertIntermediariPaToBroker();
    Converter<IbanValidiPerPa, Iban> convertIbanValidiPerPaToIban = new ConvertIbanValidiPerPaToIban();
    Converter<IntermediariPa, BrokerDetails> convertIntermediariPaToBrokerDetails = new ConvertIntermediariPaToBrokerDetails();
    Converter<InformativeContoAccreditoMaster, Ica> convertInformativeContoAccreditoMasterRepositoryToIca = new ConvertInformativeContoAccreditoMasterRepositoryToIca();
    Converter<InformativePaMaster, CounterpartTable> convertInformativePaMasterToCounterpartTable = new ConvertInformativePaMasterToCounterpartTable();
    Converter<CreditorInstitutionDetails, Pa> convertCreditorInstitutionDetailsToPa = new ConvertCreditorInstitutionDetailsToPa();
    Converter<BrokerDetails, IntermediariPa> convertBrokerDetailsToIntermediariPa = new ConvertBrokerDetailsToIntermediariPa();
    Converter<StationDetails, Stazioni> convertStationDetailsToStazioni = new ConvertStationDetailsToStazioni();
    Converter<Encoding, CodifichePa> convertEncodingToCodifichePa = new ConvertEncodingToCodifichePa();
    Converter<Psp, PaymentServiceProvider> convertPspToPaymentServiceProvider = new ConvertPspToPaymentServiceProvider();
    Converter<Psp, PaymentServiceProviderDetails> convertPspToPaymentServiceProviderDetails = new ConvertPspToPaymentServiceProviderDetails();
    Converter<CreditorInstitutionStationEdit, PaStazionePa> convertCreditorInstitutionStationPostToPaStazionePa = new ConvertCreditorInstitutionStationPostToPaStazionePa();
    Converter<IntermediariPsp, BrokerPsp> convertIntermediariPspToBrokerPsp = new ConvertIntermediariPspToBrokerPsp();
    Converter<IntermediariPsp, BrokerPspDetails> convertIntermediariPspToBrokerPspDetails = new ConvertIntermediariPspToBrokerPspDetails();
    Converter<Canali, Channel> convertCanaliToChannel = new ConvertCanaliToChannel();
    Converter<Canali, ChannelDetails> convertCanaliToChannelDetails = new ConvertCanaliToChannelDetails();
    Converter<ElencoServizi, Service> convertElencoServiziToService = new ConvertElencoServiziToService();
    Converter<CdiMaster, Cdi> convertCdiMasterToCdi = new ConvertCdiMasterToCdi();
    Converter<PspCanaleTipoVersamento, PspChannel> convertPspCanaleTipoVersamentoToPspChannel = new ConvertPspCanaleTipoVersamentoToPspChannel();
    Converter<BrokerPspDetails, IntermediariPsp> convertBrokerPspDetailsToIntermediariPsp = new ConvertBrokerPspDetailsToIntermediariPsp();
    Converter<PaymentServiceProviderDetails, Psp> convertPaymentServiceProviderDetailsToPsp = new ConvertPaymentServiceProviderDetailsToPsp();
    Converter<ChannelDetails, Canali> convertChannelDetailsToCanali = new ConvertChannelDetailsToCanali();
    Converter<ConfigurationKeys, ConfigurationKey> convertConfigurationKeysConfigurationKey = new ConvertConfigurationKeysToConfigurationKey();
    Converter<CanaleTipoVersamento, PaymentType> convertCanaleTipoVersamentoToPaymentType = new ConvertCanaleTipoVersamentoToPaymentType();
    Converter<WfespPluginConf, it.pagopa.pagopa.apiconfig.model.configuration.WfespPluginConf> convertConfWfespPluginConf = new ConvertWfespPluginConfToWfespPluginConf();
    Converter<Pdd, it.pagopa.pagopa.apiconfig.model.configuration.Pdd> convertPddEToPddM = new ConvertPddEToPddM();
    Converter<it.pagopa.pagopa.apiconfig.model.configuration.Pdd, Pdd> convertPddMToPddE = new ConvertPddMToPddE();
    Converter<FtpServers, FtpServer> convertFtpServersFtpServer = new ConvertFtpServersToFtpServer();
    Converter<TipiVersamento, PaymentType> convertTipiVersamentoPaymentType = new ConvertTipiVersamentoToPaymentType();
    Converter<PaymentType, String> convertPaymentTypeString = new ConvertPaymentTypeToString();
    Converter<PaymentType, TipiVersamento> convertPaymentTypeTipiVersamento = new ConvertPaymentTypeToTipiVersamento();
    mapper.createTypeMap(Pa.class, CreditorInstitutionDetails.class).setConverter(convertPaToCreditorInstitutionDetails);
    mapper.createTypeMap(Pa.class, CreditorInstitution.class).setConverter(convertPaToCreditorInstitution);
    mapper.createTypeMap(Stazioni.class, Station.class).setConverter(convertStazioniToStation);
    mapper.createTypeMap(Stazioni.class, StationDetails.class).setConverter(convertStazioniToStationDetails);
    mapper.createTypeMap(PaStazionePa.class, CreditorInstitutionStation.class).setConverter(convertPaStazionePaToCreditorInstitutionStation);
    mapper.createTypeMap(PaStazionePa.class, StationCreditorInstitution.class).setConverter(convertPaStazionePaToStationCreditorInstitution);
    mapper.createTypeMap(CodifichePa.class, Encoding.class).setConverter(convertCodifichePaToEncoding);
    mapper.createTypeMap(IntermediariPa.class, Broker.class).setConverter(convertIntermediariPaToBroker);
    mapper.createTypeMap(IbanValidiPerPa.class, Iban.class).setConverter(convertIbanValidiPerPaToIban);
    mapper.createTypeMap(IntermediariPa.class, BrokerDetails.class).setConverter(convertIntermediariPaToBrokerDetails);
    mapper.createTypeMap(InformativeContoAccreditoMaster.class, Ica.class).setConverter(convertInformativeContoAccreditoMasterRepositoryToIca);
    mapper.createTypeMap(InformativePaMaster.class, CounterpartTable.class).setConverter(convertInformativePaMasterToCounterpartTable);
    mapper.createTypeMap(CreditorInstitutionDetails.class, Pa.class).setConverter(convertCreditorInstitutionDetailsToPa);
    mapper.createTypeMap(BrokerDetails.class, IntermediariPa.class).setConverter(convertBrokerDetailsToIntermediariPa);
    mapper.createTypeMap(StationDetails.class, Stazioni.class).setConverter(convertStationDetailsToStazioni);
    mapper.createTypeMap(Encoding.class, CodifichePa.class).setConverter(convertEncodingToCodifichePa);
    mapper.createTypeMap(Psp.class, PaymentServiceProvider.class).setConverter(convertPspToPaymentServiceProvider);
    mapper.createTypeMap(Psp.class, PaymentServiceProviderDetails.class).setConverter(convertPspToPaymentServiceProviderDetails);
    mapper.createTypeMap(CreditorInstitutionStationEdit.class, PaStazionePa.class).setConverter(convertCreditorInstitutionStationPostToPaStazionePa);
    mapper.createTypeMap(IntermediariPsp.class, BrokerPsp.class).setConverter(convertIntermediariPspToBrokerPsp);
    mapper.createTypeMap(IntermediariPsp.class, BrokerPspDetails.class).setConverter(convertIntermediariPspToBrokerPspDetails);
    mapper.createTypeMap(Canali.class, Channel.class).setConverter(convertCanaliToChannel);
    mapper.createTypeMap(Canali.class, ChannelDetails.class).setConverter(convertCanaliToChannelDetails);
    mapper.createTypeMap(ElencoServizi.class, Service.class).setConverter(convertElencoServiziToService);
    mapper.createTypeMap(CdiMaster.class, Cdi.class).setConverter(convertCdiMasterToCdi);
    mapper.createTypeMap(PspCanaleTipoVersamento.class, PspChannel.class).setConverter(convertPspCanaleTipoVersamentoToPspChannel);
    mapper.createTypeMap(BrokerPspDetails.class, IntermediariPsp.class).setConverter(convertBrokerPspDetailsToIntermediariPsp);
    mapper.createTypeMap(PaymentServiceProviderDetails.class, Psp.class).setConverter(convertPaymentServiceProviderDetailsToPsp);
    mapper.createTypeMap(ChannelDetails.class, Canali.class).setConverter(convertChannelDetailsToCanali);
    mapper.createTypeMap(ConfigurationKeys.class, ConfigurationKey.class).setConverter(convertConfigurationKeysConfigurationKey);
    mapper.createTypeMap(CanaleTipoVersamento.class, PaymentType.class).setConverter(convertCanaleTipoVersamentoToPaymentType);
    mapper.createTypeMap(WfespPluginConf.class, it.pagopa.pagopa.apiconfig.model.configuration.WfespPluginConf.class).setConverter(convertConfWfespPluginConf);
    mapper.createTypeMap(Pdd.class, it.pagopa.pagopa.apiconfig.model.configuration.Pdd.class).setConverter(convertPddEToPddM);
    mapper.createTypeMap(it.pagopa.pagopa.apiconfig.model.configuration.Pdd.class, Pdd.class).setConverter(convertPddMToPddE);
    mapper.createTypeMap(FtpServers.class, FtpServer.class).setConverter(convertFtpServersFtpServer);
    mapper.createTypeMap(TipiVersamento.class, PaymentType.class).setConverter(convertTipiVersamentoPaymentType);
    mapper.createTypeMap(PaymentType.class, String.class).setConverter(convertPaymentTypeString);
    mapper.createTypeMap(PaymentType.class, TipiVersamento.class).setConverter(convertPaymentTypeTipiVersamento);
    return mapper;
}
Also used : Cdi(it.pagopa.pagopa.apiconfig.model.psp.Cdi) BrokerPsp(it.pagopa.pagopa.apiconfig.model.psp.BrokerPsp) PaymentServiceProviderDetails(it.pagopa.pagopa.apiconfig.model.psp.PaymentServiceProviderDetails) ConfigurationKey(it.pagopa.pagopa.apiconfig.model.configuration.ConfigurationKey) PaymentServiceProvider(it.pagopa.pagopa.apiconfig.model.psp.PaymentServiceProvider) ChannelDetails(it.pagopa.pagopa.apiconfig.model.psp.ChannelDetails) PspChannel(it.pagopa.pagopa.apiconfig.model.psp.PspChannel) Channel(it.pagopa.pagopa.apiconfig.model.psp.Channel) BrokerPsp(it.pagopa.pagopa.apiconfig.model.psp.BrokerPsp) PaymentType(it.pagopa.pagopa.apiconfig.model.configuration.PaymentType) Service(it.pagopa.pagopa.apiconfig.model.psp.Service) PspChannel(it.pagopa.pagopa.apiconfig.model.psp.PspChannel) ModelMapper(org.modelmapper.ModelMapper) FtpServer(it.pagopa.pagopa.apiconfig.model.configuration.FtpServer) BrokerPspDetails(it.pagopa.pagopa.apiconfig.model.psp.BrokerPspDetails) Bean(org.springframework.context.annotation.Bean)

Aggregations

PspChannel (it.pagopa.pagopa.apiconfig.model.psp.PspChannel)2 ConfigurationKey (it.pagopa.pagopa.apiconfig.model.configuration.ConfigurationKey)1 FtpServer (it.pagopa.pagopa.apiconfig.model.configuration.FtpServer)1 PaymentType (it.pagopa.pagopa.apiconfig.model.configuration.PaymentType)1 BrokerPsp (it.pagopa.pagopa.apiconfig.model.psp.BrokerPsp)1 BrokerPspDetails (it.pagopa.pagopa.apiconfig.model.psp.BrokerPspDetails)1 Cdi (it.pagopa.pagopa.apiconfig.model.psp.Cdi)1 Channel (it.pagopa.pagopa.apiconfig.model.psp.Channel)1 ChannelDetails (it.pagopa.pagopa.apiconfig.model.psp.ChannelDetails)1 PaymentServiceProvider (it.pagopa.pagopa.apiconfig.model.psp.PaymentServiceProvider)1 PaymentServiceProviderDetails (it.pagopa.pagopa.apiconfig.model.psp.PaymentServiceProviderDetails)1 Service (it.pagopa.pagopa.apiconfig.model.psp.Service)1 ModelMapper (org.modelmapper.ModelMapper)1 Bean (org.springframework.context.annotation.Bean)1