From 4719780b02af04d21da40d3c72c5d01d55df59f1 Mon Sep 17 00:00:00 2001 From: Andrea De Rinaldis Date: Wed, 17 Jan 2024 20:09:03 +0100 Subject: [PATCH] [PASELC-655] feat: added mapping configuration --- README.md | 9 +++++++-- .../config/MappingsConfiguration.java | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e71949c..aa21d4e4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=pagopa_pagopa-api-config-selfcare-integration&metric=alert_status)](https://sonarcloud.io/dashboard?id=pagopa_pagopa-api-config-selfcare-integration) -Spring Application that exposes a subset of the APIs to manage configuration for EC/PSP on the _Nodo dei Pagamenti_, needed by PagoPA SelfCare application. +Spring Application that exposes a subset of the APIs to manage configuration for EC/PSP on the _Nodo dei Pagamenti_, +needed by PagoPA SelfCare application. - [pagoPa Api Config - SelfCare integration](#pagopa-api-config---selfcare-integration) * [Api Documentation 📖](#api-documentation---) @@ -25,7 +26,8 @@ Spring Application that exposes a subset of the APIs to manage configuration for ## Api Documentation 📖 -See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-api-config-selfcare-integration/main/openapi/openapi.json) +See +the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-api-config-selfcare-integration/main/openapi/openapi.json) --- @@ -73,6 +75,9 @@ or, for H2 tests: `mvn spring-boot:run -Dspring-boot.run.profiles=h2` +Using the spring profile `local`, the Spring application connects to the H2 in-memory DB. +For access to H2 console, use this url: http://localhost:8080/h2-console/ + ### Spring Profiles - **local**: to develop locally, pointing to DEV database. diff --git a/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/config/MappingsConfiguration.java b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/config/MappingsConfiguration.java index 6687b836..5364d31b 100644 --- a/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/config/MappingsConfiguration.java +++ b/src/main/java/it/gov/pagopa/apiconfig/selfcareintegration/config/MappingsConfiguration.java @@ -2,10 +2,13 @@ import it.gov.pagopa.apiconfig.selfcareintegration.mapper.ConvertCanaliToChannelDetails; import it.gov.pagopa.apiconfig.selfcareintegration.mapper.ConvertIbanMasterToIbanDetail; +import it.gov.pagopa.apiconfig.selfcareintegration.mapper.ConvertPaStazionePaToCreditorInstitutionDetail; import it.gov.pagopa.apiconfig.selfcareintegration.model.channel.ChannelDetails; +import it.gov.pagopa.apiconfig.selfcareintegration.model.creditorinstitution.CreditorInstitutionDetail; import it.gov.pagopa.apiconfig.selfcareintegration.model.iban.IbanDetails; import it.gov.pagopa.apiconfig.starter.entity.Canali; import it.gov.pagopa.apiconfig.starter.entity.IbanMaster; +import it.gov.pagopa.apiconfig.starter.entity.PaStazionePa; import org.modelmapper.ModelMapper; import org.modelmapper.convention.MatchingStrategies; import org.springframework.context.annotation.Bean; @@ -26,6 +29,9 @@ ModelMapper modelMapper() { mapper .createTypeMap(IbanMaster.class, IbanDetails.class) .setConverter(new ConvertIbanMasterToIbanDetail()); + mapper + .createTypeMap(PaStazionePa.class, CreditorInstitutionDetail.class) + .setConverter(new ConvertPaStazionePaToCreditorInstitutionDetail()); return mapper; }