users, String workContractId) {
+ StringBuilder builder = new StringBuilder();
+ users.forEach(user -> {
+ builder
+ .append("")
+ .append("Nome e Cognome: ")
+ .append(getStringValue(user.getName())).append(" ")
+ .append(getStringValue(user.getFamilyName()))
+ .append("
\n")
+ .append("Codice Fiscale: ")
+ .append(user.getFiscalCode())
+ .append("
\n")
+ .append("Amm.ne/Ente/Società:
\n")
+ .append("Qualifica/Posizione:
\n")
+ .append("e-mail: ");
+
+ if (Objects.nonNull(user.getWorkContacts()) && user.getWorkContacts().containsKey(workContractId)) {
+ builder.append(getStringValue(user.getWorkContacts().get(workContractId).getEmail()));
+ }
+
+ builder.append("
\n")
+ .append("PEC:
\n")
+ .append("");
+ });
+ return builder.toString();
+ }
+
+ private static String getStringValue(CertifiableFieldResourceOfstring resourceOfString) {
+ return Optional.ofNullable(resourceOfString).map(CertifiableFieldResourceOfstring::getValue).orElse("");
+ }
+}
diff --git a/apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/utils/Utils.java b/apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/utils/Utils.java
new file mode 100644
index 000000000..21eb3ae6a
--- /dev/null
+++ b/apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/utils/Utils.java
@@ -0,0 +1,38 @@
+package it.pagopa.selfcare.onboarding.utils;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+import it.pagopa.selfcare.onboarding.exception.FunctionOrchestratedException;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.function.Function;
+
+public class Utils {
+
+ public static final String PDF_FORMAT_FILENAME = "%s_accordo_adesione.pdf";
+
+ public static final Function CONTRACT_FILENAME_FUNC =
+ productName -> String.format(PDF_FORMAT_FILENAME, StringUtils.stripAccents(productName.replaceAll("\\s+","_")));
+
+
+
+ public static Onboarding readOnboardingValue(ObjectMapper objectMapper, String onboardingString) {
+ try {
+ return objectMapper.readValue(onboardingString, Onboarding.class);
+ } catch (JsonProcessingException e) {
+ throw new FunctionOrchestratedException(e);
+ }
+ }
+
+ public static String getOnboardingString(ObjectMapper objectMapper, Onboarding onboarding) {
+
+ String onboardingString;
+ try {
+ onboardingString = objectMapper.writeValueAsString(onboarding);
+ } catch (JsonProcessingException e) {
+ throw new FunctionOrchestratedException(e);
+ }
+ return onboardingString;
+ }
+}
diff --git a/apps/onboarding-functions/src/main/openapi/core.json b/apps/onboarding-functions/src/main/openapi/core.json
new file mode 100644
index 000000000..9a817aab6
--- /dev/null
+++ b/apps/onboarding-functions/src/main/openapi/core.json
@@ -0,0 +1,8099 @@
+{
+ "openapi" : "3.0.3",
+ "info" : {
+ "title" : "selc-ms-core",
+ "version" : "1.0-SNAPSHOT"
+ },
+ "servers" : [ {
+ "url" : "{url}:{port}{basePath}",
+ "variables" : {
+ "url" : {
+ "default" : "http://localhost"
+ },
+ "port" : {
+ "default" : "80"
+ },
+ "basePath" : {
+ "default" : ""
+ }
+ }
+ } ],
+ "tags" : [ {
+ "name" : "Delegation",
+ "description" : "Delegation Controller"
+ }, {
+ "name" : "External",
+ "description" : "External Controller"
+ }, {
+ "name" : "Institution",
+ "description" : "Institution Controller"
+ }, {
+ "name" : "Management",
+ "description" : "Management Controller"
+ }, {
+ "name" : "Migration",
+ "description" : "Crud Controller"
+ }, {
+ "name" : "Onboarding",
+ "description" : "Onboarding Controller"
+ }, {
+ "name" : "Persons",
+ "description" : "User Controller"
+ }, {
+ "name" : "Token",
+ "description" : "Token Controller"
+ }, {
+ "name" : "scheduler",
+ "description" : "Scheduler Controller"
+ } ],
+ "paths" : {
+ "/migration/institution" : {
+ "post" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.save.institution}",
+ "description" : "${swagger.mscore.migration.save.institution}",
+ "operationId" : "createInstitutionUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/MigrationInstitution"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Institution"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/migration/institution/{id}" : {
+ "get" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.findbyid.institution}",
+ "description" : "${swagger.mscore.migration.findbyid.institution}",
+ "operationId" : "findInstitutionByIdUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "id",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Institution"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ },
+ "delete" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.delete.institution}",
+ "description" : "${swagger.mscore.migration.delete.institution}",
+ "operationId" : "deleteInstitutionUsingDELETE",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "id",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Institution"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/migration/institutions" : {
+ "get" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.find.institution}",
+ "description" : "${swagger.mscore.migration.find.institution}",
+ "operationId" : "findInstitutionsUsingGET",
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Institution"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/migration/token" : {
+ "post" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.save.token}",
+ "description" : "${swagger.mscore.migration.save.token}",
+ "operationId" : "createTokenUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/MigrationToken"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Token"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/migration/token/{id}" : {
+ "get" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.findbyid.token}",
+ "description" : "${swagger.mscore.migration.findbyid.token}",
+ "operationId" : "findTokenByIdUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "id",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Token"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ },
+ "delete" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.delete.token}",
+ "description" : "${swagger.mscore.migration.delete.token}",
+ "operationId" : "deleteTokenUsingDELETE",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "id",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Token"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/migration/tokens" : {
+ "get" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.find.token}",
+ "description" : "${swagger.mscore.migration.find.token}",
+ "operationId" : "findTokensUsingGET",
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Token"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/migration/user" : {
+ "post" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.save.user}",
+ "description" : "${swagger.mscore.migration.save.user}",
+ "operationId" : "createUserUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/MigrationOnboardedUser"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardedUser"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/migration/user/{id}" : {
+ "get" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.findbyid.user}",
+ "description" : "${swagger.mscore.migration.findbyid.user}",
+ "operationId" : "findUserByIdUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "id",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardedUser"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ },
+ "delete" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.delete.user}",
+ "description" : "${swagger.mscore.migration.delete.user}",
+ "operationId" : "deleteUserUsingDELETE",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "id",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardedUser"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/migration/users" : {
+ "get" : {
+ "tags" : [ "Migration" ],
+ "summary" : "${swagger.mscore.migration.find.token}",
+ "description" : "${swagger.mscore.migration.find.token}",
+ "operationId" : "findUsersUsingGET",
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/OnboardedUser"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/delegations" : {
+ "get" : {
+ "tags" : [ "Delegation", "external-v2", "support" ],
+ "summary" : "Retrieve institution's delegations",
+ "description" : "Retrieve institution's delegations",
+ "operationId" : "getDelegationsUsingGET",
+ "parameters" : [ {
+ "name" : "institutionId",
+ "in" : "query",
+ "description" : "The internal identifier of the institution",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "brokerId",
+ "in" : "query",
+ "description" : "The internal identifier of the institution",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "query",
+ "description" : "Product's unique identifier",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "mode",
+ "in" : "query",
+ "description" : "Mode (full or normal) to retreieve institution's delegations",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "FULL", "NORMAL" ]
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/DelegationResponse"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ },
+ "post" : {
+ "tags" : [ "Delegation" ],
+ "summary" : "Create an association between institution id and technical partner",
+ "description" : "Create an association between institution id and technical partner",
+ "operationId" : "createDelegationUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/DelegationRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/DelegationResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/delegations/from-taxcode" : {
+ "post" : {
+ "tags" : [ "Delegation" ],
+ "summary" : "Create an association between institution and technical partner using taxCode for both instead of internal id. It is useful when we don't know institution's internal id.",
+ "description" : "Create an association between institution and technical partner using taxCode for both instead of internal id. It is useful when we don't know institution's internal id.",
+ "operationId" : "createDelegationFromInstitutionsTaxCodeUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/DelegationRequestFromTaxcode"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/DelegationResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/external/institutions" : {
+ "get" : {
+ "tags" : [ "External" ],
+ "summary" : "Gets the corresponding institution using internal institution id",
+ "description" : "Gets the corresponding institution using internal institution id",
+ "operationId" : "retrieveInstitutionByIdsUsingGET",
+ "parameters" : [ {
+ "name" : "ids",
+ "in" : "query",
+ "description" : "List of Institution to onboard",
+ "required" : true,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/external/institutions/pn-pg" : {
+ "post" : {
+ "tags" : [ "External" ],
+ "summary" : "create an institution (PG) using external institution id fetching data from info-camere",
+ "description" : "create an institution (PG) using external institution id fetching data from info-camere",
+ "operationId" : "createPnPgInstitutionUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/CreatePnPgInstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionPnPgResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/external/institutions/{externalId}" : {
+ "get" : {
+ "tags" : [ "External" ],
+ "summary" : "Gets institution using external institution id",
+ "description" : "Gets institution using external institution id",
+ "operationId" : "getByExternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/external/institutions/{externalId}/geotaxonomies" : {
+ "get" : {
+ "tags" : [ "External" ],
+ "summary" : "retrieves the geographic taxonomies related to Institution.",
+ "description" : "retrieves the geographic taxonomies related to Institution.",
+ "operationId" : "retrieveInstitutionGeoTaxonomiesByExternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeographicTaxonomies"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/external/institutions/{externalId}/products" : {
+ "get" : {
+ "tags" : [ "External" ],
+ "summary" : "retrieves the products related to Institution",
+ "description" : "retrieves the products related to Institution",
+ "operationId" : "retrieveInstitutionProductsByExternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "states",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardedProducts"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/external/institutions/{externalId}/products/{productId}/billing" : {
+ "get" : {
+ "tags" : [ "External" ],
+ "summary" : "retrieves the billing data related to the institution even if the current user is not related to the institution/product",
+ "description" : "retrieves the billing data related to the institution even if the current user is not related to the institution/product",
+ "operationId" : "getBillingInstitutionByExternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionBillingResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/external/institutions/{externalId}/products/{productId}/manager" : {
+ "get" : {
+ "tags" : [ "External" ],
+ "summary" : "retrieves the manager related to the institution even if the current user is not related to the institution/product",
+ "description" : "retrieves the manager related to the institution even if the current user is not related to the institution/product",
+ "operationId" : "getManagerInstitutionByExternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionManagerResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/external/institutions/{externalId}/relationships" : {
+ "get" : {
+ "tags" : [ "External" ],
+ "summary" : "returns the relationships related to the institution",
+ "description" : "returns the relationships related to the institution",
+ "operationId" : "getUserInstitutionRelationshipsByExternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "personId",
+ "in" : "query",
+ "description" : "personId",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "roles",
+ "in" : "query",
+ "description" : "roles",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "states",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ }
+ }, {
+ "name" : "products",
+ "in" : "query",
+ "description" : "products",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productRoles",
+ "in" : "query",
+ "description" : "productRoles",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/RelationshipResult"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions" : {
+ "get" : {
+ "tags" : [ "Institution", "external-v2", "support" ],
+ "summary" : "Gets institutions filtering by taxCode and/or subunitCode",
+ "description" : "Gets institutions filtering by taxCode and/or subunitCode",
+ "operationId" : "getInstitutionsUsingGET",
+ "parameters" : [ {
+ "name" : "taxCode",
+ "in" : "query",
+ "description" : "Institution's tax code",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "subunitCode",
+ "in" : "query",
+ "description" : "Institution's subunit code",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "origin",
+ "in" : "query",
+ "description" : "origin",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "originId",
+ "in" : "query",
+ "description" : "originId",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionsResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ },
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "create an institution using external institution id without fetching data from party-registry or info-camere",
+ "description" : "create an institution using external institution id without fetching data from party-registry or info-camere",
+ "operationId" : "createInstitutionUsingPOST_1",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/from-anac" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "${swagger.mscore.institution.create.from-anac}",
+ "description" : "${swagger.mscore.institution.create.from-anac}",
+ "operationId" : "createInstitutionFromAnacUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/from-infocamere" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "create an institution from infocamere registry",
+ "description" : "create an institution from infocamere registry",
+ "operationId" : "createInstitutionFromInfocamereUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/from-ipa" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "create an institution from ipa registry",
+ "description" : "create an institution from ipa registry",
+ "operationId" : "createInstitutionFromIpaUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionFromIpaPost"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/from-ivass" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "create an institution from ivass CSV",
+ "description" : "create an institution from ivass CSV",
+ "operationId" : "createInstitutionFromIvassUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/from-pda" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "${swagger.mscore.institution.create.from-pda}",
+ "description" : "create an institution from ipa registry",
+ "operationId" : "createInstitutionFromPdaUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PdaInstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/insert/{externalId}" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "create an institution using external institution id without fetching data from party-registry or info-camere",
+ "description" : "create an institution using external institution id without fetching data from party-registry or info-camere",
+ "operationId" : "createInstitutionRawUsingPOST",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/onboarded/{productId}" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "Retrieve list of institution which logged user can onboard",
+ "description" : "Retrieve list of institution which logged user can onboard",
+ "operationId" : "getValidInstitutionToOnboardUsingPOST",
+ "parameters" : [ {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "productId",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionToOnboard"
+ }
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionToOnboard"
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/pg" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "create an institution (PG) using external institution id fetching data from info-camere",
+ "description" : "create an institution (PG) using external institution id fetching data from info-camere",
+ "operationId" : "createPgInstitutionUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/CreatePgInstitutionRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/products/{productId}" : {
+ "get" : {
+ "tags" : [ "Institution" ],
+ "summary" : "Gets institutions filtering onboardings by product id",
+ "description" : "Gets institutions filtering onboardings by product id",
+ "operationId" : "findFromProductUsingGET",
+ "parameters" : [ {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "page",
+ "in" : "query",
+ "description" : "${swagger.mscore.page.number}",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ }, {
+ "name" : "size",
+ "in" : "query",
+ "description" : "${swagger.mscore.page.size}",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionOnboardingListResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions/{externalId}" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "create an institution (PA) using external institution id fetching data from party-registry",
+ "description" : "create an institution (PA) using external institution id fetching data from party-registry",
+ "operationId" : "createInstitutionByExternalIdUsingPOST",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/{id}" : {
+ "get" : {
+ "tags" : [ "Institution", "external-v2" ],
+ "summary" : "Gets the corresponding institution using internal institution id",
+ "description" : "Gets the corresponding institution using internal institution id",
+ "operationId" : "retrieveInstitutionByIdUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ },
+ "put" : {
+ "tags" : [ "Institution" ],
+ "summary" : "update institution data of given institution",
+ "description" : "update institution data of given institution",
+ "operationId" : "updateInstitutionUsingPUT",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionPut"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "400" : {
+ "description" : "Bad Request",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ },
+ "403" : {
+ "description" : "Forbidden",
+ "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" ]
+ } ]
+ },
+ "head" : {
+ "tags" : [ "Management" ],
+ "summary" : "verify if Institution exists for a given ID",
+ "description" : "verify if Institution exists for a given ID",
+ "operationId" : "verifyInstitutionUsingHEAD",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/{id}/geotaxonomies" : {
+ "get" : {
+ "tags" : [ "Institution" ],
+ "summary" : "retrieves the geographic taxonomies this institution is related to",
+ "description" : "retrieves the geographic taxonomies this institution is related to",
+ "operationId" : "retrieveInstitutionGeoTaxonomiesUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeographicTaxonomies"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions/{id}/onboarding" : {
+ "post" : {
+ "tags" : [ "Institution" ],
+ "summary" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body",
+ "description" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body",
+ "operationId" : "onboardingInstitutionUsingPOST",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "id",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionOnboardingRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "201" : {
+ "description" : "Created",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/{id}/products" : {
+ "get" : {
+ "tags" : [ "Institution" ],
+ "summary" : "retrieves the insistitution's related products.",
+ "description" : "retrieves the insistitution's related products.",
+ "operationId" : "retrieveInstitutionProductsUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "List of Relationship state for filter products",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardedProducts"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions/{id}/relationships" : {
+ "get" : {
+ "tags" : [ "Institution" ],
+ "summary" : "returns the relationships related to the institution",
+ "description" : "returns the relationships related to the institution",
+ "operationId" : "getUserInstitutionRelationshipsUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "personId",
+ "in" : "query",
+ "description" : "personId",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "roles",
+ "in" : "query",
+ "description" : "roles",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "states",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ }
+ }, {
+ "name" : "products",
+ "in" : "query",
+ "description" : "products",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productRoles",
+ "in" : "query",
+ "description" : "productRoles",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/RelationshipResult"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions/{institutionId}/onboardings" : {
+ "get" : {
+ "tags" : [ "Institution", "external-v2" ],
+ "summary" : "${swagger.mscore.institution.info}",
+ "description" : "${swagger.mscore.institution.info}",
+ "operationId" : "getOnboardingsInstitutionUsingGET",
+ "parameters" : [ {
+ "name" : "institutionId",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "query",
+ "description" : "productId",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingsResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions/{institutionId}/products/{productId}/createdAt" : {
+ "put" : {
+ "tags" : [ "Institution" ],
+ "summary" : "The service updates the createdAt field for the institution-product pair",
+ "description" : "The service updates the createdAt field for the institution-product pair",
+ "operationId" : "updateCreatedAtUsingPUT",
+ "parameters" : [ {
+ "name" : "institutionId",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "createdAt",
+ "in" : "query",
+ "description" : "The createdAt date",
+ "required" : true,
+ "style" : "form",
+ "schema" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK"
+ },
+ "400" : {
+ "description" : "Bad Request",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ },
+ "403" : {
+ "description" : "Forbidden",
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions/{institutionId}/users" : {
+ "get" : {
+ "tags" : [ "Institution", "support" ],
+ "summary" : "getInstitutionUsers",
+ "description" : "Retrieve institution's users",
+ "operationId" : "getInstitutionUsersUsingGET",
+ "parameters" : [ {
+ "name" : "institutionId",
+ "in" : "path",
+ "description" : "Institution's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/UserInfoResponse"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/institutions/{productId}/brokers/{institutionType}" : {
+ "get" : {
+ "tags" : [ "Institution" ],
+ "summary" : "Retrieve institution brokers",
+ "description" : "${swagger.mscore.institutions.getInstitutionBrokers}",
+ "operationId" : "getInstitutionBrokersUsingGET",
+ "parameters" : [ {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "institutionType",
+ "in" : "path",
+ "description" : "Institution's type",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/BrokerResponse"
+ }
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/bulk/institutions" : {
+ "post" : {
+ "tags" : [ "Management" ],
+ "summary" : "Gets the corresponding institution using internal institution id",
+ "description" : "Gets the corresponding institution using internal institution id",
+ "operationId" : "retrieveInstitutionByIdsUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/BulkPartiesSeed"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/BulkInstitutions"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/external/institutions/product/{productId}" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "Retrieves Institutions by product ID",
+ "description" : "Retrieves Institutions by product ID",
+ "operationId" : "getInstitutionByProductIdUsingGET",
+ "parameters" : [ {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionListResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/bygeotaxonomies" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "Retrieves a collection of institutions having one or more geographic taxonomies",
+ "description" : "Retrieves a collection of institutions having one or more geographic taxonomies",
+ "operationId" : "getInstitutionByGeotaxonomiesUsingGET",
+ "parameters" : [ {
+ "name" : "geoTaxonomies",
+ "in" : "query",
+ "description" : "Comma separated list of the geographic taxonomies to search",
+ "required" : true,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "searchMode",
+ "in" : "query",
+ "description" : "The search mode to perform, as default 'any'",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "ALL", "ANY", "EXACT" ]
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionListResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/institutions/{id}/attributes" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "returns the attributes of the identified institution, if any.",
+ "description" : "returns the attributes of the identified institution, if any.",
+ "operationId" : "getInstitutionAttributesUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/AttributesResponse"
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/management/external/institutions/{externalId}" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "Gets institution using external institution id",
+ "description" : "Gets institution using external institution id",
+ "operationId" : "getInstitutionByExternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionManagementResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/management/institutions/{id}" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "Gets the corresponding institution using internal institution id",
+ "description" : "Gets the corresponding institution using internal institution id",
+ "operationId" : "getInstitutionByInternalIdUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/InstitutionManagementResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/persons/{id}" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "Retrieves Person by ID",
+ "description" : "Retrieves Person by ID",
+ "operationId" : "getUserUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "User's unique identifier (uuid)",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/PersonId"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ },
+ "head" : {
+ "tags" : [ "Management" ],
+ "summary" : "verify if a Person exists for a given ID",
+ "description" : "verify if a Person exists for a given ID",
+ "operationId" : "verifyUserUsingHEAD",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "User's unique identifier (uuid)",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK"
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/relationships" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "Return a list of relationships",
+ "description" : "Return a list of relationships",
+ "operationId" : "getInstitutionRelationshipsUsingGET",
+ "parameters" : [ {
+ "name" : "from",
+ "in" : "query",
+ "description" : "from",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "to",
+ "in" : "query",
+ "description" : "to",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "roles",
+ "in" : "query",
+ "description" : "roles",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "states",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ }
+ }, {
+ "name" : "products",
+ "in" : "query",
+ "description" : "products",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productRoles",
+ "in" : "query",
+ "description" : "productRoles",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "No Content",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/RelationshipsManagement"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/tokens/{tokenId}" : {
+ "get" : {
+ "tags" : [ "Management" ],
+ "summary" : "retrieve a token relationship",
+ "description" : "retrieve a token relationship",
+ "operationId" : "getTokenUsingGET",
+ "parameters" : [ {
+ "name" : "tokenId",
+ "in" : "path",
+ "description" : "contract's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/TokenResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ },
+ "deprecated" : true,
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding" : {
+ "head" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "verify if onboardedProduct is already onboarded for institution",
+ "description" : "verify if onboardedProduct is already onboarded for institution",
+ "operationId" : "verifyOnboardingInfoUsingHEAD",
+ "parameters" : [ {
+ "name" : "taxCode",
+ "in" : "query",
+ "description" : "Institution's tax code",
+ "required" : true,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "subunitCode",
+ "in" : "query",
+ "description" : "Institution's subunit code",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "query",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "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" ]
+ } ]
+ }
+ },
+ "/onboarding/approve/{tokenId}" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "approve an onboarding reuqest by an operator review",
+ "description" : "approve an onboarding reuqest by an operator review",
+ "operationId" : "approveOnboardingUsingPOST",
+ "parameters" : [ {
+ "name" : "tokenId",
+ "in" : "path",
+ "description" : "contract's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/complete/{tokenId}" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "complete an onboarding request",
+ "description" : "complete an onboarding request",
+ "operationId" : "completeOnboardingUsingPOST",
+ "parameters" : [ {
+ "name" : "tokenId",
+ "in" : "path",
+ "description" : "contract's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "requestBody" : {
+ "content" : {
+ "multipart/form-data" : {
+ "schema" : {
+ "required" : [ "contract" ],
+ "type" : "object",
+ "properties" : {
+ "contract" : {
+ "type" : "string",
+ "description" : "contract",
+ "format" : "binary"
+ }
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ },
+ "delete" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "invalidate an onboarding request",
+ "description" : "invalidate an onboarding request",
+ "operationId" : "invalidateOnboardingUsingDELETE",
+ "parameters" : [ {
+ "name" : "tokenId",
+ "in" : "path",
+ "description" : "contract's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/info" : {
+ "get" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "returns onboarding info",
+ "description" : "returns onboarding info",
+ "operationId" : "onboardingInfoUsingGET",
+ "parameters" : [ {
+ "name" : "institutionId",
+ "in" : "query",
+ "description" : "The internal identifier of the institution",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "institutionExternalId",
+ "in" : "query",
+ "description" : "Institution's unique external identifier",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "List of Relationship state for filter products",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInfoResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/onboarding/institution" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "Responsible for saving the association between an institution and a product. It also creates occurrences in the Users collection as part of this process.",
+ "description" : "Responsible for saving the association between an institution and a product. It also creates occurrences in the Users collection as part of this process.",
+ "operationId" : "onboardingInstitutionUsingPOST_1",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInstitutionRequest"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/institution/complete" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "update institution and users data without adding a new token",
+ "description" : "update institution and users data without adding a new token",
+ "operationId" : "onboardingInstitutionCompleteUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInstitutionRequest"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/institution/{externalId}/products/{productId}" : {
+ "head" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "verify if onboardedProduct is already onboarded for institution",
+ "description" : "verify if onboardedProduct is already onboarded for institution",
+ "operationId" : "verifyOnboardingInfoUsingHEAD_1",
+ "parameters" : [ {
+ "name" : "externalId",
+ "in" : "path",
+ "description" : "Institution's unique external identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "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" ]
+ } ]
+ }
+ },
+ "/onboarding/legals" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "performs legals onboarding on an already existing institution",
+ "description" : "performs legals onboarding on an already existing institution",
+ "operationId" : "onboardingInstitutionLegalsUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInstitutionLegalsRequest"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/operators" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "performs operators onboarding on an already existing institution",
+ "description" : "performs operators onboarding on an already existing institution",
+ "operationId" : "onboardingInstitutionOperatorsUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInstitutionOperatorsRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/RelationshipResult"
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/reject/{tokenId}" : {
+ "delete" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "invalidate an onboarding request by an operator review",
+ "description" : "invalidate an onboarding request by an operator review",
+ "operationId" : "onboardingRejectUsingDELETE",
+ "parameters" : [ {
+ "name" : "tokenId",
+ "in" : "path",
+ "description" : "contract's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/relationship/{relationshipId}/document" : {
+ "get" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "retrieve the contractDocument related to a relationship",
+ "description" : "retrieve the contractDocument related to a relationship",
+ "operationId" : "getOnboardingDocumentUsingGET",
+ "parameters" : [ {
+ "name" : "relationshipId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "type" : "string",
+ "format" : "byte"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/onboarding/subdelegates" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "performs subdelegates onboarding on an already existing institution",
+ "description" : "performs subdelegates onboarding on an already existing institution",
+ "operationId" : "onboardingInstitutionSubDelegateUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInstitutionOperatorsRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/RelationshipResult"
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/users" : {
+ "post" : {
+ "tags" : [ "Onboarding", "support" ],
+ "summary" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body",
+ "description" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body",
+ "operationId" : "onboardingInstitutionUsersUsingPOST",
+ "requestBody" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInstitutionUsersRequest"
+ }
+ }
+ }
+ },
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/RelationshipResult"
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/onboarding/{tokenId}/consume" : {
+ "post" : {
+ "tags" : [ "Onboarding" ],
+ "summary" : "Consume token onboarding request without digest verification ",
+ "description" : "Consume token onboarding request without digest verification ",
+ "operationId" : "consumeTokenUsingPOST",
+ "parameters" : [ {
+ "name" : "tokenId",
+ "in" : "path",
+ "description" : "contract's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "requestBody" : {
+ "content" : {
+ "multipart/form-data" : {
+ "schema" : {
+ "required" : [ "contract" ],
+ "type" : "object",
+ "properties" : {
+ "contract" : {
+ "type" : "string",
+ "description" : "contract",
+ "format" : "binary"
+ }
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/scheduler" : {
+ "post" : {
+ "tags" : [ "scheduler" ],
+ "summary" : "start",
+ "description" : "Service to start scheduler to resend old messages to DL",
+ "operationId" : "startUsingPOST",
+ "parameters" : [ {
+ "name" : "size",
+ "in" : "query",
+ "description" : "size",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ }, {
+ "name" : "productsFilter",
+ "in" : "query",
+ "description" : "productsFilter",
+ "required" : true,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK"
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/tokens/products/{productId}" : {
+ "get" : {
+ "tags" : [ "Token", "external-v2" ],
+ "summary" : "${swagger.mscore.tokens.findFromProduct}",
+ "description" : "${swagger.mscore.tokens.findFromProduct}",
+ "operationId" : "findFromProductUsingGET_1",
+ "parameters" : [ {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "page",
+ "in" : "query",
+ "description" : "${swagger.mscore.page.number}",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ }, {
+ "name" : "size",
+ "in" : "query",
+ "description" : "${swagger.mscore.page.size}",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/TokenListResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/tokens/token" : {
+ "get" : {
+ "tags" : [ "Token" ],
+ "summary" : "Retrieve token given the institution's and product ids",
+ "operationId" : "getTokenUsingGET_1",
+ "parameters" : [ {
+ "name" : "institutionId",
+ "in" : "query",
+ "description" : "Institution's unique internal identifier",
+ "required" : true,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "query",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/TokenResource"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/tokens/{tokenId}/verify" : {
+ "post" : {
+ "tags" : [ "Token" ],
+ "summary" : "Verify if the token is already consumed",
+ "description" : "Verify if the token is already consumed",
+ "operationId" : "verifyTokenUsingPOST",
+ "parameters" : [ {
+ "name" : "tokenId",
+ "in" : "path",
+ "description" : "contract's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/TokenResponse"
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/relationships/{relationshipId}" : {
+ "get" : {
+ "tags" : [ "Persons" ],
+ "summary" : "Gets the corresponding relationship",
+ "description" : "Gets the corresponding relationship",
+ "operationId" : "getRelationshipUsingGET",
+ "parameters" : [ {
+ "name" : "relationshipId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/RelationshipResult"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ },
+ "delete" : {
+ "tags" : [ "Persons" ],
+ "summary" : "Given a relationship identifier, it deletes the corresponding relationship",
+ "description" : "Given a relationship identifier, it deletes the corresponding relationship",
+ "operationId" : "deleteRelationshipUsingDELETE",
+ "parameters" : [ {
+ "name" : "relationshipId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/relationships/{relationshipId}/activate" : {
+ "post" : {
+ "tags" : [ "Persons" ],
+ "summary" : "Activate the relationship",
+ "description" : "Activate the relationship",
+ "operationId" : "activateRelationshipUsingPOST",
+ "parameters" : [ {
+ "name" : "relationshipId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/relationships/{relationshipId}/suspend" : {
+ "post" : {
+ "tags" : [ "Persons" ],
+ "summary" : "Suspend the relationship",
+ "description" : "Suspend the relationship",
+ "operationId" : "suspendRelationshipUsingPOST",
+ "parameters" : [ {
+ "name" : "relationshipId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/users/{id}" : {
+ "get" : {
+ "tags" : [ "Persons", "external-v2", "support" ],
+ "summary" : "Retrieves user given userId and optional ProductId",
+ "description" : "Retrieves user given userId and optional ProductId",
+ "operationId" : "getUserInfoUsingGET",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "User's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "query",
+ "description" : "Product's unique identifier",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "institutionId",
+ "in" : "query",
+ "description" : "The internal identifier of the institution",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/UserResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/users/{id}/update" : {
+ "post" : {
+ "tags" : [ "Persons" ],
+ "summary" : "Service to send notification when user data get's updated",
+ "description" : "Service to send notification when user data get's updated",
+ "operationId" : "updateUserUsingPOST",
+ "parameters" : [ {
+ "name" : "id",
+ "in" : "path",
+ "description" : "User's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "institutionId",
+ "in" : "query",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/users/{userId}/institution-products" : {
+ "get" : {
+ "tags" : [ "Persons" ],
+ "summary" : "returns onboarding info",
+ "description" : "returns onboarding info",
+ "operationId" : "getInstitutionProductsInfoUsingGET",
+ "parameters" : [ {
+ "name" : "userId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "institutionId",
+ "in" : "query",
+ "description" : "The internal identifier of the institution",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "List of Relationship state for filter products",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/OnboardingInfoResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ },
+ "/users/{userId}/institutions/{institutionId}/products/{productId}" : {
+ "delete" : {
+ "tags" : [ "Persons" ],
+ "summary" : "Delete logically the association institution and product",
+ "description" : "Delete logically the association institution and product",
+ "operationId" : "deleteProductsUsingDELETE",
+ "parameters" : [ {
+ "name" : "userId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "institutionId",
+ "in" : "path",
+ "description" : "The internal identifier of the institution",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "productId",
+ "in" : "path",
+ "description" : "Product's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK"
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "409" : {
+ "description" : "Conflict",
+ "content" : {
+ "application/problem+json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Problem"
+ }
+ }
+ }
+ }
+ },
+ "security" : [ {
+ "bearerAuth" : [ "global" ]
+ } ]
+ }
+ },
+ "/users/{userId}/products" : {
+ "get" : {
+ "tags" : [ "Persons" ],
+ "summary" : "Retrieves products info and role which the user is enabled",
+ "description" : "Retrieves products info and role which the user is enabled",
+ "operationId" : "getUserProductsInfoUsingGET",
+ "parameters" : [ {
+ "name" : "userId",
+ "in" : "path",
+ "description" : "UserBinding's unique identifier",
+ "required" : true,
+ "style" : "simple",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "institutionId",
+ "in" : "query",
+ "description" : "The internal identifier of the institution",
+ "required" : false,
+ "style" : "form",
+ "schema" : {
+ "type" : "string"
+ }
+ }, {
+ "name" : "states",
+ "in" : "query",
+ "description" : "List of Relationship state for filter products",
+ "required" : false,
+ "style" : "form",
+ "explode" : true,
+ "schema" : {
+ "type" : "string"
+ }
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "OK",
+ "content" : {
+ "*/*" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/UserProductsResponse"
+ }
+ }
+ }
+ },
+ "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" ]
+ } ]
+ }
+ }
+ },
+ "components" : {
+ "schemas" : {
+ "Attributes" : {
+ "title" : "Attributes",
+ "type" : "object",
+ "properties" : {
+ "code" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "origin" : {
+ "type" : "string"
+ }
+ }
+ },
+ "AttributesRequest" : {
+ "title" : "AttributesRequest",
+ "type" : "object",
+ "properties" : {
+ "code" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "origin" : {
+ "type" : "string"
+ }
+ }
+ },
+ "AttributesResponse" : {
+ "title" : "AttributesResponse",
+ "type" : "object",
+ "properties" : {
+ "code" : {
+ "type" : "string"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "origin" : {
+ "type" : "string"
+ }
+ }
+ },
+ "Billing" : {
+ "title" : "Billing",
+ "type" : "object",
+ "properties" : {
+ "publicServices" : {
+ "type" : "boolean"
+ },
+ "recipientCode" : {
+ "type" : "string"
+ },
+ "vatNumber" : {
+ "type" : "string"
+ }
+ }
+ },
+ "BillingRequest" : {
+ "title" : "BillingRequest",
+ "type" : "object",
+ "properties" : {
+ "publicServices" : {
+ "type" : "boolean"
+ },
+ "recipientCode" : {
+ "type" : "string"
+ },
+ "vatNumber" : {
+ "type" : "string"
+ }
+ }
+ },
+ "BillingResponse" : {
+ "title" : "BillingResponse",
+ "type" : "object",
+ "properties" : {
+ "publicServices" : {
+ "type" : "boolean"
+ },
+ "recipientCode" : {
+ "type" : "string"
+ },
+ "vatNumber" : {
+ "type" : "string"
+ }
+ }
+ },
+ "BrokerResponse" : {
+ "title" : "BrokerResponse",
+ "type" : "object",
+ "properties" : {
+ "description" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "numberOfDelegations" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ }
+ },
+ "BulkInstitution" : {
+ "title" : "BulkInstitution",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/AttributesResponse"
+ }
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "products" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "$ref" : "#/components/schemas/BulkProduct"
+ }
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "BulkInstitutions" : {
+ "title" : "BulkInstitutions",
+ "type" : "object",
+ "properties" : {
+ "found" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/BulkInstitution"
+ }
+ },
+ "notFound" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "BulkPartiesSeed" : {
+ "title" : "BulkPartiesSeed",
+ "type" : "object",
+ "properties" : {
+ "partyIdentifiers" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "BulkProduct" : {
+ "title" : "BulkProduct",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingResponse"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "product" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ }
+ }
+ },
+ "BusinessData" : {
+ "title" : "BusinessData",
+ "type" : "object",
+ "properties" : {
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ }
+ }
+ },
+ "Contract" : {
+ "title" : "Contract",
+ "type" : "object",
+ "properties" : {
+ "path" : {
+ "type" : "string"
+ },
+ "version" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ContractRequest" : {
+ "title" : "ContractRequest",
+ "type" : "object",
+ "properties" : {
+ "path" : {
+ "type" : "string"
+ },
+ "version" : {
+ "type" : "string"
+ }
+ }
+ },
+ "CreatePgInstitutionRequest" : {
+ "title" : "CreatePgInstitutionRequest",
+ "type" : "object",
+ "properties" : {
+ "description" : {
+ "type" : "string"
+ },
+ "existsInRegistry" : {
+ "type" : "boolean"
+ },
+ "taxId" : {
+ "type" : "string"
+ }
+ }
+ },
+ "CreatePnPgInstitutionRequest" : {
+ "title" : "CreatePnPgInstitutionRequest",
+ "type" : "object",
+ "properties" : {
+ "description" : {
+ "type" : "string"
+ },
+ "taxId" : {
+ "type" : "string"
+ }
+ }
+ },
+ "DataProtectionOfficer" : {
+ "title" : "DataProtectionOfficer",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "email" : {
+ "type" : "string"
+ },
+ "pec" : {
+ "type" : "string"
+ }
+ }
+ },
+ "DataProtectionOfficerRequest" : {
+ "title" : "DataProtectionOfficerRequest",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "email" : {
+ "type" : "string"
+ },
+ "pec" : {
+ "type" : "string"
+ }
+ }
+ },
+ "DataProtectionOfficerResponse" : {
+ "title" : "DataProtectionOfficerResponse",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "email" : {
+ "type" : "string"
+ },
+ "pec" : {
+ "type" : "string"
+ }
+ }
+ },
+ "DelegationRequest" : {
+ "title" : "DelegationRequest",
+ "type" : "object",
+ "properties" : {
+ "from" : {
+ "type" : "string"
+ },
+ "institutionFromName" : {
+ "type" : "string"
+ },
+ "institutionToName" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "to" : {
+ "type" : "string"
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "AOO", "PT" ]
+ }
+ }
+ },
+ "DelegationRequestFromTaxcode" : {
+ "title" : "DelegationRequestFromTaxcode",
+ "type" : "object",
+ "properties" : {
+ "fromSubunitCode" : {
+ "type" : "string"
+ },
+ "fromTaxCode" : {
+ "type" : "string"
+ },
+ "institutionFromName" : {
+ "type" : "string"
+ },
+ "institutionToName" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "toSubunitCode" : {
+ "type" : "string"
+ },
+ "toTaxCode" : {
+ "type" : "string"
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "AOO", "PT" ]
+ }
+ }
+ },
+ "DelegationResponse" : {
+ "title" : "DelegationResponse",
+ "type" : "object",
+ "properties" : {
+ "brokerId" : {
+ "type" : "string"
+ },
+ "brokerName" : {
+ "type" : "string"
+ },
+ "brokerTaxCode" : {
+ "type" : "string"
+ },
+ "brokerType" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionName" : {
+ "type" : "string"
+ },
+ "institutionRootName" : {
+ "type" : "string"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "AOO", "PT" ]
+ }
+ }
+ },
+ "GeoTaxonomies" : {
+ "title" : "GeoTaxonomies",
+ "type" : "object",
+ "properties" : {
+ "code" : {
+ "type" : "string"
+ },
+ "desc" : {
+ "type" : "string"
+ }
+ }
+ },
+ "GeographicTaxonomies" : {
+ "title" : "GeographicTaxonomies",
+ "type" : "object",
+ "properties" : {
+ "code" : {
+ "type" : "string"
+ },
+ "country" : {
+ "type" : "string"
+ },
+ "country_abbreviation" : {
+ "type" : "string"
+ },
+ "desc" : {
+ "type" : "string"
+ },
+ "enabled" : {
+ "type" : "boolean"
+ },
+ "istat_code" : {
+ "type" : "string"
+ },
+ "province_abbreviation" : {
+ "type" : "string"
+ },
+ "province_id" : {
+ "type" : "string"
+ },
+ "region_id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "Institution" : {
+ "title" : "Institution",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Attributes"
+ }
+ },
+ "billing" : {
+ "$ref" : "#/components/schemas/Billing"
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "city" : {
+ "type" : "string"
+ },
+ "country" : {
+ "type" : "string"
+ },
+ "county" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficer"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionGeographicTaxonomies"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "istatCode" : {
+ "type" : "string"
+ },
+ "onboarding" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Onboarding"
+ }
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "paAttributes" : {
+ "$ref" : "#/components/schemas/PaAttributes"
+ },
+ "parentDescription" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProvider"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "rootParentId" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionBillingResponse" : {
+ "title" : "InstitutionBillingResponse",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "aooParentCode" : {
+ "type" : "string"
+ },
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingResponse"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "origin" : {
+ "type" : "string",
+ "enum" : [ "ADE", "ANAC", "INFOCAMERE", "IPA", "IVASS", "MOCK", "SELC", "UNKNOWN" ]
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionFromIpaPost" : {
+ "title" : "InstitutionFromIpaPost",
+ "type" : "object",
+ "properties" : {
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeoTaxonomies"
+ }
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string",
+ "enum" : [ "AOO", "UO" ]
+ },
+ "taxCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionGeographicTaxonomies" : {
+ "title" : "InstitutionGeographicTaxonomies",
+ "type" : "object",
+ "properties" : {
+ "code" : {
+ "type" : "string"
+ },
+ "desc" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionListResponse" : {
+ "title" : "InstitutionListResponse",
+ "type" : "object",
+ "properties" : {
+ "items" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionManagementResponse"
+ }
+ }
+ }
+ },
+ "InstitutionManagementResponse" : {
+ "title" : "InstitutionManagementResponse",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "aooParentCode" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/AttributesResponse"
+ }
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficerResponse"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeoTaxonomies"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProviderResponse"
+ },
+ "products" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "$ref" : "#/components/schemas/ProductsManagement"
+ }
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionManagerResponse" : {
+ "title" : "InstitutionManagerResponse",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingResponse"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "from" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdateResponse"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "product" : {
+ "$ref" : "#/components/schemas/ProductInfo"
+ },
+ "role" : {
+ "type" : "string"
+ },
+ "state" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "to" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ }
+ },
+ "InstitutionOnboardingListResponse" : {
+ "title" : "InstitutionOnboardingListResponse",
+ "type" : "object",
+ "properties" : {
+ "items" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionOnboardingResponse"
+ }
+ }
+ }
+ },
+ "InstitutionOnboardingRequest" : {
+ "title" : "InstitutionOnboardingRequest",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingRequest"
+ },
+ "contractPath" : {
+ "type" : "string"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "tokenId" : {
+ "type" : "string"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Person"
+ }
+ }
+ }
+ },
+ "InstitutionOnboardingResponse" : {
+ "title" : "InstitutionOnboardingResponse",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "aooParentCode" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/AttributesResponse"
+ }
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficerResponse"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeoTaxonomies"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "onboardings" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "$ref" : "#/components/schemas/OnboardingResponse"
+ }
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProviderResponse"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionPnPgResponse" : {
+ "title" : "InstitutionPnPgResponse",
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionProduct" : {
+ "title" : "InstitutionProduct",
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "state" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ }
+ }
+ },
+ "InstitutionProducts" : {
+ "title" : "InstitutionProducts",
+ "type" : "object",
+ "properties" : {
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionName" : {
+ "type" : "string"
+ },
+ "institutionRootName" : {
+ "type" : "string"
+ },
+ "products" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Product"
+ }
+ }
+ }
+ },
+ "InstitutionPut" : {
+ "title" : "InstitutionPut",
+ "type" : "object",
+ "properties" : {
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "geographicTaxonomyCodes" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "InstitutionRequest" : {
+ "title" : "InstitutionRequest",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/AttributesRequest"
+ }
+ },
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingRequest"
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "city" : {
+ "type" : "string"
+ },
+ "country" : {
+ "type" : "string"
+ },
+ "county" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficerRequest"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeoTaxonomies"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "onboarding" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/OnboardingRequest"
+ }
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProviderRequest"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionResponse" : {
+ "title" : "InstitutionResponse",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "aooParentCode" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/AttributesResponse"
+ }
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "city" : {
+ "type" : "string"
+ },
+ "country" : {
+ "type" : "string"
+ },
+ "county" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficerResponse"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeoTaxonomies"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "onboarding" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/OnboardedProductResponse"
+ }
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProviderResponse"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "rootParent" : {
+ "$ref" : "#/components/schemas/RootParentResponse"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionToOnboard" : {
+ "title" : "InstitutionToOnboard",
+ "type" : "object",
+ "properties" : {
+ "cfImpresa" : {
+ "type" : "string"
+ },
+ "denominazione" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionUpdate" : {
+ "title" : "InstitutionUpdate",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "city" : {
+ "type" : "string"
+ },
+ "country" : {
+ "type" : "string"
+ },
+ "county" : {
+ "type" : "string"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficer"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionGeographicTaxonomies"
+ }
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "ivassCode" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProvider"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionUpdateRequest" : {
+ "title" : "InstitutionUpdateRequest",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "city" : {
+ "type" : "string"
+ },
+ "country" : {
+ "type" : "string"
+ },
+ "county" : {
+ "type" : "string"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficerRequest"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "geographicTaxonomyCodes" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "ivassCode" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProviderRequest"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionUpdateResponse" : {
+ "title" : "InstitutionUpdateResponse",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "aooParentCode" : {
+ "type" : "string"
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "city" : {
+ "type" : "string"
+ },
+ "country" : {
+ "type" : "string"
+ },
+ "county" : {
+ "type" : "string"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficerResponse"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "geographicTaxonomyCodes" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProviderResponse"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "InstitutionsResponse" : {
+ "title" : "InstitutionsResponse",
+ "type" : "object",
+ "properties" : {
+ "institutions" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionResponse"
+ }
+ }
+ }
+ },
+ "LegalsResponse" : {
+ "title" : "LegalsResponse",
+ "type" : "object",
+ "properties" : {
+ "env" : {
+ "type" : "string",
+ "enum" : [ "COLL", "DEV", "PROD", "ROOT" ]
+ },
+ "partyId" : {
+ "type" : "string"
+ },
+ "relationshipId" : {
+ "type" : "string"
+ },
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ }
+ }
+ },
+ "MigrationInstitution" : {
+ "title" : "MigrationInstitution",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Attributes"
+ }
+ },
+ "billing" : {
+ "$ref" : "#/components/schemas/Billing"
+ },
+ "businessRegisterPlace" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficer"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionGeographicTaxonomies"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "imported" : {
+ "type" : "boolean"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "onboarding" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Onboarding"
+ }
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProvider"
+ },
+ "rea" : {
+ "type" : "string"
+ },
+ "shareCapital" : {
+ "type" : "string"
+ },
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "MigrationOnboardedUser" : {
+ "title" : "MigrationOnboardedUser",
+ "type" : "object",
+ "properties" : {
+ "bindings" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/UserBinding"
+ }
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "MigrationToken" : {
+ "title" : "MigrationToken",
+ "type" : "object",
+ "properties" : {
+ "checksum" : {
+ "type" : "string"
+ },
+ "closedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "contractSigned" : {
+ "type" : "string"
+ },
+ "contractTemplate" : {
+ "type" : "string"
+ },
+ "contractVersion" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "expiringDate" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdate"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "INSTITUTION", "LEGALS" ]
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/TokenUser"
+ }
+ }
+ }
+ },
+ "OnboardedInstitutionResponse" : {
+ "title" : "OnboardedInstitutionResponse",
+ "type" : "object",
+ "properties" : {
+ "address" : {
+ "type" : "string"
+ },
+ "aooParentCode" : {
+ "type" : "string"
+ },
+ "attributes" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/AttributesResponse"
+ }
+ },
+ "billing" : {
+ "$ref" : "#/components/schemas/Billing"
+ },
+ "businessData" : {
+ "$ref" : "#/components/schemas/BusinessData"
+ },
+ "dataProtectionOfficer" : {
+ "$ref" : "#/components/schemas/DataProtectionOfficerResponse"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "digitalAddress" : {
+ "type" : "string"
+ },
+ "externalId" : {
+ "type" : "string"
+ },
+ "geographicTaxonomies" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/GeoTaxonomies"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionType" : {
+ "type" : "string",
+ "enum" : [ "AS", "GSP", "PA", "PG", "PSP", "PT", "SA", "SCP" ]
+ },
+ "origin" : {
+ "type" : "string"
+ },
+ "originId" : {
+ "type" : "string"
+ },
+ "parentDescription" : {
+ "type" : "string"
+ },
+ "paymentServiceProvider" : {
+ "$ref" : "#/components/schemas/PaymentServiceProviderResponse"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "productInfo" : {
+ "$ref" : "#/components/schemas/ProductInfo"
+ },
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ },
+ "rootParentId" : {
+ "type" : "string"
+ },
+ "state" : {
+ "type" : "string"
+ },
+ "subunitCode" : {
+ "type" : "string"
+ },
+ "subunitType" : {
+ "type" : "string"
+ },
+ "supportContact" : {
+ "$ref" : "#/components/schemas/SupportContact"
+ },
+ "taxCode" : {
+ "type" : "string"
+ },
+ "zipCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "OnboardedProduct" : {
+ "title" : "OnboardedProduct",
+ "type" : "object",
+ "properties" : {
+ "contract" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "env" : {
+ "type" : "string",
+ "enum" : [ "COLL", "DEV", "PROD", "ROOT" ]
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "productRole" : {
+ "type" : "string"
+ },
+ "relationshipId" : {
+ "type" : "string"
+ },
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "tokenId" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ }
+ },
+ "OnboardedProductResponse" : {
+ "title" : "OnboardedProductResponse",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingResponse"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ }
+ },
+ "OnboardedProducts" : {
+ "title" : "OnboardedProducts",
+ "type" : "object",
+ "properties" : {
+ "products" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionProduct"
+ }
+ }
+ }
+ },
+ "OnboardedUser" : {
+ "title" : "OnboardedUser",
+ "type" : "object",
+ "properties" : {
+ "bindings" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/UserBinding"
+ }
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "Onboarding" : {
+ "title" : "Onboarding",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/Billing"
+ },
+ "closedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "contract" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "tokenId" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ }
+ },
+ "OnboardingImportContract" : {
+ "title" : "OnboardingImportContract",
+ "type" : "object",
+ "properties" : {
+ "contractType" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "fileName" : {
+ "type" : "string"
+ },
+ "filePath" : {
+ "type" : "string"
+ }
+ }
+ },
+ "OnboardingInfoResponse" : {
+ "title" : "OnboardingInfoResponse",
+ "type" : "object",
+ "properties" : {
+ "institutions" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/OnboardedInstitutionResponse"
+ }
+ },
+ "userId" : {
+ "type" : "string"
+ }
+ }
+ },
+ "OnboardingInstitutionLegalsRequest" : {
+ "title" : "OnboardingInstitutionLegalsRequest",
+ "type" : "object",
+ "properties" : {
+ "contract" : {
+ "$ref" : "#/components/schemas/ContractRequest"
+ },
+ "institutionExternalId" : {
+ "type" : "string"
+ },
+ "institutionId" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "productName" : {
+ "type" : "string"
+ },
+ "signContract" : {
+ "type" : "boolean"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Person"
+ }
+ }
+ }
+ },
+ "OnboardingInstitutionOperatorsRequest" : {
+ "title" : "OnboardingInstitutionOperatorsRequest",
+ "type" : "object",
+ "properties" : {
+ "institutionId" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "productTitle" : {
+ "type" : "string"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Person"
+ }
+ }
+ }
+ },
+ "OnboardingInstitutionRequest" : {
+ "title" : "OnboardingInstitutionRequest",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingRequest"
+ },
+ "contract" : {
+ "$ref" : "#/components/schemas/ContractRequest"
+ },
+ "contractImported" : {
+ "$ref" : "#/components/schemas/OnboardingImportContract"
+ },
+ "institutionExternalId" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdateRequest"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "productName" : {
+ "type" : "string"
+ },
+ "sendCompleteOnboardingEmail" : {
+ "type" : "boolean",
+ "description" : "Parameter that allows you to specify whether following completion of onboarding you want to receive an email",
+ "example" : false
+ },
+ "signContract" : {
+ "type" : "boolean"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Person"
+ }
+ }
+ }
+ },
+ "OnboardingInstitutionUsersRequest" : {
+ "title" : "OnboardingInstitutionUsersRequest",
+ "type" : "object",
+ "properties" : {
+ "institutionSubunitCode" : {
+ "type" : "string"
+ },
+ "institutionTaxCode" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "sendCreateUserNotificationEmail" : {
+ "type" : "boolean"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/Person"
+ }
+ }
+ }
+ },
+ "OnboardingRequest" : {
+ "title" : "OnboardingRequest",
+ "type" : "object",
+ "properties" : {
+ "billingRequest" : {
+ "$ref" : "#/components/schemas/Billing"
+ },
+ "contract" : {
+ "$ref" : "#/components/schemas/Contract"
+ },
+ "contractCreatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "contractFilePath" : {
+ "type" : "string"
+ },
+ "institutionExternalId" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdate"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "productName" : {
+ "type" : "string"
+ },
+ "sendCompleteOnboardingEmail" : {
+ "type" : "boolean"
+ },
+ "signContract" : {
+ "type" : "boolean"
+ },
+ "tokenType" : {
+ "type" : "string",
+ "enum" : [ "INSTITUTION", "LEGALS" ]
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/UserToOnboard"
+ }
+ }
+ }
+ },
+ "OnboardingResponse" : {
+ "title" : "OnboardingResponse",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingResponse"
+ },
+ "closedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "contract" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "tokenId" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ }
+ },
+ "OnboardingsResponse" : {
+ "title" : "OnboardingsResponse",
+ "type" : "object",
+ "properties" : {
+ "onboardings" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/OnboardingResponse"
+ }
+ }
+ }
+ },
+ "PaAttributes" : {
+ "title" : "PaAttributes",
+ "type" : "object",
+ "properties" : {
+ "aooParentCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "PaymentServiceProvider" : {
+ "title" : "PaymentServiceProvider",
+ "type" : "object",
+ "properties" : {
+ "abiCode" : {
+ "type" : "string"
+ },
+ "businessRegisterNumber" : {
+ "type" : "string"
+ },
+ "legalRegisterName" : {
+ "type" : "string"
+ },
+ "legalRegisterNumber" : {
+ "type" : "string"
+ },
+ "vatNumberGroup" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "PaymentServiceProviderRequest" : {
+ "title" : "PaymentServiceProviderRequest",
+ "type" : "object",
+ "properties" : {
+ "abiCode" : {
+ "type" : "string"
+ },
+ "businessRegisterNumber" : {
+ "type" : "string"
+ },
+ "legalRegisterName" : {
+ "type" : "string"
+ },
+ "legalRegisterNumber" : {
+ "type" : "string"
+ },
+ "vatNumberGroup" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "PaymentServiceProviderResponse" : {
+ "title" : "PaymentServiceProviderResponse",
+ "type" : "object",
+ "properties" : {
+ "abiCode" : {
+ "type" : "string"
+ },
+ "businessRegisterNumber" : {
+ "type" : "string"
+ },
+ "legalRegisterName" : {
+ "type" : "string"
+ },
+ "legalRegisterNumber" : {
+ "type" : "string"
+ },
+ "vatNumberGroup" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "PdaInstitutionRequest" : {
+ "title" : "PdaInstitutionRequest",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingRequest"
+ },
+ "description" : {
+ "type" : "string"
+ },
+ "injectionInstitutionType" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "Person" : {
+ "title" : "Person",
+ "type" : "object",
+ "properties" : {
+ "email" : {
+ "type" : "string"
+ },
+ "env" : {
+ "type" : "string",
+ "enum" : [ "COLL", "DEV", "PROD", "ROOT" ]
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "name" : {
+ "type" : "string"
+ },
+ "productRole" : {
+ "type" : "string"
+ },
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ },
+ "roleLabel" : {
+ "type" : "string"
+ },
+ "surname" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "PersonId" : {
+ "title" : "PersonId",
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "Problem" : {
+ "title" : "Problem",
+ "type" : "object",
+ "properties" : {
+ "errors" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/ProblemError"
+ }
+ },
+ "status" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ }
+ },
+ "ProblemError" : {
+ "title" : "ProblemError",
+ "type" : "object"
+ },
+ "Product" : {
+ "title" : "Product",
+ "type" : "object",
+ "properties" : {
+ "contract" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "env" : {
+ "type" : "string",
+ "enum" : [ "COLL", "DEV", "PROD", "ROOT" ]
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "productRole" : {
+ "type" : "string"
+ },
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "tokenId" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ }
+ },
+ "ProductInfo" : {
+ "title" : "ProductInfo",
+ "type" : "object",
+ "properties" : {
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "role" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string"
+ }
+ }
+ },
+ "ProductsManagement" : {
+ "title" : "ProductsManagement",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingResponse"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "product" : {
+ "type" : "string"
+ }
+ }
+ },
+ "RelationshipResult" : {
+ "title" : "RelationshipResult",
+ "type" : "object",
+ "properties" : {
+ "billing" : {
+ "$ref" : "#/components/schemas/BillingResponse"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "from" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdateResponse"
+ },
+ "pricingPlan" : {
+ "type" : "string"
+ },
+ "product" : {
+ "$ref" : "#/components/schemas/ProductInfo"
+ },
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ },
+ "state" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "to" : {
+ "type" : "string"
+ },
+ "tokenId" : {
+ "type" : "string"
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ }
+ }
+ },
+ "RelationshipsManagement" : {
+ "title" : "RelationshipsManagement",
+ "type" : "object",
+ "properties" : {
+ "items" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/RelationshipResult"
+ }
+ }
+ }
+ },
+ "RootParentResponse" : {
+ "title" : "RootParentResponse",
+ "type" : "object",
+ "properties" : {
+ "description" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "SupportContact" : {
+ "title" : "SupportContact",
+ "type" : "object",
+ "properties" : {
+ "supportEmail" : {
+ "type" : "string"
+ },
+ "supportPhone" : {
+ "type" : "string"
+ }
+ }
+ },
+ "Token" : {
+ "title" : "Token",
+ "type" : "object",
+ "properties" : {
+ "activatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "checksum" : {
+ "type" : "string"
+ },
+ "contentType" : {
+ "type" : "string"
+ },
+ "contractSigned" : {
+ "type" : "string"
+ },
+ "contractTemplate" : {
+ "type" : "string"
+ },
+ "contractVersion" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "deletedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "expiringDate" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdate"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "INSTITUTION", "LEGALS" ]
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/TokenUser"
+ }
+ }
+ }
+ },
+ "TokenListResponse" : {
+ "title" : "TokenListResponse",
+ "type" : "object",
+ "properties" : {
+ "items" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/TokenResponse"
+ }
+ }
+ }
+ },
+ "TokenResource" : {
+ "title" : "TokenResource",
+ "type" : "object",
+ "properties" : {
+ "checksum" : {
+ "type" : "string"
+ },
+ "closedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "contractSigned" : {
+ "type" : "string"
+ },
+ "contractTemplate" : {
+ "type" : "string"
+ },
+ "contractVersion" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "expiringDate" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdate"
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "type" : {
+ "type" : "string",
+ "enum" : [ "INSTITUTION", "LEGALS" ]
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/TokenUser"
+ }
+ }
+ }
+ },
+ "TokenResponse" : {
+ "title" : "TokenResponse",
+ "type" : "object",
+ "properties" : {
+ "checksum" : {
+ "type" : "string"
+ },
+ "closedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "contentType" : {
+ "type" : "string"
+ },
+ "contractSigned" : {
+ "type" : "string"
+ },
+ "contractTemplate" : {
+ "type" : "string"
+ },
+ "contractVersion" : {
+ "type" : "string"
+ },
+ "createdAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "expiringDate" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionUpdate" : {
+ "$ref" : "#/components/schemas/InstitutionUpdate"
+ },
+ "legals" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/LegalsResponse"
+ }
+ },
+ "productId" : {
+ "type" : "string"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ]
+ },
+ "updatedAt" : {
+ "type" : "string",
+ "format" : "date-time"
+ },
+ "users" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/TokenUser"
+ }
+ }
+ }
+ },
+ "TokenUser" : {
+ "title" : "TokenUser",
+ "type" : "object",
+ "properties" : {
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ },
+ "userId" : {
+ "type" : "string"
+ }
+ }
+ },
+ "UserBinding" : {
+ "title" : "UserBinding",
+ "type" : "object",
+ "properties" : {
+ "institutionId" : {
+ "type" : "string"
+ },
+ "institutionName" : {
+ "type" : "string"
+ },
+ "institutionRootName" : {
+ "type" : "string"
+ },
+ "products" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/OnboardedProduct"
+ }
+ }
+ }
+ },
+ "UserInfoResponse" : {
+ "title" : "UserInfoResponse",
+ "type" : "object",
+ "properties" : {
+ "email" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "name" : {
+ "type" : "string"
+ },
+ "products" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/OnboardedProduct"
+ }
+ },
+ "surname" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "UserProductsResponse" : {
+ "title" : "UserProductsResponse",
+ "type" : "object",
+ "properties" : {
+ "bindings" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/components/schemas/InstitutionProducts"
+ }
+ },
+ "id" : {
+ "type" : "string"
+ }
+ }
+ },
+ "UserResponse" : {
+ "title" : "UserResponse",
+ "type" : "object",
+ "properties" : {
+ "email" : {
+ "type" : "string"
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "name" : {
+ "type" : "string"
+ },
+ "surname" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ }
+ }
+ },
+ "UserToOnboard" : {
+ "title" : "UserToOnboard",
+ "type" : "object",
+ "properties" : {
+ "email" : {
+ "type" : "string"
+ },
+ "env" : {
+ "type" : "string",
+ "enum" : [ "COLL", "DEV", "PROD", "ROOT" ]
+ },
+ "id" : {
+ "type" : "string"
+ },
+ "name" : {
+ "type" : "string"
+ },
+ "productRole" : {
+ "type" : "string"
+ },
+ "role" : {
+ "type" : "string",
+ "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ]
+ },
+ "roleLabel" : {
+ "type" : "string"
+ },
+ "surname" : {
+ "type" : "string"
+ },
+ "taxCode" : {
+ "type" : "string"
+ }
+ }
+ }
+ },
+ "securitySchemes" : {
+ "bearerAuth" : {
+ "type" : "http",
+ "description" : "A bearer token in the format of a JWS and conformed to the specifications included in [RFC8725](https://tools.ietf.org/html/RFC8725)",
+ "scheme" : "bearer",
+ "bearerFormat" : "JWT"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/onboarding-ms/src/main/openapi/user_registry.json b/apps/onboarding-functions/src/main/openapi/user_registry.json
similarity index 100%
rename from onboarding-ms/src/main/openapi/user_registry.json
rename to apps/onboarding-functions/src/main/openapi/user_registry.json
diff --git a/apps/onboarding-functions/src/main/resources/application.properties b/apps/onboarding-functions/src/main/resources/application.properties
new file mode 100644
index 000000000..af51f06fc
--- /dev/null
+++ b/apps/onboarding-functions/src/main/resources/application.properties
@@ -0,0 +1,115 @@
+quarkus.log.category."it.pagopa.selfcare.onboarding".level=DEBUG
+
+quarkus.mongodb.connection-string = ${MONGODB_CONNECTION_URI}
+quarkus.mongodb.database = selcOnboarding
+
+quarkus.index-dependency.commons.group-id=it.pagopa.selfcare
+quarkus.index-dependency.commons.artifact-id=selc-commons-base
+
+quarkus.index-dependency.onboarding.group-id=it.pagopa.selfcare
+quarkus.index-dependency.onboarding.artifact-id=onboarding-sdk-common
+
+## RETRY POLICY FUNCTION ##
+# Max number of attempts: The maximum number of attempts. If set to 1, there will be no retry.
+# First retry interval: The amount of time to wait before the first retry attempt.
+# Backoff coefficient: The coefficient used to determine rate of increase of backoff. Defaults to 1.
+onboarding-functions.retry.max-attempts = 5
+onboarding-functions.retry.first-retry-interval = 30
+onboarding-functions.retry.backoff-coefficient = 5
+
+## PURGE FUNCTION ##
+# configuration for the start and end dates of the two functions
+onboarding-functions.purge.completed-from = 60
+onboarding-functions.purge.completed-to = 30
+onboarding-functions.purge.all-from = 150
+onboarding-functions.purge.all-to = 120
+
+## REST CLIENT #
+
+quarkus.openapi-generator.user_registry_json.auth.api_key.api-key = ${USER_REGISTRY_API_KEY:example-api-key}
+quarkus.rest-client."org.openapi.quarkus.user_registry_json.api.UserApi".url=${USER_REGISTRY_URL:http://localhost:8080}
+
+quarkus.openapi-generator.codegen.spec.core_json.enable-security-generation=false
+quarkus.openapi-generator.codegen.spec.core_json.additional-api-type-annotations=@org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders(it.pagopa.selfcare.onboarding.client.auth.AuthenticationPropagationHeadersFactory.class)
+quarkus.rest-client."org.openapi.quarkus.core_json.api.InstitutionApi".url=${MS_CORE_URL:http://localhost:8080}
+
+## AZURE STORAGE ##
+
+onboarding-functions.blob-storage.container-contract=${STORAGE_CONTAINER_CONTRACT:selc-d-contracts-blob}
+onboarding-functions.blob-storage.container-product=${STORAGE_CONTAINER_PRODUCT:selc-d-product}
+onboarding-functions.blob-storage.contract-path = parties/docs/
+onboarding-functions.blob-storage.product-filepath = products.json
+onboarding-functions.blob-storage.connection-string-contract = ${BLOB_STORAGE_CONN_STRING_CONTRACT:UseDevelopmentStorage=true;}
+onboarding-functions.blob-storage.connection-string-product = ${BLOB_STORAGE_CONN_STRING_PRODUCT:UseDevelopmentStorage=true;}
+
+
+## MAIL
+onboarding-functions.sender-mail = ${MAIL_SENDER_ADDRESS:test@test.it}
+onboarding-functions.destination-mail-test = ${MAIL_DESTINATION_TEST:true}
+onboarding-functions.destination-mail-test-address = ${MAIL_DESTINATION_TEST_ADDRESS:test@test.it}
+onboarding-functions.notification-admin-email = ${ADDRESS_EMAIL_NOTIFICATION_ADMIN:default}
+
+onboarding-functions.logo-path = ${PAGOPA_LOGO_URL:resources/logo.png}
+
+## MAIL TEMPLATE
+onboarding-functions.mail-template.path.onboarding.complete-path = ${MAIL_TEMPLATE_COMPLETE_PATH:contracts/template/mail/onboarding-complete/1.0.0.json}
+onboarding-functions.mail-template.path.onboarding.complete-path-fd = ${MAIL_TEMPLATE_FD_COMPLETE_NOTIFICATION_PATH:contracts/template/mail/onboarding-complete-fd/1.0.0.json}
+onboarding-functions.mail-template.path.onboarding.complete-path-pt = ${MAIL_TEMPLATE_PT_COMPLETE_PATH:contracts/template/mail/onboarding-complete-pt/1.0.0.json}
+
+onboarding-functions.mail-template.path.onboarding.autocomplete-path = ${MAIL_TEMPLATE_AUTOCOMPLETE_PATH:default}
+onboarding-functions.mail-template.path.onboarding.delegation-notification-path = ${MAIL_TEMPLATE_DELEGATION_NOTIFICATION_PATH:default}
+onboarding-functions.mail-template.path.onboarding.registration-path = ${MAIL_TEMPLATE_REGISTRATION_PATH:contracts/template/mail/1.0.0.json}
+
+onboarding-functions.mail-template.path.onboarding.onboarding-approve-path = ${MAIL_TEMPLATE_NOTIFICATION_PATH:default}
+onboarding-functions.mail-template.path.onboarding.registration-request-path = ${MAIL_TEMPLATE_REGISTRATION_REQUEST_PT_PATH:contracts/template/mail/registration-request-pt/1.0.0.json}
+onboarding-functions.mail-template.path.onboarding.registration-approve-path = ${MAIL_TEMPLATE_REGISTRATION_NOTIFICATION_ADMIN_PATH:contracts/template/mail/registration-notification-admin/1.0.0.json}
+
+onboarding-functions.mail-template.path.onboarding.reject-path = ${MAIL_TEMPLATE_REJECT_PATH:default}
+
+## MAIL PLACEHOLDERS
+onboarding-functions.mail-template.placeholders.onboarding.user-name = requesterName
+onboarding-functions.mail-template.placeholders.onboarding.user-surname = requesterSurname
+onboarding-functions.mail-template.placeholders.onboarding.product-name = productName
+onboarding-functions.mail-template.placeholders.onboarding.institution-description = institutionName
+onboarding-functions.mail-template.placeholders.onboarding.admin-link = ${SELFCARE_ADMIN_NOTIFICATION_URL:https://dev.selfcare.pagopa.it/dashboard/admin/onboarding/}
+
+onboarding-functions.mail-template.placeholders.onboarding.complete-selfcare-name = selfcareURL
+onboarding-functions.mail-template.placeholders.onboarding.complete-product-name = productName
+onboarding-functions.mail-template.placeholders.onboarding.complete-selfcare-placeholder= ${SELFCARE_URL:https://selfcare.pagopa.it}
+
+onboarding-functions.mail-template.placeholders.onboarding.confirm-token-name= confirmTokenURL
+onboarding-functions.mail-template.placeholders.onboarding.confirm-token-placeholder = ${MAIL_ONBOARDING_CONFIRMATION_LINK:https://dev.selfcare.pagopa.it/onboarding/confirm?jwt=}
+
+onboarding-functions.mail-template.placeholders.onboarding.reject-token-placeholder = ${MAIL_ONBOARDING_REJECTION_LINK:https://dev.selfcare.pagopa.it/onboarding/cancel?jwt=}
+onboarding-functions.mail-template.placeholders.onboarding.reject-token-name = rejectTokenURL
+
+onboarding-functions.mail-template.placeholders.onboarding.notification-product-name = productName
+onboarding-functions.mail-template.placeholders.onboarding.notification-requester-name = requesterName
+onboarding-functions.mail-template.placeholders.onboarding.notification-requester-surname = requesterSurname
+
+onboarding-functions.mail-template.placeholders.onboarding.reject-product-name=productName
+onboarding-functions.mail-template.placeholders.onboarding.reject-onboarding-url-placeholder=onboardingUrl
+onboarding-functions.mail-template.placeholders.onboarding.reject-onboarding-url-value=${MAIL_ONBOARDING_URL:https://dev.selfcare.pagopa.it/onboarding/}
+
+## MAIL SERVER
+quarkus.mailer.host=${MAIL_SERVER_HOST:smtp.gmail.com}
+quarkus.mailer.port=${MAIL_SERVER_PORT:587}
+quarkus.mailer.username=${MAIL_SERVER_USERNAME:}
+quarkus.mailer.password=${MAIL_SERVER_PASSWORD:}
+quarkus.mailer.auth-methods=${MAIL_SERVER_SMTP_AUTH:LOGIN}
+quarkus.mailer.start-tls=${MAIL_SERVER_SMTP_TLS_ENABLE:REQUIRED}
+
+#aws.ses.secret-id=${AWS_SES_ACCESS_KEY_ID:secret-id-example}
+#aws.ses.secret-key=${AWS_SES_SECRET_ACCESS_KEY:secret-key-example}
+#aws.ses.region=${AWS_SES_REGION:eu-south-1}
+
+## SIGNATURE
+# You can enable the signature inside contracts when there are builded setting PAGOPA_SIGNATURE_SOURCE env (default value is `disabled`) as `local` if you want to use Pkcs7HashSignService or `aruba` for ArubaPkcs7HashSignService
+onboarding-functions.pagopa-signature.source=${PAGOPA_SIGNATURE_SOURCE:disabled}
+onboarding-functions.pagopa-signature.signer=${PAGOPA_SIGNATURE_SIGNER:PagoPA S.p.A.}
+onboarding-functions.pagopa-signature.location=${PAGOPA_SIGNATURE_LOCATION:Roma}
+onboarding-functions.pagopa-signature.apply-onboarding-enabled=${PAGOPA_SIGNATURE_ONBOARDING_ENABLED:false}
+onboarding-functions.pagopa-signature.apply-onboarding-template-reason=${PAGOPA_SIGNATURE_ONBOARDING_REASON_TEMPLATE:Firma contratto adesione prodotto}
+
+## Jacoco
+quarkus.jacoco.includes=it/pagopa/selfcare/onboarding/*,it/pagopa/selfcare/onboarding/service/**,it/pagopa/selfcare/onboarding/repository/**
diff --git a/onboarding-functions/src/test/java/org/acme/HttpResponseMessageMock.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/HttpResponseMessageMock.java
similarity index 98%
rename from onboarding-functions/src/test/java/org/acme/HttpResponseMessageMock.java
rename to apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/HttpResponseMessageMock.java
index 75891d483..d8ba89bab 100644
--- a/onboarding-functions/src/test/java/org/acme/HttpResponseMessageMock.java
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/HttpResponseMessageMock.java
@@ -1,4 +1,4 @@
-package org.acme;
+package it.pagopa.selfcare.onboarding;
import com.microsoft.azure.functions.HttpResponseMessage;
import com.microsoft.azure.functions.HttpStatus;
diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/OnboardingCompletionFunctionsTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/OnboardingCompletionFunctionsTest.java
new file mode 100644
index 000000000..e642f9d22
--- /dev/null
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/OnboardingCompletionFunctionsTest.java
@@ -0,0 +1,178 @@
+package it.pagopa.selfcare.onboarding;
+
+import com.microsoft.azure.functions.ExecutionContext;
+import com.microsoft.azure.functions.HttpRequestMessage;
+import com.microsoft.azure.functions.HttpResponseMessage;
+import com.microsoft.azure.functions.HttpStatus;
+import com.microsoft.durabletask.DurableTaskClient;
+import com.microsoft.durabletask.Task;
+import com.microsoft.durabletask.TaskOrchestrationContext;
+import com.microsoft.durabletask.azurefunctions.DurableClientContext;
+import io.quarkus.test.InjectMock;
+import io.quarkus.test.junit.QuarkusTest;
+import it.pagopa.selfcare.onboarding.entity.Institution;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+import it.pagopa.selfcare.onboarding.exception.ResourceNotFoundException;
+import it.pagopa.selfcare.onboarding.functions.OnboardingCompletionFunctions;
+import it.pagopa.selfcare.onboarding.service.CompletionService;
+import it.pagopa.selfcare.onboarding.service.OnboardingService;
+import jakarta.inject.Inject;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.logging.Logger;
+
+import static it.pagopa.selfcare.onboarding.functions.CommonFunctions.SAVE_ONBOARDING_STATUS_ACTIVITY;
+import static it.pagopa.selfcare.onboarding.functions.OnboardingCompletionFunctions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.*;
+
+@QuarkusTest
+public class OnboardingCompletionFunctionsTest {
+
+
+ @Inject
+ OnboardingCompletionFunctions function;
+
+ @InjectMock
+ OnboardingService service;
+
+ @InjectMock
+ CompletionService completionService;
+
+ final String onboardinString = "{\"onboardingId\":\"onboardingId\"}";
+
+ /**
+ * Unit test for HttpTriggerJava method.
+ */
+ @Test
+ public void testHttpTriggerJava() {
+ // Setup
+ @SuppressWarnings("unchecked")
+ final HttpRequestMessage> req = mock(HttpRequestMessage.class);
+ final HttpResponseMessage res = mock(HttpResponseMessage.class);
+
+ final Map queryParams = new HashMap<>();
+ final String onboardingId = "onboardingId";
+ queryParams.put("onboardingId", onboardingId);
+ doReturn(queryParams).when(req).getQueryParameters();
+
+ final Optional queryBody = Optional.empty();
+ doReturn(queryBody).when(req).getBody();
+
+ doAnswer(new Answer() {
+ @Override
+ public HttpResponseMessage.Builder answer(InvocationOnMock invocation) {
+ HttpStatus status = (HttpStatus) invocation.getArguments()[0];
+ return new HttpResponseMessageMock.HttpResponseMessageBuilderMock().status(status);
+ }
+ }).when(req).createResponseBuilder(any(HttpStatus.class));
+
+ final ExecutionContext context = mock(ExecutionContext.class);
+ doReturn(Logger.getGlobal()).when(context).getLogger();
+
+ final DurableClientContext durableContext = mock(DurableClientContext.class);
+ final DurableTaskClient client = mock(DurableTaskClient.class);
+ final String scheduleNewOrchestrationInstance = "scheduleNewOrchestrationInstance";
+ doReturn(client).when(durableContext).getClient();
+ doReturn(scheduleNewOrchestrationInstance).when(client).scheduleNewOrchestrationInstance(ONBOARDING_COMPLETION_ACTIVITY, onboardingId);
+ doReturn(res).when(durableContext).createCheckStatusResponse(any(), any());
+
+ // Invoke
+ function.startOrchestration(req, durableContext, context);
+
+ // Verify
+ ArgumentCaptor captorInstanceId = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(durableContext, times(1))
+ .createCheckStatusResponse(any(), captorInstanceId.capture());
+ assertEquals(scheduleNewOrchestrationInstance, captorInstanceId.getValue());
+ }
+
+
+
+ @Test
+ void onboardingsOrchestrator_thorwExceptionIfOnboardingNotPresent() {
+ final String onboardingId = "onboardingId";
+ TaskOrchestrationContext orchestrationContext = mock(TaskOrchestrationContext.class);
+ when(orchestrationContext.getInput(String.class)).thenReturn(onboardingId);
+ when(service.getOnboarding(onboardingId)).thenReturn(Optional.empty());
+ assertThrows(ResourceNotFoundException.class, () -> function.onboardingCompletionOrchestrator(orchestrationContext));
+ }
+
+
+ @Test
+ void onboardingCompletionOrchestrator() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setOnboardingId("onboardingId");
+ onboarding.setInstitution(new Institution());
+
+ TaskOrchestrationContext orchestrationContext = mockTaskOrchestrationContext(onboarding);
+
+ function.onboardingCompletionOrchestrator(orchestrationContext);
+
+ ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(orchestrationContext, times(4))
+ .callActivity(captorActivity.capture(), any(), any(),any());
+ assertEquals(CREATE_INSTITUTION_ACTIVITY, captorActivity.getAllValues().get(0));
+ assertEquals(CREATE_ONBOARDING_ACTIVITY, captorActivity.getAllValues().get(1));
+ assertEquals(SEND_MAIL_COMPLETION_ACTIVITY, captorActivity.getAllValues().get(2));
+ assertEquals(SAVE_ONBOARDING_STATUS_ACTIVITY, captorActivity.getAllValues().get(3));
+ }
+
+
+ @Test
+ void createInstitutionAndPersistInstitutionId() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ when(completionService.createInstitutionAndPersistInstitutionId(any()))
+ .thenReturn("id");
+
+ function.createInstitutionAndPersistInstitutionId(onboardinString, executionContext);
+
+ Mockito.verify(completionService, times(1))
+ .createInstitutionAndPersistInstitutionId(any());
+ }
+
+ @Test
+ void sendCompletedEmail() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(completionService).sendCompletedEmail(any());
+
+ function.sendMailCompletion(onboardinString, executionContext);
+
+ Mockito.verify(completionService, times(1))
+ .sendCompletedEmail(any());
+ }
+
+ @Test
+ void createOnboarding() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(completionService).persistOnboarding(any());
+
+ function.createOnboarding(onboardinString, executionContext);
+
+ Mockito.verify(completionService, times(1))
+ .persistOnboarding(any());
+ }
+
+ TaskOrchestrationContext mockTaskOrchestrationContext(Onboarding onboarding) {
+ TaskOrchestrationContext orchestrationContext = mock(TaskOrchestrationContext.class);
+ when(orchestrationContext.getInput(String.class)).thenReturn(onboarding.getOnboardingId());
+ when(service.getOnboarding(onboarding.getOnboardingId())).thenReturn(Optional.of(onboarding));
+
+ Task task = mock(Task.class);
+ when(orchestrationContext.callActivity(any(),any(),any(),any())).thenReturn(task);
+ when(task.await()).thenReturn(onboardinString);
+ return orchestrationContext;
+ }
+}
diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/OnboardingFunctionsTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/OnboardingFunctionsTest.java
new file mode 100644
index 000000000..bef2f9ec2
--- /dev/null
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/OnboardingFunctionsTest.java
@@ -0,0 +1,297 @@
+package it.pagopa.selfcare.onboarding;
+
+import com.microsoft.azure.functions.ExecutionContext;
+import com.microsoft.azure.functions.HttpRequestMessage;
+import com.microsoft.azure.functions.HttpResponseMessage;
+import com.microsoft.azure.functions.HttpStatus;
+import com.microsoft.durabletask.DurableTaskClient;
+import com.microsoft.durabletask.Task;
+import com.microsoft.durabletask.TaskOrchestrationContext;
+import com.microsoft.durabletask.azurefunctions.DurableClientContext;
+import io.quarkus.test.InjectMock;
+import io.quarkus.test.junit.QuarkusTest;
+import it.pagopa.selfcare.onboarding.common.OnboardingStatus;
+import it.pagopa.selfcare.onboarding.common.WorkflowType;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+import it.pagopa.selfcare.onboarding.exception.ResourceNotFoundException;
+import it.pagopa.selfcare.onboarding.functions.OnboardingFunctions;
+import it.pagopa.selfcare.onboarding.service.OnboardingService;
+import jakarta.inject.Inject;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.logging.Logger;
+
+import static it.pagopa.selfcare.onboarding.functions.CommonFunctions.SAVE_ONBOARDING_STATUS_ACTIVITY;
+import static it.pagopa.selfcare.onboarding.functions.OnboardingFunctions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.*;
+
+
+/**
+ * Unit test for Function class.
+ */
+@QuarkusTest
+public class OnboardingFunctionsTest {
+
+ @Inject
+ OnboardingFunctions function;
+
+ @InjectMock
+ OnboardingService service;
+
+ final String onboardinString = "{\"onboardingId\":\"onboardingId\"}";
+
+ /**
+ * Unit test for HttpTriggerJava method.
+ */
+ @Test
+ public void testHttpTriggerJava() throws Exception {
+ // Setup
+ @SuppressWarnings("unchecked")
+ final HttpRequestMessage> req = mock(HttpRequestMessage.class);
+ final HttpResponseMessage res = mock(HttpResponseMessage.class);
+
+ final Map queryParams = new HashMap<>();
+ final String onboardingId = "onboardingId";
+ queryParams.put("onboardingId", onboardingId);
+ doReturn(queryParams).when(req).getQueryParameters();
+
+ final Optional queryBody = Optional.empty();
+ doReturn(queryBody).when(req).getBody();
+
+ doAnswer(new Answer() {
+ @Override
+ public HttpResponseMessage.Builder answer(InvocationOnMock invocation) {
+ HttpStatus status = (HttpStatus) invocation.getArguments()[0];
+ return new HttpResponseMessageMock.HttpResponseMessageBuilderMock().status(status);
+ }
+ }).when(req).createResponseBuilder(any(HttpStatus.class));
+
+ final ExecutionContext context = mock(ExecutionContext.class);
+ doReturn(Logger.getGlobal()).when(context).getLogger();
+
+ final DurableClientContext durableContext = mock(DurableClientContext.class);
+ final DurableTaskClient client = mock(DurableTaskClient.class);
+ final String scheduleNewOrchestrationInstance = "scheduleNewOrchestrationInstance";
+ doReturn(client).when(durableContext).getClient();
+ doReturn(scheduleNewOrchestrationInstance).when(client).scheduleNewOrchestrationInstance("Onboardings",onboardingId);
+ doReturn(res).when(durableContext).createCheckStatusResponse(any(), any());
+
+ // Invoke
+ function.startOrchestration(req, durableContext, context);
+
+ // Verify
+ ArgumentCaptor captorInstanceId = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(durableContext, times(1))
+ .createCheckStatusResponse(any(), captorInstanceId.capture());
+ assertEquals(scheduleNewOrchestrationInstance, captorInstanceId.getValue());
+ }
+
+ @Test
+ void onboardingsOrchestrator_thorwExceptionIfOnboardingNotPresent() {
+ final String onboardingId = "onboardingId";
+ TaskOrchestrationContext orchestrationContext = mock(TaskOrchestrationContext.class);
+ when(orchestrationContext.getInput(String.class)).thenReturn(onboardingId);
+ when(service.getOnboarding(onboardingId)).thenReturn(Optional.empty());
+ assertThrows(ResourceNotFoundException.class, () -> function.onboardingsOrchestrator(orchestrationContext));
+ }
+
+ @Test
+ void onboardingsOrchestratorContractRegistration() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setOnboardingId("onboardingId");
+ onboarding.setWorkflowType(WorkflowType.CONTRACT_REGISTRATION);
+
+ TaskOrchestrationContext orchestrationContext = mockTaskOrchestrationContext(onboarding);
+
+ function.onboardingsOrchestrator(orchestrationContext);
+
+ Mockito.verify(orchestrationContext, times(4))
+ .callActivity(any(), any(), any(),any());
+
+ ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(orchestrationContext, times(4))
+ .callActivity(captorActivity.capture(), any(), any(),any());
+ assertEquals(BUILD_CONTRACT_ACTIVITY_NAME, captorActivity.getAllValues().get(0));
+ assertEquals(SAVE_TOKEN_WITH_CONTRACT_ACTIVITY_NAME, captorActivity.getAllValues().get(1));
+ assertEquals(SEND_MAIL_REGISTRATION_WITH_CONTRACT_ACTIVITY, captorActivity.getAllValues().get(2));
+ assertEquals(SAVE_ONBOARDING_STATUS_ACTIVITY, captorActivity.getAllValues().get(3));
+ }
+
+ @Test
+ void onboardingsOrchestratorForApprove() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setOnboardingId("onboardingId");
+ onboarding.setStatus(OnboardingStatus.REQUEST);
+ onboarding.setWorkflowType(WorkflowType.FOR_APPROVE);
+
+ TaskOrchestrationContext orchestrationContext = mockTaskOrchestrationContext(onboarding);
+
+ function.onboardingsOrchestrator(orchestrationContext);
+
+ ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(orchestrationContext, times(2))
+ .callActivity(captorActivity.capture(), any(), any(),any());
+ assertEquals(SEND_MAIL_ONBOARDING_APPROVE_ACTIVITY, captorActivity.getAllValues().get(0));
+ assertEquals(SAVE_ONBOARDING_STATUS_ACTIVITY, captorActivity.getAllValues().get(1));
+ }
+
+ @Test
+ void onboardingsOrchestratorForApproveWhenToBeValidated() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setOnboardingId("onboardingId");
+ onboarding.setStatus(OnboardingStatus.TO_BE_VALIDATED);
+ onboarding.setWorkflowType(WorkflowType.FOR_APPROVE);
+
+ TaskOrchestrationContext orchestrationContext = mockTaskOrchestrationContext(onboarding);
+
+ function.onboardingsOrchestrator(orchestrationContext);
+
+ ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(orchestrationContext, times(4))
+ .callActivity(captorActivity.capture(), any(), any(),any());
+ assertEquals(BUILD_CONTRACT_ACTIVITY_NAME, captorActivity.getAllValues().get(0));
+ assertEquals(SAVE_TOKEN_WITH_CONTRACT_ACTIVITY_NAME, captorActivity.getAllValues().get(1));
+ assertEquals(SEND_MAIL_REGISTRATION_WITH_CONTRACT_WHEN_APPROVE_ACTIVITY, captorActivity.getAllValues().get(2));
+ assertEquals(SAVE_ONBOARDING_STATUS_ACTIVITY, captorActivity.getAllValues().get(3));
+ }
+
+ @Test
+ void onboardingsOrchestratorConfirmation() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setOnboardingId("onboardingId");
+ onboarding.setWorkflowType(WorkflowType.CONFIRMATION);
+
+ TaskOrchestrationContext orchestrationContext = mockTaskOrchestrationContext(onboarding);
+
+ function.onboardingsOrchestrator(orchestrationContext);
+
+ ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(orchestrationContext, times(2))
+ .callActivity(captorActivity.capture(), any(), any(),any());
+ assertEquals(SEND_MAIL_CONFIRMATION_ACTIVITY, captorActivity.getAllValues().get(0));
+ assertEquals(SAVE_ONBOARDING_STATUS_ACTIVITY, captorActivity.getAllValues().get(1));
+ }
+
+ @Test
+ void onboardingsOrchestratorRegistrationRequestApprove() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setOnboardingId("onboardingId");
+ onboarding.setWorkflowType(WorkflowType.FOR_APPROVE_PT);
+
+ TaskOrchestrationContext orchestrationContext = mockTaskOrchestrationContext(onboarding);
+
+ function.onboardingsOrchestrator(orchestrationContext);
+
+ ArgumentCaptor captorActivity = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(orchestrationContext, times(3))
+ .callActivity(captorActivity.capture(), any(), any(),any());
+ assertEquals(SEND_MAIL_REGISTRATION_REQUEST_ACTIVITY, captorActivity.getAllValues().get(0));
+ assertEquals(SEND_MAIL_REGISTRATION_APPROVE_ACTIVITY, captorActivity.getAllValues().get(1));
+ assertEquals(SAVE_ONBOARDING_STATUS_ACTIVITY, captorActivity.getAllValues().get(2));
+ }
+
+ TaskOrchestrationContext mockTaskOrchestrationContext(Onboarding onboarding) {
+ TaskOrchestrationContext orchestrationContext = mock(TaskOrchestrationContext.class);
+ when(orchestrationContext.getInput(String.class)).thenReturn(onboarding.getOnboardingId());
+ when(service.getOnboarding(onboarding.getOnboardingId())).thenReturn(Optional.of(onboarding));
+
+ Task task = mock(Task.class);
+ when(orchestrationContext.callActivity(any(),any(),any(),any())).thenReturn(task);
+ when(task.await()).thenReturn("example");
+ return orchestrationContext;
+ }
+
+ @Test
+ void buildContract() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(service).createContract(any());
+
+ function.buildContract(onboardinString, executionContext);
+
+ Mockito.verify(service, times(1))
+ .createContract(any());
+ }
+
+ @Test
+ void saveToken() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(service).saveTokenWithContract(any());
+
+ function.saveToken(onboardinString, executionContext);
+
+ Mockito.verify(service, times(1))
+ .saveTokenWithContract(any());
+ }
+
+ @Test
+ void sendMailRegistrationWithContract() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(service).sendMailRegistrationWithContract(any());
+
+ function.sendMailRegistrationWithContract(onboardinString, executionContext);
+
+ Mockito.verify(service, times(1))
+ .sendMailRegistrationWithContract(any());
+ }
+
+ @Test
+ void sendMailRegistration() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(service).sendMailRegistration(any());
+
+ function.sendMailRegistration(onboardinString, executionContext);
+
+ Mockito.verify(service, times(1))
+ .sendMailRegistration(any());
+ }
+
+ @Test
+ void sendMailRegistrationApprove() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(service).sendMailRegistrationApprove(any());
+
+ function.sendMailRegistrationApprove(onboardinString, executionContext);
+
+ Mockito.verify(service, times(1))
+ .sendMailRegistrationApprove(any());
+ }
+
+ @Test
+ void sendMailOnboardingApprove() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(service).sendMailOnboardingApprove(any());
+
+ function.sendMailOnboardingApprove(onboardinString, executionContext);
+
+ Mockito.verify(service, times(1))
+ .sendMailOnboardingApprove(any());
+ }
+
+ @Test
+ void sendMailRegistrationWithContractWhenApprove() {
+ ExecutionContext executionContext = mock(ExecutionContext.class);
+ when(executionContext.getLogger()).thenReturn(Logger.getGlobal());
+ doNothing().when(service).sendMailRegistrationWithContractWhenApprove(any());
+
+ function.sendMailRegistrationWithContractWhenApprove(onboardinString, executionContext);
+
+ Mockito.verify(service, times(1))
+ .sendMailRegistrationWithContractWhenApprove(any());
+ }
+}
diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/repository/TokenRepositoryTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/repository/TokenRepositoryTest.java
new file mode 100644
index 000000000..a0f29be4e
--- /dev/null
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/repository/TokenRepositoryTest.java
@@ -0,0 +1,34 @@
+package it.pagopa.selfcare.onboarding.repository;
+
+import io.quarkus.mongodb.panache.PanacheQuery;
+import io.quarkus.test.InjectMock;
+import io.quarkus.test.junit.QuarkusTest;
+import it.pagopa.selfcare.onboarding.entity.Token;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.util.Optional;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+@QuarkusTest
+public class TokenRepositoryTest {
+ @InjectMock
+ TokenRepository tokenRepository;
+
+ @Test
+ void findByOnboardingId() {
+ final String onboardingId = "onboardingId";
+ PanacheQuery panacheQuery = mock(PanacheQuery.class);
+ when(panacheQuery.firstResultOptional()).thenReturn(Optional.of(new Token()));
+ Mockito.when(tokenRepository.find(TokenRepository.ONBOARDING_ID_FIELD, onboardingId))
+ .thenReturn(panacheQuery);
+
+ // Instruct mockito to call real method that you are testing
+ Mockito.when(tokenRepository.findByOnboardingId(onboardingId)).thenCallRealMethod();
+ Optional token = tokenRepository.findByOnboardingId(onboardingId);
+ assertTrue(token.isPresent());
+ }
+}
diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/CompletionServiceDefaultTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/CompletionServiceDefaultTest.java
new file mode 100644
index 000000000..a89163279
--- /dev/null
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/CompletionServiceDefaultTest.java
@@ -0,0 +1,333 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import io.quarkus.mongodb.panache.common.PanacheUpdate;
+import io.quarkus.test.InjectMock;
+import io.quarkus.test.junit.QuarkusTest;
+import it.pagopa.selfcare.onboarding.common.InstitutionPaSubunitType;
+import it.pagopa.selfcare.onboarding.common.InstitutionType;
+import it.pagopa.selfcare.onboarding.common.Origin;
+import it.pagopa.selfcare.onboarding.common.PartyRole;
+import it.pagopa.selfcare.onboarding.entity.*;
+import it.pagopa.selfcare.onboarding.exception.GenericOnboardingException;
+import it.pagopa.selfcare.onboarding.repository.OnboardingRepository;
+import it.pagopa.selfcare.onboarding.repository.TokenRepository;
+import it.pagopa.selfcare.product.entity.Product;
+import it.pagopa.selfcare.product.service.ProductService;
+import jakarta.inject.Inject;
+import org.bson.types.ObjectId;
+import org.eclipse.microprofile.rest.client.inject.RestClient;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+import org.openapi.quarkus.core_json.api.InstitutionApi;
+import org.openapi.quarkus.core_json.model.InstitutionFromIpaPost;
+import org.openapi.quarkus.core_json.model.InstitutionOnboardingRequest;
+import org.openapi.quarkus.core_json.model.InstitutionResponse;
+import org.openapi.quarkus.core_json.model.InstitutionsResponse;
+import org.openapi.quarkus.user_registry_json.api.UserApi;
+import org.openapi.quarkus.user_registry_json.model.CertifiableFieldResourceOfstring;
+import org.openapi.quarkus.user_registry_json.model.UserResource;
+import org.openapi.quarkus.user_registry_json.model.WorkContactResource;
+
+import java.util.*;
+
+import static it.pagopa.selfcare.onboarding.service.OnboardingService.USERS_WORKS_FIELD_LIST;
+import static it.pagopa.selfcare.onboarding.utils.PdfMapper.workContactsKey;
+import static it.pagopa.selfcare.onboarding.service.OnboardingService.USERS_FIELD_LIST;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.mockito.Mockito.*;
+
+@QuarkusTest
+public class CompletionServiceDefaultTest {
+
+ public static final String MANAGER_WORKCONTRACT_MAIL = "mail@mail.it";
+ @Inject
+ CompletionServiceDefault completionServiceDefault;
+
+ @InjectMock
+ OnboardingRepository onboardingRepository;
+ @InjectMock
+ TokenRepository tokenRepository;
+ @InjectMock
+ NotificationService notificationService;
+ @InjectMock
+ ProductService productService;
+
+ @RestClient
+ @InjectMock
+ InstitutionApi institutionApi;
+ @RestClient
+ @InjectMock
+ UserApi userRegistryApi;
+
+ final String productId = "productId";
+
+ @Test
+ void createInstitutionAndPersistInstitutionId_shouldThrowExceptionIfMoreInstitutions() {
+ Onboarding onboarding = createOnboarding();
+
+ InstitutionsResponse response = new InstitutionsResponse();
+ response.setInstitutions(List.of(new InstitutionResponse(), new InstitutionResponse()));
+ when(institutionApi.getInstitutionsUsingGET(onboarding.getInstitution().getTaxCode(),
+ onboarding.getInstitution().getSubunitCode(), null, null))
+ .thenReturn(response);
+
+ assertThrows(GenericOnboardingException.class, () -> completionServiceDefault.createInstitutionAndPersistInstitutionId(onboarding));
+ }
+
+ @Test
+ void createInstitutionAndPersistInstitutionId_foundInstitution() {
+ Onboarding onboarding = createOnboarding();
+
+ InstitutionsResponse response = new InstitutionsResponse();
+ InstitutionResponse institutionResponse = new InstitutionResponse();
+ institutionResponse.setId("actual-id");
+ response.setInstitutions(List.of(institutionResponse));
+ when(institutionApi.getInstitutionsUsingGET(onboarding.getInstitution().getTaxCode(),
+ onboarding.getInstitution().getSubunitCode(), null, null))
+ .thenReturn(response);
+
+ mockOnboardingUpdateAndExecuteCreateInstitution(onboarding, institutionResponse);
+ }
+
+ void mockOnboardingUpdateAndExecuteCreateInstitution(Onboarding onboarding, InstitutionResponse institutionResponse){
+ PanacheUpdate panacheUpdateMock = mock(PanacheUpdate.class);
+ when(panacheUpdateMock.where("_id", onboarding.getOnboardingId()))
+ .thenReturn(Long.valueOf(1));
+ when(onboardingRepository.update("institution.id", institutionResponse.getId()))
+ .thenReturn(panacheUpdateMock);
+
+ completionServiceDefault.createInstitutionAndPersistInstitutionId(onboarding);
+
+ verify(onboardingRepository, times(1))
+ .update("institution.id", institutionResponse.getId());
+ }
+
+ @Test
+ void createInstitutionAndPersistInstitutionId_notFoundInstitutionAndCreateSaAnac() {
+ Onboarding onboarding = createOnboarding();
+
+ Institution institutionSa = new Institution();
+ institutionSa.setInstitutionType(InstitutionType.SA);
+ institutionSa.setOrigin(Origin.ANAC);
+ onboarding.setInstitution(institutionSa);
+
+ InstitutionsResponse response = new InstitutionsResponse();
+ when(institutionApi.getInstitutionsUsingGET(onboarding.getInstitution().getTaxCode(),
+ onboarding.getInstitution().getSubunitCode(), null, null))
+ .thenReturn(response);
+
+ InstitutionResponse institutionResponse = dummyInstitutionResponse();
+ when(institutionApi.createInstitutionFromAnacUsingPOST(any())).thenReturn(institutionResponse);
+
+ mockOnboardingUpdateAndExecuteCreateInstitution(onboarding, institutionResponse);
+ }
+
+ @Test
+ void createInstitutionAndPersistInstitutionId_notFoundInstitutionAndCreateAsIvass() {
+ Onboarding onboarding = createOnboarding();
+
+ Institution institution = new Institution();
+ institution.setInstitutionType(InstitutionType.AS);
+ institution.setOrigin(Origin.IVASS);
+ onboarding.setInstitution(institution);
+
+ InstitutionsResponse response = new InstitutionsResponse();
+ when(institutionApi.getInstitutionsUsingGET(onboarding.getInstitution().getTaxCode(),
+ onboarding.getInstitution().getSubunitCode(), null, null))
+ .thenReturn(response);
+
+ InstitutionResponse institutionResponse = dummyInstitutionResponse();
+ when(institutionApi.createInstitutionFromIvassUsingPOST(any())).thenReturn(institutionResponse);
+
+ mockOnboardingUpdateAndExecuteCreateInstitution(onboarding, institutionResponse);
+ }
+ @Test
+ void createInstitutionAndPersistInstitutionId_notFoundInstitutionAndCreatePgAde() {
+ Onboarding onboarding = createOnboarding();
+
+ Institution institution = new Institution();
+ institution.setInstitutionType(InstitutionType.PG);
+ institution.setOrigin(Origin.ADE);
+ onboarding.setInstitution(institution);
+
+ InstitutionsResponse response = new InstitutionsResponse();
+ when(institutionApi.getInstitutionsUsingGET(onboarding.getInstitution().getTaxCode(),
+ onboarding.getInstitution().getSubunitCode(), null, null))
+ .thenReturn(response);
+
+ InstitutionResponse institutionResponse = dummyInstitutionResponse();
+ when(institutionApi.createInstitutionFromInfocamereUsingPOST(any())).thenReturn(institutionResponse);
+
+ mockOnboardingUpdateAndExecuteCreateInstitution(onboarding, institutionResponse);
+ }
+ @Test
+ void createInstitutionAndPersistInstitutionId_notFoundInstitutionAndCreatePa() {
+ Onboarding onboarding = createOnboarding();
+
+ Institution institution = new Institution();
+ institution.setInstitutionType(InstitutionType.PA);
+ institution.setSubunitType(InstitutionPaSubunitType.AOO);
+ institution.setSubunitCode("code");
+ onboarding.setInstitution(institution);
+
+ InstitutionsResponse response = new InstitutionsResponse();
+ when(institutionApi.getInstitutionsUsingGET(onboarding.getInstitution().getTaxCode(),
+ onboarding.getInstitution().getSubunitCode(), null, null))
+ .thenReturn(response);
+
+ InstitutionResponse institutionResponse = dummyInstitutionResponse();
+ when(institutionApi.createInstitutionFromIpaUsingPOST(any())).thenReturn(institutionResponse);
+
+ mockOnboardingUpdateAndExecuteCreateInstitution(onboarding, institutionResponse);
+
+ ArgumentCaptor captor = ArgumentCaptor.forClass(InstitutionFromIpaPost.class);
+ verify(institutionApi, times(1))
+ .createInstitutionFromIpaUsingPOST(captor.capture());
+ assertEquals(institution.getTaxCode(), captor.getValue().getTaxCode());
+ assertEquals(institution.getSubunitCode(), captor.getValue().getSubunitCode());
+ }
+
+ @Test
+ void persistOnboarding_workContractsNotFound() {
+ Onboarding onboarding = createOnboarding();
+
+ User manager = new User();
+ manager.setId("id");
+ manager.setRole(PartyRole.MANAGER);
+ onboarding.setUsers(List.of(manager));
+
+ when(userRegistryApi.findByIdUsingGET(USERS_WORKS_FIELD_LIST, manager.getId()))
+ .thenReturn(new UserResource());
+
+ assertThrows(GenericOnboardingException.class, () -> completionServiceDefault.persistOnboarding(onboarding));
+ }
+
+ @Test
+ void persistOnboarding() {
+ Onboarding onboarding = createOnboarding();
+
+ User manager = new User();
+ manager.setId("id");
+ manager.setRole(PartyRole.MANAGER);
+ onboarding.setUsers(List.of(manager));
+
+ UserResource userResource = dummyUserResource(onboarding.getOnboardingId());
+
+ when(userRegistryApi.findByIdUsingGET(USERS_WORKS_FIELD_LIST, manager.getId()))
+ .thenReturn(userResource);
+ when(institutionApi.onboardingInstitutionUsingPOST(any(), any()))
+ .thenReturn(new InstitutionResponse());
+ Token token = new Token();
+ token.setContractSigned("contract-signed-path");
+ when(tokenRepository.findByOnboardingId(onboarding.getOnboardingId()))
+ .thenReturn(Optional.of(token));
+
+ completionServiceDefault.persistOnboarding(onboarding);
+
+ ArgumentCaptor captor = ArgumentCaptor.forClass(InstitutionOnboardingRequest.class);
+ verify(institutionApi, times(1))
+ .onboardingInstitutionUsingPOST(any(), captor.capture());
+
+ verify(tokenRepository, times(1))
+ .findByOnboardingId(onboarding.getOnboardingId());
+
+ InstitutionOnboardingRequest actual = captor.getValue();
+ assertEquals(onboarding.getProductId(), actual.getProductId());
+ assertEquals(onboarding.getPricingPlan(), actual.getPricingPlan());
+ assertEquals(1, actual.getUsers().size());
+ assertEquals(MANAGER_WORKCONTRACT_MAIL, actual.getUsers().get(0).getEmail());
+ assertEquals(manager.getRole().name(), actual.getUsers().get(0).getRole().name());
+ assertEquals(token.getContractSigned(), actual.getContractPath());
+ }
+
+ @Test
+ void sendCompletedEmail() {
+
+ UserResource userResource = new UserResource();
+ userResource.setId(UUID.randomUUID());
+ Map map = new HashMap<>();
+ userResource.setWorkContacts(map);
+ Product product = createDummyProduct();
+ Onboarding onboarding = createOnboarding();
+
+ User user = new User();
+ user.setRole(PartyRole.MANAGER);
+ user.setId("user-id");
+ onboarding.setUsers(List.of(user));
+
+ when(productService.getProduct(onboarding.getProductId()))
+ .thenReturn(product);
+ when(userRegistryApi.findByIdUsingGET(USERS_FIELD_LIST, user.getId()))
+ .thenReturn(userResource);
+ doNothing().when(notificationService).sendCompletedEmail(any(), any(), any());
+
+ completionServiceDefault.sendCompletedEmail(onboarding);
+
+ Mockito.verify(notificationService, times(1))
+ .sendCompletedEmail(any(), any(), any());
+ }
+
+ private InstitutionResponse dummyInstitutionResponse() {
+ InstitutionResponse response = new InstitutionResponse();
+ response.setId("response-id");
+ return response;
+ }
+
+
+ private Onboarding createOnboarding() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setId(ObjectId.get());
+ onboarding.setOnboardingId(onboarding.getId().toHexString());
+ onboarding.setProductId(productId);
+ onboarding.setPricingPlan("pricingPlan");
+ onboarding.setUsers(List.of());
+ onboarding.setInstitution(new Institution());
+ onboarding.setUserRequestUid("example-uid");
+
+ Billing billing = new Billing();
+ billing.setPublicServices(true);
+ billing.setRecipientCode("example");
+ billing.setVatNumber("example");
+ onboarding.setBilling(billing);
+ return onboarding;
+ }
+
+ private Product createDummyProduct() {
+ Product product = new Product();
+ product.setContractTemplatePath("example");
+ product.setContractTemplateVersion("version");
+ product.setTitle("Title");
+ product.setId(productId);
+ return product;
+ }
+
+ private UserResource dummyUserResource(String onboardingId){
+ UserResource userResource = new UserResource();
+ userResource.setId(UUID.randomUUID());
+
+ CertifiableFieldResourceOfstring resourceOfName = new CertifiableFieldResourceOfstring();
+ resourceOfName.setCertification(CertifiableFieldResourceOfstring.CertificationEnum.NONE);
+ resourceOfName.setValue("name");
+ userResource.setName(resourceOfName);
+
+ CertifiableFieldResourceOfstring resourceOfSurname = new CertifiableFieldResourceOfstring();
+ resourceOfSurname.setCertification(CertifiableFieldResourceOfstring.CertificationEnum.NONE);
+ resourceOfSurname.setValue("surname");
+ userResource.setFamilyName(resourceOfSurname);
+
+
+ CertifiableFieldResourceOfstring resourceOfMail = new CertifiableFieldResourceOfstring();
+ resourceOfMail.setCertification(CertifiableFieldResourceOfstring.CertificationEnum.NONE);
+ resourceOfMail.setValue(MANAGER_WORKCONTRACT_MAIL);
+ WorkContactResource workContactResource = new WorkContactResource();
+ workContactResource.email(resourceOfMail);
+
+ Map map = new HashMap<>();
+ map.put(workContactsKey.apply(onboardingId), workContactResource);
+ userResource.setWorkContacts(map);
+ return userResource;
+ }
+}
+
diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/ContractServiceDefaultTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/ContractServiceDefaultTest.java
new file mode 100644
index 000000000..c2ffca5e5
--- /dev/null
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/ContractServiceDefaultTest.java
@@ -0,0 +1,196 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import io.quarkus.test.InjectMock;
+import io.quarkus.test.junit.QuarkusTest;
+import it.pagopa.selfcare.azurestorage.AzureBlobClient;
+import it.pagopa.selfcare.onboarding.common.InstitutionType;
+import it.pagopa.selfcare.onboarding.config.AzureStorageConfig;
+import it.pagopa.selfcare.onboarding.config.PagoPaSignatureConfig;
+import it.pagopa.selfcare.onboarding.crypto.PadesSignService;
+import it.pagopa.selfcare.onboarding.entity.Institution;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+import jakarta.inject.Inject;
+import org.bson.types.ObjectId;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+import org.openapi.quarkus.user_registry_json.model.CertifiableFieldResourceOfstring;
+import org.openapi.quarkus.user_registry_json.model.UserResource;
+import org.openapi.quarkus.user_registry_json.model.WorkContactResource;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import static it.pagopa.selfcare.onboarding.utils.PdfMapper.workContactsKey;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.*;
+
+@QuarkusTest
+class ContractServiceDefaultTest {
+
+ @Inject
+ AzureStorageConfig azureStorageConfig;
+
+ @InjectMock
+ AzureBlobClient azureBlobClient;
+ PadesSignService padesSignService;
+
+ @Inject
+ ContractService contractService;
+
+ @Inject
+ PagoPaSignatureConfig pagoPaSignatureConfig;
+
+
+ final static String productNameExample = "product-name";
+
+ @BeforeEach
+ void setup(){
+ padesSignService = mock(PadesSignService.class);
+ contractService = new ContractServiceDefault(azureStorageConfig, azureBlobClient, padesSignService, pagoPaSignatureConfig, "logo- path");
+ }
+
+
+ private Onboarding createOnboarding() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setId(ObjectId.get());
+ onboarding.setOnboardingId("example");
+ onboarding.setProductId("productId");
+ onboarding.setUsers(List.of());
+
+ Institution institution = new Institution();
+ institution.setInstitutionType(InstitutionType.PSP);
+ institution.setDescription("42");
+
+ institution.setRea("rea");
+ institution.setBusinessRegisterPlace("place");
+ institution.setShareCapital("10000");
+ onboarding.setInstitution(institution);
+ return onboarding;
+ }
+
+ UserResource createDummyUserResource(String onboardingId) {
+ UserResource validManager = new UserResource();
+
+ CertifiableFieldResourceOfstring emailCert = new CertifiableFieldResourceOfstring();
+ emailCert.setValue("email");
+ WorkContactResource workContact = new WorkContactResource();
+ workContact.setEmail(emailCert);
+ Map map = new HashMap<>();
+ map.put(workContactsKey.apply(onboardingId), workContact);
+
+ validManager.setWorkContacts(map);
+ return validManager;
+ }
+
+ @Test
+ void createContractPDF() {
+ final String contractFilepath = "contract";
+ final String contractHtml = "contract";
+ final String productNameAccent = "Interoperabilità";
+
+ Onboarding onboarding = createOnboarding();
+ UserResource manager = createDummyUserResource(onboarding.getOnboardingId());
+
+ Mockito.when(azureBlobClient.getFileAsText(contractFilepath)).thenReturn(contractHtml);
+
+ Mockito.when(azureBlobClient.uploadFile(any(),any(),any())).thenReturn(contractHtml);
+
+ File contract = contractService.createContractPDF(contractFilepath, onboarding, manager, List.of(), productNameAccent);
+
+ assertNotNull(contract);
+
+ ArgumentCaptor captorFilename = ArgumentCaptor.forClass(String.class);
+ verify(azureBlobClient, times(1))
+ .uploadFile(any(),captorFilename.capture(),any());
+ assertEquals("Interoperabilita_accordo_adesione.pdf", captorFilename.getValue());
+ }
+
+ @Test
+ void createContractPDFSA() {
+ final String contractFilepath = "contract";
+ final String contractHtml = "contract";
+
+ Onboarding onboarding = createOnboarding();
+ UserResource manager = createDummyUserResource(onboarding.getOnboardingId());
+ onboarding.getInstitution().setInstitutionType(InstitutionType.SA);
+
+ Mockito.when(azureBlobClient.getFileAsText(contractFilepath)).thenReturn(contractHtml);
+
+ Mockito.when(azureBlobClient.uploadFile(any(),any(),any())).thenReturn(contractHtml);
+
+ assertNotNull(contractService.createContractPDF(contractFilepath, onboarding, manager, List.of(), productNameExample));
+ }
+
+ @Test
+ void createContractPDFAndSigned() {
+ final String contractFilepath = "contract";
+ final String contractHtml = "contract";
+
+ Onboarding onboarding = createOnboarding();
+ UserResource manager = createDummyUserResource(onboarding.getOnboardingId());
+
+ PagoPaSignatureConfig pagoPaSignatureConfig = Mockito.spy(this.pagoPaSignatureConfig);
+ when(pagoPaSignatureConfig.source()).thenReturn("local");
+ contractService = new ContractServiceDefault(azureStorageConfig, azureBlobClient, padesSignService, pagoPaSignatureConfig, "logo-path");
+
+ Mockito.when(azureBlobClient.getFileAsText(contractFilepath)).thenReturn(contractHtml);
+
+ Mockito.doNothing().when(padesSignService).padesSign(any(),any(),any());
+
+ Mockito.when(azureBlobClient.uploadFile(any(),any(),any())).thenReturn(contractHtml);
+
+ assertNotNull(contractService.createContractPDF(contractFilepath, onboarding, manager, List.of(), productNameExample));
+ }
+
+
+
+ @Test
+ void loadContractPDF() {
+ final String contractFilepath = "contract";
+ final String contractHtml = "contract";
+
+ Onboarding onboarding = createOnboarding();
+
+ File pdf = new File(Objects.requireNonNull(getClass().getClassLoader().getResource("application.properties")).getFile());
+
+ Mockito.when(azureBlobClient.getFileAsPdf(contractFilepath)).thenReturn(pdf);
+
+ Mockito.when(azureBlobClient.uploadFile(any(), any(), any())).thenReturn(contractHtml);
+
+ assertNotNull(contractService.loadContractPDF(contractFilepath, onboarding.getId().toHexString(), productNameExample));
+ }
+
+ @Test
+ void retrieveContractNotSigned() {
+
+ Onboarding onboarding = createOnboarding();
+
+ File pdf = mock(File.class);
+ Mockito.when(azureBlobClient.getFileAsPdf(any())).thenReturn(pdf);
+
+ contractService.retrieveContractNotSigned(onboarding.getOnboardingId(), productNameExample);
+
+ ArgumentCaptor filepathActual = ArgumentCaptor.forClass(String.class);
+ Mockito.verify(azureBlobClient, times(1))
+ .getFileAsPdf(filepathActual.capture());
+ assertTrue(filepathActual.getValue().contains(onboarding.getOnboardingId()));
+ assertTrue(filepathActual.getValue().contains(productNameExample));
+ }
+
+
+ @Test
+ void getLogoFile() {
+ Mockito.when(azureBlobClient.getFileAsText(any())).thenReturn("example");
+
+ contractService.getLogoFile();
+
+ Mockito.verify(azureBlobClient, times(1))
+ .getFileAsText(any());
+ }
+}
diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/NotificationServiceDefaultTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/NotificationServiceDefaultTest.java
new file mode 100644
index 000000000..fc6045db7
--- /dev/null
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/NotificationServiceDefaultTest.java
@@ -0,0 +1,188 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.quarkus.mailer.Mail;
+import io.quarkus.mailer.Mailer;
+import io.quarkus.test.InjectMock;
+import io.quarkus.test.junit.QuarkusTest;
+import it.pagopa.selfcare.azurestorage.AzureBlobClient;
+import it.pagopa.selfcare.onboarding.common.InstitutionType;
+import it.pagopa.selfcare.onboarding.config.MailTemplatePathConfig;
+import it.pagopa.selfcare.onboarding.config.MailTemplatePlaceholdersConfig;
+import it.pagopa.selfcare.product.entity.Product;
+import jakarta.inject.Inject;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+
+import java.io.File;
+import java.util.List;
+import java.util.Objects;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+
+@QuarkusTest
+class NotificationServiceDefaultTest {
+
+ @InjectMock
+ AzureBlobClient azureBlobClient;
+ @InjectMock
+ ContractService contractService;
+ @Inject
+ MailTemplatePlaceholdersConfig templatePlaceholdersConfig;
+ @Inject
+ MailTemplatePathConfig templatePathConfig;
+ @Inject
+ ObjectMapper objectMapper;
+ Mailer mailer;
+ NotificationServiceDefault notificationService;
+
+ final String notificationAdminMail = "adminAddress";
+
+ @BeforeEach
+ void startup() {
+ mailer = mock(Mailer.class);
+ this.notificationService = new NotificationServiceDefault(templatePlaceholdersConfig, templatePathConfig,
+ azureBlobClient, objectMapper, mailer, contractService, notificationAdminMail, "senderMail", false, "destinationMailTestAddress");
+ }
+
+ @Test
+ void sendMailRegistrationWithContract() {
+
+ final String mailTemplate = "{\"subject\":\"example\",\"body\":\"example\"}";
+
+ final String onboardingId = "onboardingId";
+ final String destination = "test@test.it";
+ final String productName = "productName";
+
+ final File file = new File(Objects.requireNonNull(getClass().getClassLoader().getResource("application.properties")).getFile());
+
+ Mockito.when(contractService.retrieveContractNotSigned(onboardingId, productName))
+ .thenReturn(file);
+
+ Mockito.when(azureBlobClient.getFileAsText(templatePathConfig.registrationPath()))
+ .thenReturn(mailTemplate);
+ Mockito.doNothing().when(mailer).send(any());
+
+ notificationService.sendMailRegistrationWithContract(onboardingId, destination,"","", productName);
+
+ Mockito.verify(azureBlobClient, Mockito.times(1))
+ .getFileAsText(any());
+
+ ArgumentCaptor mailArgumentCaptor = ArgumentCaptor.forClass(Mail.class);
+ Mockito.verify(mailer, Mockito.times(1))
+ .send(mailArgumentCaptor.capture());
+ assertEquals(destination, mailArgumentCaptor.getValue().getTo().get(0));
+ }
+
+ @Test
+ void sendMailRegistrationWithContract_shouldThrowException() {
+ final String onboardingId = "onboardingId";
+ final String productName = "productName";
+ final File file = mock(File.class);
+ Mockito.when(contractService.retrieveContractNotSigned(onboardingId, productName)).thenReturn(file);
+ assertThrows(RuntimeException.class, () -> notificationService.sendMailRegistrationWithContract(onboardingId, "example@pagopa.it","mario","rossi","prod-example"));
+ }
+
+ @Test
+ void sendMailRegistration() {
+
+ final String mailTemplate = "{\"subject\":\"example\",\"body\":\"example\"}";
+
+ final String onboardingId = "onboardingId";
+ final String destination = "test@test.it";
+
+ Mockito.when(azureBlobClient.getFileAsText(templatePathConfig.registrationRequestPath()))
+ .thenReturn(mailTemplate);
+
+ Mockito.doNothing().when(mailer).send(any());
+
+ notificationService.sendMailRegistration(onboardingId, destination,"","","");
+
+ Mockito.verify(azureBlobClient, Mockito.times(1))
+ .getFileAsText(any());
+
+ ArgumentCaptor mailArgumentCaptor = ArgumentCaptor.forClass(Mail.class);
+ Mockito.verify(mailer, Mockito.times(1))
+ .send(mailArgumentCaptor.capture());
+ assertEquals(destination, mailArgumentCaptor.getValue().getTo().get(0));
+ }
+
+ @Test
+ void sendCompletedEmail() {
+
+ final String mailTemplate = "{\"subject\":\"example\",\"body\":\"example\"}";
+
+ final String destination = "test@test.it";
+ Product product = new Product();
+ product.setTitle("productName");
+ product.setId("prod-id");
+
+ final File file = new File(Objects.requireNonNull(getClass().getClassLoader().getResource("application.properties")).getFile());
+
+ Mockito.when(contractService.getLogoFile()).thenReturn(file);
+
+ Mockito.when(azureBlobClient.getFileAsText(templatePathConfig.registrationPath()))
+ .thenReturn(mailTemplate);
+ Mockito.doNothing().when(mailer).send(any());
+
+ notificationService.sendCompletedEmail(List.of(destination), product, InstitutionType.PA);
+
+ Mockito.verify(azureBlobClient, Mockito.times(1))
+ .getFileAsText(any());
+
+ ArgumentCaptor mailArgumentCaptor = ArgumentCaptor.forClass(Mail.class);
+ Mockito.verify(mailer, Mockito.times(1))
+ .send(mailArgumentCaptor.capture());
+ assertEquals(destination, mailArgumentCaptor.getValue().getTo().get(0));
+ }
+
+
+ @Test
+ void sendMailRegistrationApprove() {
+
+ final String mailTemplate = "{\"subject\":\"example\",\"body\":\"example\"}";
+ final String institutionName = "institutionName";
+
+ Mockito.when(azureBlobClient.getFileAsText(templatePathConfig.registrationApprovePath()))
+ .thenReturn(mailTemplate);
+ Mockito.doNothing().when(mailer).send(any());
+
+ notificationService.sendMailRegistrationApprove(institutionName, "name","username","product","token");
+
+ Mockito.verify(azureBlobClient, Mockito.times(1))
+ .getFileAsText(any());
+
+ ArgumentCaptor mailArgumentCaptor = ArgumentCaptor.forClass(Mail.class);
+ Mockito.verify(mailer, Mockito.times(1))
+ .send(mailArgumentCaptor.capture());
+ assertEquals(notificationAdminMail, mailArgumentCaptor.getValue().getTo().get(0));
+ }
+
+
+ @Test
+ void sendMailOnboardingApprove() {
+
+ final String mailTemplate = "{\"subject\":\"example\",\"body\":\"example\"}";
+ final String institutionName = "institutionName";
+
+ Mockito.when(azureBlobClient.getFileAsText(templatePathConfig.onboardingApprovePath()))
+ .thenReturn(mailTemplate);
+ Mockito.doNothing().when(mailer).send(any());
+
+ notificationService.sendMailOnboardingApprove(institutionName, "name","username","product","token");
+
+ Mockito.verify(azureBlobClient, Mockito.times(1))
+ .getFileAsText(any());
+
+ ArgumentCaptor mailArgumentCaptor = ArgumentCaptor.forClass(Mail.class);
+ Mockito.verify(mailer, Mockito.times(1))
+ .send(mailArgumentCaptor.capture());
+ assertEquals(notificationAdminMail, mailArgumentCaptor.getValue().getTo().get(0));
+ }
+
+}
diff --git a/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/OnboardingServiceTest.java b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/OnboardingServiceTest.java
new file mode 100644
index 000000000..da5264d34
--- /dev/null
+++ b/apps/onboarding-functions/src/test/java/it/pagopa/selfcare/onboarding/service/OnboardingServiceTest.java
@@ -0,0 +1,378 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import eu.europa.esig.dss.enumerations.DigestAlgorithm;
+import eu.europa.esig.dss.model.DSSDocument;
+import eu.europa.esig.dss.model.FileDocument;
+import io.quarkus.test.InjectMock;
+import io.quarkus.test.junit.QuarkusTest;
+import it.pagopa.selfcare.onboarding.common.PartyRole;
+import it.pagopa.selfcare.onboarding.entity.Institution;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+import it.pagopa.selfcare.onboarding.entity.Token;
+import it.pagopa.selfcare.onboarding.entity.User;
+import it.pagopa.selfcare.onboarding.exception.GenericOnboardingException;
+import it.pagopa.selfcare.product.entity.Product;
+import it.pagopa.selfcare.product.service.ProductService;
+import it.pagopa.selfcare.onboarding.repository.OnboardingRepository;
+import it.pagopa.selfcare.onboarding.repository.TokenRepository;
+import jakarta.inject.Inject;
+import org.bson.types.ObjectId;
+import org.eclipse.microprofile.rest.client.inject.RestClient;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+import org.openapi.quarkus.user_registry_json.api.UserApi;
+import org.openapi.quarkus.user_registry_json.model.CertifiableFieldResourceOfstring;
+import org.openapi.quarkus.user_registry_json.model.UserResource;
+
+import java.io.File;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.UUID;
+
+import static it.pagopa.selfcare.onboarding.service.OnboardingService.USERS_FIELD_LIST;
+import static it.pagopa.selfcare.onboarding.service.OnboardingService.USERS_WORKS_FIELD_LIST;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.*;
+
+@QuarkusTest
+class OnboardingServiceTest {
+
+ @InjectMock
+ OnboardingRepository onboardingRepository;
+ @InjectMock
+ TokenRepository tokenRepository;
+ @RestClient
+ @InjectMock
+ UserApi userRegistryApi;
+ @InjectMock
+ NotificationService notificationService;
+ @InjectMock
+ ContractService contractService;
+ @InjectMock
+ ProductService productService;
+
+ @Inject
+ OnboardingService onboardingService;
+
+ final String productId = "productId";
+
+ private Onboarding createOnboarding() {
+ Onboarding onboarding = new Onboarding();
+ onboarding.setId(ObjectId.get());
+ onboarding.setOnboardingId(onboarding.getId().toHexString());
+ onboarding.setProductId(productId);
+ onboarding.setUsers(List.of());
+ Institution institution = new Institution();
+ institution.setDescription("description");
+ onboarding.setInstitution(institution);
+ onboarding.setUserRequestUid("example-uid");
+ return onboarding;
+ }
+
+ private UserResource createUserResource(){
+ UserResource userResource = new UserResource();
+ userResource.setId(UUID.randomUUID());
+
+ CertifiableFieldResourceOfstring resourceOfName = new CertifiableFieldResourceOfstring();
+ resourceOfName.setCertification(CertifiableFieldResourceOfstring.CertificationEnum.NONE);
+ resourceOfName.setValue("name");
+ userResource.setName(resourceOfName);
+
+ CertifiableFieldResourceOfstring resourceOfSurname = new CertifiableFieldResourceOfstring();
+ resourceOfSurname.setCertification(CertifiableFieldResourceOfstring.CertificationEnum.NONE);
+ resourceOfSurname.setValue("surname");
+ userResource.setFamilyName(resourceOfSurname);
+ return userResource;
+ }
+
+ @Test
+ void getOnboarding() {
+ Onboarding onboarding = createOnboarding();
+ when(onboardingRepository.findByIdOptional(any())).thenReturn(Optional.of(onboarding));
+
+ Optional actual = onboardingService.getOnboarding(onboarding.getOnboardingId());
+ assertTrue(actual.isPresent());
+ assertEquals(onboarding.getOnboardingId(), actual.get().getOnboardingId());
+ }
+
+ @Test
+ void createContract_shouldThrowIfManagerNotfound() {
+ Onboarding onboarding = createOnboarding();
+ assertThrows(GenericOnboardingException.class, () -> onboardingService.createContract(onboarding));
+ }
+
+ @Test
+ void createContract() {
+
+ UserResource userResource = createUserResource();
+ UserResource delegateResource = createUserResource();
+
+ Onboarding onboarding = createOnboarding();
+ User manager = new User();
+ manager.setId(userResource.getId().toString());
+ manager.setRole(PartyRole.MANAGER);
+ User delegate = new User();
+ delegate.setId(delegateResource.getId().toString());
+ delegate.setRole(PartyRole.DELEGATE);
+ onboarding.setUsers(List.of(manager, delegate));
+
+ when(userRegistryApi.findByIdUsingGET(USERS_WORKS_FIELD_LIST,manager.getId()))
+ .thenReturn(userResource);
+
+ when(userRegistryApi.findByIdUsingGET(USERS_WORKS_FIELD_LIST,delegate.getId()))
+ .thenReturn(delegateResource);
+
+ when(productService.getProductIsValid(onboarding.getProductId()))
+ .thenReturn(new Product());
+
+ onboardingService.createContract(onboarding);
+
+ Mockito.verify(userRegistryApi, Mockito.times(1))
+ .findByIdUsingGET(USERS_WORKS_FIELD_LIST,manager.getId());
+
+ Mockito.verify(userRegistryApi, Mockito.times(1))
+ .findByIdUsingGET(USERS_WORKS_FIELD_LIST,delegate.getId());
+
+ Mockito.verify(productService, Mockito.times(1))
+ .getProductIsValid(onboarding.getProductId());
+ }
+
+ private Product createDummyProduct() {
+ Product product = new Product();
+ product.setContractTemplatePath("example");
+ product.setContractTemplateVersion("version");
+ product.setTitle("Title");
+ product.setId(productId);
+ return product;
+ }
+ @Test
+ void saveToken_shouldSkipIfTokenExists() {
+ Onboarding onboarding = createOnboarding();
+ Token token = new Token();
+ token.setId(ObjectId.get());
+
+ when(tokenRepository.findByOnboardingId(onboarding.getOnboardingId()))
+ .thenReturn(Optional.of(token));
+
+ onboardingService.saveTokenWithContract(onboarding);
+
+ Mockito.verify(tokenRepository, Mockito.times(1))
+ .findByOnboardingId(onboarding.getOnboardingId());
+ Mockito.verifyNoMoreInteractions(tokenRepository);
+ }
+
+
+ @Test
+ void saveToken() {
+ Onboarding onboarding = createOnboarding();
+ File contract = new File(Objects.requireNonNull(getClass().getClassLoader().getResource("application.properties")).getFile());
+ DSSDocument document = new FileDocument(contract);
+ String digestExpected = document.getDigest(DigestAlgorithm.SHA256);
+
+ Product productExpected = createDummyProduct();
+ when(contractService.retrieveContractNotSigned(onboarding.getOnboardingId(), productExpected.getTitle()))
+ .thenReturn(contract);
+ when(productService.getProductIsValid(onboarding.getProductId()))
+ .thenReturn(productExpected);
+
+ Mockito.doNothing().when(tokenRepository).persist(any(Token.class));
+
+ onboardingService.saveTokenWithContract(onboarding);
+
+
+ ArgumentCaptor tokenArgumentCaptor = ArgumentCaptor.forClass(Token.class);
+ Mockito.verify(tokenRepository, Mockito.times(1))
+ .persist(tokenArgumentCaptor.capture());
+ assertEquals(onboarding.getProductId(), tokenArgumentCaptor.getValue().getProductId());
+ assertEquals(digestExpected, tokenArgumentCaptor.getValue().getChecksum());
+ assertEquals(productExpected.getContractTemplatePath(), tokenArgumentCaptor.getValue().getContractTemplate());
+ assertEquals(productExpected.getContractTemplateVersion(), tokenArgumentCaptor.getValue().getContractVersion());
+ }
+
+ @Test
+ void loadContract() {
+
+ Onboarding onboarding = createOnboarding();
+ Product product = createDummyProduct();
+
+ when(productService.getProductIsValid(onboarding.getProductId()))
+ .thenReturn(product);
+
+ onboardingService.loadContract(onboarding);
+
+ Mockito.verify(productService, Mockito.times(1))
+ .getProductIsValid(onboarding.getProductId());
+ Mockito.verify(contractService, Mockito.times(1))
+ .loadContractPDF(product.getContractTemplatePath(), onboarding.getOnboardingId(), product.getTitle());
+ }
+
+
+ @Test
+ void sendMailRegistrationWithContract() {
+
+ Onboarding onboarding = createOnboarding();
+ Product product = createDummyProduct();
+ UserResource userResource = createUserResource();
+ Token token = new Token();
+ token.setId(ObjectId.get());
+
+ when(tokenRepository.findByOnboardingId(onboarding.getOnboardingId()))
+ .thenReturn(Optional.of(token));
+ when(productService.getProduct(onboarding.getProductId()))
+ .thenReturn(product);
+
+ when(userRegistryApi.findByIdUsingGET(USERS_FIELD_LIST, onboarding.getUserRequestUid()))
+ .thenReturn(userResource);
+ doNothing().when(notificationService)
+ .sendMailRegistrationWithContract(onboarding.getOnboardingId(),
+ onboarding.getInstitution().getDigitalAddress(),
+ userResource.getName().getValue(), userResource.getFamilyName().getValue(),
+ product.getTitle());
+
+ onboardingService.sendMailRegistrationWithContract(onboarding);
+
+ Mockito.verify(notificationService, times(1))
+ .sendMailRegistrationWithContract(onboarding.getOnboardingId(),
+ onboarding.getInstitution().getDigitalAddress(),
+ userResource.getName().getValue(), userResource.getFamilyName().getValue(),
+ product.getTitle());
+ }
+
+
+ @Test
+ void sendMailRegistrationWithContractWhenApprove() {
+
+ Onboarding onboarding = createOnboarding();
+ Product product = createDummyProduct();
+ UserResource userResource = createUserResource();
+ Token token = new Token();
+ token.setId(ObjectId.get());
+
+ when(tokenRepository.findByOnboardingId(onboarding.getOnboardingId()))
+ .thenReturn(Optional.of(token));
+ when(productService.getProduct(onboarding.getProductId()))
+ .thenReturn(product);
+
+ when(userRegistryApi.findByIdUsingGET(USERS_FIELD_LIST, onboarding.getUserRequestUid()))
+ .thenReturn(userResource);
+ doNothing().when(notificationService)
+ .sendMailRegistrationWithContract(onboarding.getOnboardingId(),
+ onboarding.getInstitution().getDigitalAddress(),
+ onboarding.getInstitution().getDescription(), "",
+ product.getTitle());
+
+ onboardingService.sendMailRegistrationWithContractWhenApprove(onboarding);
+
+ Mockito.verify(notificationService, times(1))
+ .sendMailRegistrationWithContract(onboarding.getOnboardingId(),
+ onboarding.getInstitution().getDigitalAddress(),
+ onboarding.getInstitution().getDescription(), "",
+ product.getTitle());
+ }
+
+
+ @Test
+ void sendMailRegistrationWithContract_throwExceptionWhenTokenIsNotPresent() {
+ Onboarding onboarding = createOnboarding();
+ when(tokenRepository.findByOnboardingId(onboarding.getOnboardingId()))
+ .thenReturn(Optional.empty());
+ assertThrows(GenericOnboardingException.class, () -> onboardingService.sendMailRegistrationWithContract(onboarding));
+ }
+
+
+ @Test
+ void sendMailRegistration() {
+
+ UserResource userResource = createUserResource();
+ Product product = createDummyProduct();
+ Onboarding onboarding = createOnboarding();
+
+ when(productService.getProduct(onboarding.getProductId()))
+ .thenReturn(product);
+ when(userRegistryApi.findByIdUsingGET(USERS_FIELD_LIST, onboarding.getUserRequestUid()))
+ .thenReturn(userResource);
+ doNothing().when(notificationService).sendMailRegistration(onboarding.getInstitution().getDescription(),
+ onboarding.getInstitution().getDigitalAddress(),
+ userResource.getName().getValue(), userResource.getFamilyName().getValue(),
+ product.getTitle());
+
+ onboardingService.sendMailRegistration(onboarding);
+
+ Mockito.verify(notificationService, times(1))
+ .sendMailRegistration(onboarding.getInstitution().getDescription(),
+ onboarding.getInstitution().getDigitalAddress(),
+ userResource.getName().getValue(), userResource.getFamilyName().getValue(),
+ product.getTitle());
+ }
+
+ @Test
+ void sendMailRegistrationApprove() {
+
+ Onboarding onboarding = createOnboarding();
+ Product product = createDummyProduct();
+ UserResource userResource = createUserResource();
+
+ when(productService.getProduct(onboarding.getProductId()))
+ .thenReturn(product);
+ when(userRegistryApi.findByIdUsingGET(USERS_FIELD_LIST, onboarding.getUserRequestUid()))
+ .thenReturn(userResource);
+
+ doNothing().when(notificationService)
+ .sendMailRegistrationApprove(any(), any(), any(),any(),any());
+
+ onboardingService.sendMailRegistrationApprove(onboarding);
+
+ Mockito.verify(notificationService, times(1))
+ .sendMailRegistrationApprove(onboarding.getInstitution().getDescription(),
+ userResource.getName().getValue(),
+ userResource.getFamilyName().getValue(),
+ product.getTitle(),
+ onboarding.getOnboardingId());
+ }
+
+
+ @Test
+ void sendMailRegistrationApprove_throwExceptionWhenTokenIsNotPresent() {
+ Onboarding onboarding = createOnboarding();
+ when(tokenRepository.findByOnboardingId(onboarding.getOnboardingId()))
+ .thenReturn(Optional.empty());
+ assertThrows(GenericOnboardingException.class, () -> onboardingService.sendMailRegistrationApprove(onboarding));
+ }
+
+
+ @Test
+ void sendMailOnboardingApprove() {
+
+ Onboarding onboarding = createOnboarding();
+ Product product = createDummyProduct();
+ UserResource userResource = createUserResource();
+
+ when(productService.getProduct(onboarding.getProductId()))
+ .thenReturn(product);
+ when(userRegistryApi.findByIdUsingGET(USERS_FIELD_LIST, onboarding.getUserRequestUid()))
+ .thenReturn(userResource);
+ doNothing().when(notificationService).sendMailOnboardingApprove(any(), any(), any(),any(),any());
+
+ onboardingService.sendMailOnboardingApprove(onboarding);
+
+
+ Mockito.verify(notificationService, times(1))
+ .sendMailOnboardingApprove(onboarding.getInstitution().getDescription(),
+ userResource.getName().getValue(),
+ userResource.getFamilyName().getValue(),
+ product.getTitle(),
+ onboarding.getOnboardingId());
+ }
+
+
+ @Test
+ void sendMailOnboardingApprove_throwExceptionWhenTokenIsNotPresent() {
+ Onboarding onboarding = createOnboarding();
+ when(tokenRepository.findByOnboardingId(onboarding.getOnboardingId()))
+ .thenReturn(Optional.empty());
+ assertThrows(GenericOnboardingException.class, () -> onboardingService.sendMailOnboardingApprove(onboarding));
+ }
+}
diff --git a/apps/onboarding-functions/src/test/resources/application.properties b/apps/onboarding-functions/src/test/resources/application.properties
new file mode 100644
index 000000000..3d05d6e62
--- /dev/null
+++ b/apps/onboarding-functions/src/test/resources/application.properties
@@ -0,0 +1,49 @@
+quarkus.azure-functions.app-name=example
+quarkus.azure-functions.subscription-id=example
+quarkus.azure-functions.resource-group=example
+quarkus.azure-functions.region=example
+quarkus.azure-functions.app-insights-key=example
+quarkus.azure-functions.app-service-plan-name=example
+
+## MAIL AND MAIL TEMPLATE ##
+onboarding-functions.sender-mail = ${MAIL_SENDER_ADDRESS:test@test.it}
+onboarding-functions.notification-admin-email = default
+
+## MAIL TEMPLATE
+onboarding-functions.mail-template.path.onboarding.complete-path = default
+onboarding-functions.mail-template.path.onboarding.complete-path-fd = default
+
+onboarding-functions.mail-template.path.onboarding.autocomplete-path = default
+onboarding-functions.mail-template.path.onboarding.delegation-notification-path = default
+onboarding-functions.mail-template.path.onboarding.registration-path = default
+
+onboarding-functions.mail-template.path.onboarding.onboarding-approve-path = default
+onboarding-functions.mail-template.path.onboarding.registration-request-path = default
+onboarding-functions.mail-template.path.onboarding.registration-approve-path = default
+
+onboarding-functions.mail-template.path.onboarding.reject-path = default
+
+## MAIL PLACEHOLDERS
+onboarding-functions.mail-template.placeholders.onboarding.user-name = requesterName
+onboarding-functions.mail-template.placeholders.onboarding.user-surname = requesterSurname
+onboarding-functions.mail-template.placeholders.onboarding.product-name = productName
+onboarding-functions.mail-template.placeholders.onboarding.institution-description = institutionName
+onboarding-functions.mail-template.placeholders.onboarding.admin-link = default
+
+onboarding-functions.mail-template.placeholders.onboarding.complete-selfcare-name = selfcareURL
+onboarding-functions.mail-template.placeholders.onboarding.complete-product-name = productName
+onboarding-functions.mail-template.placeholders.onboarding.complete-selfcare-placeholder= default
+
+onboarding-functions.mail-template.placeholders.onboarding.confirm-token-name= confirmTokenURL
+onboarding-functions.mail-template.placeholders.onboarding.confirm-token-placeholder = default
+
+onboarding-functions.mail-template.placeholders.onboarding.reject-token-placeholder = default
+onboarding-functions.mail-template.placeholders.onboarding.reject-token-name = rejectTokenURL
+
+onboarding-functions.mail-template.placeholders.onboarding.notification-product-name = productName
+onboarding-functions.mail-template.placeholders.onboarding.notification-requester-name = requesterName
+onboarding-functions.mail-template.placeholders.onboarding.notification-requester-surname = requesterSurname
+
+onboarding-functions.mail-template.placeholders.onboarding.reject-product-name=productName
+onboarding-functions.mail-template.placeholders.onboarding.reject-onboarding-url-placeholder=onboardingUrl
+onboarding-functions.mail-template.placeholders.onboarding.reject-onboarding-url-value=default
diff --git a/onboarding-ms/.gitignore b/apps/onboarding-ms/.gitignore
similarity index 100%
rename from onboarding-ms/.gitignore
rename to apps/onboarding-ms/.gitignore
diff --git a/apps/onboarding-ms/Dockerfile b/apps/onboarding-ms/Dockerfile
new file mode 100644
index 000000000..20885dfe5
--- /dev/null
+++ b/apps/onboarding-ms/Dockerfile
@@ -0,0 +1,38 @@
+# syntax=docker/dockerfile:1.6
+FROM maven:3-eclipse-temurin-17 AS builder
+
+WORKDIR /src
+COPY --link ./pom.xml .
+
+WORKDIR /src/libs
+COPY --link ./libs/ .
+
+WORKDIR /src/test-coverage
+COPY --link ./test-coverage/pom.xml .
+
+WORKDIR /src/apps
+COPY --link ./apps/pom.xml .
+
+WORKDIR /src/apps/onboarding-ms
+COPY --link ./apps/onboarding-ms/pom.xml .
+COPY ./apps/onboarding-ms/src/main/ ./src/main/
+
+WORKDIR /src
+RUN mvn --projects :onboarding-ms --also-make clean package -DskipTests
+
+FROM openjdk:17-jdk AS runtime
+
+ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
+ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
+
+WORKDIR /app
+
+COPY --from=builder /src/apps/onboarding-ms/target/quarkus-app/lib/ ./lib/
+COPY --from=builder /src/apps/onboarding-ms/target/quarkus-app/*.jar ./
+COPY --from=builder /src/apps/onboarding-ms/target/quarkus-app/app/ ./app/
+COPY --from=builder /src/apps/onboarding-ms/target/quarkus-app/quarkus/ ./quarkus/
+
+EXPOSE 8080
+USER 1001
+
+ENTRYPOINT ["sh", "-c", "java $JAVA_OPTIONS -jar /app/quarkus-run.jar"]
diff --git a/apps/onboarding-ms/README.md b/apps/onboarding-ms/README.md
new file mode 100644
index 000000000..9b5a2250d
--- /dev/null
+++ b/apps/onboarding-ms/README.md
@@ -0,0 +1,89 @@
+# Microservice Onboarding
+
+Repository that contains backend services synch for selfcare onboarding.
+
+It implements CRUD operations for the 'onboarding' object and the business logic for the onboarding phase. During the onboarding process, the following activities are executed:
+
+1. Check for the presence of users associated with the onboarding and potentially add them to the point of sale (pdv).
+2. Validate the requested product's suitability and verify eligible roles.
+3. Verify if there is an existing onboarding record for that institution and product.
+
+After the data is saved, it invokes the function implemented by onboarding-functions to trigger asynchronous onboarding activities.
+
+### Disable starting async onboarding workflow
+
+````properties
+env ONBOARDING_ORCHESTRATION_ENABLED=false.
+````
+### Allowed onboarding product with status TESTING
+
+ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS property permits onboarding for product with status TESTING. It can contain a map of entry with product as key and a list of taxcode as value.
+
+````properties
+ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS={'prod-interop': ['0123456789']}.
+````
+
+## Configuration Properties
+
+Before running you must set these properties as environment variables.
+
+
+| **Property** | **Environment Variable** | **Default** | **Required** |
+|--------------------------------------------------------|------------------------------------------|-------------|:------------:|
+| quarkus.mongodb.connection-string
| MONGODB-CONNECTION-STRING | | yes |
+| mp.jwt.verify.publickey
| JWT-PUBLIC-KEY | | yes |
+| quarkus.rest-client."**.UserApi".api-key
| USER-REGISTRY-API-KEY | | yes |
+| quarkus.rest-client."**.UserApi".url
| USER_REGISTRY_URL | | yes |
+| quarkus.rest-client."**.CoreApi".url
| MS_CORE_URL | | yes |
+| quarkus.rest-client."**.AooApi".url
| MS_PARTY_REGISTRY_URL | | yes |
+| quarkus.rest-client."**.UoApi".url
| MS_PARTY_REGISTRY_URL | | yes |
+| quarkus.rest-client."**.OrchestrationApi".url
| ONBOARDING_FUNCTIONS_URL | | yes |
+| quarkus.rest-client."**.OrchestrationApi".api-key
| ONBOARDING-FUNCTIONS-API-KEY | | yes |
+| onboarding.institutions-allowed-list
| ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS | | no |
+
+> **_NOTE:_** properties that contains secret must have the same name of its secret as uppercase.
+
+
+## Running the application in dev mode
+
+You can run your application in dev mode that enables live coding using:
+```shell script
+./mvnw compile quarkus:dev
+```
+
+For some endpoints
+
+> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8083/q/dev/.
+
+## Packaging and running the application
+
+The application can be packaged using:
+```shell script
+./mvnw package
+```
+It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
+Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
+
+The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
+
+If you want to build an _über-jar_, execute the following command:
+```shell script
+./mvnw package -Dquarkus.package.type=uber-jar
+```
+
+The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
+
+## Related Guides
+
+
+### RESTEasy Reactive
+
+Easily start your Reactive RESTful Web Services
+
+[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources)
+
+### OpenAPI Generator
+
+Rest client are generated using a quarkus' extension.
+
+[Related guide section...](hhttps://github.com/quarkiverse/quarkus-openapi-generator)
diff --git a/onboarding-ms/pom.xml b/apps/onboarding-ms/pom.xml
similarity index 57%
rename from onboarding-ms/pom.xml
rename to apps/onboarding-ms/pom.xml
index b99420703..2c42b13cb 100644
--- a/onboarding-ms/pom.xml
+++ b/apps/onboarding-ms/pom.xml
@@ -4,10 +4,10 @@
4.0.0
it.pagopa.selfcare
- onboarding
+ onboarding-apps
0.0.1
- it.pagopa.selfcare
+
onboarding-ms
1.0.0-SNAPSHOT
@@ -19,9 +19,11 @@
UTF-8
quarkus-bom
io.quarkus.platform
- 3.3.2
+ 3.5.2
true
3.1.2
+ 0.1.3
+ 2.2.13
@@ -46,7 +48,7 @@
io.quarkiverse.openapi.generator
quarkus-openapi-generator
- 2.2.10
+ ${quarkus-openapi-generator.version}
io.quarkus
@@ -85,6 +87,10 @@
io.quarkus
quarkus-rest-client-reactive-jackson
+
+ io.quarkus
+ quarkus-smallrye-health
+
org.mapstruct
mapstruct
@@ -103,16 +109,136 @@
io.quarkus
quarkus-smallrye-openapi
+
+ io.quarkus
+ quarkus-mongodb-panache
+
io.quarkus
- quarkus-mongodb-client
+ quarkus-smallrye-context-propagation
+
+ io.quarkus
+ quarkus-panache-mock
+ test
+
+
+ io.quarkus
+ quarkus-test-hibernate-reactive-panache
+ test
+
io.quarkus
quarkus-jacoco
test
+
+ io.quarkus
+ quarkus-test-security-jwt
+ test
+
+
+ it.pagopa.selfcare
+ onboarding-sdk-common
+ ${onboarding-sdk.version}
+
+
+
+ it.pagopa.selfcare
+ onboarding-sdk-azure-storage
+ ${onboarding-sdk.version}
+
+
+ it.pagopa.selfcare
+ onboarding-sdk-product
+ ${onboarding-sdk.version}
+
+
+
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-test
+ 5.12.1
+ test
+
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-utils
+ 5.12.1
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-model
+ 5.12.1
+ compile
+
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-service
+ 5.12.1
+
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-tsl-validation
+ 5.12.1
+
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-utils-google-guava
+ 5.12.1
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-pades
+ 5.12.1
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-pades-pdfbox
+ 5.12.1
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-cades
+ 5.12.1
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-utils-apache-commons
+ 5.12.1
+
+
+ eu.europa.ec.joinup.sd-dss
+ dss-crl-parser-stream
+ 5.12.1
+
+
+
+
+ javax.xml.bind
+ jaxb-api
+ 2.3.1
+
+
+
+ jakarta.activation
+ jakarta.activation-api
+ 2.1.0
+
+
+ com.sun.xml.bind
+ jaxb-impl
+ 2.3.4
+
+
+
+
@@ -154,19 +280,14 @@
lombok-mapstruct-binding
0.2.0
+
+ io.quarkus
+ quarkus-panache-common
+ ${quarkus.platform.version}
+
-
- maven-surefire-plugin
- ${surefire-plugin.version}
-
-
- org.jboss.logmanager.LogManager
- ${maven.home}
-
-
-
maven-failsafe-plugin
${surefire-plugin.version}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/client/auth/AuthenticationPropagationHeadersFactory.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/client/auth/AuthenticationPropagationHeadersFactory.java
new file mode 100644
index 000000000..f4cdbc908
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/client/auth/AuthenticationPropagationHeadersFactory.java
@@ -0,0 +1,22 @@
+package it.pagopa.selfcare.onboarding.client.auth;
+
+import jakarta.ws.rs.core.MultivaluedMap;
+import org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory;
+
+import java.util.List;
+
+public class AuthenticationPropagationHeadersFactory implements ClientHeadersFactory {
+
+ @Override
+ public MultivaluedMap update(MultivaluedMap incomingHeaders, MultivaluedMap clientOutgoingHeaders) {
+ if(incomingHeaders.containsKey("Authorization")) {
+ List headerValue = incomingHeaders.get("Authorization");
+
+ if (headerValue != null) {
+ clientOutgoingHeaders.put("Authorization", headerValue);
+ }
+
+ };
+ return clientOutgoingHeaders;
+ }
+}
\ No newline at end of file
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/conf/JacksonConfiguration.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/JacksonConfiguration.java
similarity index 91%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/conf/JacksonConfiguration.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/JacksonConfiguration.java
index 9f6aef669..471ed0d2d 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/conf/JacksonConfiguration.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/JacksonConfiguration.java
@@ -1,11 +1,10 @@
-package it.pagopa.selfcare.conf;
+package it.pagopa.selfcare.onboarding.conf;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.databind.cfg.ConstructorDetector;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/OnboardingMsConfig.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/OnboardingMsConfig.java
new file mode 100644
index 000000000..f72c849eb
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/OnboardingMsConfig.java
@@ -0,0 +1,42 @@
+package it.pagopa.selfcare.onboarding.conf;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import it.pagopa.selfcare.azurestorage.AzureBlobClient;
+import it.pagopa.selfcare.azurestorage.AzureBlobClientDefault;
+import it.pagopa.selfcare.product.service.ProductService;
+import it.pagopa.selfcare.product.service.ProductServiceDefault;
+import jakarta.enterprise.context.ApplicationScoped;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@ApplicationScoped
+public class OnboardingMsConfig {
+
+ @ConfigProperty(name = "onboarding-ms.blob-storage.container-product")
+ String containerProduct;
+
+ @ConfigProperty(name = "onboarding-ms.blob-storage.filepath-product")
+ String filepathProduct;
+
+ @ConfigProperty(name = "onboarding-ms.blob-storage.connection-string-product")
+ String connectionStringProduct;
+
+ @ApplicationScoped
+ public ProductService productService(ObjectMapper objectMapper){
+ AzureBlobClient azureBlobClient = new AzureBlobClientDefault(connectionStringProduct, containerProduct);
+ String productJsonString = azureBlobClient.getFileAsText(filepathProduct);
+ try {
+ return new ProductServiceDefault(productJsonString, objectMapper);
+ } catch (JsonProcessingException e) {
+ throw new IllegalArgumentException("Found an issue when trying to serialize product json string!!");
+ }
+ }
+
+ @ApplicationScoped
+ public AzureBlobClient azureBobClientContract(@ConfigProperty(name = "onboarding-ms.blob-storage.connection-string-contracts")
+ String connectionStringContracts,
+ @ConfigProperty(name = "onboarding-ms.blob-storage.container-contracts")
+ String containerContracts){
+ return new AzureBlobClientDefault(connectionStringContracts, containerContracts);
+ }
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/TrustedListsCertificateSourceConfig.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/TrustedListsCertificateSourceConfig.java
new file mode 100644
index 000000000..d1e484fb7
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/conf/TrustedListsCertificateSourceConfig.java
@@ -0,0 +1,163 @@
+package it.pagopa.selfcare.onboarding.conf;
+
+import eu.europa.esig.dss.service.http.commons.CommonsDataLoader;
+import eu.europa.esig.dss.service.http.commons.FileCacheDataLoader;
+import eu.europa.esig.dss.spi.client.http.DSSFileLoader;
+import eu.europa.esig.dss.spi.client.http.IgnoreDataLoader;
+import eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource;
+import eu.europa.esig.dss.spi.x509.CommonCertificateSource;
+import eu.europa.esig.dss.tsl.alerts.LOTLAlert;
+import eu.europa.esig.dss.tsl.alerts.TLAlert;
+import eu.europa.esig.dss.tsl.alerts.detections.LOTLLocationChangeDetection;
+import eu.europa.esig.dss.tsl.alerts.detections.OJUrlChangeDetection;
+import eu.europa.esig.dss.tsl.alerts.detections.TLExpirationDetection;
+import eu.europa.esig.dss.tsl.alerts.detections.TLSignatureErrorDetection;
+import eu.europa.esig.dss.tsl.alerts.handlers.log.LogLOTLLocationChangeAlertHandler;
+import eu.europa.esig.dss.tsl.alerts.handlers.log.LogOJUrlChangeAlertHandler;
+import eu.europa.esig.dss.tsl.alerts.handlers.log.LogTLExpirationAlertHandler;
+import eu.europa.esig.dss.tsl.alerts.handlers.log.LogTLSignatureErrorAlertHandler;
+import eu.europa.esig.dss.tsl.cache.CacheCleaner;
+import eu.europa.esig.dss.tsl.function.OfficialJournalSchemeInformationURI;
+import eu.europa.esig.dss.tsl.job.TLValidationJob;
+import eu.europa.esig.dss.tsl.source.LOTLSource;
+import eu.europa.esig.dss.tsl.sync.AcceptAllStrategy;
+import io.quarkus.arc.profile.IfBuildProfile;
+import io.quarkus.arc.profile.UnlessBuildProfile;
+import io.quarkus.runtime.Startup;
+import io.smallrye.mutiny.Uni;
+import jakarta.enterprise.context.ApplicationScoped;
+import lombok.extern.slf4j.Slf4j;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+import java.io.File;
+import java.util.List;
+import java.util.concurrent.Executors;
+
+@Slf4j
+@Startup
+@ApplicationScoped
+public class TrustedListsCertificateSourceConfig {
+
+ @ConfigProperty(name = "onboarding-ms.signature.eu-list-of-trusted-lists-url")
+ String euListOfTrustedListsURL;
+ @ConfigProperty(name = "onboarding-ms.signature.eu-official-journal-url")
+ String euOfficialJournalUrl;
+
+ @Startup
+ @ApplicationScoped
+ @UnlessBuildProfile("test")
+ public TrustedListsCertificateSource generateTrustedListsCertificateSource() {
+
+ TrustedListsCertificateSource trustedListsCertificateSource = new TrustedListsCertificateSource();
+ LOTLSource europeanLOTL = getEuropeanLOTL();
+ TLValidationJob validationJob = getJob(europeanLOTL);
+ validationJob.setTrustedListCertificateSource(trustedListsCertificateSource);
+
+ /* It is an async execution, it avoid waiting 60s for the onlineRefresh to complete */
+ Uni.createFrom().item(validationJob)
+ .onItem().invoke(TLValidationJob::onlineRefresh)
+ .runSubscriptionOn(Executors.newSingleThreadExecutor())
+ .subscribe().with(
+ result -> log.info("TrustedListsCertificateSource online refresh success!!"),
+ failure -> log.error("Error on TrustedListsCertificateSource online refresh, message:" + failure.getMessage())
+ );
+
+ return trustedListsCertificateSource;
+ }
+
+ /* It is used for unit test, it does not perform onlineRefresh */
+ @ApplicationScoped
+ @IfBuildProfile("test")
+ public TrustedListsCertificateSource generateTrustedListsCertificateSourceTest() {
+
+ TrustedListsCertificateSource trustedListsCertificateSource = new TrustedListsCertificateSource();
+ LOTLSource europeanLOTL = getEuropeanLOTL();
+ TLValidationJob validationJob = getJob(europeanLOTL);
+ validationJob.setTrustedListCertificateSource(trustedListsCertificateSource);
+ return trustedListsCertificateSource;
+ }
+
+ private LOTLSource getEuropeanLOTL() {
+ LOTLSource lotlSource = new LOTLSource();
+ lotlSource.setUrl(euListOfTrustedListsURL);
+ lotlSource.setCertificateSource(new CommonCertificateSource());
+ lotlSource.setSigningCertificatesAnnouncementPredicate(
+ new OfficialJournalSchemeInformationURI(euOfficialJournalUrl)
+ );
+ lotlSource.setPivotSupport(true);
+ return lotlSource;
+ }
+
+ private DSSFileLoader offlineLoader() {
+ FileCacheDataLoader offlineFileLoader = new FileCacheDataLoader();
+ offlineFileLoader.setCacheExpirationTime(Long.MAX_VALUE);
+ offlineFileLoader.setDataLoader(new IgnoreDataLoader());
+ offlineFileLoader.setFileCacheDirectory(tlCacheDirectory());
+ return offlineFileLoader;
+ }
+
+ private DSSFileLoader onlineLoader() {
+ FileCacheDataLoader onlineFileLoader = new FileCacheDataLoader();
+ onlineFileLoader.setCacheExpirationTime(0);
+ onlineFileLoader.setDataLoader(new CommonsDataLoader());
+ onlineFileLoader.setFileCacheDirectory(tlCacheDirectory());
+ return onlineFileLoader;
+ }
+
+ private CacheCleaner cacheCleaner() {
+ CacheCleaner cacheCleaner = new CacheCleaner();
+ cacheCleaner.setCleanMemory(true);
+ cacheCleaner.setCleanFileSystem(true);
+ cacheCleaner.setDSSFileLoader(offlineLoader());
+ return cacheCleaner;
+ }
+
+ private File tlCacheDirectory() {
+ File rootFolder = new File(System.getProperty("java.io.tmpdir"));
+ File tslCache = new File(rootFolder, "dss-tsl-loader");
+ if (tslCache.mkdirs()) {
+ log.debug("TL Cache folder : {}", tslCache.getAbsolutePath());
+ }
+ return tslCache;
+ }
+
+ private TLAlert tlSigningAlert() {
+ TLSignatureErrorDetection signingDetection = new TLSignatureErrorDetection();
+ LogTLSignatureErrorAlertHandler handler = new LogTLSignatureErrorAlertHandler();
+ return new TLAlert(signingDetection, handler);
+ }
+
+ private TLAlert tlExpirationDetection() {
+ var expirationDetection = new TLExpirationDetection();
+ var handler = new LogTLExpirationAlertHandler();
+ return new TLAlert(expirationDetection, handler);
+ }
+
+ private LOTLAlert ojUrlAlert(LOTLSource source) {
+ var ojUrlDetection = new OJUrlChangeDetection(source);
+ var handler = new LogOJUrlChangeAlertHandler();
+ return new LOTLAlert(ojUrlDetection, handler);
+ }
+
+ private LOTLAlert lotlLocationAlert(LOTLSource source) {
+ var lotlLocationDetection = new LOTLLocationChangeDetection(source);
+ var handler = new LogLOTLLocationChangeAlertHandler();
+ return new LOTLAlert(lotlLocationDetection, handler);
+ }
+
+ private TLValidationJob getJob(LOTLSource lotl) {
+ TLValidationJob job = new TLValidationJob();
+
+ job.setOfflineDataLoader(offlineLoader());
+ job.setOnlineDataLoader(onlineLoader());
+ job.setSynchronizationStrategy(new AcceptAllStrategy());
+ job.setCacheCleaner(cacheCleaner());
+
+ job.setListOfTrustedListSources(lotl);
+
+ job.setLOTLAlerts(List.of(ojUrlAlert(lotl), lotlLocationAlert(lotl)));
+ job.setTLAlerts(List.of(tlSigningAlert(), tlExpirationDetection()));
+
+ return job;
+ }
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/constants/CustomError.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/constants/CustomError.java
similarity index 66%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/constants/CustomError.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/constants/CustomError.java
index 322eedd36..649f271ee 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/constants/CustomError.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/constants/CustomError.java
@@ -1,8 +1,12 @@
-package it.pagopa.selfcare.constants;
+package it.pagopa.selfcare.onboarding.constants;
public enum CustomError {
- ROLES_NOT_ADMITTED_ERROR("0034","Roles %s are not admitted for this operation");
+ DEFAULT_ERROR("0000", ""),
+
+ ROLES_NOT_ADMITTED_ERROR("0034","Roles %s are not admitted for this operation"),
+ AOO_NOT_FOUND("0000","AOO %s not found"),
+ UO_NOT_FOUND("0000","UO %s not found");
private final String code;
private final String detail;
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/OnboardingController.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/OnboardingController.java
new file mode 100644
index 000000000..ad15324ac
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/OnboardingController.java
@@ -0,0 +1,169 @@
+package it.pagopa.selfcare.onboarding.controller;
+
+import io.quarkus.security.Authenticated;
+import io.quarkus.security.identity.CurrentIdentityAssociation;
+import io.smallrye.jwt.auth.principal.DefaultJWTCallerPrincipal;
+import io.smallrye.mutiny.Uni;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingDefaultRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingPaRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingPspRequest;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingGet;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingGetResponse;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingResponse;
+import it.pagopa.selfcare.onboarding.service.OnboardingService;
+import jakarta.inject.Inject;
+import jakarta.validation.Valid;
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.SecurityContext;
+import lombok.AllArgsConstructor;
+import org.apache.http.HttpStatus;
+import org.eclipse.microprofile.openapi.annotations.Operation;
+import org.jboss.resteasy.reactive.RestForm;
+
+import java.io.File;
+
+@Authenticated
+@Path("/v1/onboarding")
+@AllArgsConstructor
+public class OnboardingController {
+
+ @Inject
+ CurrentIdentityAssociation currentIdentityAssociation;
+
+ private final OnboardingService onboardingService;
+
+ @Operation(summary = "Perform default onboarding request, it is used for GSP/SA/AS institution type." +
+ "Users data will be saved on personal data vault if it doesn't already exist." +
+ "At the end, function triggers async activities related to onboarding based on institution type.")
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public Uni onboarding(@Valid OnboardingDefaultRequest onboardingRequest, @Context SecurityContext ctx) {
+ return readUserIdFromToken(ctx)
+ .onItem().invoke(onboardingRequest::setUserRequestUid)
+ .onItem().transformToUni(ignore -> onboardingService.onboarding(onboardingRequest));
+ }
+
+
+ @Operation(summary = "Perform onboarding request for PA institution type, it require billing.recipientCode in additition to default request" +
+ "Users data will be saved on personal data vault if it doesn't already exist." +
+ "At the end, function triggers async activities related to onboarding that consist of create contract and sending mail to institution's digital address.")
+ @POST
+ @Path("/pa")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public Uni onboardingPa(@Valid OnboardingPaRequest onboardingRequest, @Context SecurityContext ctx) {
+ return readUserIdFromToken(ctx)
+ .onItem().invoke(onboardingRequest::setUserRequestUid)
+ .onItem().transformToUni(ignore -> onboardingService.onboardingPa(onboardingRequest));
+ }
+
+ @Operation(summary = "Perform onboarding request for PSP institution type." +
+ "Users data will be saved on personal data vault if it doesn't already exist." +
+ "At the end, function triggers async activities related to onboarding that consist of sending mail to Selfcare admin for approve request.")
+ @POST
+ @Path("/psp")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public Uni onboardingPsp(@Valid OnboardingPspRequest onboardingRequest, @Context SecurityContext ctx) {
+ return readUserIdFromToken(ctx)
+ .onItem().invoke(onboardingRequest::setUserRequestUid)
+ .onItem().transformToUni(ignore -> onboardingService.onboardingPsp(onboardingRequest));
+ }
+
+ /**
+ * Onboarding pg may be excluded from the async onboarding flow
+ * Institutions may be saved without passing from onboarding
+ *
+ @POST
+ @Path("/pg")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public Uni onboardingPg(@Valid OnboardingPgRequest onboardingRequest) {
+ return onboardingService.onboarding(onboardingMapper.toEntity(onboardingRequest))
+ .map(onboardingMapper::toResponse);
+ }*/
+
+
+ private Uni readUserIdFromToken(SecurityContext ctx) {
+
+ return currentIdentityAssociation.getDeferredIdentity()
+ .onItem().transformToUni(identity -> {
+ if (ctx.getUserPrincipal() == null || !ctx.getUserPrincipal().getName().equals(identity.getPrincipal().getName())) {
+ return Uni.createFrom().failure(new InternalServerErrorException("Principal and JsonWebToken names do not match"));
+ }
+
+ if(identity.getPrincipal() instanceof DefaultJWTCallerPrincipal jwtCallerPrincipal) {
+ String uid = jwtCallerPrincipal.getClaim("uid");
+ return Uni.createFrom().item(uid);
+ }
+
+ return Uni.createFrom().nullItem();
+ });
+ }
+
+
+ @Operation(summary = "Perform complete operation of an onboarding request receiving onboarding id and contract signed by hte institution." +
+ "It checks the contract's signature and upload the contract on an azure storage" +
+ "At the end, function triggers async activities related to complete onboarding " +
+ "that consist of create the institution, activate the onboarding and sending data to notification queue.")
+
+ @PUT
+ @Path("/{onboardingId}/complete")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ public Uni complete(@PathParam(value = "onboardingId") String onboardingId, @RestForm("contract") File file) {
+ return onboardingService.complete(onboardingId, file)
+ .map(ignore -> Response
+ .status(HttpStatus.SC_NO_CONTENT)
+ .build());
+ }
+
+ @Operation(summary = "The API retrieves paged onboarding using optional filter, order by descending creation date")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public Uni getOnboardingWithFilter(@QueryParam(value = "productId") String productId,
+ @QueryParam(value = "taxCode") String taxCode,
+ @QueryParam(value = "from") String from,
+ @QueryParam(value = "to") String to,
+ @QueryParam(value = "status") String status,
+ @QueryParam(value = "page") @DefaultValue("0") Integer page,
+ @QueryParam(value = "size") @DefaultValue("20") Integer size) {
+ return onboardingService.onboardingGet(productId, taxCode, status, from, to, page, size);
+ }
+
+ @PUT
+ @Path("/{onboardingId}/delete")
+ public Uni delete(@PathParam(value = "onboardingId") String onboardingId) {
+ return onboardingService.deleteOnboarding(onboardingId)
+ .map(ignore -> Response
+ .status(HttpStatus.SC_NO_CONTENT)
+ .build());
+ }
+
+ @Operation(summary = "Retrieve an onboarding record given its ID")
+ @GET
+ @Path("/{onboardingId}")
+ public Uni getById(@PathParam(value = "onboardingId") String onboardingId) {
+ return onboardingService.onboardingGet(onboardingId);
+ }
+
+ @Operation(summary = "Retrieve an onboarding record given its ID adding to user sensitive information")
+ @GET
+ @Path("/{onboardingId}/withUserInfo")
+ public Uni getByIdWithUserInfo(@PathParam(value = "onboardingId") String onboardingId) {
+ return onboardingService.onboardingGetWithUserInfo(onboardingId);
+ }
+ @Operation(summary = "Returns an onboarding record by its ID only if its status is PENDING. " +
+ "This feature is crucial for ensuring that the onboarding process can be completed only when " +
+ "the onboarding status is appropriately set to PENDING.")
+ @GET
+ @Path("/{onboardingId}/pending")
+ public Uni getOnboardingPending(@PathParam(value = "onboardingId") String onboardingId) {
+ return onboardingService.onboardingPending(onboardingId);
+ }
+
+
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/BillingRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingPaRequest.java
similarity index 75%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/BillingRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingPaRequest.java
index d0961c970..1cd1ba060 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/BillingRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingPaRequest.java
@@ -1,10 +1,10 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
@Data
-public class BillingRequest {
+public class BillingPaRequest {
@NotEmpty(message = "vatNumber is required")
private String vatNumber;
@NotEmpty(message = "recipientCode is required")
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingRequest.java
new file mode 100644
index 000000000..7b4713d5c
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingRequest.java
@@ -0,0 +1,12 @@
+package it.pagopa.selfcare.onboarding.controller.request;
+
+import jakarta.validation.constraints.NotEmpty;
+import lombok.Data;
+
+@Data
+public class BillingRequest {
+ @NotEmpty(message = "vatNumber is required")
+ private String vatNumber;
+ private String recipientCode;
+ private boolean publicServices;
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingSaRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingSaRequest.java
new file mode 100644
index 000000000..4ab9bf4c2
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/BillingSaRequest.java
@@ -0,0 +1,12 @@
+package it.pagopa.selfcare.onboarding.controller.request;
+
+import jakarta.validation.constraints.NotEmpty;
+import lombok.Data;
+
+@Data
+public class BillingSaRequest {
+ @NotEmpty(message = "vatNumber is required")
+ private String vatNumber;
+ private String recipientCode;
+ private boolean publicServices;
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/ContractRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/ContractRequest.java
similarity index 78%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/ContractRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/ContractRequest.java
index 3269a577a..9e978de47 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/ContractRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/ContractRequest.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/DataProtectionOfficerRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/DataProtectionOfficerRequest.java
similarity index 72%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/DataProtectionOfficerRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/DataProtectionOfficerRequest.java
index cdf089f9a..f66634cb8 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/DataProtectionOfficerRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/DataProtectionOfficerRequest.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import lombok.Data;
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/GeographicTaxonomyDto.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/GeographicTaxonomyDto.java
new file mode 100644
index 000000000..2af54c7fc
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/GeographicTaxonomyDto.java
@@ -0,0 +1,9 @@
+package it.pagopa.selfcare.onboarding.controller.request;
+
+import lombok.Data;
+
+@Data
+public class GeographicTaxonomyDto {
+ private String code;
+ private String desc;
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/InstitutionBaseRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/InstitutionBaseRequest.java
similarity index 63%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/InstitutionBaseRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/InstitutionBaseRequest.java
index 0335c5593..964d7bf3f 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/InstitutionBaseRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/InstitutionBaseRequest.java
@@ -1,7 +1,8 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
-import it.pagopa.selfcare.util.InstitutionPaSubunitType;
-import it.pagopa.selfcare.util.InstitutionType;
+import it.pagopa.selfcare.onboarding.common.InstitutionType;
+import it.pagopa.selfcare.onboarding.common.Origin;
+import it.pagopa.selfcare.onboarding.util.InstitutionPaSubunitType;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@@ -17,13 +18,17 @@ public class InstitutionBaseRequest {
private String taxCode;
private String subunitCode;
private InstitutionPaSubunitType subunitType;
-
+ private Origin origin;
+ private String city;
+ private String country;
+ private String county;
private String description;
+ @NotEmpty(message = "digitalAddress is required")
private String digitalAddress;
private String address;
private String zipCode;
- private List geographicTaxonomyCodes;
+ private List geographicTaxonomies;
private String rea;
private String shareCapital;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/InstitutionPspRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/InstitutionPspRequest.java
similarity index 89%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/InstitutionPspRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/InstitutionPspRequest.java
index f89823ca9..00800bb0d 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/InstitutionPspRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/InstitutionPspRequest.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingBaseRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingBaseRequest.java
similarity index 83%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingBaseRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingBaseRequest.java
index 1010b94f6..ecda47165 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingBaseRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingBaseRequest.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
@@ -20,5 +20,6 @@ public class OnboardingBaseRequest {
private OnboardingImportContract contractImported;
private Boolean signContract;
+ private String userRequestUid;
}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingDefaultRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingDefaultRequest.java
similarity index 77%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingDefaultRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingDefaultRequest.java
index aa5a5d201..c421202ca 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingDefaultRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingDefaultRequest.java
@@ -1,11 +1,10 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import java.util.List;
@EqualsAndHashCode(callSuper = true)
@Data
@@ -14,6 +13,8 @@ public class OnboardingDefaultRequest extends OnboardingBaseRequest {
@NotNull(message = "institutionData is required")
@Valid
private InstitutionBaseRequest institution;
+ @NotNull(message = "billing is required")
+ @Valid
private BillingRequest billing;
}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingImportContract.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingImportContract.java
similarity index 80%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingImportContract.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingImportContract.java
index e90be3668..cab71cde4 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingImportContract.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingImportContract.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import lombok.Data;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPaRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPaRequest.java
similarity index 72%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPaRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPaRequest.java
index c4b909ea6..afd614335 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPaRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPaRequest.java
@@ -1,13 +1,10 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import java.util.List;
-
@EqualsAndHashCode(callSuper = true)
@Data
public class OnboardingPaRequest extends OnboardingBaseRequest {
@@ -18,6 +15,6 @@ public class OnboardingPaRequest extends OnboardingBaseRequest {
@NotNull(message = "billing is required")
@Valid
- private BillingRequest billing;
+ private BillingPaRequest billing;
}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPgRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPgRequest.java
similarity index 91%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPgRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPgRequest.java
index 9e4f9b94b..55e61e3dd 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPgRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPgRequest.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPspRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPspRequest.java
similarity index 87%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPspRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPspRequest.java
index d7023c0cb..c6577b73e 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/OnboardingPspRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingPspRequest.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingSaRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingSaRequest.java
new file mode 100644
index 000000000..4e120673d
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/OnboardingSaRequest.java
@@ -0,0 +1,20 @@
+package it.pagopa.selfcare.onboarding.controller.request;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class OnboardingSaRequest extends OnboardingBaseRequest {
+
+ @NotNull(message = "institutionData is required")
+ @Valid
+ private InstitutionBaseRequest institution;
+ @NotNull(message = "billing is required")
+ @Valid
+ private BillingSaRequest billing;
+
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/PaymentServiceProviderRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/PaymentServiceProviderRequest.java
similarity index 81%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/PaymentServiceProviderRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/PaymentServiceProviderRequest.java
index 89a0b89f0..bdfc788a4 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/PaymentServiceProviderRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/PaymentServiceProviderRequest.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import lombok.Data;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/ProductInfo.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/ProductInfo.java
similarity index 82%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/ProductInfo.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/ProductInfo.java
index 2b74bb6ea..83a826394 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/ProductInfo.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/ProductInfo.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/SupportContact.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/SupportContact.java
similarity index 80%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/SupportContact.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/SupportContact.java
index 2142da125..5e358efbf 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/SupportContact.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/SupportContact.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import lombok.AllArgsConstructor;
import lombok.Data;
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/UserRequest.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/UserRequest.java
similarity index 54%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/UserRequest.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/UserRequest.java
index 104cde93c..cefa5730a 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/request/UserRequest.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/request/UserRequest.java
@@ -1,9 +1,8 @@
-package it.pagopa.selfcare.controller.request;
+package it.pagopa.selfcare.onboarding.controller.request;
import com.fasterxml.jackson.annotation.JsonInclude;
-import it.pagopa.selfcare.commons.base.security.PartyRole;
+import it.pagopa.selfcare.onboarding.common.PartyRole;
import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -18,18 +17,12 @@
@NoArgsConstructor
public class UserRequest {
- @NotEmpty(message = "User internal id is required")
- private String id;
private String taxCode;
private String name;
private String surname;
private String email;
private PartyRole role;
- /*private String productRole;
- private Env env = Env.ROOT;
- private String roleLabel;*/
+ private String productRole;
+ //private Env env = Env.ROOT;
- public UserRequest(String id) {
- this.id = id;
- }
}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/BillingResponse.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/BillingResponse.java
similarity index 62%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/BillingResponse.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/BillingResponse.java
index 00b303c14..a97f75dd5 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/BillingResponse.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/BillingResponse.java
@@ -1,6 +1,5 @@
-package it.pagopa.selfcare.controller.response;
+package it.pagopa.selfcare.onboarding.controller.response;
-import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
@Data
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/ContractRequestResponse.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/ContractRequestResponse.java
new file mode 100644
index 000000000..43e2198c6
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/ContractRequestResponse.java
@@ -0,0 +1,9 @@
+package it.pagopa.selfcare.onboarding.controller.response;
+
+import lombok.Data;
+
+@Data
+public class ContractRequestResponse {
+ private String version;
+ private String path;
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/InstitutionResponse.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/InstitutionResponse.java
similarity index 50%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/InstitutionResponse.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/InstitutionResponse.java
index 9bbb72059..16469e95a 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/InstitutionResponse.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/InstitutionResponse.java
@@ -1,9 +1,11 @@
-package it.pagopa.selfcare.controller.response;
-
-import it.pagopa.selfcare.controller.request.DataProtectionOfficerRequest;
-import it.pagopa.selfcare.controller.request.PaymentServiceProviderRequest;
-import it.pagopa.selfcare.util.InstitutionPaSubunitType;
-import it.pagopa.selfcare.util.InstitutionType;
+package it.pagopa.selfcare.onboarding.controller.response;
+
+import it.pagopa.selfcare.onboarding.common.InstitutionType;
+import it.pagopa.selfcare.onboarding.common.Origin;
+import it.pagopa.selfcare.onboarding.controller.request.DataProtectionOfficerRequest;
+import it.pagopa.selfcare.onboarding.controller.request.GeographicTaxonomyDto;
+import it.pagopa.selfcare.onboarding.controller.request.PaymentServiceProviderRequest;
+import it.pagopa.selfcare.onboarding.util.InstitutionPaSubunitType;
import lombok.Data;
import java.util.List;
@@ -16,13 +18,16 @@ public class InstitutionResponse {
private String taxCode;
private String subunitCode;
private InstitutionPaSubunitType subunitType;
-
+ private Origin origin;
+ private String city;
+ private String country;
+ private String county;
private String description;
private String digitalAddress;
private String address;
private String zipCode;
- private List geographicTaxonomyCodes;
+ private List geographicTaxonomies;
private String rea;
private String shareCapital;
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingGet.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingGet.java
new file mode 100644
index 000000000..6007b8c37
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingGet.java
@@ -0,0 +1,20 @@
+package it.pagopa.selfcare.onboarding.controller.response;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class OnboardingGet {
+ private String id;
+ private String productId;
+ private String workflowType;
+ private InstitutionResponse institution;
+ private List users;
+ private String pricingPlan;
+ private BillingResponse billing;
+ private Boolean signContract;
+
+ private String status;
+ private String userRequestUid;
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingGetResponse.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingGetResponse.java
new file mode 100644
index 000000000..eaa6ab4bb
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingGetResponse.java
@@ -0,0 +1,11 @@
+package it.pagopa.selfcare.onboarding.controller.response;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class OnboardingGetResponse {
+ Long count;
+ List items;
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingImportContractResponse.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingImportContractResponse.java
new file mode 100644
index 000000000..9606310d5
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingImportContractResponse.java
@@ -0,0 +1,13 @@
+package it.pagopa.selfcare.onboarding.controller.response;
+
+import lombok.Data;
+
+import java.time.OffsetDateTime;
+
+@Data
+public class OnboardingImportContractResponse {
+ private String fileName;
+ private String filePath;
+ private String contractType;
+ private OffsetDateTime createdAt;
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/OnboardingResponse.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingResponse.java
similarity index 74%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/OnboardingResponse.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingResponse.java
index 2521ac539..5c175c926 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/OnboardingResponse.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/OnboardingResponse.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.controller.response;
+package it.pagopa.selfcare.onboarding.controller.response;
import lombok.Data;
@@ -8,10 +8,10 @@
public class OnboardingResponse {
private InstitutionResponse institution;
-
private String productId;
private String pricingPlan;
private List users;
private BillingResponse billing;
+ private String userRequestUid;
}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/UserResponse.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/UserResponse.java
similarity index 65%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/UserResponse.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/UserResponse.java
index da68f1773..417d4dc76 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/controller/response/UserResponse.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/controller/response/UserResponse.java
@@ -1,6 +1,6 @@
-package it.pagopa.selfcare.controller.response;
+package it.pagopa.selfcare.onboarding.controller.response;
-import it.pagopa.selfcare.commons.base.security.PartyRole;
+import it.pagopa.selfcare.onboarding.common.PartyRole;
import lombok.Data;
@Data
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/Billing.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Billing.java
similarity index 64%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/entity/Billing.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Billing.java
index faf1244d5..afd113eaf 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/Billing.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Billing.java
@@ -1,6 +1,5 @@
-package it.pagopa.selfcare.entity;
+package it.pagopa.selfcare.onboarding.entity;
-import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
@Data
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/DataProtectionOfficer.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/DataProtectionOfficer.java
similarity index 75%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/entity/DataProtectionOfficer.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/DataProtectionOfficer.java
index 9f59a4e66..eba4c0e1e 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/DataProtectionOfficer.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/DataProtectionOfficer.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.entity;
+package it.pagopa.selfcare.onboarding.entity;
import lombok.Data;
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/GeographicTaxonomy.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/GeographicTaxonomy.java
new file mode 100644
index 000000000..e34c9bae8
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/GeographicTaxonomy.java
@@ -0,0 +1,9 @@
+package it.pagopa.selfcare.onboarding.entity;
+
+import lombok.Data;
+
+@Data
+public class GeographicTaxonomy {
+ private String code;
+ private String desc;
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/Institution.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Institution.java
similarity index 61%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/entity/Institution.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Institution.java
index 45156e00a..ed9b11f2e 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/Institution.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Institution.java
@@ -1,7 +1,8 @@
-package it.pagopa.selfcare.entity;
+package it.pagopa.selfcare.onboarding.entity;
-import it.pagopa.selfcare.util.InstitutionPaSubunitType;
-import it.pagopa.selfcare.util.InstitutionType;
+import it.pagopa.selfcare.onboarding.common.InstitutionType;
+import it.pagopa.selfcare.onboarding.common.Origin;
+import it.pagopa.selfcare.onboarding.util.InstitutionPaSubunitType;
import lombok.Data;
import java.util.List;
@@ -13,13 +14,16 @@ public class Institution {
private String taxCode;
private String subunitCode;
private InstitutionPaSubunitType subunitType;
-
+ private Origin origin;
+ private String city;
+ private String country;
+ private String county;
private String description;
private String digitalAddress;
private String address;
private String zipCode;
- private List geographicTaxonomyCodes;
+ private List geographicTaxonomies;
private String rea;
private String shareCapital;
@@ -32,4 +36,6 @@ public class Institution {
private PaymentServiceProvider paymentServiceProvider;
private DataProtectionOfficer dataProtectionOfficer;
+
+ private String parentDescription;
}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Onboarding.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Onboarding.java
new file mode 100644
index 000000000..1d6cd03a8
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Onboarding.java
@@ -0,0 +1,40 @@
+package it.pagopa.selfcare.onboarding.entity;
+
+import io.quarkus.mongodb.panache.common.MongoEntity;
+import io.quarkus.mongodb.panache.reactive.ReactivePanacheMongoEntity;
+import it.pagopa.selfcare.onboarding.common.OnboardingStatus;
+import it.pagopa.selfcare.onboarding.common.WorkflowType;
+import it.pagopa.selfcare.onboarding.controller.request.ContractRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingImportContract;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.FieldNameConstants;
+import org.bson.types.ObjectId;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@FieldNameConstants(asEnum = true)
+@MongoEntity(collection="onboardings")
+public class Onboarding extends ReactivePanacheMongoEntity {
+
+ public ObjectId id;
+
+ private String productId;
+ private WorkflowType workflowType;
+ private Institution institution;
+ private List users;
+ private String pricingPlan;
+ private Billing billing;
+ private ContractRequest contract;
+ private OnboardingImportContract contractImported;
+ private Boolean signContract;
+
+ private LocalDateTime createdAt;
+ private LocalDateTime updatedAt;
+ private LocalDateTime expiringDate;
+ private OnboardingStatus status;
+ private String userRequestUid;
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/PaymentServiceProvider.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/PaymentServiceProvider.java
similarity index 84%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/entity/PaymentServiceProvider.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/PaymentServiceProvider.java
index 35b739928..a0bae7b69 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/PaymentServiceProvider.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/PaymentServiceProvider.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.entity;
+package it.pagopa.selfcare.onboarding.entity;
import lombok.Data;
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Product.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Product.java
new file mode 100644
index 000000000..e805c16df
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Product.java
@@ -0,0 +1,2 @@
+package it.pagopa.selfcare.onboarding.entity;public class Product {
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Token.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Token.java
new file mode 100644
index 000000000..b866e5e91
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/Token.java
@@ -0,0 +1,33 @@
+package it.pagopa.selfcare.onboarding.entity;
+
+import io.quarkus.mongodb.panache.common.MongoEntity;
+import io.quarkus.mongodb.panache.reactive.ReactivePanacheMongoEntity;
+import it.pagopa.selfcare.onboarding.common.TokenType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.bson.types.ObjectId;
+
+import java.time.LocalDateTime;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@MongoEntity(collection="tokens")
+public class Token extends ReactivePanacheMongoEntity {
+
+ private ObjectId id;
+ private TokenType type;
+ private String onboardingId;
+ private String productId;
+ private String checksum;
+ private String contractVersion;
+ private String contractTemplate;
+ private String contractSigned;
+ private String contractFilename;
+ //@Indexed
+ private LocalDateTime createdAt;
+ private LocalDateTime updatedAt;
+ private LocalDateTime deletedAt;
+ private LocalDateTime activatedAt;
+
+}
+
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/User.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/User.java
similarity index 51%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/entity/User.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/User.java
index a5f67af3b..e532cfe49 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/entity/User.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/entity/User.java
@@ -1,9 +1,6 @@
-package it.pagopa.selfcare.entity;
+package it.pagopa.selfcare.onboarding.entity;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import it.pagopa.selfcare.commons.base.security.PartyRole;
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotEmpty;
+import it.pagopa.selfcare.onboarding.common.PartyRole;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -18,4 +15,5 @@ public class User {
private String id;
private PartyRole role;
+ private String ProductRole;
}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/exception/InvalidRequestException.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/InvalidRequestException.java
similarity index 63%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/exception/InvalidRequestException.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/InvalidRequestException.java
index 8873d2f90..6db99d82b 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/exception/InvalidRequestException.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/InvalidRequestException.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.exception;
+package it.pagopa.selfcare.onboarding.exception;
public class InvalidRequestException extends RuntimeException{
private final String code;
@@ -8,6 +8,11 @@ public InvalidRequestException(String message, String code) {
this.code = code;
}
+ public InvalidRequestException(String message) {
+ super(message);
+ this.code = "0000";
+ }
+
public String getCode() {
return code;
}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/OnboardingNotAllowedException.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/OnboardingNotAllowedException.java
new file mode 100644
index 000000000..fed93ea05
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/OnboardingNotAllowedException.java
@@ -0,0 +1,15 @@
+package it.pagopa.selfcare.onboarding.exception;
+
+public class OnboardingNotAllowedException extends RuntimeException {
+
+ private final String code;
+
+ public OnboardingNotAllowedException(String message, String code) {
+ super(message);
+ this.code = code;
+ }
+
+ public String getCode() {
+ return code;
+ }
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/ResourceNotFoundException.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/ResourceNotFoundException.java
new file mode 100644
index 000000000..fcbeff460
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/ResourceNotFoundException.java
@@ -0,0 +1,19 @@
+package it.pagopa.selfcare.onboarding.exception;
+
+public class ResourceNotFoundException extends RuntimeException{
+ private final String code;
+
+ public ResourceNotFoundException(String message, String code) {
+ super(message);
+ this.code = code;
+ }
+
+ public ResourceNotFoundException(String message) {
+ super(message);
+ this.code = "0000";
+ }
+
+ public String getCode() {
+ return code;
+ }
+}
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/exception/UpdateNotAllowedException.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/UpdateNotAllowedException.java
similarity index 76%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/exception/UpdateNotAllowedException.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/UpdateNotAllowedException.java
index 809333837..fcee21d9f 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/exception/UpdateNotAllowedException.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/UpdateNotAllowedException.java
@@ -1,4 +1,4 @@
-package it.pagopa.selfcare.exception;
+package it.pagopa.selfcare.onboarding.exception;
public class UpdateNotAllowedException extends RuntimeException {
diff --git a/onboarding-ms/src/main/java/it/pagopa/selfcare/exception/handler/ExceptionHandler.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/handler/ExceptionHandler.java
similarity index 53%
rename from onboarding-ms/src/main/java/it/pagopa/selfcare/exception/handler/ExceptionHandler.java
rename to apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/handler/ExceptionHandler.java
index d7b154c54..5aae94ff2 100644
--- a/onboarding-ms/src/main/java/it/pagopa/selfcare/exception/handler/ExceptionHandler.java
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/exception/handler/ExceptionHandler.java
@@ -1,18 +1,14 @@
-package it.pagopa.selfcare.exception.handler;
+package it.pagopa.selfcare.onboarding.exception.handler;
-import it.pagopa.selfcare.exception.InvalidRequestException;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
+import it.pagopa.selfcare.onboarding.exception.InvalidRequestException;
+import it.pagopa.selfcare.onboarding.exception.OnboardingNotAllowedException;
+import it.pagopa.selfcare.onboarding.exception.ResourceNotFoundException;
import jakarta.ws.rs.core.Response;
-import jakarta.ws.rs.ext.ExceptionMapper;
-import jakarta.ws.rs.ext.Provider;
import org.jboss.resteasy.reactive.RestResponse;
import org.jboss.resteasy.reactive.server.ServerExceptionMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Collections;
-
public class ExceptionHandler {
@@ -24,10 +20,20 @@ public RestResponse toResponse(InvalidRequestException exception) {
LOGGER.error("{}: {}", SOMETHING_HAS_GONE_WRONG_IN_THE_SERVER, exception.getMessage());
return RestResponse.status(Response.Status.BAD_REQUEST, exception.getMessage());
}
+ @ServerExceptionMapper
+ public RestResponse toResponse(OnboardingNotAllowedException exception) {
+ LOGGER.error("{}: {}", SOMETHING_HAS_GONE_WRONG_IN_THE_SERVER, exception.getMessage());
+ return RestResponse.status(Response.Status.BAD_REQUEST, exception.getMessage());
+ }
@ServerExceptionMapper
public RestResponse toResponse(Exception exception) {
LOGGER.error("{}: {}", SOMETHING_HAS_GONE_WRONG_IN_THE_SERVER, exception.getMessage());
return RestResponse.status(Response.Status.INTERNAL_SERVER_ERROR, SOMETHING_HAS_GONE_WRONG_IN_THE_SERVER);
}
+ @ServerExceptionMapper
+ public RestResponse toResponse(ResourceNotFoundException exception) {
+ LOGGER.error("{}: {}", SOMETHING_HAS_GONE_WRONG_IN_THE_SERVER, exception.getMessage());
+ return RestResponse.status(Response.Status.NOT_FOUND, exception.getMessage());
+ }
}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/mapper/OnboardingMapper.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/mapper/OnboardingMapper.java
new file mode 100644
index 000000000..eed469990
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/mapper/OnboardingMapper.java
@@ -0,0 +1,35 @@
+package it.pagopa.selfcare.onboarding.mapper;
+
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingDefaultRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingPaRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingPspRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingSaRequest;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingGet;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingResponse;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+import org.bson.types.ObjectId;
+import org.mapstruct.*;
+
+@Mapper(componentModel = "cdi")
+public interface OnboardingMapper {
+
+ Onboarding toEntity(OnboardingPaRequest request);
+ Onboarding toEntity(OnboardingPspRequest request);
+ Onboarding toEntity(OnboardingDefaultRequest request);
+ Onboarding toEntity(OnboardingSaRequest request);
+
+ //@Mapping(source = "taxCode", target = "institution.taxCode")
+ //@Mapping(source = "businessName", target = "institution.description")
+ //@Mapping(source = "digitalAddress", target = "institution.digitalAddress")
+ //Onboarding toEntity(OnboardingPgRequest request);
+
+ OnboardingResponse toResponse(Onboarding onboarding);
+
+ @Mapping(target = "id", expression = "java(objectIdToString(model.getId()))")
+ OnboardingGet toGetResponse(Onboarding model);
+
+ @Named("objectIdToString")
+ default String objectIdToString(ObjectId objectId) {
+ return objectId.toHexString();
+ }
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/mapper/UserMapper.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/mapper/UserMapper.java
new file mode 100644
index 000000000..75e4695b2
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/mapper/UserMapper.java
@@ -0,0 +1,18 @@
+package it.pagopa.selfcare.onboarding.mapper;
+
+import it.pagopa.selfcare.onboarding.controller.response.UserResponse;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.MappingTarget;
+import org.openapi.quarkus.user_registry_json.model.UserResource;
+
+@Mapper(componentModel = "cdi")
+public interface UserMapper {
+
+ @Mapping(source = "name.value", target = "name")
+ @Mapping(source = "familyName.value", target = "surname")
+ @Mapping(source = "email.value", target = "email")
+ @Mapping(source = "fiscalCode", target = "taxCode")
+ void fillUserResponse(UserResource userResource, @MappingTarget UserResponse userResponse);
+
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/OnboardingService.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/OnboardingService.java
new file mode 100644
index 000000000..18ff9afc7
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/OnboardingService.java
@@ -0,0 +1,38 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import io.smallrye.mutiny.Uni;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingDefaultRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingPaRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingPspRequest;
+import it.pagopa.selfcare.onboarding.controller.request.OnboardingSaRequest;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingGet;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingGetResponse;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingResponse;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+
+import java.io.File;
+
+public interface OnboardingService {
+
+ Uni onboarding(OnboardingDefaultRequest onboardingRequest);
+
+ Uni onboardingPsp(OnboardingPspRequest onboardingRequest);
+
+ Uni onboardingSa(OnboardingSaRequest onboardingRequest);
+
+ Uni onboardingPa(OnboardingPaRequest onboardingRequest);
+
+ Uni complete(String tokenId, File contract);
+
+ Uni completeWithoutSignatureVerification(String tokenId, File contract);
+
+ Uni onboardingGet(String productId, String taxCode, String status, String from, String to, Integer page, Integer size);
+
+ Uni deleteOnboarding(String onboardingId);
+
+ Uni onboardingPending(String onboardingId);
+
+ Uni onboardingGet(String onboardingId);
+
+ Uni onboardingGetWithUserInfo(String onboardingId);
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/OnboardingServiceDefault.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/OnboardingServiceDefault.java
new file mode 100644
index 000000000..44baaf67a
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/OnboardingServiceDefault.java
@@ -0,0 +1,631 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import io.quarkus.mongodb.panache.common.reactive.Panache;
+import io.quarkus.mongodb.panache.reactive.ReactivePanacheQuery;
+import io.smallrye.mutiny.Multi;
+import io.smallrye.mutiny.Uni;
+import io.smallrye.mutiny.infrastructure.Infrastructure;
+import io.smallrye.mutiny.tuples.Tuple2;
+import io.smallrye.mutiny.unchecked.Unchecked;
+import it.pagopa.selfcare.azurestorage.AzureBlobClient;
+import it.pagopa.selfcare.onboarding.common.InstitutionType;
+import it.pagopa.selfcare.onboarding.common.OnboardingStatus;
+import it.pagopa.selfcare.onboarding.common.PartyRole;
+import it.pagopa.selfcare.onboarding.common.WorkflowType;
+import it.pagopa.selfcare.onboarding.constants.CustomError;
+import it.pagopa.selfcare.onboarding.controller.request.*;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingGet;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingGetResponse;
+import it.pagopa.selfcare.onboarding.controller.response.OnboardingResponse;
+import it.pagopa.selfcare.onboarding.controller.response.UserResponse;
+import it.pagopa.selfcare.onboarding.entity.Onboarding;
+import it.pagopa.selfcare.onboarding.entity.Token;
+import it.pagopa.selfcare.onboarding.entity.User;
+import it.pagopa.selfcare.onboarding.exception.InvalidRequestException;
+import it.pagopa.selfcare.onboarding.exception.OnboardingNotAllowedException;
+import it.pagopa.selfcare.onboarding.exception.ResourceNotFoundException;
+import it.pagopa.selfcare.onboarding.exception.UpdateNotAllowedException;
+import it.pagopa.selfcare.onboarding.mapper.OnboardingMapper;
+import it.pagopa.selfcare.onboarding.mapper.UserMapper;
+import it.pagopa.selfcare.onboarding.service.strategy.OnboardingValidationStrategy;
+import it.pagopa.selfcare.onboarding.util.InstitutionPaSubunitType;
+import it.pagopa.selfcare.onboarding.util.QueryUtils;
+import it.pagopa.selfcare.onboarding.util.SortEnum;
+import it.pagopa.selfcare.product.entity.Product;
+import it.pagopa.selfcare.product.entity.ProductRoleInfo;
+import it.pagopa.selfcare.product.service.ProductService;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.WebApplicationException;
+import jakarta.ws.rs.core.Response;
+import org.apache.commons.lang3.StringUtils;
+import org.bson.Document;
+import org.bson.types.ObjectId;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+import org.eclipse.microprofile.rest.client.inject.RestClient;
+import org.jboss.resteasy.reactive.ClientWebApplicationException;
+import org.openapi.quarkus.core_json.api.OnboardingApi;
+import org.openapi.quarkus.onboarding_functions_json.api.OrchestrationApi;
+import org.openapi.quarkus.party_registry_proxy_json.api.AooApi;
+import org.openapi.quarkus.party_registry_proxy_json.api.UoApi;
+import org.openapi.quarkus.user_registry_json.api.UserApi;
+import org.openapi.quarkus.user_registry_json.model.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import static it.pagopa.selfcare.onboarding.common.ProductId.PROD_INTEROP;
+import static it.pagopa.selfcare.onboarding.constants.CustomError.*;
+import static it.pagopa.selfcare.onboarding.util.GenericError.GENERIC_ERROR;
+import static it.pagopa.selfcare.onboarding.util.GenericError.ONBOARDING_EXPIRED;
+
+@ApplicationScoped
+public class OnboardingServiceDefault implements OnboardingService {
+ protected static final String ATLEAST_ONE_PRODUCT_ROLE_REQUIRED = "At least one Product role related to %s Party role is required";
+ protected static final String MORE_THAN_ONE_PRODUCT_ROLE_AVAILABLE = "More than one Product role related to %s Party role is available. Cannot automatically set the Product role";
+ private static final String ONBOARDING_NOT_ALLOWED_ERROR_MESSAGE_TEMPLATE = "Institution with external id '%s' is not allowed to onboard '%s' product";
+ private static final String ONBOARDING_NOT_ALLOWED_ERROR_MESSAGE_NOT_DELEGABLE = "Institution with external id '%s' is not allowed to onboard '%s' product because it is not delegable";
+ private static final String INVALID_OBJECTID = "Given onboardingId [%s] has wrong format";
+ private static final String ONBOARDING_NOT_FOUND_OR_ALREADY_DELETED = "Onboarding with id %s not found or already deleted";
+ public static final String UNABLE_TO_COMPLETE_THE_ONBOARDING_FOR_INSTITUTION_FOR_PRODUCT_DISMISSED = "Unable to complete the onboarding for institution with taxCode '%s' to product '%s', the product is dismissed.";
+
+ public static final String USERS_FIELD_LIST = "fiscalCode,familyName,name,workContacts";
+ public static final String USERS_FIELD_TAXCODE = "fiscalCode";
+ public static final String UNABLE_TO_COMPLETE_THE_ONBOARDING_FOR_INSTITUTION_ALREADY_ONBOARDED = "Unable to complete the onboarding for institution with taxCode '%s' to product '%s' because is already onboarded.";
+
+
+ public static final Function workContactsKey = onboardingId -> String.format("obg_%s", onboardingId);
+
+ @RestClient
+ @Inject
+ UserApi userRegistryApi;
+
+ @RestClient
+ @Inject
+ OnboardingApi onboardingApi;
+
+ @RestClient
+ @Inject
+ AooApi aooApi;
+
+ @RestClient
+ @Inject
+ UoApi uoApi;
+
+ @RestClient
+ @Inject
+ OrchestrationApi orchestrationApi;
+
+ @Inject
+ OnboardingMapper onboardingMapper;
+
+ @Inject
+ OnboardingValidationStrategy onboardingValidationStrategy;
+ @Inject
+ ProductService productService;
+ @Inject
+ SignatureService signatureService;
+ @Inject
+ AzureBlobClient azureBlobClient;
+
+ @Inject
+ UserMapper userMapper;
+
+ @ConfigProperty(name = "onboarding.expiring-date")
+ Integer onboardingExpireDate;
+ @ConfigProperty(name = "onboarding.orchestration.enabled")
+ Boolean onboardingOrchestrationEnabled;
+ @ConfigProperty(name = "onboarding-ms.signature.verify-enabled")
+ Boolean isVerifyEnabled;
+ @ConfigProperty(name = "onboarding-ms.blob-storage.path-contracts")
+ String pathContracts;
+
+ @Override
+ public Uni onboarding(OnboardingDefaultRequest onboardingRequest) {
+ return fillUsersAndOnboarding(onboardingMapper.toEntity(onboardingRequest), onboardingRequest.getUsers());
+ }
+
+ @Override
+ public Uni onboardingPsp(OnboardingPspRequest onboardingRequest) {
+ return fillUsersAndOnboarding(onboardingMapper.toEntity(onboardingRequest), onboardingRequest.getUsers());
+ }
+
+ @Override
+ public Uni onboardingSa(OnboardingSaRequest onboardingRequest) {
+ return fillUsersAndOnboarding(onboardingMapper.toEntity(onboardingRequest), onboardingRequest.getUsers());
+ }
+
+ @Override
+ public Uni onboardingPa(OnboardingPaRequest onboardingRequest) {
+ return fillUsersAndOnboarding(onboardingMapper.toEntity(onboardingRequest), onboardingRequest.getUsers());
+ }
+
+ public Uni fillUsersAndOnboarding(Onboarding onboarding, List userRequests) {
+ onboarding.setExpiringDate(OffsetDateTime.now().plusDays(onboardingExpireDate).toLocalDateTime());
+ onboarding.setCreatedAt(LocalDateTime.now());
+ onboarding.setWorkflowType(getWorkflowType(onboarding));
+ onboarding.setStatus(OnboardingStatus.REQUEST);
+
+ return Panache.withTransaction(() -> Onboarding.persist(onboarding).replaceWith(onboarding)
+ .onItem().transformToUni(onboardingPersisted -> checkRoleAndRetrieveUsers(userRequests, onboardingPersisted.id.toHexString())
+ .onItem().invoke(onboardingPersisted::setUsers).replaceWith(onboardingPersisted))
+ .onItem().transformToUni(this::checkProductAndReturnOnboarding)
+ .onItem().transformToUni(this::addParentDescritpionForAooOrUo)
+ .onItem().transformToUni(this::persistAndStartOrchestrationOnboarding)
+ .onItem().transform(onboardingMapper::toResponse));
+ }
+
+ private Uni addParentDescritpionForAooOrUo(Onboarding onboarding) {
+ if (InstitutionType.PA == onboarding.getInstitution().getInstitutionType()) {
+ if (InstitutionPaSubunitType.AOO == onboarding.getInstitution().getSubunitType()) {
+ return addParentDescriptionForAOO(onboarding);
+ } else if (InstitutionPaSubunitType.UO == onboarding.getInstitution().getSubunitType()) {
+ return addParentDescriptionForUO(onboarding);
+ }
+ }
+ return Uni.createFrom().item(onboarding);
+ }
+
+ private Uni addParentDescriptionForUO(Onboarding onboarding) {
+ return uoApi.findByUnicodeUsingGET1(onboarding.getInstitution().getSubunitCode(), null)
+ .onItem().invoke(uoResource -> onboarding.getInstitution().setParentDescription(uoResource.getDenominazioneEnte()))
+ .onFailure(WebApplicationException.class).recoverWithUni(ex -> ((WebApplicationException) ex).getResponse().getStatus() == 404
+ ? Uni.createFrom().failure(new ResourceNotFoundException(String.format(UO_NOT_FOUND.getMessage(), onboarding.getInstitution().getSubunitCode())))
+ : Uni.createFrom().failure(ex))
+ .replaceWith(onboarding);
+
+ }
+
+ private Uni addParentDescriptionForAOO(Onboarding onboarding) {
+ return aooApi.findByUnicodeUsingGET(onboarding.getInstitution().getSubunitCode(), null)
+ .onItem().invoke(aooResource -> onboarding.getInstitution().setParentDescription(aooResource.getDenominazioneEnte()))
+ .onFailure(WebApplicationException.class).recoverWithUni(ex -> ((WebApplicationException) ex).getResponse().getStatus() == 404
+ ? Uni.createFrom().failure(new ResourceNotFoundException(String.format(AOO_NOT_FOUND.getMessage(), onboarding.getInstitution().getSubunitCode())))
+ : Uni.createFrom().failure(ex))
+ .replaceWith(onboarding);
+ }
+
+ public Uni persistAndStartOrchestrationOnboarding(Onboarding onboarding) {
+ final List onboardings = new ArrayList<>();
+ onboardings.add(onboarding);
+
+ if (Boolean.TRUE.equals(onboardingOrchestrationEnabled)) {
+ return Onboarding.persistOrUpdate(onboardings)
+ .onItem().transformToUni(saved -> orchestrationApi.apiStartOnboardingOrchestrationGet(onboarding.getId().toHexString())
+ .replaceWith(onboarding));
+ } else {
+ return Onboarding.persistOrUpdate(onboardings)
+ .replaceWith(onboarding);
+ }
+ }
+
+ /**
+ * Identify which workflow must be trigger during onboarding process.
+ * Each workflow consist of different activities such as creating contract or sending appropriate mail.
+ * For more information look at ...
+ *
+ * @param onboarding actual onboarding request
+ * @return WorkflowType
+ */
+ private WorkflowType getWorkflowType(Onboarding onboarding) {
+ InstitutionType institutionType = onboarding.getInstitution().getInstitutionType();
+ if(InstitutionType.PT.equals(institutionType)){
+ return WorkflowType.FOR_APPROVE_PT;
+ }
+
+ if(InstitutionType.PA.equals(institutionType)
+ || isGspAndProdInterop(institutionType, onboarding.getProductId())
+ || InstitutionType.SA.equals(institutionType)
+ || InstitutionType.AS.equals(institutionType)) {
+ return WorkflowType.CONTRACT_REGISTRATION;
+ }
+
+ if(InstitutionType.PG.equals(institutionType)) {
+ return WorkflowType.CONFIRMATION;
+ }
+
+ return WorkflowType.FOR_APPROVE;
+ }
+
+ private boolean isGspAndProdInterop(InstitutionType institutionType, String productId) {
+ return InstitutionType.GSP == institutionType
+ && productId.equals(PROD_INTEROP.getValue());
+ }
+
+ private Uni product(String productId) {
+ return Uni.createFrom().item(() -> productService.getProductIsValid(productId))
+ .runSubscriptionOn(Infrastructure.getDefaultWorkerPool());
+ }
+
+ public Uni checkProductAndReturnOnboarding(Onboarding onboarding) {
+
+ return product(onboarding.getProductId())
+ .onFailure().transform(ex -> new OnboardingNotAllowedException(String.format(UNABLE_TO_COMPLETE_THE_ONBOARDING_FOR_INSTITUTION_FOR_PRODUCT_DISMISSED,
+ onboarding.getInstitution().getTaxCode(),
+ onboarding.getProductId()), DEFAULT_ERROR.getCode()))
+ .onItem().transformToUni(product -> {
+
+ /* if PT and product is not delegable, throw an exception */
+ if(InstitutionType.PT == onboarding.getInstitution().getInstitutionType() && !product.isDelegable()) {
+ return Uni.createFrom().failure(new OnboardingNotAllowedException(String.format(ONBOARDING_NOT_ALLOWED_ERROR_MESSAGE_NOT_DELEGABLE,
+ onboarding.getInstitution().getTaxCode(),
+ onboarding.getProductId()), DEFAULT_ERROR.getCode()));
+ }
+
+ validateProductRole(onboarding.getUsers(), Objects.nonNull(product.getParent())
+ ? product.getParent().getRoleMappings()
+ : product.getRoleMappings());
+
+ return verifyAlreadyOnboardingForProductAndProductParent(onboarding, product);
+ });
+ }
+
+ private Uni verifyAlreadyOnboardingForProductAndProductParent(Onboarding onboarding, Product product) {
+ String institutionTaxCode = onboarding.getInstitution().getTaxCode();
+ String institutionSubunitCode = onboarding.getInstitution().getSubunitCode();
+
+ return (Objects.nonNull(product.getParent())
+ //If product has parent, I must verify if onboarding is present for parent and child
+ ? checkIfAlreadyOnboardingAndValidateAllowedMap(product.getParentId(), institutionTaxCode, institutionSubunitCode)
+ .onItem().transformToUni( ignore -> checkIfAlreadyOnboardingAndValidateAllowedMap(product.getId(), institutionTaxCode, institutionSubunitCode))
+ //If product is a root, I must only verify if onboarding for root
+ : checkIfAlreadyOnboardingAndValidateAllowedMap(product.getId(), institutionTaxCode, institutionSubunitCode)
+ ).replaceWith(onboarding);
+ }
+
+ private Uni checkIfAlreadyOnboardingAndValidateAllowedMap(String productId, String institutionTaxCode, String institutionSubuniCode) {
+
+ if (!onboardingValidationStrategy.validate(productId, institutionTaxCode)) {
+ return Uni.createFrom().failure(new OnboardingNotAllowedException(String.format(ONBOARDING_NOT_ALLOWED_ERROR_MESSAGE_TEMPLATE,
+ institutionTaxCode,
+ productId),
+ DEFAULT_ERROR.getCode()));
+ }
+
+ return onboardingApi.verifyOnboardingInfoUsingHEAD(institutionTaxCode, productId, institutionSubuniCode)
+ .onItem().failWith(() -> new InvalidRequestException(String.format(UNABLE_TO_COMPLETE_THE_ONBOARDING_FOR_INSTITUTION_ALREADY_ONBOARDED,
+ institutionTaxCode, productId),
+ DEFAULT_ERROR.getCode()))
+ .onFailure(ClientWebApplicationException.class).recoverWithUni(ex -> ((WebApplicationException)ex).getResponse().getStatus() == 404
+ ? Uni.createFrom().item(Response.noContent().build())
+ : Uni.createFrom().failure(new RuntimeException(ex.getMessage())))
+ .replaceWith(Boolean.TRUE);
+ }
+
+ private void validateProductRole(List users, Map roleMappings) {
+ try {
+ if(Objects.isNull(roleMappings) || roleMappings.isEmpty())
+ throw new IllegalArgumentException("Role mappings is required");
+ users.forEach(userInfo -> {
+ if(Objects.isNull(roleMappings.get(userInfo.getRole())))
+ throw new IllegalArgumentException(String.format(ATLEAST_ONE_PRODUCT_ROLE_REQUIRED, userInfo.getRole()));
+ if(Objects.isNull((roleMappings.get(userInfo.getRole()).getRoles())))
+ throw new IllegalArgumentException(String.format(ATLEAST_ONE_PRODUCT_ROLE_REQUIRED, userInfo.getRole()));
+ if(roleMappings.get(userInfo.getRole()).getRoles().size() != 1)
+ throw new IllegalArgumentException(String.format(MORE_THAN_ONE_PRODUCT_ROLE_AVAILABLE, userInfo.getRole()));
+ userInfo.setProductRole(roleMappings.get(userInfo.getRole()).getRoles().get(0).getCode());
+ });
+ } catch (IllegalArgumentException e){
+ throw new OnboardingNotAllowedException(e.getMessage(), DEFAULT_ERROR.getCode());
+ }
+ }
+
+ public Uni> checkRoleAndRetrieveUsers(List users, String onboardingId) {
+
+ List validRoles = List.of(PartyRole.MANAGER, PartyRole.DELEGATE);
+
+ List usersNotValidRole = users.stream()
+ .filter(user -> !validRoles.contains(user.getRole()))
+ .toList();
+ if (!usersNotValidRole.isEmpty()) {
+ String usersNotValidRoleString = usersNotValidRole.stream()
+ .map(user -> user.getRole().toString())
+ .collect(Collectors.joining(","));
+ return Uni.createFrom().failure( new InvalidRequestException(String.format(CustomError.ROLES_NOT_ADMITTED_ERROR.getMessage(), usersNotValidRoleString),
+ CustomError.ROLES_NOT_ADMITTED_ERROR.getCode()));
+ }
+
+ return Multi.createFrom().iterable(users)
+ .onItem().transformToUni(user -> userRegistryApi
+ .searchUsingPOST(USERS_FIELD_LIST, new UserSearchDto().fiscalCode(user.getTaxCode()))
+
+ /* retrieve userId, if found will eventually update some fields */
+ .onItem().transformToUni(userResource -> createUpdateUserRequest(user, userResource, onboardingId)
+ .map(userUpdateRequest -> userRegistryApi.updateUsingPATCH(userResource.getId().toString(), userUpdateRequest)
+ .replaceWith(userResource.getId()))
+ .orElse(Uni.createFrom().item(userResource.getId())))
+ /* if not found 404, will create new user */
+ .onFailure(WebApplicationException.class).recoverWithUni(ex -> ((WebApplicationException)ex).getResponse().getStatus() == 404
+ ? userRegistryApi.saveUsingPATCH(createSaveUserDto(user, onboardingId)).onItem().transform(UserId::getId)
+ : Uni.createFrom().failure(ex))
+ .onItem().transform(userResourceId -> User.builder()
+ .id(userResourceId.toString())
+ .role(user.getRole())
+ .build())
+ )
+ .concatenate().collect().asList();
+ }
+
+ private SaveUserDto createSaveUserDto(UserRequest model, String onboardingId) {
+ SaveUserDto resource = new SaveUserDto();
+ resource.setFiscalCode(model.getTaxCode());
+ resource.setName(new CertifiableFieldResourceOfstring()
+ .value(model.getName())
+ .certification(CertifiableFieldResourceOfstring.CertificationEnum.NONE));
+ resource.setFamilyName(new CertifiableFieldResourceOfstring()
+ .value(model.getSurname())
+ .certification(CertifiableFieldResourceOfstring.CertificationEnum.NONE));
+
+ if (Objects.nonNull(onboardingId)) {
+ WorkContactResource contact = new WorkContactResource();
+ contact.setEmail(new CertifiableFieldResourceOfstring()
+ .value(model.getEmail())
+ .certification(CertifiableFieldResourceOfstring.CertificationEnum.NONE));
+ resource.setWorkContacts(Map.of(workContactsKey.apply(onboardingId), contact));
+ }
+ return resource;
+ }
+
+ protected static Optional createUpdateUserRequest(UserRequest user, UserResource foundUser, String onboardingId) {
+ Optional mutableUserFieldsDto = Optional.empty();
+ if (isFieldToUpdate(foundUser.getName(), user.getName())) {
+ MutableUserFieldsDto dto = new MutableUserFieldsDto();
+ dto.setName(new CertifiableFieldResourceOfstring()
+ .value(user.getName())
+ .certification(CertifiableFieldResourceOfstring.CertificationEnum.NONE));
+ mutableUserFieldsDto = Optional.of(dto);
+ }
+ if (isFieldToUpdate(foundUser.getFamilyName(), user.getSurname())) {
+ MutableUserFieldsDto dto = mutableUserFieldsDto.orElseGet(MutableUserFieldsDto::new);
+ dto.setFamilyName(new CertifiableFieldResourceOfstring()
+ .value(user.getSurname())
+ .certification(CertifiableFieldResourceOfstring.CertificationEnum.NONE));
+ mutableUserFieldsDto = Optional.of(dto);
+ }
+
+ if (foundUser.getWorkContacts() == null
+ || !foundUser.getWorkContacts().containsKey(onboardingId)
+ || isFieldToUpdate(foundUser.getWorkContacts().get(onboardingId).getEmail(), user.getEmail())) {
+ MutableUserFieldsDto dto = mutableUserFieldsDto.orElseGet(MutableUserFieldsDto::new);
+ final WorkContactResource workContact = new WorkContactResource();
+ workContact.setEmail(new CertifiableFieldResourceOfstring()
+ .value(user.getEmail())
+ .certification(CertifiableFieldResourceOfstring.CertificationEnum.NONE));
+ dto.setWorkContacts(Map.of(workContactsKey.apply(onboardingId), workContact));
+ mutableUserFieldsDto = Optional.of(dto);
+ }
+ return mutableUserFieldsDto;
+ }
+
+ private static boolean isFieldToUpdate(CertifiableFieldResourceOfstring certifiedField, String value) {
+ boolean isToUpdate = true;
+ if (certifiedField != null) {
+ boolean isNoneCertification = CertifiableFieldResourceOfstring.CertificationEnum.NONE.equals(certifiedField.getCertification());
+ boolean isSameValue = isNoneCertification ? certifiedField.getValue().equals(value) : certifiedField.getValue().equalsIgnoreCase(value);
+
+ if (isSameValue) {
+ isToUpdate = false;
+ } else if (!isNoneCertification) {
+ throw new UpdateNotAllowedException(String.format("Update user request not allowed because of value %s", value));
+ }
+ }
+ return isToUpdate;
+ }
+
+ @Override
+ public Uni complete(String onboardingId, File contract) {
+
+ if (Boolean.TRUE.equals(isVerifyEnabled)) {
+ //Retrieve as Tuple: managers fiscal-code from user registry and contract digest
+ //At least, verify contract signature using both
+ Function> verification = onboarding -> Uni.combine().all()
+ .unis(retrieveOnboardingUserFiscalCodeList(onboarding), retrieveContractDigest(onboardingId))
+ .asTuple()
+ .onItem().transform(inputSignatureVerification -> {
+ signatureService.verifySignature(contract,
+ inputSignatureVerification.getItem2(),
+ inputSignatureVerification.getItem1());
+ return onboarding;
+ });
+
+ return complete(onboardingId, contract, verification);
+ } else {
+ return completeWithoutSignatureVerification(onboardingId, contract);
+ }
+ }
+
+ @Override
+ public Uni completeWithoutSignatureVerification(String onboardingId, File contract) {
+ Function> verification = ignored -> Uni.createFrom().item(ignored);
+ return complete(onboardingId, contract, verification);
+ }
+
+ private Uni complete(String onboardingId, File contract, Function> verificationContractSignature) {
+
+ return retrieveOnboardingAndCheckIfExpired(onboardingId)
+ .onItem().transformToUni(verificationContractSignature::apply)
+ //Fail if onboarding exists for a product
+ .onItem().transformToUni(onboarding -> product(onboarding.getProductId())
+ .onItem().transformToUni(product -> verifyAlreadyOnboardingForProductAndProductParent(onboarding, product))
+ )
+ //Upload contract on storage
+ .onItem().transformToUni(onboarding -> uploadSignedContractAndUpdateToken(onboardingId, contract)
+ .map(ignore -> onboarding))
+ // Start async activity if onboardingOrchestrationEnabled is true
+ .onItem().transformToUni(onboarding -> onboardingOrchestrationEnabled
+ ? orchestrationApi.apiStartOnboardingCompletionOrchestrationGet(onboarding.getId().toHexString())
+ .map(ignore -> onboarding)
+ : Uni.createFrom().item(onboarding));
+ }
+
+ private Uni uploadSignedContractAndUpdateToken(String onboardingId, File contract) {
+ return retrieveToken(onboardingId)
+ .onItem().transformToUni(token -> Uni.createFrom().item(Unchecked.supplier(() -> {
+ final String path = String.format("%s%s", pathContracts, onboardingId);
+ final String filename = String.format("signed_%s", token.getContractFilename());
+
+ try {
+ return azureBlobClient.uploadFile(path, filename, Files.readAllBytes(contract.toPath()));
+ } catch (IOException e) {
+ throw new OnboardingNotAllowedException(GENERIC_ERROR.getCode(),
+ "Error on upload contract for onboarding with id " + onboardingId);
+ }
+ }))
+ .runSubscriptionOn(Infrastructure.getDefaultWorkerPool())
+ .onItem().transformToUni(filepath -> Token.update("contractSigned", filepath)
+ .where("_id", token.getId())
+ .replaceWith(filepath))
+ );
+ }
+
+
+ private Uni retrieveOnboardingAndCheckIfExpired(String onboardingId) {
+ //Retrieve Onboarding if exists
+ return Onboarding.findByIdOptional(new ObjectId(onboardingId))
+ .onItem().transformToUni(opt -> opt
+ //I must cast to Onboarding because findByIdOptional return a generic ReactiveEntity
+ .map(onboarding -> (Onboarding) onboarding)
+ //Check if onboarding is expired
+ .filter(onboarding -> !isOnboardingExpired(onboarding.getExpiringDate()))
+ .map(onboarding -> Uni.createFrom().item(onboarding))
+ .orElse(Uni.createFrom().failure(new InvalidRequestException(String.format(ONBOARDING_EXPIRED.getMessage(),
+ onboardingId, ONBOARDING_EXPIRED.getCode())))));
+ }
+
+ public static boolean isOnboardingExpired(LocalDateTime dateTime) {
+ LocalDateTime now = LocalDateTime.now();
+ return Objects.nonNull(dateTime) && (now.isEqual(dateTime) || now.isAfter(dateTime));
+ }
+
+
+
+ private Uni retrieveContractDigest(String onboardingId) {
+ return retrieveToken(onboardingId)
+ .map(Token::getChecksum);
+ }
+ private Uni retrieveToken(String onboardingId) {
+ return Token.list("onboardingId", onboardingId)
+ .map(tokens -> tokens.stream().findFirst()
+ .map(token -> (Token) token)
+ .orElseThrow());
+ }
+
+ private Uni> retrieveOnboardingUserFiscalCodeList(Onboarding onboarding) {
+ return Multi.createFrom().iterable(onboarding.getUsers().stream()
+ .filter(user -> PartyRole.MANAGER.equals(user.getRole()))
+ .map(User::getId)
+ .toList())
+ .onItem().transformToUni(userId -> userRegistryApi.findByIdUsingGET(USERS_FIELD_TAXCODE, userId))
+ .merge().collect().asList()
+ .onItem().transform(usersResource -> usersResource.stream().map(UserResource::getFiscalCode).toList());
+ }
+
+ @Override
+ public Uni onboardingGet(String productId, String taxCode, String status, String from, String to, Integer page, Integer size) {
+ Document sort = QueryUtils.buildSortDocument(Onboarding.Fields.createdAt.name(), SortEnum.DESC);
+ Map queryParameter = QueryUtils.createMapForOnboardingQueryParameter(productId, taxCode, status, from, to);
+ Document query = QueryUtils.buildQuery(queryParameter);
+
+ return Uni.combine().all().unis(
+ runQuery(query, sort).page(page, size).list(),
+ runQuery(query, null).count()
+ ).asTuple()
+ .map(this::constructOnboardingGetResponse);
+ }
+
+ private ReactivePanacheQuery runQuery(Document query, Document sort) {
+ return Onboarding.find(query, sort);
+ }
+
+ private OnboardingGetResponse constructOnboardingGetResponse(Tuple2, Long> tuple) {
+ OnboardingGetResponse onboardingGetResponse = new OnboardingGetResponse();
+ onboardingGetResponse.setCount(tuple.getItem2());
+ onboardingGetResponse.setItems(convertOnboardingListToResponse(tuple.getItem1()));
+ return onboardingGetResponse;
+ }
+
+ private List convertOnboardingListToResponse(List item1) {
+ return item1.stream()
+ .map(onboardingMapper::toGetResponse)
+ .toList();
+ }
+
+ @Override
+ public Uni deleteOnboarding(String onboardingId) {
+ return checkOnboardingIdFormat(onboardingId)
+ .onItem()
+ .transformToUni(id -> updateStatus(onboardingId, OnboardingStatus.DELETED));
+ }
+
+ /**
+ * Returns an onboarding record by its ID only if its status is PENDING.
+ * This feature is crucial for ensuring that the onboarding process can be completed only when
+ * the onboarding status is appropriately set to PENDING.
+ * @param onboardingId String
+ * @return OnboardingGet
+ */
+ @Override
+ public Uni onboardingPending(String onboardingId) {
+ return onboardingGet(onboardingId)
+ .flatMap(onboardingGet -> OnboardingStatus.PENDING.name().equals(onboardingGet.getStatus())
+ ? Uni.createFrom().item(onboardingGet)
+ : Uni.createFrom().failure(new ResourceNotFoundException(String.format("Onboarding with id %s not found or not in PENDING status!",onboardingId))));
+ }
+
+ @Override
+ public Uni onboardingGet(String onboardingId) {
+ return Onboarding.findByIdOptional(new ObjectId(onboardingId))
+ .onItem().transformToUni(opt -> opt
+ //I must cast to Onboarding because findByIdOptional return a generic ReactiveEntity
+ .map(onboarding -> (Onboarding) onboarding)
+ .map(onboardingMapper::toGetResponse)
+ .map(onboardingGet -> Uni.createFrom().item(onboardingGet))
+ .orElse(Uni.createFrom().failure(new ResourceNotFoundException(String.format("Onboarding with id %s not found!",onboardingId)))));
+ }
+
+ @Override
+ public Uni onboardingGetWithUserInfo(String onboardingId) {
+ return onboardingGet(onboardingId)
+ .flatMap(onboardingGet -> fillOnboardingWithUserInfo(onboardingGet.getUsers(), workContactsKey.apply(onboardingId))
+ .replaceWith(onboardingGet));
+ }
+
+ private Uni> fillOnboardingWithUserInfo(List users, String workContractId) {
+ return Multi.createFrom().iterable(users)
+ .onItem().transformToUni(userResponse -> userRegistryApi.findByIdUsingGET(USERS_FIELD_LIST ,userResponse.getId())
+ .onItem().invoke(userResource -> userMapper.fillUserResponse(userResource, userResponse))
+ .onItem().invoke(userResource -> Optional.ofNullable(userResource.getWorkContacts())
+ .filter(map -> map.containsKey(workContractId))
+ .map(map -> map.get(workContractId))
+ .filter(workContract -> StringUtils.isNotBlank(workContract.getEmail().getValue()))
+ .map(workContract -> workContract.getEmail().getValue())
+ .ifPresent(userResponse::setEmail))
+ .replaceWith(userResponse)
+ )
+ .merge().collect().asList();
+ }
+
+ private static Uni updateStatus(String onboardingId, OnboardingStatus onboardingStatus ) {
+ return Onboarding.update(Onboarding.Fields.status.name(), onboardingStatus)
+ .where("_id", onboardingId)
+ .onItem().transformToUni(updateItemCount -> {
+ if (updateItemCount == 0) {
+ return Uni.createFrom().failure(new InvalidRequestException(String.format(ONBOARDING_NOT_FOUND_OR_ALREADY_DELETED, onboardingId)));
+ }
+ return Uni.createFrom().item(updateItemCount);
+ });
+ }
+
+ private Uni checkOnboardingIdFormat(String onboardingId) {
+ if (!ObjectId.isValid(onboardingId)) {
+ return Uni.createFrom().failure(new InvalidRequestException(String.format(INVALID_OBJECTID, onboardingId)));
+ }
+ return Uni.createFrom().item(onboardingId);
+ }
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/SignatureService.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/SignatureService.java
new file mode 100644
index 000000000..28e139290
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/SignatureService.java
@@ -0,0 +1,8 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import java.io.File;
+import java.util.List;
+
+public interface SignatureService {
+ void verifySignature(File file, String checksum, List usersTaxCode);
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/SignatureServiceDefault.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/SignatureServiceDefault.java
new file mode 100644
index 000000000..3275d784a
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/SignatureServiceDefault.java
@@ -0,0 +1,207 @@
+package it.pagopa.selfcare.onboarding.service;
+
+import eu.europa.esig.dss.diagnostic.CertificateWrapper;
+import eu.europa.esig.dss.enumerations.DigestAlgorithm;
+import eu.europa.esig.dss.enumerations.Indication;
+import eu.europa.esig.dss.enumerations.SignatureForm;
+import eu.europa.esig.dss.model.DSSDocument;
+import eu.europa.esig.dss.model.InMemoryDocument;
+import eu.europa.esig.dss.service.crl.OnlineCRLSource;
+import eu.europa.esig.dss.service.ocsp.OnlineOCSPSource;
+import eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource;
+import eu.europa.esig.dss.spi.x509.aia.DefaultAIASource;
+import eu.europa.esig.dss.validation.AdvancedSignature;
+import eu.europa.esig.dss.validation.CertificateVerifier;
+import eu.europa.esig.dss.validation.CommonCertificateVerifier;
+import eu.europa.esig.dss.validation.SignedDocumentValidator;
+import eu.europa.esig.dss.validation.reports.Reports;
+import eu.europa.esig.validationreport.jaxb.SignatureValidationReportType;
+import it.pagopa.selfcare.onboarding.exception.InvalidRequestException;
+import jakarta.enterprise.context.ApplicationScoped;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import static it.pagopa.selfcare.onboarding.util.GenericError.*;
+
+
+@Slf4j
+@ApplicationScoped
+public class SignatureServiceDefault implements SignatureService {
+
+ private static final Integer CF_MATCHER_GROUP = 2;
+ private static final Pattern signatureRegex = Pattern.compile("(TINIT-)(.*)");
+
+ private final TrustedListsCertificateSource trustedListsCertificateSource;
+
+ public SignatureServiceDefault(TrustedListsCertificateSource trustedListsCertificateSource) {
+ this.trustedListsCertificateSource = trustedListsCertificateSource;
+ }
+
+
+ public SignedDocumentValidator createDocumentValidator(byte[] bytes) {
+
+ CertificateVerifier certificateVerifier = new CommonCertificateVerifier();
+ certificateVerifier.setTrustedCertSources(trustedListsCertificateSource);
+ certificateVerifier.setAIASource(new DefaultAIASource());
+ certificateVerifier.setOcspSource(new OnlineOCSPSource());
+ certificateVerifier.setCrlSource(new OnlineCRLSource());
+ try {
+ DSSDocument document = new InMemoryDocument(bytes);
+ SignedDocumentValidator documentValidator = SignedDocumentValidator.fromDocument(document);
+ documentValidator.setCertificateVerifier(certificateVerifier);
+ return documentValidator;
+ } catch (Exception e) {
+ log.error("Error message: {}", e.getMessage(), e);
+ throw new InvalidRequestException(DOCUMENT_VALIDATION_FAIL.getMessage(), DOCUMENT_VALIDATION_FAIL.getCode());
+ }
+ }
+
+ public void isDocumentSigned(SignedDocumentValidator documentValidator) {
+ if (documentValidator.getSignatures().isEmpty()) {
+ throw new InvalidRequestException(SIGNATURE_VALIDATION_ERROR.getMessage(), SIGNATURE_VALIDATION_ERROR.getCode());
+ }
+ }
+
+ public void verifyOriginalDocument(SignedDocumentValidator validator) {
+ List advancedSignatures = validator.getSignatures();
+ List dssDocuments = new ArrayList<>();
+ if (advancedSignatures != null && !advancedSignatures.isEmpty()) {
+ for (AdvancedSignature a : advancedSignatures) {
+ Optional.ofNullable(validator.getOriginalDocuments(a.getId())).ifPresent(dssDocuments::addAll);
+ }
+ }
+ if (dssDocuments.isEmpty()) {
+ throw new InvalidRequestException(ORIGINAL_DOCUMENT_NOT_FOUND.getMessage(), ORIGINAL_DOCUMENT_NOT_FOUND.getCode());
+ }
+ }
+
+ public Reports validateDocument(SignedDocumentValidator signedDocumentValidator) {
+ try {
+ return signedDocumentValidator.validateDocument();
+ } catch (Exception e) {
+ throw new InvalidRequestException(String.format(DOCUMENT_VALIDATION_FAIL.getMessage(), e.getMessage()), DOCUMENT_VALIDATION_FAIL.getCode());
+ }
+ }
+
+ public void verifySignatureForm(SignedDocumentValidator validator) {
+
+ String signatureFormErrors = validator.getSignatures().stream()
+ .map(AdvancedSignature::getSignatureForm)
+ .filter(signatureForm -> signatureForm != SignatureForm.CAdES)
+ .map(SignatureForm::toString)
+ .collect(Collectors.joining(","));
+
+ if (!StringUtils.isBlank(signatureFormErrors)) {
+ throw new InvalidRequestException(String.format(INVALID_SIGNATURE_FORMS.getMessage(), signatureFormErrors),
+ INVALID_SIGNATURE_FORMS.getCode());
+ }
+ }
+
+ public void verifySignature(Reports reports) {
+ List signatureValidationReportTypes = new ArrayList<>();
+
+ if (reports.getEtsiValidationReportJaxb() != null) {
+ signatureValidationReportTypes = reports.getEtsiValidationReportJaxb().getSignatureValidationReport();
+ }
+ if (signatureValidationReportTypes.isEmpty()
+ || (!signatureValidationReportTypes.stream().allMatch(s -> s.getSignatureValidationStatus() != null
+ && Indication.TOTAL_PASSED == s.getSignatureValidationStatus().getMainIndication()))) {
+ throw new InvalidRequestException(INVALID_DOCUMENT_SIGNATURE.getMessage(), INVALID_DOCUMENT_SIGNATURE.getCode());
+ }
+ }
+
+ public void verifyDigest(SignedDocumentValidator validator, String checksum) {
+ List advancedSignatures = validator.getSignatures();
+
+ if (advancedSignatures != null && !advancedSignatures.isEmpty()) {
+ for (AdvancedSignature a : advancedSignatures) {
+
+ List dssDocuments = validator.getOriginalDocuments(a.getId());
+ if (!dssDocuments.stream().map(dssDocument -> dssDocument.getDigest(DigestAlgorithm.SHA256))
+ .collect(Collectors.toList()).contains(checksum)) {
+ throw new InvalidRequestException(INVALID_CONTRACT_DIGEST.getMessage(), INVALID_CONTRACT_DIGEST.getCode());
+ }
+ }
+ }
+
+ }
+
+ @Override
+ public void verifySignature(File file, String checksum, List usersTaxCode) {
+ try {
+ byte[] byteData = Files.readAllBytes(file.toPath());
+
+ SignedDocumentValidator validator = createDocumentValidator(byteData);
+ isDocumentSigned(validator);
+ verifyOriginalDocument(validator);
+ Reports reports = validateDocument(validator);
+
+ verifySignatureForm(validator);
+ verifySignature(reports);
+ verifyDigest(validator, checksum);
+ verifyManagerTaxCode(reports, usersTaxCode);
+
+ } catch (InvalidRequestException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new InvalidRequestException(GENERIC_ERROR.getMessage(), GENERIC_ERROR.getCode());
+ }
+ }
+
+ public void verifyManagerTaxCode(Reports reports, List usersTaxCode) {
+ List signatureTaxCodes = extractSubjectSNCFs(reports);
+ if (signatureTaxCodes.isEmpty()) {
+ throw new InvalidRequestException(TAX_CODE_NOT_FOUND_IN_SIGNATURE.getMessage(), TAX_CODE_NOT_FOUND_IN_SIGNATURE.getCode());
+ }
+
+ List taxCodes = extractTaxCode(signatureTaxCodes);
+
+ if (taxCodes.isEmpty() || !isSignedByLegal(usersTaxCode, taxCodes)) {
+ throw new InvalidRequestException(INVALID_SIGNATURE_TAX_CODE.getMessage(), INVALID_SIGNATURE_TAX_CODE.getCode());
+ }
+
+ }
+
+ private List extractTaxCode(List signatureTaxCodes) {
+ List taxCode = new ArrayList<>();
+ signatureTaxCodes.forEach(s -> {
+ Matcher matcher = signatureRegex.matcher(s);
+ if (matcher.matches()) {
+ taxCode.add(matcher.group(CF_MATCHER_GROUP));
+ }
+ });
+ return taxCode;
+ }
+
+ private boolean isSignedByLegal(List usersTaxCode, List signatureTaxCodes) {
+ return !signatureTaxCodes.isEmpty() && !usersTaxCode.isEmpty()
+ && new HashSet<>(signatureTaxCodes).containsAll(usersTaxCode);
+ }
+
+ private List extractSubjectSNCFs(Reports reports) {
+ if (reports.getDiagnosticData() != null && reports.getDiagnosticData().getUsedCertificates() != null) {
+ List subjectSNCFs = reports.getDiagnosticData().getUsedCertificates()
+ .stream().map(CertificateWrapper::getSubjectSerialNumber)
+ .filter(this::serialNumberMatch).collect(Collectors.toList());
+ if (!subjectSNCFs.isEmpty()) {
+ return subjectSNCFs;
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ private boolean serialNumberMatch(String s) {
+ if (!StringUtils.isEmpty(s)) {
+ return signatureRegex.matcher(s).matches();
+ }
+ return false;
+ }
+
+}
diff --git a/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/strategy/ConfigMapAllowedListOnboardingValidationStrategy.java b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/strategy/ConfigMapAllowedListOnboardingValidationStrategy.java
new file mode 100644
index 000000000..8fbd8d572
--- /dev/null
+++ b/apps/onboarding-ms/src/main/java/it/pagopa/selfcare/onboarding/service/strategy/ConfigMapAllowedListOnboardingValidationStrategy.java
@@ -0,0 +1,76 @@
+package it.pagopa.selfcare.onboarding.service.strategy;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import jakarta.enterprise.context.ApplicationScoped;
+import lombok.extern.slf4j.Slf4j;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+import java.util.*;
+
+/**
+ * It validate the onboarding request based on an allowed-list loaded from a property.
+ */
+@Slf4j
+@ApplicationScoped
+public class ConfigMapAllowedListOnboardingValidationStrategy implements OnboardingValidationStrategy {
+
+ /**
+ * It represent, if present, the institutions and products allowed to be onboarded (i.e. an allowed-list).
+ * The {@code Map} has as key the product id and as values a list of institution external id allowed for that product
+ * A {@code *} value means "anything".
+ * If used, the '*' is the only value allowed for a given key.
+ */
+ private final Optional