Skip to content

Commit

Permalink
add userAggregatorContractMappings field in Product
Browse files Browse the repository at this point in the history
  • Loading branch information
giulia-tremolada committed Nov 5, 2024
1 parent d725c13 commit 148250f
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 18 deletions.
6 changes: 3 additions & 3 deletions apps/onboarding-functions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-crypto</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-azure-storage</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-product</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
4 changes: 2 additions & 2 deletions apps/onboarding-ms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-azure-storage</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-product</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>

</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-common</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion libs/onboarding-sdk-azure-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-pom</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../onboarding-sdk-pom</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion libs/onboarding-sdk-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-pom</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../onboarding-sdk-pom</relativePath>
</parent>
<artifactId>onboarding-sdk-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion libs/onboarding-sdk-crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-pom</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../onboarding-sdk-pom</relativePath>
</parent>
<artifactId>onboarding-sdk-crypto</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion libs/onboarding-sdk-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>onboarding-sdk-pom</artifactId>
<packaging>pom</packaging>
<name>onboarding-sdk-pom</name>
<version>0.4.0</version>
<version>0.4.1</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
4 changes: 2 additions & 2 deletions libs/onboarding-sdk-product/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-pom</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<relativePath>../onboarding-sdk-pom</relativePath>
</parent>
<artifactId>onboarding-sdk-product</artifactId>
<name>onboarding-sdk-product</name>
<version>0.4.0</version>
<version>0.4.1</version>

<properties>
<jackson.version>2.15.2</jackson.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ public enum PHASE_ADDITION_ALLOWED {
DASHBOARD("dashboard"),

//Phase on dashboard "Aggiunta Utenti" when a sign contract is needed
DASHBOARD_ASYNC("dashboard-async");
DASHBOARD_ASYNC("dashboard-async"),

//Phase on dashboard "Aggiunta Utenti" for aggregators when a sign contract is needed
DASHBOARD_AGGREGATOR("dashboard-aggregator");

public final String value;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package it.pagopa.selfcare.product.entity;

import it.pagopa.selfcare.onboarding.common.PartyRole;
import org.apache.commons.lang3.StringUtils;

import java.time.Instant;
import java.util.*;
import org.apache.commons.lang3.StringUtils;

public class Product {

Expand Down Expand Up @@ -36,6 +37,7 @@ public class Product {
private List<String> consumers;
private Map<String, ContractTemplate> institutionContractMappings;
private Map<String, ContractTemplate> userContractMappings;
private Map<String, ContractTemplate> userAggregatorContractMappings;

public String getId() {
return id;
Expand Down Expand Up @@ -300,6 +302,14 @@ public void setUserContractMappings(Map<String, ContractTemplate> userContractMa
this.userContractMappings = userContractMappings;
}

public Map<String, ContractTemplate> getUserAggregatorContractMappings() {
return userAggregatorContractMappings;
}

public void setUserAggregatorContractMappings(Map<String, ContractTemplate> userAggregatorContractMappings) {
this.userAggregatorContractMappings = userAggregatorContractMappings;
}

public String getAlias() {
return alias;
}
Expand Down Expand Up @@ -347,4 +357,24 @@ && getInstitutionContractMappings().containsKey(institutionType)) {
}
return contractTemplate;
}

/**
* This method returns ContractTemplate associate with a specific InstitutionType for UserAggregatorContract.
* In case none InstitutionType exists on contractMapping, it returns the default ContractTemplate.
*
* @param institutionType InstitutionType
* @return ContractTemplate
*/
public ContractTemplate getUserAggregatorContractTemplate(String institutionType) {
ContractTemplate userAggregatorContractTemplate = new ContractTemplate();
if (Objects.nonNull(getUserAggregatorContractMappings())) {
if (Objects.nonNull(institutionType)
&& getUserAggregatorContractMappings().containsKey(institutionType)) {
userAggregatorContractTemplate = getUserAggregatorContractMappings().get(institutionType);
} else if (getUserAggregatorContractMappings().containsKey(CONTRACT_TYPE_DEFAULT)) {
userAggregatorContractTemplate = getUserAggregatorContractMappings().get(CONTRACT_TYPE_DEFAULT);
}
}
return userAggregatorContractTemplate;
}
}
8 changes: 4 additions & 4 deletions test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-product</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-common</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-azure-storage</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-crypto</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
</dependencies>

Expand Down

0 comments on commit 148250f

Please sign in to comment.