From 8fc11b2226218ccd376df1226a89773feeac5341 Mon Sep 17 00:00:00 2001 From: Giulia Tremolada <124147597+giulia-tremolada@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:25:24 +0100 Subject: [PATCH] [SELC-6150] feat: add institutionAggregatorContractMappings field in Product (#663) --- apps/onboarding-functions/pom.xml | 2 +- apps/onboarding-ms/pom.xml | 2 +- apps/pom.xml | 2 +- libs/onboarding-sdk-azure-storage/pom.xml | 2 +- libs/onboarding-sdk-common/pom.xml | 2 +- libs/onboarding-sdk-crypto/pom.xml | 2 +- libs/onboarding-sdk-pom/pom.xml | 2 +- libs/onboarding-sdk-product/pom.xml | 4 ++-- .../selfcare/product/entity/Product.java | 24 +++++++++++++++++++ test-coverage/pom.xml | 2 +- 10 files changed, 34 insertions(+), 10 deletions(-) diff --git a/apps/onboarding-functions/pom.xml b/apps/onboarding-functions/pom.xml index ccffb9988..63ea64b35 100644 --- a/apps/onboarding-functions/pom.xml +++ b/apps/onboarding-functions/pom.xml @@ -22,7 +22,7 @@ true 3.1.2 1.5.5.Final - 0.6.2 + 0.6.3 diff --git a/apps/onboarding-ms/pom.xml b/apps/onboarding-ms/pom.xml index 901b0730d..eea296f3f 100644 --- a/apps/onboarding-ms/pom.xml +++ b/apps/onboarding-ms/pom.xml @@ -24,7 +24,7 @@ true 3.1.2 2.4.1 - 0.6.2 + 0.6.3 diff --git a/apps/pom.xml b/apps/pom.xml index da50b1918..a43e05b79 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -13,7 +13,7 @@ pom - 0.6.2 + 0.6.3 diff --git a/libs/onboarding-sdk-azure-storage/pom.xml b/libs/onboarding-sdk-azure-storage/pom.xml index 38519a1ba..3b31b5f63 100644 --- a/libs/onboarding-sdk-azure-storage/pom.xml +++ b/libs/onboarding-sdk-azure-storage/pom.xml @@ -6,7 +6,7 @@ it.pagopa.selfcare onboarding-sdk-pom - 0.6.2 + 0.6.3 ../onboarding-sdk-pom diff --git a/libs/onboarding-sdk-common/pom.xml b/libs/onboarding-sdk-common/pom.xml index 60028f5ab..ce0db2f65 100644 --- a/libs/onboarding-sdk-common/pom.xml +++ b/libs/onboarding-sdk-common/pom.xml @@ -4,7 +4,7 @@ it.pagopa.selfcare onboarding-sdk-pom - 0.6.2 + 0.6.3 ../onboarding-sdk-pom onboarding-sdk-common diff --git a/libs/onboarding-sdk-crypto/pom.xml b/libs/onboarding-sdk-crypto/pom.xml index 8d5108755..025f55b8c 100644 --- a/libs/onboarding-sdk-crypto/pom.xml +++ b/libs/onboarding-sdk-crypto/pom.xml @@ -4,7 +4,7 @@ it.pagopa.selfcare onboarding-sdk-pom - 0.6.2 + 0.6.3 ../onboarding-sdk-pom onboarding-sdk-crypto diff --git a/libs/onboarding-sdk-pom/pom.xml b/libs/onboarding-sdk-pom/pom.xml index c227d2d50..cc26ea08a 100644 --- a/libs/onboarding-sdk-pom/pom.xml +++ b/libs/onboarding-sdk-pom/pom.xml @@ -5,7 +5,7 @@ onboarding-sdk-pom pom onboarding-sdk-pom - 0.6.2 + 0.6.3 17 diff --git a/libs/onboarding-sdk-product/pom.xml b/libs/onboarding-sdk-product/pom.xml index 058a35163..eeaafc4ae 100644 --- a/libs/onboarding-sdk-product/pom.xml +++ b/libs/onboarding-sdk-product/pom.xml @@ -4,12 +4,12 @@ it.pagopa.selfcare onboarding-sdk-pom - 0.6.2 + 0.6.3 ../onboarding-sdk-pom onboarding-sdk-product onboarding-sdk-product - 0.6.2 + 0.6.3 2.15.2 diff --git a/libs/onboarding-sdk-product/src/main/java/it/pagopa/selfcare/product/entity/Product.java b/libs/onboarding-sdk-product/src/main/java/it/pagopa/selfcare/product/entity/Product.java index e61c66955..cc972e930 100644 --- a/libs/onboarding-sdk-product/src/main/java/it/pagopa/selfcare/product/entity/Product.java +++ b/libs/onboarding-sdk-product/src/main/java/it/pagopa/selfcare/product/entity/Product.java @@ -36,6 +36,8 @@ public class Product { private Product parent; private List consumers; private Map institutionContractMappings; + private Map institutionAggregatorContractMappings; + private Map userContractMappings; private Map userAggregatorContractMappings; @@ -294,6 +296,15 @@ public void setInstitutionContractMappings( this.institutionContractMappings = institutionContractMappings; } + public Map getInstitutionAggregatorContractMappings() { + return institutionAggregatorContractMappings; + } + + public void setInstitutionAggregatorContractMappings( + Map institutionAggregatorContractMappings) { + this.institutionAggregatorContractMappings = institutionAggregatorContractMappings; + } + public Map getUserContractMappings() { return userContractMappings; } @@ -377,4 +388,17 @@ && getUserAggregatorContractMappings().containsKey(institutionType)) { } return userAggregatorContractTemplate; } + + public ContractTemplate getInstitutionAggregatorContractTemplate(String institutionType) { + ContractTemplate contractTemplate = new ContractTemplate(); + if (Objects.nonNull(getInstitutionAggregatorContractMappings())) { + if (Objects.nonNull(institutionType) + && getInstitutionAggregatorContractMappings().containsKey(institutionType)) { + contractTemplate = getInstitutionAggregatorContractMappings().get(institutionType); + } else if (getInstitutionAggregatorContractMappings().containsKey(CONTRACT_TYPE_DEFAULT)) { + contractTemplate = getInstitutionAggregatorContractMappings().get(CONTRACT_TYPE_DEFAULT); + } + } + return contractTemplate; + } } diff --git a/test-coverage/pom.xml b/test-coverage/pom.xml index 02db09fe6..b83b14ef8 100644 --- a/test-coverage/pom.xml +++ b/test-coverage/pom.xml @@ -19,7 +19,7 @@ **/utils/**, **/*Constant*, **/*Config.java, **/error/**, **/filter/**, org/** https://sonarcloud.io - 0.6.2 + 0.6.3