Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into feature/SELC-4383
Browse files Browse the repository at this point in the history
# Conflicts:
#	connector-api/src/main/java/it/pagopa/selfcare/mscore/config/CoreConfig.java
#	core/src/main/java/it/pagopa/selfcare/mscore/core/MailNotificationServiceImpl.java
#	infra/container_apps/env/dev-pnpg/terraform.tfvars
#	infra/container_apps/env/dev/terraform.tfvars
#	infra/container_apps/env/prod-pnpg/terraform.tfvars
#	infra/container_apps/env/prod/terraform.tfvars
#	infra/container_apps/env/uat-pnpg/terraform.tfvars
#	infra/container_apps/env/uat/terraform.tfvars
  • Loading branch information
manuraf committed Apr 23, 2024
2 parents a47da17 + 471b595 commit e84c7f4
Show file tree
Hide file tree
Showing 65 changed files with 2,326 additions and 278 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/pr_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,11 @@ on:
- main
- releases/**
types:
- opened
- edited
- synchronize
- reopened
- ready_for_review
paths:
- '.github/workflows/pr_ms.yml'
- '.github/workflows/release_ms.yml'
- '.github/workflows/release_ms_pnpg.yml'
- '!.devops/**'
- '!.identity/**'
- '!helm/**'
- '!**.md'
- '!**ignore'
- '!infra/**'
- '!.terraform-version'
- '!CODEOWNERS'

jobs:

Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ on:
push:
branches:
- main
- releases/**
- releases/*
paths:
- '!.devops/**'
- '!.github/**'
- '!.identity/**'
- '!helm/**'
- '!**.md'
- '!.**ignore'
- '!infra/repository/**'
- '!.terraform-version'
- '!CODEOWNERS'
- 'app/**'
- 'connector/**'
- 'connector-api/**'
- 'core/**'
- 'infra/**'
- 'web/**'
- 'pom.xml'

workflow_dispatch:
inputs:
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release_ms_pnpg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ on:
push:
branches:
- main
- releases/**
- releases/*
paths:
- '!.devops/**'
- '!.github/**'
- '!.identity/**'
- '!helm/**'
- '!**.md'
- '!.**ignore'
- '!infra/repository/**'
- '!.terraform-version'
- '!CODEOWNERS'
- 'app/**'
- 'connector/**'
- 'connector-api/**'
- 'core/**'
- 'infra/**'
- 'web/**'
- 'pom.xml'

workflow_dispatch:
inputs:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.new
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3-eclipse-temurin-17 AS builder
FROM maven:3-eclipse-temurin-17@sha256:0d328fa6843bb26b60cf44d69833f241ffe96218fb29fa19df7a6603863eaae7 AS builder

COPY . .

Expand All @@ -18,7 +18,7 @@ ARG REPO_PASSWORD

RUN mvn --global-settings settings.xml -DrepositoryOnboarding=${REPO_ONBOARDING} -DrepoLogin=${REPO_USERNAME} -DrepoPwd=${REPO_PASSWORD} clean package -DskipTests=true

FROM openjdk:17-jdk AS runtime
FROM openjdk:17-jdk@sha256:528707081fdb9562eb819128a9f85ae7fe000e2fbaeaf9f87662e7b3f38cb7d8 AS runtime

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/config/core-config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mscore.logoPath = ${PAGOPA_LOGO_URL:resources/logo.png}
mscore.infoCamereEnable = ${INFOCAMERE_ENABLE:false}
mscore.sender-mail = ${MAIL_SENDER_ADDRESS:test@test.it}
mscore.destination-mails = ${DESTINATION_MAILS:}

mscore.enableSendDelegationMail=${SEND_DELEGATION_PEC:false}
mscore.sendEmailToInstitution = ${ONBOARDING_SEND_EMAIL_TO_INSTITUTION:false}
mscore.institutionAlternativeEmail = ${ONBOARDING_INSTITUTION_ALTERNATIVE_EMAIL}
mscore.onboarding-expiring-date = ${ONBOARDING_EXPIRING_DATE:60}
Expand Down
101 changes: 101 additions & 0 deletions app/src/main/resources/swagger/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@
"type" : "string",
"enum" : [ "FULL", "NORMAL" ]
}
}, {
"name" : "order",
"in" : "query",
"description" : "Order to show response NONE, ASC, DESC",
"required" : false,
"style" : "form",
"schema" : {
"type" : "string",
"enum" : [ "ASC", "DESC", "NONE" ]
}
}, {
"name" : "page",
"in" : "query",
Expand Down Expand Up @@ -2945,6 +2955,97 @@
} ]
}
},
"/onboarding/verify" : {
"head" : {
"tags" : [ "Onboarding" ],
"summary" : "verify if onboardedProduct is already onboarded for institution",
"description" : "verify if onboardedProduct is already onboarded for institution",
"operationId" : "verifyOnboardingInfoByFiltersUsingHEAD",
"parameters" : [ {
"name" : "productId",
"in" : "query",
"description" : "Product's unique identifier",
"required" : true,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "externalId",
"in" : "query",
"description" : "Institution's unique external identifier",
"required" : false,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "taxCode",
"in" : "query",
"description" : "Institution's tax code",
"required" : false,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "origin",
"in" : "query",
"description" : "Institution's origin",
"required" : false,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "originId",
"in" : "query",
"description" : "Institution's id in the relative origin open data",
"required" : false,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "subunitCode",
"in" : "query",
"description" : "Institution's subunit code",
"required" : false,
"style" : "form",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"204" : {
"description" : "No Content"
},
"400" : {
"description" : "Bad Request",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"404" : {
"description" : "Not Found",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
}
},
"security" : [ {
"bearerAuth" : [ "global" ]
} ]
}
},
"/notification-event/contracts" : {
"put" : {
"tags" : [ "kafka" ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import it.pagopa.selfcare.mscore.constant.DelegationState;
import it.pagopa.selfcare.mscore.constant.GetDelegationsMode;
import it.pagopa.selfcare.mscore.constant.Order;
import it.pagopa.selfcare.mscore.model.delegation.Delegation;

import java.util.List;
Expand All @@ -10,7 +11,7 @@ public interface DelegationConnector {

Delegation save(Delegation delegation);
boolean checkIfExists(Delegation delegation);
List<Delegation> find(String from, String to, String productId, String search, String taxCode, GetDelegationsMode mode, Integer page, Integer size);
List<Delegation> find(String from, String to, String productId, String search, String taxCode, GetDelegationsMode mode, Order order, Integer page, Integer size);
Delegation findByIdAndModifyStatus(String delegationId, DelegationState status);
boolean checkIfDelegationsAreActive(String institutionId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import it.pagopa.selfcare.mscore.constant.RelationshipState;
import it.pagopa.selfcare.mscore.constant.SearchMode;
import it.pagopa.selfcare.mscore.model.institution.*;
import it.pagopa.selfcare.mscore.model.onboarding.VerifyOnboardingFilters;

import java.time.OffsetDateTime;
import java.util.List;
Expand Down Expand Up @@ -56,4 +57,6 @@ public interface InstitutionConnector {
List<Institution> findByTaxCodeAndSubunitCode(String taxCode, String subunitCode);

List<Institution> findByOriginAndOriginId(String origin, String originId);

Boolean existsOnboardingByFilters(VerifyOnboardingFilters filters);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ public interface PartyRegistryProxyConnector {

SaResource getSAFromAnac(String taxId);

AsResource getASFromIvass(String taxId);
ASResource getASFromIvass(String ivassCode);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package it.pagopa.selfcare.mscore.api;


import java.util.List;

public interface UserApiConnector {

List<String> getUserEmails(String institutionId, String productId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class CoreConfig {
private boolean sendEmailToInstitution;
private Integer onboardingExpiringDate;
private boolean infoCamereEnable;
private boolean enableSendDelegationMail;
private BlobStorage blobStorage;

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ public enum CustomError {
MANAGER_NOT_FOUND_ERROR("0033", "No onboarded managers for at least one of the institutions %s and product %s"),
ROLES_NOT_ADMITTED_ERROR("0034","Roles %s are not admitted for this operation"),
INSTITUTION_NOT_ONBOARDED("0004", "Institution having externalId %s is not onboarded for product %s"),
INSTITUTION_NOT_ONBOARDED_BY_FILTERS("0004", "Has not been found an onboarded Institution with the provided filters"),
INSTITUTION_NOT_FOUND("0036", "Cannot find Institution using institutionId %s and externalInstitutionId %s"),
INSTITUTION_LEGAL_NOT_FOUND("0037", "Institution with externalInstitutionId %s is not related to user"),
CREATE_INSTITUTION_CONFLICT("0038", "Institution having externalId %s already exists"),
CREATE_INSTITUTION_IPA_CONFLICT("0038", "Institution having taxCode %s and subunitCode %s already exists"),
CREATE_INSTITUTION_ORIGIN_CONFLICT("0038", "Institution having origin %s and originId %s already exists"),
CREATE_INSTITUTION_NOT_FOUND("0039", "Institution having externalId %s not exists in registry"),
INSTITUTION_TAX_CODE_NOT_FOUND("0040", "Cannot find Institution using taxCode %s"),
ONBOARDING_INVALID_UPDATES("0046", "Cannot perform data overrides on institution having external id %s"),
GEO_TAXONOMY_CODE_NOT_FOUND("0049", "Error on retrieve geographic taxonomy code: %s"),
PRODUCTS_NOT_FOUND_ERROR("0030", "Products not found for institution having internalId %s"),
ONBOARDING_INFO_INSTITUTION_NOT_FOUND("0050", "No onboarding information found for %s"),
ONBOARDING_INFO_ERROR("0051", "Error getting onboarding info"),
ONBOARDING_INFO_FILTERS_ERROR("0052", "Invalid filters parameters to retrieve onboarding info"),
ONBOARDING_BILLING_ERROR("0000", "Billing vatNumber and recipientCode are required"),
ONBOARDING_BILLING_VATNUMBER_ERROR("0000", "Billing vatNumber is required"),
ONBOARDING_PENDING("0000", "There is already an onboarding request for product %s pending"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package it.pagopa.selfcare.mscore.constant;

public enum Order {

NONE,
ASC,
DESC;

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lombok.Data;

@Data
public class AsResource {
public class ASResource {
private String id;
private String originId;
private String taxCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class Institution {
private String address;
private String zipCode;
private String taxCode;
private String ivassCode;
private String city;
private String county;
private String country;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package it.pagopa.selfcare.mscore.model.onboarding;

import it.pagopa.selfcare.mscore.constant.CustomError;
import it.pagopa.selfcare.mscore.constant.RelationshipState;
import it.pagopa.selfcare.mscore.exception.InvalidRequestException;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.List;

@Data
public class VerifyOnboardingFilters {
private String productId;
private String externalId;
private String taxCode;
private String origin;
private String originId;
private String subunitCode;
private List<RelationshipState> validRelationshipStates;

public VerifyOnboardingFilters(String productId, String externalId, String taxCode, String origin, String originId, String subunitCode) {
this.productId = productId;

/*
We don't set the values of all the attributes of the class, but try to value only a portion of them based on different
search patterns priority that we intend to convey.
And if the provided parameters do not fall within the identified cases for a search then return exception.
*/
if (StringUtils.hasText(externalId)) {
this.externalId = externalId;
} else if (StringUtils.hasText(taxCode)) {
this.taxCode = taxCode;
this.subunitCode = subunitCode;
this.origin = origin;
} else if(StringUtils.hasText(subunitCode)) {
this.subunitCode = subunitCode;
this.origin = origin;
} else if (StringUtils.hasText(origin) && StringUtils.hasText(originId)) {
this.origin = origin;
this.originId = originId;
} else {
throw new InvalidRequestException(CustomError.ONBOARDING_INFO_FILTERS_ERROR.getMessage(), CustomError.ONBOARDING_INFO_FILTERS_ERROR.getCode());
}
}
}
Loading

0 comments on commit e84c7f4

Please sign in to comment.