From 1d404e40a0eab2d1d5e29550eaa5e1ba858ae6bd Mon Sep 17 00:00:00 2001 From: flaminiaScarciofolo Date: Wed, 14 Feb 2024 11:14:15 +0100 Subject: [PATCH 1/2] add clients for core API --- .../docs/openapi/api-selfcare-core-docs.json | 3927 ++++++++++++----- .../connector/rest/MsCoreConnectorImpl.java | 14 +- ....java => CoreDelegationApiRestClient.java} | 2 +- .../client/CoreInstitutionApiRestClient.java | 8 + .../client/CoreManagementApiRestClient.java | 9 + .../client/CoreOnboardingApiRestClient.java | 8 + ...Client.java => CoreUserApiRestClient.java} | 2 +- ...=> CoreDelegationApiRestClientConfig.java} | 6 +- .../CoreInstitutionApiRestClientConfig.java | 16 + .../CoreManagementApiRestClientConfig.java | 16 + .../CoreOnboardingApiRestClientConfig.java | 16 + .../config/CoreUserApiRestClientConfig.java | 16 + .../rest/config/MsCoreRestClientConfig.java | 5 +- .../PartyManagementRestClientConfig.java | 4 +- .../config/PartyProcessRestClientConfig.java | 4 +- .../config/ms-core-rest-client.properties | 23 +- .../rest/MsCoreConnectorImplTest.java | 21 +- 17 files changed, 3068 insertions(+), 1029 deletions(-) rename connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/{MsCoreDelegationApiRestClient.java => CoreDelegationApiRestClient.java} (66%) create mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreInstitutionApiRestClient.java create mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreManagementApiRestClient.java create mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreOnboardingApiRestClient.java rename connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/{MsCoreUserApiRestClient.java => CoreUserApiRestClient.java} (67%) rename connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/{MsCoreDelegationApiRestClientConfig.java => CoreDelegationApiRestClientConfig.java} (67%) create mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java create mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java create mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java create mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java diff --git a/connector/rest/docs/openapi/api-selfcare-core-docs.json b/connector/rest/docs/openapi/api-selfcare-core-docs.json index ec6e0a4ba..b67029277 100644 --- a/connector/rest/docs/openapi/api-selfcare-core-docs.json +++ b/connector/rest/docs/openapi/api-selfcare-core-docs.json @@ -42,6 +42,9 @@ }, { "name" : "Token", "description" : "Token Controller" + }, { + "name" : "kafka", + "description" : "Queue Notification Controller" } ], "paths" : { "/migration/institution" : { @@ -712,7 +715,7 @@ }, "/delegations" : { "get" : { - "tags" : [ "Delegation" ], + "tags" : [ "Delegation", "external-v2", "support" ], "summary" : "Retrieve institution's delegations", "description" : "Retrieve institution's delegations", "operationId" : "getDelegationsUsingGET", @@ -743,6 +746,16 @@ "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" : { @@ -844,6 +857,68 @@ } ] } }, + "/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" ], @@ -855,10 +930,11 @@ "in" : "query", "description" : "List of Institution to onboard", "required" : true, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" + "schema": { + "type": "array", + "items": { + "type": "string" + } } } ], "responses" : { @@ -1093,10 +1169,13 @@ "description" : "states", "required" : false, "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + + } } } ], "responses" : { @@ -1289,42 +1368,47 @@ "in" : "query", "description" : "roles", "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + "schema": { + "type": "array", + "items": { + "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" ] + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + + } } }, { "name" : "products", "in" : "query", "description" : "products", "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" + "schema": { + "type": "array", + "items": { + "type": "string" + } } }, { "name" : "productRoles", "in" : "query", "description" : "productRoles", "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" + "schema": { + "type": "array", + "items": { + "type": "string" + } } } ], "responses" : { @@ -1367,17 +1451,17 @@ } ] } }, - "/institutions/" : { + "/institutions" : { "get" : { - "tags" : [ "Institution" ], + "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" : "${swagger.mscore.institutions.model.taxCode}", - "required" : true, + "description" : "Institution's tax code", + "required" : false, "style" : "form", "schema" : { "type" : "string" @@ -1385,7 +1469,25 @@ }, { "name" : "subunitCode", "in" : "query", - "description" : "${swagger.mscore.institutions.model.subunitCode}", + "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" : { @@ -1489,17 +1591,17 @@ } ] } }, - "/institutions/from-ipa/" : { + "/institutions/from-anac" : { "post" : { "tags" : [ "Institution" ], - "summary" : "${swagger.mscore.institution.create.from-ipa}", - "description" : "${swagger.mscore.institution.create.from-ipa}", - "operationId" : "createInstitutionFromIpaUsingPOST", + "summary" : "${swagger.mscore.institution.create.from-anac}", + "description" : "${swagger.mscore.institution.create.from-anac}", + "operationId" : "createInstitutionFromAnacUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionFromIpaPost" + "$ref" : "#/components/schemas/InstitutionRequest" } } } @@ -1551,22 +1653,12 @@ } ] } }, - "/institutions/insert/{externalId}" : { + "/institutions/from-infocamere" : { "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" - } - } ], + "summary" : "create an institution from infocamere registry", + "description" : "create an institution from infocamere registry", + "operationId" : "createInstitutionFromInfocamereUsingPOST", "requestBody" : { "content" : { "application/json" : { @@ -1577,8 +1669,8 @@ } }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { @@ -1618,50 +1710,33 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/onboarded/{productId}" : { + "/institutions/from-ipa" : { "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" - } - } ], + "summary" : "create an institution from ipa registry", + "description" : "create an institution from ipa registry", + "operationId" : "createInstitutionFromIpaUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionToOnboard" - } + "$ref" : "#/components/schemas/InstitutionFromIpaPost" } } } }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionToOnboard" - } + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -1702,17 +1777,17 @@ } ] } }, - "/institutions/pg" : { + "/institutions/from-ivass" : { "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", + "summary" : "create an institution from ivass CSV", + "description" : "create an institution from ivass CSV", + "operationId" : "createInstitutionFromIvassUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreatePgInstitutionRequest" + "$ref" : "#/components/schemas/InstitutionRequest" } } } @@ -1764,49 +1839,28 @@ } ] } }, - "/institutions/products/{productId}" : { - "get" : { + "/institutions/from-pda" : { + "post" : { "tags" : [ "Institution" ], - "summary" : "${swagger.mscore.institutions.findFromProduct}", - "description" : "${swagger.mscore.institutions.findFromProduct}", - "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" + "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" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionOnboardingListResponse" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -1830,6 +1884,16 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { @@ -1837,12 +1901,12 @@ } ] } }, - "/institutions/{externalId}" : { + "/institutions/insert/{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", + "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", @@ -1853,9 +1917,18 @@ "type" : "string" } } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/InstitutionRequest" + } + } + } + }, "responses" : { - "201" : { - "description" : "Created", + "200" : { + "description" : "OK", "content" : { "application/json" : { "schema" : { @@ -1901,29 +1974,44 @@ } ] } }, - "/institutions/{id}" : { - "get" : { + "/institutions/onboarded/{productId}" : { + "post" : { "tags" : [ "Institution" ], - "summary" : "Gets the corresponding institution using internal institution id", - "description" : "Gets the corresponding institution using internal institution id", - "operationId" : "retrieveInstitutionByIdUsingGET", + "summary" : "Retrieve list of institution which logged user can onboard", + "description" : "Retrieve list of institution which logged user can onboard", + "operationId" : "getValidInstitutionToOnboardUsingPOST", "parameters" : [ { - "name" : "id", + "name" : "productId", "in" : "path", - "description" : "The internal identifier of the institution", + "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" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/InstitutionToOnboard" + } } } } @@ -1947,39 +2035,41 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { "bearerAuth" : [ "global" ] } ] - }, - "put" : { + } + }, + "/institutions/pg" : { + "post" : { "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" - } - } ], + "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/InstitutionPut" + "$ref" : "#/components/schemas/CreatePgInstitutionRequest" } } } }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { @@ -1998,8 +2088,8 @@ } } }, - "403" : { - "description" : "Forbidden", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -2008,8 +2098,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -2022,25 +2112,54 @@ "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", + } + }, + "/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" : "id", + "name" : "productId", "in" : "path", - "description" : "The internal identifier of the institution", + "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" : { - "204" : { - "description" : "No Content" + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/InstitutionOnboardingListResponse" + } + } + } }, "400" : { "description" : "Bad Request", @@ -2063,22 +2182,21 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{id}/geotaxonomies" : { - "get" : { + "/institutions/{externalId}" : { + "post" : { "tags" : [ "Institution" ], - "summary" : "retrieves the geographic taxonomies this institution is related to", - "description" : "retrieves the geographic taxonomies this institution is related to", - "operationId" : "retrieveInstitutionGeoTaxonomiesUsingGET", + "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" : "id", + "name" : "externalId", "in" : "path", - "description" : "The internal identifier of the institution", + "description" : "Institution's unique external identifier", "required" : true, "style" : "simple", "schema" : { @@ -2086,15 +2204,12 @@ } } ], "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/GeographicTaxonomies" - } + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -2118,19 +2233,30 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{id}/products" : { + "/institutions/{id}" : { "get" : { - "tags" : [ "Institution" ], - "summary" : "retrieves the insistitution's related products.", - "description" : "retrieves the insistitution's related products.", - "operationId" : "retrieveInstitutionProductsUsingGET", + "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", @@ -2140,17 +2266,6 @@ "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" : { @@ -2158,7 +2273,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/OnboardedProducts" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -2187,14 +2302,12 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - } - }, - "/institutions/{id}/relationships" : { - "get" : { + }, + "put" : { "tags" : [ "Institution" ], - "summary" : "returns the relationships related to the institution", - "description" : "returns the relationships related to the institution", - "operationId" : "getUserInstitutionRelationshipsUsingGET", + "summary" : "update institution data of given institution", + "description" : "update institution data of given institution", + "operationId" : "updateInstitutionUsingPUT", "parameters" : [ { "name" : "id", "in" : "path", @@ -2204,68 +2317,23 @@ "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" - } } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/InstitutionPut" + } + } + } + }, "responses" : { "200" : { "description" : "OK", "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -2280,6 +2348,16 @@ } } }, + "403" : { + "description" : "Forbidden", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, "404" : { "description" : "Not Found", "content" : { @@ -2294,16 +2372,14 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - } - }, - "/institutions/{institutionId}/onboardings" : { - "get" : { - "tags" : [ "Institution" ], - "summary" : "${swagger.mscore.institution.info}", - "description" : "${swagger.mscore.institution.info}", - "operationId" : "getOnboardingsInstitutionUsingGET", + }, + "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" : "institutionId", + "name" : "id", "in" : "path", "description" : "The internal identifier of the institution", "required" : true, @@ -2311,26 +2387,10 @@ "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" - } - } - } + "204" : { + "description" : "No Content" }, "400" : { "description" : "Bad Request", @@ -2353,19 +2413,20 @@ } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{institutionId}/products/{productId}/createdAt" : { - "put" : { + "/institutions/{id}/geotaxonomies" : { + "get" : { "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", + "summary" : "retrieves the geographic taxonomies this institution is related to", + "description" : "retrieves the geographic taxonomies this institution is related to", + "operationId" : "retrieveInstitutionGeoTaxonomiesUsingGET", "parameters" : [ { - "name" : "institutionId", + "name" : "id", "in" : "path", "description" : "The internal identifier of the institution", "required" : true, @@ -2373,42 +2434,23 @@ "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", + "description" : "OK", "content" : { - "application/problem+json" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Problem" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/GeographicTaxonomies" + } } } } }, - "403" : { - "description" : "Forbidden", + "400" : { + "description" : "Bad Request", "content" : { "application/problem+json" : { "schema" : { @@ -2433,94 +2475,38 @@ } ] } }, - "/institutions/{productId}/brokers/{institutionType}" : { - "get" : { + "/institutions/{id}/onboarding" : { + "post" : { "tags" : [ "Institution" ], - "summary" : "Retrieve institution brokers", - "description" : "${swagger.mscore.institutions.getInstitutionBrokers}", - "operationId" : "getInstitutionBrokersUsingGET", + "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" : "productId", + "name" : "id", "in" : "path", - "description" : "Product's unique identifier", + "description" : "id", "required" : true, "style" : "simple", "schema" : { "type" : "string" } - }, { - "name" : "institutionType", - "in" : "path", - "description" : "Institution's type", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "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" + "$ref" : "#/components/schemas/InstitutionOnboardingRequest" } } } }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/BulkInstitutions" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -2561,29 +2547,41 @@ } ] } }, - "/external/institutions/product/{productId}" : { + "/institutions/{id}/products" : { "get" : { - "tags" : [ "Management" ], - "summary" : "Retrieves Institutions by product ID", - "description" : "Retrieves Institutions by product ID", - "operationId" : "getInstitutionByProductIdUsingGET", + "tags" : [ "Institution" ], + "summary" : "retrieves the insistitution's related products.", + "description" : "retrieves the insistitution's related products.", + "operationId" : "retrieveInstitutionProductsUsingGET", "parameters" : [ { - "name" : "productId", + "name" : "id", "in" : "path", - "description" : "Product's unique identifier", + "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, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionListResponse" + "$ref" : "#/components/schemas/OnboardedProducts" } } } @@ -2609,45 +2607,92 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/bygeotaxonomies" : { + "/institutions/{id}/relationships" : { "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", + "tags" : [ "Institution" ], + "summary" : "returns the relationships related to the institution", + "description" : "returns the relationships related to the institution", + "operationId" : "getUserInstitutionRelationshipsUsingGET", "parameters" : [ { - "name" : "geoTaxonomies", - "in" : "query", - "description" : "Comma separated list of the geographic taxonomies to search", + "name" : "id", + "in" : "path", + "description" : "The internal identifier of the institution", "required" : true, - "style" : "form", + "style" : "simple", "schema" : { "type" : "string" } }, { - "name" : "searchMode", + "name" : "personId", "in" : "query", - "description" : "The search mode to perform, as default 'any'", + "description" : "personId", "required" : false, "style" : "form", "schema" : { - "type" : "string", - "enum" : [ "ALL", "ANY", "EXACT" ] + "type" : "string" + } + }, { + "name" : "roles", + "in" : "query", + "description" : "roles", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + } + }, { + "name" : "states", + "in" : "query", + "description" : "states", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + } + }, { + "name" : "products", + "in" : "query", + "description" : "products", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { + "name" : "productRoles", + "in" : "query", + "description" : "productRoles", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string" + } } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionListResponse" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/RelationshipResult" + } } } } @@ -2673,20 +2718,19 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{id}/attributes" : { + "/institutions/{institutionId}/onboardings" : { "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", + "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, @@ -2694,17 +2738,23 @@ "schema" : { "type" : "string" } + }, { + "name" : "productId", + "in" : "query", + "description" : "productId", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/AttributesResponse" - } + "$ref" : "#/components/schemas/OnboardingsResponse" } } } @@ -2730,41 +2780,62 @@ } } }, - "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", + "/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" : "externalId", + "name" : "institutionId", "in" : "path", - "description" : "Institution's unique external identifier", + "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" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK" + }, + "400" : { + "description" : "Bad Request", "content" : { - "*/*" : { + "application/problem+json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionManagementResponse" + "$ref" : "#/components/schemas/Problem" } } } }, - "400" : { - "description" : "Bad Request", + "403" : { + "description" : "Forbidden", "content" : { "application/problem+json" : { "schema" : { @@ -2784,22 +2855,21 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/management/institutions/{id}" : { + "/institutions/{institutionId}/users" : { "get" : { - "tags" : [ "Management" ], - "summary" : "Gets the corresponding institution using internal institution id", - "description" : "Gets the corresponding institution using internal institution id", - "operationId" : "getInstitutionByInternalIdUsingGET", + "tags" : [ "Institution", "support" ], + "summary" : "getInstitutionUsers", + "description" : "Retrieve institution's users", + "operationId" : "getInstitutionUsersUsingGET", "parameters" : [ { - "name" : "id", + "name" : "institutionId", "in" : "path", - "description" : "The internal identifier of the institution", + "description" : "Institution's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -2807,12 +2877,15 @@ } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionManagementResponse" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/UserInfoResponse" + } } } } @@ -2838,35 +2911,47 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/persons/{id}" : { + "/institutions/{productId}/brokers/{institutionType}" : { "get" : { - "tags" : [ "Management" ], - "summary" : "Retrieves Person by ID", - "description" : "Retrieves Person by ID", - "operationId" : "getUserUsingGET", + "tags" : [ "Institution" ], + "summary" : "Retrieve institution brokers", + "description" : "${swagger.mscore.institutions.getInstitutionBrokers}", + "operationId" : "getInstitutionBrokersUsingGET", "parameters" : [ { - "name" : "id", + "name" : "productId", "in" : "path", - "description" : "User's unique identifier (uuid)", + "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", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + } } ], "responses" : { "200" : { "description" : "OK", "content" : { - "*/*" : { + "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PersonId" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BrokerResponse" + } } } } @@ -2892,29 +2977,36 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] - }, - "head" : { + } + }, + "/bulk/institutions" : { + "post" : { "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" + "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" + "description" : "OK", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/BulkInstitutions" + } + } + } }, "400" : { "description" : "Bad Request", @@ -2935,77 +3027,35 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/relationships" : { + "/external/institutions/product/{productId}" : { "get" : { "tags" : [ "Management" ], - "summary" : "Return a list of relationships", - "description" : "Return a list of relationships", - "operationId" : "getInstitutionRelationshipsUsingGET", + "summary" : "Retrieves Institutions by product ID", + "description" : "Retrieves Institutions by product ID", + "operationId" : "getInstitutionByProductIdUsingGET", "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, + "name" : "productId", + "in" : "path", + "description" : "Product's unique identifier", + "required" : true, + "style" : "simple", "schema" : { "type" : "string" } @@ -3016,7 +3066,7 @@ "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/RelationshipsManagement" + "$ref" : "#/components/schemas/InstitutionListResponse" } } } @@ -3048,29 +3098,39 @@ } ] } }, - "/tokens/{tokenId}" : { + "/institutions/bygeotaxonomies" : { "get" : { "tags" : [ "Management" ], - "summary" : "retrieve a token relationship", - "description" : "retrieve a token relationship", - "operationId" : "getTokenUsingGET", + "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" : "tokenId", - "in" : "path", - "description" : "contract's unique identifier", - "required" : true, - "style" : "simple", + "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" : { - "200" : { - "description" : "OK", + "204" : { + "description" : "No Content", "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/TokenResponse" + "$ref" : "#/components/schemas/InstitutionListResponse" } } } @@ -3102,43 +3162,35 @@ } ] } }, - "/onboarding/" : { - "head" : { - "tags" : [ "Onboarding" ], - "summary" : "verify if onboardedProduct is already onboarded for institution", - "description" : "verify if onboardedProduct is already onboarded for institution", - "operationId" : "verifyOnboardingInfoUsingHEAD", + "/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" : "taxCode", - "in" : "query", - "description" : "${swagger.mscore.institutions.model.taxCode}", - "required" : true, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "subunitCode", - "in" : "query", - "description" : "${swagger.mscore.institutions.model.subunitCode}", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "productId", - "in" : "query", - "description" : "Product's unique identifier", + "name" : "id", + "in" : "path", + "description" : "The internal identifier of the institution", "required" : true, - "style" : "form", + "style" : "simple", "schema" : { "type" : "string" } } ], "responses" : { "204" : { - "description" : "No Content" + "description" : "No Content", + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AttributesResponse" + } + } + } + } }, "400" : { "description" : "Bad Request", @@ -3161,21 +3213,22 @@ } } }, + "deprecated" : true, "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", + "/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" : "tokenId", + "name" : "externalId", "in" : "path", - "description" : "contract's unique identifier", + "description" : "Institution's unique external identifier", "required" : true, "style" : "simple", "schema" : { @@ -3184,20 +3237,17 @@ } ], "responses" : { "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", + "description" : "No Content", "content" : { - "application/problem+json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/Problem" + "$ref" : "#/components/schemas/InstitutionManagementResponse" } } } }, - "404" : { - "description" : "Not Found", + "400" : { + "description" : "Bad Request", "content" : { "application/problem+json" : { "schema" : { @@ -3206,8 +3256,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3217,60 +3267,41 @@ } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/onboarding/complete/{tokenId}" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "complete an onboarding request", - "description" : "complete an onboarding request", - "operationId" : "completeOnboardingUsingPOST", + "/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" : "tokenId", + "name" : "id", "in" : "path", - "description" : "contract's unique identifier", + "description" : "The internal identifier of the institution", "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", + "description" : "No Content", "content" : { - "application/problem+json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/Problem" + "$ref" : "#/components/schemas/InstitutionManagementResponse" } } } }, - "404" : { - "description" : "Not Found", + "400" : { + "description" : "Bad Request", "content" : { "application/problem+json" : { "schema" : { @@ -3279,8 +3310,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3290,19 +3321,22 @@ } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] - }, - "delete" : { - "tags" : [ "Onboarding" ], - "summary" : "invalidate an onboarding request", - "description" : "invalidate an onboarding request", - "operationId" : "invalidateOnboardingUsingDELETE", + } + }, + "/persons/{id}" : { + "get" : { + "tags" : [ "Management" ], + "summary" : "Retrieves Person by ID", + "description" : "Retrieves Person by ID", + "operationId" : "getUserUsingGET", "parameters" : [ { - "name" : "tokenId", + "name" : "id", "in" : "path", - "description" : "contract's unique identifier", + "description" : "User's unique identifier (uuid)", "required" : true, "style" : "simple", "schema" : { @@ -3310,21 +3344,18 @@ } } ], "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", + "200" : { + "description" : "OK", "content" : { - "application/problem+json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/Problem" + "$ref" : "#/components/schemas/PersonId" } } } }, - "404" : { - "description" : "Not Found", + "400" : { + "description" : "Bad Request", "content" : { "application/problem+json" : { "schema" : { @@ -3333,8 +3364,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3344,56 +3375,29 @@ } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] - } - }, - "/onboarding/info" : { - "get" : { - "tags" : [ "Onboarding" ], - "summary" : "returns onboarding info", - "description" : "returns onboarding info", - "operationId" : "onboardingInfoUsingGET", + }, + "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" : "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, + "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/OnboardingInfoResponse" - } - } - } + "description" : "OK" }, "400" : { "description" : "Bad Request", @@ -3416,42 +3420,96 @@ } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/onboarding/institution" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "create a new Token (contract), and update institution and users data", - "description" : "create a new Token (contract), and update institution and users data", - "operationId" : "onboardingInstitutionUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionRequest" - } - } - } - }, + "/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, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + } + }, { + "name" : "states", + "in" : "query", + "description" : "states", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + } + }, { + "name" : "products", + "in" : "query", + "description" : "products", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { + "name" : "productRoles", + "in" : "query", + "description" : "productRoles", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } ], "responses" : { "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", + "description" : "No Content", "content" : { - "application/problem+json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/Problem" + "$ref" : "#/components/schemas/RelationshipsManagement" } } } }, - "404" : { - "description" : "Not Found", + "400" : { + "description" : "Bad Request", "content" : { "application/problem+json" : { "schema" : { @@ -3460,8 +3518,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3471,42 +3529,41 @@ } } }, + "deprecated" : true, "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" - } - } + "/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" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", + "200" : { + "description" : "OK", "content" : { - "application/problem+json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/Problem" + "$ref" : "#/components/schemas/TokenResponse" } } } }, - "404" : { - "description" : "Not Found", + "400" : { + "description" : "Bad Request", "content" : { "application/problem+json" : { "schema" : { @@ -3515,8 +3572,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3526,31 +3583,87 @@ } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/onboarding/institution/{externalId}/products/{productId}" : { + "/onboarding" : { "head" : { "tags" : [ "Onboarding" ], "summary" : "verify if onboardedProduct is already onboarded for institution", "description" : "verify if onboardedProduct is already onboarded for institution", - "operationId" : "verifyOnboardingInfoUsingHEAD_1", + "operationId" : "verifyOnboardingInfoUsingHEAD", "parameters" : [ { - "name" : "externalId", - "in" : "path", - "description" : "Institution's unique external identifier", + "name" : "taxCode", + "in" : "query", + "description" : "Institution's tax code", "required" : true, - "style" : "simple", + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "subunitCode", + "in" : "query", + "description" : "Institution's subunit code", + "required" : false, + "style" : "form", "schema" : { "type" : "string" } }, { "name" : "productId", - "in" : "path", + "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" @@ -3579,6 +3692,16 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { @@ -3586,17 +3709,35 @@ } ] } }, - "/onboarding/legals" : { + "/onboarding/complete/{tokenId}" : { "post" : { "tags" : [ "Onboarding" ], - "summary" : "performs legals onboarding on an already existing institution", - "description" : "performs legals onboarding on an already existing institution", - "operationId" : "onboardingInstitutionLegalsUsingPOST", + "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" : { - "application/json" : { + "multipart/form-data" : { "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionLegalsRequest" + "required" : [ "contract" ], + "type" : "object", + "properties" : { + "contract" : { + "type" : "string", + "description" : "contract", + "format" : "binary" + } + } } } } @@ -3639,33 +3780,1077 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - } - }, - "/onboarding/operators" : { - "post" : { + }, + "delete" : { "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" + "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, + "schema": { + "type": "array", + "items": { + "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" ] + } ] + } + }, + "/notification-event/contracts" : { + "post" : { + "tags" : [ "kafka" ], + "summary" : "resendContracts", + "description" : "Service to resend contract notifications on SC-Contracts topic", + "operationId" : "resendContractsUsingPOST", + "parameters" : [ { + "name" : "size", + "in" : "query", + "description" : "size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "productsFilter", + "in" : "query", + "description" : "productsFilter", + "required" : true, + "schema": { + "type": "array", + "items": { + "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" ] + } ] + } + }, + "/notification-event/users" : { + "post" : { + "tags" : [ "kafka" ], + "summary" : "resendUsers", + "description" : "Service to resend old user onboardings to the SCUsers kafka queue, it can send the onboardings of a single user or also retrieve all the users for a given set of products in a paged manner by passing page and size", + "operationId" : "resendUsersUsingPOST", + "parameters" : [ { + "name" : "size", + "in" : "query", + "description" : "size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "page", + "in" : "query", + "description" : "page", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "productsFilter", + "in" : "query", + "description" : "productsFilter", + "required" : true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { + "name" : "userId", + "in" : "query", + "description" : "userId", + "required" : false, + "style" : "form", + "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" : { + "get" : { + "tags" : [ "Token" ], + "summary" : "${swagger.mscore.tokens.getAll}", + "description" : "${swagger.mscore.tokens.getAll}", + "operationId" : "getAllTokensUsingGET", + "parameters" : [ { + "name" : "states", + "in" : "query", + "description" : "${swagger.mscore.token.model.states}", + "required" : false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + } + }, { + "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" + } + }, { + "name" : "productId", + "in" : "query", + "description" : "productId", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/PaginatedTokenResponse" + } + } + } + }, + "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/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" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } + "$ref" : "#/components/schemas/TokenResource" } } } @@ -3689,16 +4874,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -3706,12 +4881,12 @@ } ] } }, - "/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", + "/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", @@ -3723,8 +4898,15 @@ } } ], "responses" : { - "204" : { - "description" : "No Content" + "200" : { + "description" : "OK", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/TokenResponse" + } + } + } }, "400" : { "description" : "Bad Request", @@ -3762,12 +4944,12 @@ } ] } }, - "/onboarding/relationship/{relationshipId}/document" : { + "/relationships/{relationshipId}" : { "get" : { - "tags" : [ "Onboarding" ], - "summary" : "retrieve the contractDocument related to a relationship", - "description" : "retrieve the contractDocument related to a relationship", - "operationId" : "getOnboardingDocumentUsingGET", + "tags" : [ "Persons" ], + "summary" : "Gets the corresponding relationship", + "description" : "Gets the corresponding relationship", + "operationId" : "getRelationshipUsingGET", "parameters" : [ { "name" : "relationshipId", "in" : "path", @@ -3784,8 +4966,7 @@ "content" : { "*/*" : { "schema" : { - "type" : "string", - "format" : "byte" + "$ref" : "#/components/schemas/RelationshipResult" } } } @@ -3814,36 +4995,25 @@ "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" - } - } + }, + "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" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } - } - } - } + "204" : { + "description" : "No Content" }, "400" : { "description" : "Bad Request", @@ -3881,39 +5051,22 @@ } ] } }, - "/onboarding/{tokenId}/consume" : { + "/relationships/{relationshipId}/activate" : { "post" : { - "tags" : [ "Onboarding" ], - "summary" : "Consume token onboarding request without digest verification ", - "description" : "Consume token onboarding request without digest verification ", - "operationId" : "consumeTokenUsingPOST", + "tags" : [ "Persons" ], + "summary" : "Activate the relationship", + "description" : "Activate the relationship", + "operationId" : "activateRelationshipUsingPOST", "parameters" : [ { - "name" : "tokenId", + "name" : "relationshipId", "in" : "path", - "description" : "contract's unique identifier", + "description" : "UserBinding'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" @@ -3954,43 +5107,38 @@ } ] } }, - "/tokens/token" : { - "get" : { - "tags" : [ "Token" ], - "summary" : "Retrieve token given the institution's and product ids", - "operationId" : "getTokenUsingGET_1", + "/relationships/{relationshipId}/suspend" : { + "post" : { + "tags" : [ "Persons" ], + "summary" : "Suspend the relationship", + "description" : "Suspend the relationship", + "operationId" : "suspendRelationshipUsingPOST", "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", + "name" : "relationshipId", + "in" : "path", + "description" : "UserBinding's unique identifier", "required" : true, - "style" : "form", + "style" : "simple", "schema" : { "type" : "string" } } ], "responses" : { - "200" : { - "description" : "OK", + "204" : { + "description" : "No Content" + }, + "400" : { + "description" : "Bad Request", "content" : { - "*/*" : { + "application/problem+json" : { "schema" : { - "$ref" : "#/components/schemas/TokenResource" + "$ref" : "#/components/schemas/Problem" } } } }, - "400" : { - "description" : "Bad Request", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3999,8 +5147,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -4015,18 +5163,38 @@ } ] } }, - "/tokens/{tokenId}/verify" : { - "post" : { - "tags" : [ "Token" ], - "summary" : "Verify if the token is already consumed", - "description" : "Verify if the token is already consumed", - "operationId" : "verifyTokenUsingPOST", + "/users" : { + "get" : { + "tags" : [ "Persons" ], + "summary" : "getUsers", + "description" : "Retrieve all users according to optional params in input", + "operationId" : "getUsersUsingGET", "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "contract's unique identifier", - "required" : true, - "style" : "simple", + "name" : "size", + "in" : "query", + "description" : "size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "page", + "in" : "query", + "description" : "page", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "productId", + "in" : "query", + "description" : "productId", + "required" : false, + "style" : "form", "schema" : { "type" : "string" } @@ -4037,7 +5205,7 @@ "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/TokenResponse" + "$ref" : "#/components/schemas/UsersNotificationResponse" } } } @@ -4051,19 +5219,9 @@ } } } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", + }, + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -4078,21 +5236,39 @@ } ] } }, - "/relationships/{relationshipId}" : { + "/users/{id}" : { "get" : { - "tags" : [ "Persons" ], - "summary" : "Gets the corresponding relationship", - "description" : "Gets the corresponding relationship", - "operationId" : "getRelationshipUsingGET", + "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" : "relationshipId", + "name" : "id", "in" : "path", - "description" : "UserBinding's unique identifier", + "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" : { @@ -4100,7 +5276,7 @@ "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/RelationshipResult" + "$ref" : "#/components/schemas/UserResponse" } } } @@ -4129,21 +5305,70 @@ "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", + } + }, + "/users/{id}/status" : { + "put" : { + "tags" : [ "support" ], + "summary" : "Update user status with optional filter for institution, product, role and productRole", + "description" : "Update user status with optional filter for institution, product, role and productRole", + "operationId" : "updateUserStatusUsingPUT", "parameters" : [ { - "name" : "relationshipId", + "name" : "id", "in" : "path", - "description" : "UserBinding's unique identifier", + "description" : "User'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" : "productId", + "in" : "query", + "description" : "Product's unique identifier", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "role", + "in" : "query", + "description" : "role", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + }, { + "name" : "productRole", + "in" : "query", + "description" : "productRole", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "status", + "in" : "query", + "description" : "status", + "required" : true, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } } ], "responses" : { "204" : { @@ -4159,8 +5384,8 @@ } } }, - "404" : { - "description" : "Not Found", + "403" : { + "description" : "Forbidden", "content" : { "application/problem+json" : { "schema" : { @@ -4169,8 +5394,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -4185,21 +5410,30 @@ } ] } }, - "/relationships/{relationshipId}/activate" : { + "/users/{id}/update" : { "post" : { "tags" : [ "Persons" ], - "summary" : "Activate the relationship", - "description" : "Activate the relationship", - "operationId" : "activateRelationshipUsingPOST", + "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" : "relationshipId", + "name" : "id", "in" : "path", - "description" : "UserBinding's unique identifier", + "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" : { @@ -4241,14 +5475,14 @@ } ] } }, - "/relationships/{relationshipId}/suspend" : { - "post" : { + "/users/{userId}/institution-products" : { + "get" : { "tags" : [ "Persons" ], - "summary" : "Suspend the relationship", - "description" : "Suspend the relationship", - "operationId" : "suspendRelationshipUsingPOST", + "summary" : "returns onboarding info", + "description" : "returns onboarding info", + "operationId" : "getInstitutionProductsInfoUsingGET", "parameters" : [ { - "name" : "relationshipId", + "name" : "userId", "in" : "path", "description" : "UserBinding's unique identifier", "required" : true, @@ -4256,23 +5490,41 @@ "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", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } } ], "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", + "200" : { + "description" : "OK", "content" : { - "application/problem+json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/Problem" + "$ref" : "#/components/schemas/OnboardingInfoResponse" } } } }, - "404" : { - "description" : "Not Found", + "400" : { + "description" : "Bad Request", "content" : { "application/problem+json" : { "schema" : { @@ -4281,8 +5533,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -4297,12 +5549,12 @@ } ] } }, - "/users/{userId}/institution-products" : { - "get" : { + "/users/{userId}/institutions/{institutionId}/products/{productId}" : { + "delete" : { "tags" : [ "Persons" ], - "summary" : "returns onboarding info", - "description" : "returns onboarding info", - "operationId" : "getInstitutionProductsInfoUsingGET", + "summary" : "Delete logically the association institution and product", + "description" : "Delete logically the association institution and product", + "operationId" : "deleteProductsUsingDELETE", "parameters" : [ { "name" : "userId", "in" : "path", @@ -4314,27 +5566,39 @@ } }, { "name" : "institutionId", - "in" : "query", + "in" : "path", "description" : "The internal identifier of the institution", - "required" : false, - "style" : "form", + "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", + "description" : "OK" + }, + "400" : { + "description" : "Bad Request", "content" : { - "*/*" : { + "application/problem+json" : { "schema" : { - "$ref" : "#/components/schemas/OnboardingInfoResponse" + "$ref" : "#/components/schemas/Problem" } } } }, - "400" : { - "description" : "Bad Request", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -4343,8 +5607,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -4388,10 +5652,11 @@ "in" : "query", "description" : "List of Relationship state for filter products", "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" + "schema": { + "type": "array", + "items": { + "type": "string" + } } } ], "responses" : { @@ -4434,6 +5699,72 @@ }, "components" : { "schemas" : { + "AdditionalInformations" : { + "title" : "AdditionalInformations", + "type" : "object", + "properties" : { + "agentOfPublicService" : { + "type" : "boolean" + }, + "agentOfPublicServiceNote" : { + "type" : "string" + }, + "belongRegulatedMarket" : { + "type" : "boolean" + }, + "establishedByRegulatoryProvision" : { + "type" : "boolean" + }, + "establishedByRegulatoryProvisionNote" : { + "type" : "string" + }, + "ipa" : { + "type" : "boolean" + }, + "ipaCode" : { + "type" : "string" + }, + "otherNote" : { + "type" : "string" + }, + "regulatedMarketNote" : { + "type" : "string" + } + } + }, + "AdditionalInformationsRequest" : { + "title" : "AdditionalInformationsRequest", + "type" : "object", + "properties" : { + "agentOfPublicService" : { + "type" : "boolean" + }, + "agentOfPublicServiceNote" : { + "type" : "string" + }, + "belongRegulatedMarket" : { + "type" : "boolean" + }, + "establishedByRegulatoryProvision" : { + "type" : "boolean" + }, + "establishedByRegulatoryProvisionNote" : { + "type" : "string" + }, + "ipa" : { + "type" : "boolean" + }, + "ipaCode" : { + "type" : "string" + }, + "otherNote" : { + "type" : "string" + }, + "regulatedMarketNote" : { + "type" : "string" + } + } + }, "Attributes" : { "title" : "Attributes", "type" : "object", @@ -4567,7 +5898,7 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "origin" : { "type" : "string" @@ -4738,22 +6069,50 @@ "title" : "DataProtectionOfficerResponse", "type" : "object", "properties" : { - "address" : { + "address" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "pec" : { + "type" : "string" + } + } + }, + "DelegationRequest" : { + "title" : "DelegationRequest", + "type" : "object", + "properties" : { + "from" : { "type" : "string" }, - "email" : { + "institutionFromName" : { "type" : "string" }, - "pec" : { + "institutionToName" : { + "type" : "string" + }, + "productId" : { + "type" : "string" + }, + "to" : { "type" : "string" + }, + "type" : { + "type" : "string", + "enum" : [ "AOO", "PT" ] } } }, - "DelegationRequest" : { - "title" : "DelegationRequest", + "DelegationRequestFromTaxcode" : { + "title" : "DelegationRequestFromTaxcode", "type" : "object", "properties" : { - "from" : { + "fromSubunitCode" : { + "type" : "string" + }, + "fromTaxCode" : { "type" : "string" }, "institutionFromName" : { @@ -4765,7 +6124,10 @@ "productId" : { "type" : "string" }, - "to" : { + "toSubunitCode" : { + "type" : "string" + }, + "toTaxCode" : { "type" : "string" }, "type" : { @@ -4784,6 +6146,12 @@ "brokerName" : { "type" : "string" }, + "brokerTaxCode" : { + "type" : "string" + }, + "brokerType" : { + "type" : "string" + }, "id" : { "type" : "string" }, @@ -4796,9 +6164,16 @@ "institutionRootName" : { "type" : "string" }, + "institutionType" : { + "type" : "string", + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + }, "productId" : { "type" : "string" }, + "taxCode" : { + "type" : "string" + }, "type" : { "type" : "string", "enum" : [ "AOO", "PT" ] @@ -4869,6 +6244,15 @@ "businessRegisterPlace" : { "type" : "string" }, + "city" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "county" : { + "type" : "string" + }, "createdAt" : { "type" : "string", "format" : "date-time" @@ -4899,7 +6283,10 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + }, + "istatCode" : { + "type" : "string" }, "onboarding" : { "type" : "array", @@ -4925,6 +6312,9 @@ "rea" : { "type" : "string" }, + "rootParentId" : { + "type" : "string" + }, "shareCapital" : { "type" : "string" }, @@ -4979,11 +6369,11 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "origin" : { "type" : "string", - "enum" : [ "ADE", "INFOCAMERE", "IPA", "MOCK", "SELC", "UNKNOWN" ] + "enum" : [ "ADE", "ANAC", "INFOCAMERE", "IPA", "IVASS", "MOCK", "SELC", "UNKNOWN" ] }, "originId" : { "type" : "string" @@ -5009,12 +6399,18 @@ "title" : "InstitutionFromIpaPost", "type" : "object", "properties" : { + "geographicTaxonomies" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/GeoTaxonomies" + } + }, "subunitCode" : { "type" : "string" }, "subunitType" : { "type" : "string", - "enum" : [ "AOO", "EC", "UO" ] + "enum" : [ "AOO", "UO" ] }, "taxCode" : { "type" : "string" @@ -5094,7 +6490,7 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "origin" : { "type" : "string" @@ -5195,6 +6591,33 @@ } } }, + "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", @@ -5244,7 +6667,7 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "onboardings" : { "type" : "object", @@ -5371,6 +6794,15 @@ "businessRegisterPlace" : { "type" : "string" }, + "city" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "county" : { + "type" : "string" + }, "createdAt" : { "type" : "string", "format" : "date-time" @@ -5401,7 +6833,7 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "onboarding" : { "type" : "array", @@ -5461,6 +6893,19 @@ "businessRegisterPlace" : { "type" : "string" }, + "city" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "county" : { + "type" : "string" + }, + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, "dataProtectionOfficer" : { "$ref" : "#/components/schemas/DataProtectionOfficerResponse" }, @@ -5487,7 +6932,13 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + }, + "onboarding" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OnboardedProductResponse" + } }, "origin" : { "type" : "string" @@ -5495,15 +6946,15 @@ "originId" : { "type" : "string" }, - "parentDescription" : { - "type" : "string" - }, "paymentServiceProvider" : { "$ref" : "#/components/schemas/PaymentServiceProviderResponse" }, "rea" : { "type" : "string" }, + "rootParent" : { + "$ref" : "#/components/schemas/RootParentResponse" + }, "shareCapital" : { "type" : "string" }, @@ -5522,6 +6973,68 @@ "taxCode" : { "type" : "string" }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + }, + "zipCode" : { + "type" : "string" + } + } + }, + "InstitutionToNotifyResponse" : { + "title" : "InstitutionToNotifyResponse", + "type" : "object", + "properties" : { + "address" : { + "type" : "string" + }, + "category" : { + "type" : "string" + }, + "city" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "county" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "digitalAddress" : { + "type" : "string" + }, + "institutionType" : { + "type" : "string", + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + }, + "istatCode" : { + "type" : "string" + }, + "origin" : { + "type" : "string" + }, + "originId" : { + "type" : "string" + }, + "paymentServiceProvider" : { + "$ref" : "#/components/schemas/PaymentServiceProvider" + }, + "rootParent" : { + "$ref" : "#/components/schemas/RootParent" + }, + "subUnitCode" : { + "type" : "string" + }, + "subUnitType" : { + "type" : "string" + }, + "taxCode" : { + "type" : "string" + }, "zipCode" : { "type" : "string" } @@ -5543,12 +7056,24 @@ "title" : "InstitutionUpdate", "type" : "object", "properties" : { + "additionalInformations" : { + "$ref" : "#/components/schemas/AdditionalInformations" + }, "address" : { "type" : "string" }, "businessRegisterPlace" : { "type" : "string" }, + "city" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "county" : { + "type" : "string" + }, "dataProtectionOfficer" : { "$ref" : "#/components/schemas/DataProtectionOfficer" }, @@ -5569,7 +7094,10 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + }, + "ivassCode" : { + "type" : "string" }, "paymentServiceProvider" : { "$ref" : "#/components/schemas/PaymentServiceProvider" @@ -5598,12 +7126,24 @@ "title" : "InstitutionUpdateRequest", "type" : "object", "properties" : { + "additionalInformations" : { + "$ref" : "#/components/schemas/AdditionalInformationsRequest" + }, "address" : { "type" : "string" }, "businessRegisterPlace" : { "type" : "string" }, + "city" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "county" : { + "type" : "string" + }, "dataProtectionOfficer" : { "$ref" : "#/components/schemas/DataProtectionOfficerRequest" }, @@ -5624,7 +7164,10 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + }, + "ivassCode" : { + "type" : "string" }, "paymentServiceProvider" : { "$ref" : "#/components/schemas/PaymentServiceProviderRequest" @@ -5662,6 +7205,15 @@ "businessRegisterPlace" : { "type" : "string" }, + "city" : { + "type" : "string" + }, + "country" : { + "type" : "string" + }, + "county" : { + "type" : "string" + }, "dataProtectionOfficer" : { "$ref" : "#/components/schemas/DataProtectionOfficerResponse" }, @@ -5682,7 +7234,7 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "paymentServiceProvider" : { "$ref" : "#/components/schemas/PaymentServiceProviderResponse" @@ -5794,7 +7346,7 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "onboarding" : { "type" : "array", @@ -5959,7 +7511,7 @@ }, "institutionType" : { "type" : "string", - "enum" : [ "GSP", "PA", "PG", "PSP", "PT", "SCP" ] + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, "origin" : { "type" : "string" @@ -5983,6 +7535,9 @@ "type" : "string", "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] }, + "rootParentId" : { + "type" : "string" + }, "state" : { "type" : "string" }, @@ -6044,6 +7599,30 @@ } } }, + "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", @@ -6116,6 +7695,10 @@ "title" : "OnboardingImportContract", "type" : "object", "properties" : { + "activatedAt" : { + "type" : "string", + "format" : "date-time" + }, "contractType" : { "type" : "string" }, @@ -6225,6 +7808,11 @@ "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" }, @@ -6236,6 +7824,30 @@ } } }, + "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", @@ -6246,6 +7858,10 @@ "contract" : { "$ref" : "#/components/schemas/Contract" }, + "contractActivatedAt" : { + "type" : "string", + "format" : "date-time" + }, "contractCreatedAt" : { "type" : "string", "format" : "date-time" @@ -6268,6 +7884,9 @@ "productName" : { "type" : "string" }, + "sendCompleteOnboardingEmail" : { + "type" : "boolean" + }, "signContract" : { "type" : "boolean" }, @@ -6341,6 +7960,18 @@ } } }, + "PaginatedTokenResponse" : { + "title" : "PaginatedTokenResponse", + "type" : "object", + "properties" : { + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ScContractResponse" + } + } + } + }, "PaymentServiceProvider" : { "title" : "PaymentServiceProvider", "type" : "object", @@ -6399,8 +8030,26 @@ "legalRegisterNumber" : { "type" : "string" }, - "vatNumberGroup" : { - "type" : "boolean" + "vatNumberGroup" : { + "type" : "boolean" + } + } + }, + "PdaInstitutionRequest" : { + "title" : "PdaInstitutionRequest", + "type" : "object", + "properties" : { + "billing" : { + "$ref" : "#/components/schemas/BillingRequest" + }, + "description" : { + "type" : "string" + }, + "injectionInstitutionType" : { + "type" : "string" + }, + "taxCode" : { + "type" : "string" } } }, @@ -6519,6 +8168,9 @@ }, "role" : { "type" : "string" + }, + "status" : { + "type" : "string" } } }, @@ -6595,6 +8247,88 @@ } } }, + "RootParent" : { + "title" : "RootParent", + "type" : "object", + "properties" : { + "description" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "originId" : { + "type" : "string" + } + } + }, + "RootParentResponse" : { + "title" : "RootParentResponse", + "type" : "object", + "properties" : { + "description" : { + "type" : "string" + }, + "id" : { + "type" : "string" + } + } + }, + "ScContractResponse" : { + "title" : "ScContractResponse", + "type" : "object", + "properties" : { + "billing" : { + "$ref" : "#/components/schemas/BillingResponse" + }, + "closedAt" : { + "type" : "string", + "format" : "date-time" + }, + "contentType" : { + "type" : "string" + }, + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "fileName" : { + "type" : "string" + }, + "filePath" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "institution" : { + "$ref" : "#/components/schemas/InstitutionToNotifyResponse" + }, + "internalIstitutionID" : { + "type" : "string" + }, + "notificationType" : { + "type" : "string", + "enum" : [ "ADD", "UPDATE" ] + }, + "onboardingTokenId" : { + "type" : "string" + }, + "pricingPlan" : { + "type" : "string" + }, + "product" : { + "type" : "string" + }, + "state" : { + "type" : "string" + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + } + } + }, "SupportContact" : { "title" : "SupportContact", "type" : "object", @@ -6611,13 +8345,13 @@ "title" : "Token", "type" : "object", "properties" : { - "checksum" : { - "type" : "string" - }, - "closedAt" : { + "activatedAt" : { "type" : "string", "format" : "date-time" }, + "checksum" : { + "type" : "string" + }, "contentType" : { "type" : "string" }, @@ -6634,6 +8368,10 @@ "type" : "string", "format" : "date-time" }, + "deletedAt" : { + "type" : "string", + "format" : "date-time" + }, "expiringDate" : { "type" : "string", "format" : "date-time" @@ -6670,6 +8408,18 @@ } } }, + "TokenListResponse" : { + "title" : "TokenListResponse", + "type" : "object", + "properties" : { + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TokenResponse" + } + } + } + }, "TokenResource" : { "title" : "TokenResource", "type" : "object", @@ -6737,14 +8487,61 @@ "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" + } } } }, @@ -6782,6 +8579,78 @@ } } }, + "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" + } + } + }, + "UserNotificationBindingsResponse" : { + "title" : "UserNotificationBindingsResponse", + "type" : "object", + "properties" : { + "bindings" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/UserNotificationResponse" + } + } + } + }, + "UserNotificationResponse" : { + "title" : "UserNotificationResponse", + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "eventType" : { + "type" : "string", + "enum" : [ "ADD", "UPDATE" ] + }, + "id" : { + "type" : "string" + }, + "institutionId" : { + "type" : "string" + }, + "onboardingTokenId" : { + "type" : "string" + }, + "productId" : { + "type" : "string" + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + }, + "user" : { + "$ref" : "#/components/schemas/UserToNotify" + } + } + }, "UserProductsResponse" : { "title" : "UserProductsResponse", "type" : "object", @@ -6797,6 +8666,56 @@ } } }, + "UserResponse" : { + "title" : "UserResponse", + "type" : "object", + "properties" : { + "email" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "surname" : { + "type" : "string" + }, + "taxCode" : { + "type" : "string" + } + } + }, + "UserToNotify" : { + "title" : "UserToNotify", + "type" : "object", + "properties" : { + "email" : { + "type" : "string" + }, + "familyName" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "productRole" : { + "type" : "string" + }, + "relationshipStatus" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + }, + "role" : { + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + }, + "userId" : { + "type" : "string" + } + } + }, "UserToOnboard" : { "title" : "UserToOnboard", "type" : "object", @@ -6831,6 +8750,18 @@ "type" : "string" } } + }, + "UsersNotificationResponse" : { + "title" : "UsersNotificationResponse", + "type" : "object", + "properties" : { + "users" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/UserNotificationBindingsResponse" + } + } + } } }, "securitySchemes" : { diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImpl.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImpl.java index 32fbf95ec..d1f271af5 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImpl.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImpl.java @@ -14,9 +14,9 @@ import it.pagopa.selfcare.dashboard.connector.model.institution.UpdateInstitutionResource; import it.pagopa.selfcare.dashboard.connector.model.product.PartyProduct; import it.pagopa.selfcare.dashboard.connector.model.user.UserInfo; -import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreUserApiRestClient; import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreUserApiRestClient; import it.pagopa.selfcare.dashboard.connector.rest.model.ProductState; import it.pagopa.selfcare.dashboard.connector.rest.model.RelationshipInfo; import it.pagopa.selfcare.dashboard.connector.rest.model.RelationshipsResponse; @@ -47,17 +47,17 @@ class MsCoreConnectorImpl implements MsCoreConnector { static final String REQUIRED_UPDATE_RESOURCE_MESSAGE = "An Institution description is required"; private final MsCoreRestClient msCoreRestClient; - private final MsCoreUserApiRestClient msCoreUserApiRestClient; + private final CoreUserApiRestClient msCoreUserApiRestClient; private final BrokerMapper brokerMapper; private final InstitutionMapper institutionMapper; - private final MsCoreDelegationApiRestClient msCoreDelegationApiRestClient; + private final CoreDelegationApiRestClient msCoreDelegationApiRestClient; private final DelegationRestClientMapper delegationMapper; @Autowired - public MsCoreConnectorImpl(MsCoreRestClient msCoreRestClient, MsCoreUserApiRestClient msCoreUserApiRestClient, InstitutionMapper institutionMapper, BrokerMapper brokerMapper, MsCoreDelegationApiRestClient msCoreInstitutionApiRestClient, DelegationRestClientMapper delegationMapper) { + public MsCoreConnectorImpl(MsCoreRestClient msCoreRestClient, CoreUserApiRestClient msCoreUserApiRestClient, InstitutionMapper institutionMapper, BrokerMapper brokerMapper, CoreDelegationApiRestClient msCoreInstitutionApiRestClient, DelegationRestClientMapper delegationMapper) { this.msCoreRestClient = msCoreRestClient; this.msCoreUserApiRestClient = msCoreUserApiRestClient; this.institutionMapper = institutionMapper; @@ -81,7 +81,7 @@ public Collection getOnBoardedInstitutions() { public List getUserProducts(String userId) { log.trace("getUserProducts start"); UserProductsResponse productsInfoUsingGET = msCoreUserApiRestClient._getUserProductsInfoUsingGET(userId, null, - String.join(",", ACTIVE.name(), PENDING.name(), TOBEVALIDATED.name())).getBody(); + List.of(ACTIVE.name(), PENDING.name(), TOBEVALIDATED.name())).getBody(); if(Objects.isNull(productsInfoUsingGET) || Objects.isNull(productsInfoUsingGET.getBindings())) return List.of(); @@ -227,7 +227,7 @@ public List findInstitutionsByProductAndType(String productId, Strin public List getDelegations(String from, String to, String productId) { log.trace("getDelegations start"); log.debug("getDelegations productId = {}, type = {}", from, productId); - List delegationsResponse = msCoreDelegationApiRestClient._getDelegationsUsingGET(from, to, productId).getBody(); + List delegationsResponse = msCoreDelegationApiRestClient._getDelegationsUsingGET(from, to, productId, null).getBody(); if(Objects.isNull(delegationsResponse)) return List.of(); diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/MsCoreDelegationApiRestClient.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreDelegationApiRestClient.java similarity index 66% rename from connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/MsCoreDelegationApiRestClient.java rename to connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreDelegationApiRestClient.java index 3c2bb9326..603687bd0 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/MsCoreDelegationApiRestClient.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreDelegationApiRestClient.java @@ -2,5 +2,5 @@ import org.springframework.cloud.openfeign.FeignClient; @FeignClient(name = "${rest-client.ms-core-delegation-api.serviceCode}", url = "${rest-client.ms-core.base-url}") -public interface MsCoreDelegationApiRestClient extends it.pagopa.selfcare.core.generated.openapi.v1.api.DelegationApi{ +public interface CoreDelegationApiRestClient extends it.pagopa.selfcare.core.generated.openapi.v1.api.DelegationApi{ } diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreInstitutionApiRestClient.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreInstitutionApiRestClient.java new file mode 100644 index 000000000..b0a14defb --- /dev/null +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreInstitutionApiRestClient.java @@ -0,0 +1,8 @@ +package it.pagopa.selfcare.dashboard.connector.rest.client; + +import it.pagopa.selfcare.core.generated.openapi.v1.api.InstitutionApi; +import org.springframework.cloud.openfeign.FeignClient; + +@FeignClient(name = "${rest-client.ms-core-institution-api.serviceCode}", url = "${rest-client.ms-core.base-url}") +public interface CoreInstitutionApiRestClient extends InstitutionApi { +} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreManagementApiRestClient.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreManagementApiRestClient.java new file mode 100644 index 000000000..9c8289a47 --- /dev/null +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreManagementApiRestClient.java @@ -0,0 +1,9 @@ +package it.pagopa.selfcare.dashboard.connector.rest.client; + +import it.pagopa.selfcare.core.generated.openapi.v1.api.ManagementApi; +import org.springframework.cloud.openfeign.FeignClient; + +@FeignClient(name = "${rest-client.ms-core-management-api.serviceCode}", url = "${rest-client.ms-core.base-url}") + +public interface CoreManagementApiRestClient extends ManagementApi { +} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreOnboardingApiRestClient.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreOnboardingApiRestClient.java new file mode 100644 index 000000000..f5c05a1b7 --- /dev/null +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreOnboardingApiRestClient.java @@ -0,0 +1,8 @@ +package it.pagopa.selfcare.dashboard.connector.rest.client; + +import it.pagopa.selfcare.core.generated.openapi.v1.api.OnboardingApi; +import org.springframework.cloud.openfeign.FeignClient; + +@FeignClient(name = "${rest-client.ms-core-onboarding-api.serviceCode}", url = "${rest-client.ms-core.base-url}") +public interface CoreOnboardingApiRestClient extends OnboardingApi { +} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/MsCoreUserApiRestClient.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreUserApiRestClient.java similarity index 67% rename from connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/MsCoreUserApiRestClient.java rename to connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreUserApiRestClient.java index e4964db91..3490ed6d5 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/MsCoreUserApiRestClient.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/client/CoreUserApiRestClient.java @@ -4,5 +4,5 @@ import org.springframework.cloud.openfeign.FeignClient; @FeignClient(name = "${rest-client.ms-core-user-api.serviceCode}", url = "${rest-client.ms-core.base-url}") -public interface MsCoreUserApiRestClient extends it.pagopa.selfcare.core.generated.openapi.v1.api.PersonsApi { +public interface CoreUserApiRestClient extends it.pagopa.selfcare.core.generated.openapi.v1.api.PersonsApi { } diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreDelegationApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreDelegationApiRestClientConfig.java similarity index 67% rename from connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreDelegationApiRestClientConfig.java rename to connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreDelegationApiRestClientConfig.java index 46788fb38..85fce6782 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreDelegationApiRestClientConfig.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreDelegationApiRestClientConfig.java @@ -1,7 +1,7 @@ package it.pagopa.selfcare.dashboard.connector.rest.config; import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; -import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -9,7 +9,7 @@ @Configuration @Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {MsCoreDelegationApiRestClient.class, MsCoreDelegationApiRestClient.class}) +@EnableFeignClients(clients = {CoreDelegationApiRestClient.class}) @PropertySource("classpath:config/ms-core-rest-client.properties") -public class MsCoreDelegationApiRestClientConfig { +public class CoreDelegationApiRestClientConfig { } diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java new file mode 100644 index 000000000..a4cc05158 --- /dev/null +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java @@ -0,0 +1,16 @@ +package it.pagopa.selfcare.dashboard.connector.rest.config; + +import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreInstitutionApiRestClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.PropertySource; + +@Configuration +@Import(RestClientBaseConfig.class) +@EnableFeignClients(clients = {CoreInstitutionApiRestClient.class}) +@PropertySource("classpath:config/ms-core-rest-client.properties") +public class CoreInstitutionApiRestClientConfig { +} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java new file mode 100644 index 000000000..4e7d6fbe5 --- /dev/null +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java @@ -0,0 +1,16 @@ +package it.pagopa.selfcare.dashboard.connector.rest.config; + +import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreManagementApiRestClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.PropertySource; + +@Configuration +@Import(RestClientBaseConfig.class) +@EnableFeignClients(clients = {CoreManagementApiRestClient.class}) +@PropertySource("classpath:config/ms-core-rest-client.properties") +public class CoreManagementApiRestClientConfig { +} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java new file mode 100644 index 000000000..13e1e243c --- /dev/null +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java @@ -0,0 +1,16 @@ +package it.pagopa.selfcare.dashboard.connector.rest.config; + +import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreOnboardingApiRestClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.PropertySource; + +@Configuration +@Import(RestClientBaseConfig.class) +@EnableFeignClients(clients = {CoreOnboardingApiRestClient.class}) +@PropertySource("classpath:config/ms-core-rest-client.properties") +public class CoreOnboardingApiRestClientConfig { +} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java new file mode 100644 index 000000000..be974a916 --- /dev/null +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java @@ -0,0 +1,16 @@ +package it.pagopa.selfcare.dashboard.connector.rest.config; + +import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreUserApiRestClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.PropertySource; + +@Configuration +@Import(RestClientBaseConfig.class) +@EnableFeignClients(clients = {CoreUserApiRestClient.class}) +@PropertySource("classpath:config/ms-core-rest-client.properties") +public class CoreUserApiRestClientConfig { +} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java index b7b452e99..ded0171a6 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java @@ -2,7 +2,6 @@ import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreUserApiRestClient; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -10,7 +9,7 @@ @Configuration @Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {MsCoreRestClient.class, MsCoreUserApiRestClient.class}) +@EnableFeignClients(clients = {MsCoreRestClient.class}) @PropertySource("classpath:config/ms-core-rest-client.properties") -class MsCoreRestClientConfig { +public class MsCoreRestClientConfig { } diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyManagementRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyManagementRestClientConfig.java index d76e76fe6..b1afcde66 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyManagementRestClientConfig.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyManagementRestClientConfig.java @@ -9,7 +9,7 @@ @Configuration @Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = PartyManagementRestClient.class) +@EnableFeignClients(clients = {PartyManagementRestClient.class}) @PropertySource("classpath:config/party-management-rest-client.properties") -class PartyManagementRestClientConfig { +public class PartyManagementRestClientConfig { } diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyProcessRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyProcessRestClientConfig.java index e70114d53..43a68ac6c 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyProcessRestClientConfig.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/PartyProcessRestClientConfig.java @@ -9,7 +9,7 @@ @Configuration @Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = PartyProcessRestClient.class) +@EnableFeignClients(clients = {PartyProcessRestClient.class}) @PropertySource("classpath:config/party-process-rest-client.properties") -class PartyProcessRestClientConfig { +public class PartyProcessRestClientConfig { } diff --git a/connector/rest/src/main/resources/config/ms-core-rest-client.properties b/connector/rest/src/main/resources/config/ms-core-rest-client.properties index 76d820740..866b6f51d 100644 --- a/connector/rest/src/main/resources/config/ms-core-rest-client.properties +++ b/connector/rest/src/main/resources/config/ms-core-rest-client.properties @@ -25,6 +25,13 @@ feign.client.config.ms-core.readTimeout=${USERVICE_MS_CORE_REST_CLIENT_READ_TIME feign.client.config.ms-core.loggerLevel=${USERVICE_MS_CORE_REST_CLIENT_LOGGER_LEVEL:${REST_CLIENT_LOGGER_LEVEL:FULL}} +rest-client.ms-core-institution-api.serviceCode=ms-core-institution-api +feign.client.config.ms-core-institution-api.requestInterceptors[0]=it.pagopa.selfcare.commons.connector.rest.interceptor.AuthorizationHeaderInterceptor +feign.client.config.ms-core-institution-api.connectTimeout=${USERVICE_MS_CORE_REST_CLIENT_CONNECT_TIMEOUT:${REST_CLIENT_CONNECT_TIMEOUT:5000}} +feign.client.config.ms-core-institution-api.readTimeout=${USERVICE_MS_CORE_REST_CLIENT_READ_TIMEOUT:${REST_CLIENT_READ_TIMEOUT:5000}} +feign.client.config.ms-core-institution-api.loggerLevel=${USERVICE_MS_CORE_REST_CLIENT_LOGGER_LEVEL:${REST_CLIENT_LOGGER_LEVEL:FULL}} + + rest-client.ms-core-user-api.serviceCode=ms-core-user-api feign.client.config.ms-core-user-api.connectTimeout=${USERVICE_MS_CORE_REST_CLIENT_CONNECT_TIMEOUT:${REST_CLIENT_CONNECT_TIMEOUT:5000}} feign.client.config.ms-core-user-api.requestInterceptors[0]=it.pagopa.selfcare.commons.connector.rest.interceptor.AuthorizationHeaderInterceptor @@ -38,4 +45,18 @@ feign.client.config.ms-core-delegation-api.connectTimeout=${USERVICE_MS_CORE_RES feign.client.config.ms-core-delegation-api.requestInterceptors[0]=it.pagopa.selfcare.commons.connector.rest.interceptor.AuthorizationHeaderInterceptor feign.client.config.ms-core-delegation-api.errorDecoder=it.pagopa.selfcare.dashboard.connector.rest.decoder.FeignErrorDecoder feign.client.config.ms-core-delegation-api.readTimeout=${USERVICE_MS_CORE_REST_CLIENT_READ_TIMEOUT:${REST_CLIENT_READ_TIMEOUT:5000}} -feign.client.config.ms-core-delegation-api.loggerLevel=${USERVICE_MS_CORE_REST_CLIENT_LOGGER_LEVEL:${REST_CLIENT_LOGGER_LEVEL:FULL}} \ No newline at end of file +feign.client.config.ms-core-delegation-api.loggerLevel=${USERVICE_MS_CORE_REST_CLIENT_LOGGER_LEVEL:${REST_CLIENT_LOGGER_LEVEL:FULL}} + + +rest-client.ms-core-management-api.serviceCode=ms-core-management-api +feign.client.config.ms-core-management-api.requestInterceptors[0]=it.pagopa.selfcare.commons.connector.rest.interceptor.AuthorizationHeaderInterceptor +feign.client.config.ms-core-management-api.connectTimeout=${USERVICE_MS_CORE_REST_CLIENT_CONNECT_TIMEOUT:${REST_CLIENT_CONNECT_TIMEOUT:5000}} +feign.client.config.ms-core-management-api.readTimeout=${USERVICE_MS_CORE_REST_CLIENT_READ_TIMEOUT:${REST_CLIENT_READ_TIMEOUT:5000}} +feign.client.config.ms-core-management-api.loggerLevel=${USERVICE_MS_CORE_REST_CLIENT_LOGGER_LEVEL:${REST_CLIENT_LOGGER_LEVEL:FULL}} + + +rest-client.ms-core-onboarding-api.serviceCode=ms-core-onboarding-api +feign.client.config.ms-core-onboarding-api.requestInterceptors[0]=it.pagopa.selfcare.commons.connector.rest.interceptor.AuthorizationHeaderInterceptor +feign.client.config.ms-core-onboarding-api.connectTimeout=${USERVICE_MS_CORE_REST_CLIENT_CONNECT_TIMEOUT:${REST_CLIENT_CONNECT_TIMEOUT:5000}} +feign.client.config.ms-core-onboarding-api.readTimeout=${USERVICE_MS_CORE_REST_CLIENT_READ_TIMEOUT:${REST_CLIENT_READ_TIMEOUT:5000}} +feign.client.config.ms-core-onboarding-api.loggerLevel=${USERVICE_MS_CORE_REST_CLIENT_LOGGER_LEVEL:${REST_CLIENT_LOGGER_LEVEL:FULL}} diff --git a/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImplTest.java b/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImplTest.java index 762ede202..ba847a015 100644 --- a/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImplTest.java +++ b/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/MsCoreConnectorImplTest.java @@ -24,9 +24,9 @@ import it.pagopa.selfcare.dashboard.connector.model.user.ProductInfo; import it.pagopa.selfcare.dashboard.connector.model.user.RoleInfo; import it.pagopa.selfcare.dashboard.connector.model.user.UserInfo; -import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.CoreUserApiRestClient; import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreUserApiRestClient; import it.pagopa.selfcare.dashboard.connector.rest.model.InstitutionUpdate; import it.pagopa.selfcare.dashboard.connector.rest.model.ProductState; import it.pagopa.selfcare.dashboard.connector.rest.model.RelationshipInfo; @@ -39,7 +39,6 @@ import it.pagopa.selfcare.dashboard.connector.rest.model.onboarding.OnboardingUsersRequest; import it.pagopa.selfcare.dashboard.connector.rest.model.product.Product; import it.pagopa.selfcare.dashboard.connector.rest.model.product.Products; -import it.pagopa.selfcare.dashboard.connector.rest.model.relationship.Relationship; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; import org.junit.jupiter.params.ParameterizedTest; @@ -86,10 +85,10 @@ class MsCoreConnectorImplTest { private MsCoreRestClient msCoreRestClientMock; @MockBean - private MsCoreUserApiRestClient msCoreUserApiRestClientMock; + private CoreUserApiRestClient msCoreUserApiRestClientMock; @MockBean - private MsCoreDelegationApiRestClient msCoreInstitutionApiRestClient; + private CoreDelegationApiRestClient msCoreInstitutionApiRestClient; @MockBean private BrokerMapper brokerMapper; @@ -145,7 +144,7 @@ void getUserProducts_shouldGetEmptyData() { assertEquals(0, institutions.size()); verify(msCoreUserApiRestClientMock, times(1)) - ._getUserProductsInfoUsingGET(eq(userId), isNull(), eq(String.join(",", ACTIVE.name(), PENDING.name(), TOBEVALIDATED.name()))); + ._getUserProductsInfoUsingGET(eq(userId), isNull(), eq(List.of(ACTIVE.name(), PENDING.name(), TOBEVALIDATED.name()))); verifyNoMoreInteractions(msCoreUserApiRestClientMock); } @@ -179,7 +178,7 @@ void getUserProducts_shouldGetData() { assertEquals(userProductsResponse.getBindings().get(0).getInstitutionId(), institutions.get(0).getId()); verify(msCoreUserApiRestClientMock, times(1)) - ._getUserProductsInfoUsingGET(eq(userId), isNull(), eq(String.join(",", ACTIVE.name(), PENDING.name(), TOBEVALIDATED.name()))); + ._getUserProductsInfoUsingGET(eq(userId), isNull(), eq(List.of(ACTIVE.name(), PENDING.name(), TOBEVALIDATED.name()))); verifyNoMoreInteractions(msCoreUserApiRestClientMock); } @@ -929,7 +928,7 @@ void getDelegationUsingFrom_shouldGetData() { ResponseEntity> delegationResponseEntity = new ResponseEntity<>(delegationResponseList, null, HttpStatus.OK); Delegation delegation = dummyDelegation(); - when(msCoreInstitutionApiRestClient._getDelegationsUsingGET(any(), any(), any())) + when(msCoreInstitutionApiRestClient._getDelegationsUsingGET(any(), any(), any(), any())) .thenReturn(delegationResponseEntity); @@ -948,7 +947,7 @@ void getDelegationUsingFrom_shouldGetData() { assertEquals(delegationResponseList.get(0).getBrokerName(), delegationList.get(0).getBrokerName()); verify(msCoreInstitutionApiRestClient, times(1)) - ._getDelegationsUsingGET(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId()); + ._getDelegationsUsingGET(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId(), null); verifyNoMoreInteractions(msCoreInstitutionApiRestClient); } @@ -961,7 +960,7 @@ void getDelegationUsingFrom_shouldGetEmptyData() { when(delegationResponseEntity.getBody()).thenReturn(null); - when(msCoreInstitutionApiRestClient._getDelegationsUsingGET(any(), any(), any())) + when(msCoreInstitutionApiRestClient._getDelegationsUsingGET(any(), any(), any(), any())) .thenReturn(delegationResponseEntity); @@ -972,7 +971,7 @@ void getDelegationUsingFrom_shouldGetEmptyData() { assertEquals(0, delegationList.size()); verify(msCoreInstitutionApiRestClient, times(1)) - ._getDelegationsUsingGET(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId()); + ._getDelegationsUsingGET(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId(), null); verifyNoMoreInteractions(msCoreInstitutionApiRestClient); } From 7b63634ba0221d407a705b18a1aecbaf09a8e2ed Mon Sep 17 00:00:00 2001 From: flaminiaScarciofolo Date: Thu, 15 Feb 2024 11:24:11 +0100 Subject: [PATCH 2/2] refactor clientConfig class --- .../CoreDelegationApiRestClientConfig.java | 15 --------------- .../CoreInstitutionApiRestClientConfig.java | 16 ---------------- .../CoreManagementApiRestClientConfig.java | 16 ---------------- .../CoreOnboardingApiRestClientConfig.java | 16 ---------------- .../rest/config/CoreUserApiRestClientConfig.java | 16 ---------------- .../rest/config/MsCoreRestClientConfig.java | 5 +++-- 6 files changed, 3 insertions(+), 81 deletions(-) delete mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreDelegationApiRestClientConfig.java delete mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java delete mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java delete mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java delete mode 100644 connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreDelegationApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreDelegationApiRestClientConfig.java deleted file mode 100644 index 85fce6782..000000000 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreDelegationApiRestClientConfig.java +++ /dev/null @@ -1,15 +0,0 @@ -package it.pagopa.selfcare.dashboard.connector.rest.config; - -import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.PropertySource; - -@Configuration -@Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {CoreDelegationApiRestClient.class}) -@PropertySource("classpath:config/ms-core-rest-client.properties") -public class CoreDelegationApiRestClientConfig { -} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java deleted file mode 100644 index a4cc05158..000000000 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreInstitutionApiRestClientConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package it.pagopa.selfcare.dashboard.connector.rest.config; - -import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreInstitutionApiRestClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.PropertySource; - -@Configuration -@Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {CoreInstitutionApiRestClient.class}) -@PropertySource("classpath:config/ms-core-rest-client.properties") -public class CoreInstitutionApiRestClientConfig { -} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java deleted file mode 100644 index 4e7d6fbe5..000000000 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreManagementApiRestClientConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package it.pagopa.selfcare.dashboard.connector.rest.config; - -import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreManagementApiRestClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.PropertySource; - -@Configuration -@Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {CoreManagementApiRestClient.class}) -@PropertySource("classpath:config/ms-core-rest-client.properties") -public class CoreManagementApiRestClientConfig { -} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java deleted file mode 100644 index 13e1e243c..000000000 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreOnboardingApiRestClientConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package it.pagopa.selfcare.dashboard.connector.rest.config; - -import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreOnboardingApiRestClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.PropertySource; - -@Configuration -@Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {CoreOnboardingApiRestClient.class}) -@PropertySource("classpath:config/ms-core-rest-client.properties") -public class CoreOnboardingApiRestClientConfig { -} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java deleted file mode 100644 index be974a916..000000000 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/CoreUserApiRestClientConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package it.pagopa.selfcare.dashboard.connector.rest.config; - -import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreUserApiRestClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.PropertySource; - -@Configuration -@Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {CoreUserApiRestClient.class}) -@PropertySource("classpath:config/ms-core-rest-client.properties") -public class CoreUserApiRestClientConfig { -} diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java index ded0171a6..12731aac0 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/config/MsCoreRestClientConfig.java @@ -1,7 +1,7 @@ package it.pagopa.selfcare.dashboard.connector.rest.config; import it.pagopa.selfcare.commons.connector.rest.config.RestClientBaseConfig; -import it.pagopa.selfcare.dashboard.connector.rest.client.MsCoreRestClient; +import it.pagopa.selfcare.dashboard.connector.rest.client.*; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -9,7 +9,8 @@ @Configuration @Import(RestClientBaseConfig.class) -@EnableFeignClients(clients = {MsCoreRestClient.class}) +@EnableFeignClients(clients = {MsCoreRestClient.class, CoreUserApiRestClient.class, CoreDelegationApiRestClient.class, + CoreInstitutionApiRestClient.class, CoreOnboardingApiRestClient.class, CoreManagementApiRestClient.class}) @PropertySource("classpath:config/ms-core-rest-client.properties") public class MsCoreRestClientConfig { }